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

[Docs]: aws_codedeploy_deployment_group->ecs_service only take ONE #27478

Open
FransUrbo opened this issue Oct 26, 2022 · 4 comments
Open

[Docs]: aws_codedeploy_deployment_group->ecs_service only take ONE #27478

FransUrbo opened this issue Oct 26, 2022 · 4 comments
Labels
documentation Introduces or discusses updates to documentation. service/deploy Issues and PRs that pertain to the deploy service.

Comments

@FransUrbo
Copy link

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codedeploy_deployment_group#ecs_service

Description

ecs_service - (Optional) Configuration block(s) of the ECS services for a deployment group (documented below).

This say block(s) (plural!), however only one block is allowed.

References

Error: Too many ecs_service blocks

  on <file> line 63, in resource "aws_codedeploy_deployment_group" "codedeploy":
  63:   content {

No more than 1 "ecs_service" blocks are allowed

This with the following code:

variable "cluster" {
    description                         = "Container cluster information"
    type                                = object({
        arn             = string
        name            = string
        service         = list(string)
        service_arn     = list(string)
    })
}

resource "aws_codedeploy_deployment_group" "codedeploy" {
    [...]
    dynamic "ecs_service" {
        for_each        = var.cluster.service
        content {
            cluster_name                = var.cluster.name
            service_name                = ecs_service.value
        }
    }

And then set var.cluster.service to multiple values.

Would you like to implement a fix?

No response

@FransUrbo FransUrbo added documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. labels Oct 26, 2022
@github-actions
Copy link

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 github-actions bot added the service/deploy Issues and PRs that pertain to the deploy service. label Oct 26, 2022
@FransUrbo
Copy link
Author

FransUrbo commented Oct 26, 2022

Looking at the AWS documentation, it seems the documentation is correct, but the code is not. Or... I'm a bit confused on how to interpret the AWS documentation..

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html#cfn-codedeploy-deploymentgroup-ecsservices

Type: List of ECSService

@FransUrbo
Copy link
Author

Terraform v1.3.3
aws v4.36.1

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Oct 26, 2022
@kurbar
Copy link

kurbar commented Jan 12, 2023

This is a provider bug. You can configure multiple ECS services to a deployment group but currently the AWS provider does not allow it.

A workaround is to use the aws_cloudformation_stack resource and create CodeDeploy resources through CloudFormation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. service/deploy Issues and PRs that pertain to the deploy service.
Projects
None yet
Development

No branches or pull requests

3 participants