I am attempting to trigger an instance refresh when an S3 object is updated. I am trying to do this by updating the tags in the launch template with the etag of the S3 object, which would then trigger a new version of the launch template, and consequently an instance refresh.
I expect the tag to use the etag for the object added as part of the apply and as such the plan for my tags to show:
Which then leads to the following error as the etag is updated as the new object is uploaded.
Relevant Error/Panic Output Snippet
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for module.asg_main.aws_launch_template.this[0] to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for .tag_specifications[0].tags["App Env Hash"]: was
│ cty.StringVal("<current_etag_in_state>"), but now cty.StringVal("<known_after_apply_etag>").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.0.11
AWS Provider Version
4.58.0
Affected Resource(s)
Expected Behavior
I am attempting to trigger an instance refresh when an S3 object is updated. I am trying to do this by updating the tags in the launch template with the etag of the S3 object, which would then trigger a new version of the launch template, and consequently an instance refresh.
I expect the tag to use the etag for the object added as part of the apply and as such the plan for my tags to show:
Actual Behavior
However instead of doing this, it uses the existing etag for the object in the state, so if the etag is out of date, the plan shows:
Which then leads to the following error as the etag is updated as the new object is uploaded.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Attempt to reference the aws_s3_object.x.etag output in a configuration when updating the aws_s3_object.x resource as part of apply.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None