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

Tag error for ECS in govcloud partion using default_tags #19185

Closed
pjaudiomv opened this issue Apr 30, 2021 · 8 comments
Closed

Tag error for ECS in govcloud partion using default_tags #19185

pjaudiomv opened this issue Apr 30, 2021 · 8 comments
Labels
bug Addresses a defect in current functionality. partition/aws-us-gov Pertains to the aws-us-gov partition. service/ecs Issues and PRs that pertain to the ecs service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@pjaudiomv
Copy link
Contributor

Provider version 3.38.0
Terraform 0.15.1

when using default_tags feature apply fails as it tries to create tags on ecs resource.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

resource aws_ecs_service

  • aws_XXXXX

Terraform Configuration Files

provider "aws" {
  default_tags {
    tags = {
      "Name"             = "compliance"
      "workload"        = "prod"
    }
  }
}

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

│ Error: error updating ECS Service (arn:aws-us-gov:ecs:us-gov-west-1:1111111111:service/dev) tags: error tagging resource (arn:aws-us-gov:ecs:us-gov-west-1:1111111111:service/dev): InvalidParameterException: Long arn format must be used for tagging operations
│ 
│   with module.egress_proxy[0].aws_ecs_service.service,
│   on .terraform/modules/egress_proxy/ecs.tf line 87, in resource "aws_ecs_service" "service":
│   87: resource "aws_ecs_service" "service" {
│ 

Expected Behavior

resource is created , aws provider should not attempt to tag ecs service on govcloud

Actual Behavior

Error thrown because listing tags of aws_ecs_cluster is not supported in aws-gov partitions.

Steps to Reproduce

  1. terraform apply

Important Factoids

I also tried adding an lifecycle ignore tag on the resource and that didnt work

  lifecycle {
    ignore_changes = [tags]
  }

References

  • #0000
@ghost ghost added the service/ecs Issues and PRs that pertain to the ecs service. label Apr 30, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 30, 2021
@ewbankkit ewbankkit added the partition/aws-us-gov Pertains to the aws-us-gov partition. label Apr 30, 2021
@pjaudiomv
Copy link
Contributor Author

different partition but similar ticket #18134

@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 4, 2021
@anGie44
Copy link
Contributor

anGie44 commented May 6, 2021

Hi @pjaudiomv, thank you for raising this issue! I believe a workaround is feasible similar to #19213 (comment) if you are using an existing ECS service resource, though not if you're creating the resource from scratch; instead of tags, you'll want to ignore_changes to the specific provider-level tags e.g. tags_all["Name"], tags_all["workload"] or more generally just ignore_changes = [tags_all] as that is the new attribute that holds the provider-level tags in addition to resource-level tags, unlike just tags.

@anGie44 anGie44 self-assigned this May 6, 2021
@pjaudiomv
Copy link
Contributor Author

Ahh that makes sense, I will try that. Thank you.

@anGie44
Copy link
Contributor

anGie44 commented May 6, 2021

Sure thing @pjaudiomv ! Let us know if you're still seeing the tagging errors even with the workaround.

@pjaudiomv
Copy link
Contributor Author

Sure thing @pjaudiomv ! Let us know if you're still seeing the tagging errors even with the workaround.

just tested and the workaround worked fine. thanks again.

@dgershman
Copy link

It looks like you can tag aws_ecs_service now in aws-us-gov partitions.

@anGie44 anGie44 removed their assignment Sep 24, 2021
@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Sep 23, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2023
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. partition/aws-us-gov Pertains to the aws-us-gov partition. service/ecs Issues and PRs that pertain to the ecs service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

4 participants