-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Feature request: allow aws_ecs_task_definitions to track the latest revision #8449
Comments
I think another, and more general, way to achieve the described goal would be to also have
|
See the above new data resource. I'm not entirely convinced this is the right solution though. I think using the data resource above only works if the task definition already exists. What is to be done about the very first terraform apply? |
@RyanBowlby-Reflektion, good point. There would need to be logic that'd recognize that both the resource and the datasource are defined and in this case default the datasource's revision to 0 on the initial apply. I agree this sounds a bit complicated and wouldn't allow the datasource to have pretty much any other attributes than the revision, since the other ones probably wouldn't have any acceptable 'initial' value. That said, for the described use case no other attributes are needed. |
PR #8509 looks great. However it seems to require applying in steps, first creating the task definition resources and then adding the datasources. Please correct me if I'm wrong. I realize there's also an issue with the image tags. Datasources don't support the ignore_changes lifecycle attribute, so in the described use case the deprecated |
Closed via #8509 - this is now a data source that allows you to get the latest version |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm using the AWS Elastic Container Service managed wholly with Terraform. Deploying an
aws_ecs_service
with a new Docker image means tainting the associatedaws_ecs_task_definition
and this works great.An example configuration could look like this:
Problems arise when I'd like to restart the service using the AWS API's directly as part of a CI process. The only thing that changes in the states of the associated task definition and service, is the revision number of the task definition (and possibly the image, but this could be handled with
ignore_changes
). Making an external deployment then results in the following plan:i.e., Terraform would like to roll the service back to itse previous state.
It would be great if
aws_ecs_task_definition
could optionally update its revision to the latest one during the refresh phase iff the only diff is the revision and the refreshed revision is higher.If there are other ways to achieve Terraform being in sync with the revisions I'd be very interested in hearing them.
The text was updated successfully, but these errors were encountered: