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

typescript/elasticbeanstalk/elasticbeanstalk-environment sample is not deploy complete with stack status CREATE_FAILED" #1126

Open
Jun-KODAMA-SCSK opened this issue Jan 8, 2025 · 1 comment
Labels
bug This issue is a bug. ngde/pod Great issues for pods p2

Comments

@Jun-KODAMA-SCSK
Copy link

Describe the bug

typescript/elasticbeanstalk/elasticbeanstalk-environment sample is not deploy complete with stack status CREATE_FAILED
CloudFormation stack - Event shows CREATE_FAILED message below.

"CREATE_FAILED        | AWS::ElasticBeanstalk::Environment | Environment Resource handler returned message: "Resource of type 'AWS::ElasticBeanstalk::Environment' with identifier '<environment-name>' did not stabilize." (RequestToken: XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, HandlerErrorCode: NotStabilized)

From Elastic Beanstalk Managed console - Environment - - Events displays these ERROR messages.

1 月 8, 2025 11:37:10 (UTC+9) | ERROR | Failed to launch environment.
1 月 8, 2025 11:37:10 (UTC+9) | ERROR | Environment must have instance profile associated with it.

Expected Behavior

typescript/elasticbeanstalk/elasticbeanstalk-environment sample is deploy complete with stack status "CREATE_COMPLETE".

Current Behavior

From Elastic Beanstalk Managed console - Environment - - Events displays these ERROR messages.

1 月 8, 2025 11:37:10 (UTC+9) | ERROR | Failed to launch environment.
1 月 8, 2025 11:37:10 (UTC+9) | ERROR | Environment must have instance profile associated with it.

Reproduction Steps

Change cdk.json to below, because of platform retired. ( "platformArn" should found aws elasticbeanstalk list-platform-versions command result. )

{
    "context": {
        "platform": "arn:aws:elasticbeanstalk:ap-northeast-1::platform/Tomcat 10 with Corretto 21 running on 64bit Amazon Linux 2023/5.4.2"
    },
    "app": "node index"
}

In index.ts, because of deprecated warning.

    // to ensure the application is created before the environment
    // env.addDependsOn(app);
    env.addDependency(app);

cdk synth
cdk deploy

Possible Solution

No response

Additional Information/Context

Is sample too old? ( 4 years ago )

CDK CLI Version

2.174.0 (build 9604329)

Framework Version

No response

Node.js Version

v22.12.0

OS

Windows 11 23H2

Language

Typescript

Language Version

typescript (5.7.2)

@Jun-KODAMA-SCSK Jun-KODAMA-SCSK added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2025
@kaiz-io kaiz-io removed the needs-triage This issue or PR still needs to be triaged. label Jan 8, 2025
@kaiz-io
Copy link
Contributor

kaiz-io commented Jan 8, 2025

This is a race condition in the account when it is the first time that you use the Elastic Beanstalk. If someone would like to create the ElasticBeanstalk role aws-elasticbeanstalk-ec2-role explicitly and add it to the stack so that it does not fail deploy.

This would work or hard to replicate if someone already deployed a ElasticBeanstalk application via the console and then goes to run this cdk app it would work. This is because ElasticBeanstalk would create this role that can be used later on that initial app/env creation via the console.

If you would like to creat a PR for the fix here is the example code how to fix it.cdk-git

@kaiz-io kaiz-io added p2 ngde/pod Great issues for pods labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. ngde/pod Great issues for pods p2
Projects
None yet
Development

No branches or pull requests

2 participants