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

Fargate Task state management issue compatibility with codedeploy #31620

Closed
1 task
erwanrioualbelli opened this issue Oct 2, 2024 · 2 comments
Closed
1 task
Assignees
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@erwanrioualbelli
Copy link

erwanrioualbelli commented Oct 2, 2024

Describe the bug

on last version of cdk deploy the tasks created by cdk such as for instance

this.taskDefinition = new ecs.TaskDefinition(this, `${id}-main-task-definition`, {
    family: `${id}-main-task-definition`,
    compatibility: ecs.Compatibility.FARGATE,
    cpu: '4096',
    memoryMiB: '10240',
    networkMode: ecs.NetworkMode.AWS_VPC,
    taskRole: this.clusterRole,
    executionRole: this.clusterRole,
    volumes: [
        {
            name: 'translations',
            efsVolumeConfiguration: {
                fileSystemId: this.fileSystem.fileSystemId,
                transitEncryption: 'ENABLED',
                authorizationConfig: {
                    iam: 'ENABLED',
                    accessPointId: this.accessPoint.accessPointId,
                },
            },
        },
    ],
});

in sync with codedeploy
for instance

this.fargateService = new ecs.FargateService(this, `${id}-service`, {
      serviceName: `${id}-service`,
      cluster: this.cluster,
      taskDefinition: this.taskDefinition,
      deploymentController: { type: ecs.DeploymentControllerType.CODE_DEPLOY },
      // NETWORK CONFIGURATION
      securityGroups: [this.securityGroup],
      // ACCESS
      propagateTags: 'TASK_DEFINITION',
      enableExecuteCommand: true,
      healthCheckGracePeriod: Duration.seconds(300),
});

now whenever modify it (name or anything) throw an error that is -->

Error: The stack named XXXXXXXXX. failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: UpdateService error: Unable to update task definition on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment.

Would be nice if fixed :) Not sure if it is directly related to cdk or more a cloudformation thing.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

The expected behavior would be the pipeline accept the state change of the task without codedeploy been a blocker

Current Behavior

codedeploy block the cdk deploy

Reproduction Steps

create a ECS cluster with tasks and farget and setup a codedeploy to handle deployment. The all of it with CDK. Enjoy the crash whenever you modify one task config after a sucessful deployment

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.160.0

Framework Version

No response

Node.js Version

20

OS

(container ubuntu)

Language

TypeScript

Language Version

No response

Other information

No response

@erwanrioualbelli erwanrioualbelli added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2024
@github-actions github-actions bot added the @aws-cdk/aws-codedeploy Related to AWS CodeDeploy label Oct 2, 2024
@khushail khushail added needs-reproduction This issue needs reproduction. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2024
@khushail khushail self-assigned this Oct 2, 2024
@khushail
Copy link
Contributor

khushail commented Oct 7, 2024

Hi @erwanrioualbelli , thanks for reaching out.

Apologies but I am not really sure I understand what you are trying to do here, could you please share complete self-contained minimal repro code of the above scenario,explaining your usecase which could help in issue reproduction on my end.

@khushail khushail added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 7, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants