terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

[Bug]: ecs_cluster service_connect_settings

Open robh007 opened this issue 2 years ago • 1 comments

Terraform Core Version

1.3.4

AWS Provider Version

4.55.0

Affected Resource(s)

resource "aws_ecs_cluster" "cluster" {
    service_connect_defaults {
        namespace = "aws:arn:of:namespace"
        or
        namespace = "my.namespace.local"
    }
}

Expected Behavior

The ECS cluster resource should either use an AWS ARN, if so nothing happens. However if you specify a name my-svc.local the create_cluster call will create the AWS CloudMap namespace for you.

Actual Behavior

Currently the service_connect_default argument is validating for a valid ARN. This isn't correct, the behaviour of the API either accepts an ARN or if it's an appropriate string it will then create the namespace in AWS CloudMap.

Relevant Error/Panic Output Snippet

Error: "service_connect_defaults.0.namespace" (cluster.service.connect.local) is an invalid ARN: arn: invalid prefix
│ 
│   with module.ecs.aws_ecs_cluster.this[0],
│   on ../../main.tf line 5, in resource "aws_ecs_cluster" "this":
│    5: resource "aws_ecs_cluster" "this" {

Terraform Configuration Files

resource "aws_ecs_cluster" "this" {
  name = "my-cluster"

  service_connect_defaults {
    namespace = "my.nameespace.local"
  }
}

Steps to Reproduce

Specify a valid name as per the AWS documentation

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

robh007 avatar Feb 21 '23 21:02 robh007

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

github-actions[bot] avatar Feb 21 '23 21:02 github-actions[bot]

is there any workaround for this bug# ?

muthu329024 avatar Nov 13 '23 23:11 muthu329024