Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.aws_ecs_service should return running task definition revision #1681

Closed
joeig opened this issue Sep 15, 2017 · 5 comments · Fixed by #3617
Closed

data.aws_ecs_service should return running task definition revision #1681

joeig opened this issue Sep 15, 2017 · 5 comments · Fixed by #3617
Labels
new-data-source Introduces a new data source. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@joeig
Copy link
Contributor

joeig commented Sep 15, 2017

I deploy new Docker containers to ECS using one task definition per container release (this is usually invoked by a CI job). Since aws_ecs_service requires a valid task definition name containing the revision ID, which is increased by the CI job, it is not possible to dynamically adapt the aws_ecs_service resource to the latest running task definition.

Wouldn't it be awesome if there was a data source for aws_ecs_service which is able to detect the running task definition revision?

data "aws_ecs_service" "running_voting" {
  cluster_name = "mycluster"
  service_name = "voting"
}

resource "aws_ecs_service" "voting" {
  name            = "voting"
  task_definition = "${data.aws_ecs_service.running_voting.arn}"
  desired_count   = 3
}

Terraform v0.10.4

@Ninir Ninir added the bug Addresses a defect in current functionality. label Sep 18, 2017
@joeig
Copy link
Contributor Author

joeig commented Sep 28, 2017

One possible solution is to use aws_ecs_task_definition for that, but this just returns the latest active revision and not the actually running revision.

@radeksimko radeksimko added the service/ecs Issues and PRs that pertain to the ecs service. label Jan 28, 2018
@bflad bflad added new-data-source Introduces a new data source. and removed bug Addresses a defect in current functionality. labels Mar 5, 2018
@bflad bflad added this to the v1.22.0 milestone May 31, 2018
@bflad
Copy link
Contributor

bflad commented May 31, 2018

The new aws_ecs_service data source has been merged and will release with version 1.22.0 of the AWS provider, likely sometime middle of next week.

@bflad
Copy link
Contributor

bflad commented Jun 5, 2018

This has been released in version 1.22.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@n1te1337
Copy link

n1te1337 commented Jun 14, 2018

Isn't this essentially creating a circular dependency and prohibits the service from being created in the first place?

@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants