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

AWS::CodeDeploy::BlueGreen don't work when ContainerDefinitions have DependsOn #680

Open
vbarba opened this issue Nov 15, 2020 · 2 comments

Comments

@vbarba
Copy link

vbarba commented Nov 15, 2020

1. Title

AWS::CodeDeploy::BlueGreen

2. Scope of request

When trying to deploy on ECS/Fargate using Cloudformation AWS::CodeDeploy::BlueGreen Hook I get this error:

'CodeDeployBlueGreenHook' of type AWS::CodeDeploy::BlueGreen failed with message: Condition layout is incorrect FIELD_NAME at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: aws.cfn.Template["Resources"]->java.util.LinkedHashMap["BlueTaskDefinition"]->aws.cfn.ecs.TaskDefinition["Properties"]->aws.cfn.ecs.TaskDefinitionProperties["ContainerDefinitions"]->java.util.LinkedHashSet[0]->aws.cfn.ecs.taskdefinition.ContainerDefinition["DependsOn"]->java.util.LinkedHashSet[0])

This only happens when in the ContainerDefinitions there are DependsOn properties between containers.

TaskDefinition Sample:

        Type: AWS::ECS::TaskDefinition
        Properties:
            Family: appserver
            NetworkMode: awsvpc
            RequiresCompatibilities:
                - FARGATE
            TaskRoleArn: !Ref ECSTaskIamRole
            ExecutionRoleArn: !GetAtt ECSTaskExecutionRole.Arn
            Cpu: '256'
            Memory: '512'
            ProxyConfiguration:
                Type: APPMESH
                ContainerName: envoy
                ProxyConfigurationProperties:
                    - Name: IgnoredUID
                      Value: '1337'
                    - Name: ProxyIngressPort
                      Value: '15000'
                    - Name: ProxyEgressPort
                      Value: '15001'
                    - Name: AppPorts
                      Value: '5000'
                    - Name: EgressIgnoredIPs
                      Value: '169.254.170.2,169.254.169.254'
            ContainerDefinitions:
                - Name: appserver
                  Essential: true
                  PortMappings:
                    - ContainerPort: 5000
                      Protocol: http
                  Image: !Ref Image
                  LogConfiguration:
                    LogDriver: awslogs
                    Options:
                        awslogs-group: !Ref AWS::StackName
                        awslogs-region: !Ref AWS::Region
                        awslogs-stream-prefix: ppserver
                  DependsOn:
                      - ContainerName: envoy
                        Condition: HEALTHY
                - Name: xray
                  Image: amazon/aws-xray-daemon
                  Essential: true
                  User: '1337'
                  PortMappings:
                    - ContainerPort: 2000
                      HostPort: 2000
                      Protocol: udp
                  LogConfiguration:
                      LogDriver: awslogs
                      Options:
                          awslogs-group: !Ref AWS::StackName
                          awslogs-region: !Ref AWS::Region
                          awslogs-stream-prefix: appserver
                - Name: envoy
                  Image: '840364872350.dkr.ecr.eu-west-1.amazonaws.com/aws-appmesh-envoy:v1.15.1.0-prod'
                  Essential: true
                  User: '1337'
                  DependsOn:
                      - ContainerName: xray
                        Condition: START
                  Ulimits:
                      - Name: nofile
                        HardLimit: 15000
                        SoftLimit: 15000
                  HealthCheck:
                      Command:
                         - CMD-SHELL
                         - curl -s http://localhost:9901/server_info | grep state | grep -q LIVE
                      Interval: 5
                      Timeout: 10
                      Retries: 10
                  LogConfiguration:
                      LogDriver: awslogs
                      Options:
                          awslogs-group: !Ref AWS::StackName
                          awslogs-region: !Ref AWS::Region
                          awslogs-stream-prefix: appserver
                  Environment:
                      - Name: ENVOY_LOG_LEVEL
                        Value: debug
                      - Name: ENABLE_ENVOY_XRAY_TRACING
                        Value: '1'
                      - Name: ENABLE_ENVOY_STATS_TAGS
                        Value: '1'
                      - Name: APPMESH_RESOURCE_ARN
                        Value: !Ref AppVirtualNode

3. Category

Developer Tools:
CodeDeploy
Compute:
ECS, Fargate, EFS

@JulienLajugie
Copy link

Any news on this issue? I am having the exact same problem and I was wondering if there was a fix planned

@cuongvo
Copy link

cuongvo commented Mar 22, 2022

Running into the same issue in the TYOOL 2022 still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants