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

CLI tries to create an AWSEBAutoScalingLaunchConfiguration with DisableIMDSv1=true using Docker Compose #528

Open
osalinasv opened this issue Nov 14, 2024 · 0 comments

Comments

@osalinasv
Copy link

Description

I'm getting the same issue as in #525, trying to deploy a docker-compose project always results in the same error
Event after applying the suggested DisableIMDSv1 setting to force use the new launch templates.

2024-11-14 05:18:52 ERROR Creating Auto Scaling launch configuration failed Reason: Resource handler returned message: "The Launch Configuration creation operation is not available in your account. Use launch templates to create configuration templates for your Auto Scaling groups. (Service: AutoScaling, Status Code: 400, Request ID: 94985653-6ab8-42b7-b224-87393fc43b06)" (RequestToken: ca4ca7b1-8d2c-78db-3338-ae173cb928b4, HandlerErrorCode: GeneralServiceException)

2024-11-14 05:21:12 ERROR Stack named 'awseb-e-cgemcxtxz4-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBAutoScalingLaunchConfiguration].

Steps to reproduce

Create docker-compose.yml setup (built image is based on php:8.2-fpm)

services:
    app:
        build:
            context: ./
        image: app:8.2-fpm
        working_dir: /var/www
        restart: unless-stopped
        volumes:
            - ./:/var/www
        networks:
            - internal-network
    proxy:
        image: nginx:alpine
        working_dir: /var/www
        restart: unless-stopped
        ports:
            - 80:80
        volumes:
            - ./:/var/www
            - ./nginx/conf.d:/etc/nginx/conf.d/
        networks:
            - internal-network
networks:
    internal-network:
        driver: bridge

Create file .ebextensions\01-autoscaling.config

option_settings:
  aws:autoscaling:launchconfiguration:
    DisableIMDSv1: true
    RootVolumeType: gp3

Attempt to create with eb CLI

eb create --instance-types t2.nano --max-instances 1

Observed result

2024-11-13 22:34:19,559 (DEBUG) ebcli.lib.elasticbeanstalk : Inside get_new_events api wrapper
2024-11-13 22:34:19,559 (DEBUG) ebcli.lib.aws : Making api call: (elasticbeanstalk, describe_events) to region: us-west-2 with args:{'ApplicationName': 'app', 'EnvironmentName': 'app-dev', 'RequestId': '9a7e61f6-7e8f-4f79-94f2-5f6880ca566b', 'StartTime': '2024-11-14 05:34:03.155000+00:00'}
2024-11-13 22:34:19,643 (DEBUG) ebcli.lib.aws : API call finished, status = 200
2024-11-13 22:34:19,643 (DEBUG) ebcli.lib.aws : Response: {'Events': [{'EventDate': datetime.datetime(2024, 11, 14, 5, 34, 18, 730000, tzinfo=tzutc()), 'Message': 'Creating Auto Scaling launch configuration failed Reason: Resource handler returned message: "The Launch Configuration creation operation is not available in your account. Use launch templates to create configuration templates for your Auto Scaling groups. (Service: AutoScaling, Status Code: 400, Request ID: 0c737724-00f2-40e3-b65f-3736927b69ef)" (RequestToken: f8f342c6-8320-9c75-8020-3b71b1131087, HandlerErrorCode: GeneralServiceException)', 'ApplicationName': 'app', 'EnvironmentName': 'app-dev', 'RequestId': '9a7e61f6-7e8f-4f79-94f2-5f6880ca566b', 'Severity': 'ERROR'}, {'EventDate': datetime.datetime(2024, 11, 14, 5, 34, 18, 706000, tzinfo=tzutc()), 'Message': 'Created security group named: awseb-e-ye7jpamjtv-stack-AWSEBSecurityGroup-cWPCuxLjyjN4', 'ApplicationName': 'app', 'EnvironmentName': 'app-dev', 'RequestId': '9a7e61f6-7e8f-4f79-94f2-5f6880ca566b', 'Severity': 'INFO'}, {'EventDate': datetime.datetime(2024, 11, 14, 5, 34, 18, 662000, tzinfo=tzutc()), 'Message': 'Created target group named: arn:aws:elasticloadbalancing:us-west-2:872515270712:targetgroup/awseb-AWSEB-ZAQUOHXLMOMF/675170fd152b89d5', 'ApplicationName': 'app', 'EnvironmentName': 'app-dev', 'RequestId': '9a7e61f6-7e8f-4f79-94f2-5f6880ca566b', 'Severity': 'INFO'}], 'ResponseMetadata': {'RequestId': 'b7acdc8d-a60d-40d1-ab86-fc30255dfe6b', 'HTTPStatusCode': 200, 'date': 'Thu, 14 Nov 2024 05:34:19 GMT', 'RetryAttempts': 0}}
2024-11-14 05:34:18 INFO Created target group named: arn:aws:elasticloadbalancing:us-west-2:872515270712:targetgroup/awseb-AWSEB-ZAQUOHXLMOMF/675170fd152b89d5
2024-11-14 05:34:18 INFO Created security group named: awseb-e-ye7jpamjtv-stack-AWSEBSecurityGroup-cWPCuxLjyjN4
2024-11-14 05:34:18 ERROR Creating Auto Scaling launch configuration failed Reason: Resource handler returned message: "The Launch Configuration creation operation is not available in your account. Use launch templates to create configuration templates for your Auto Scaling groups. (Service: AutoScaling, Status Code: 400, Request ID: 0c737724-00f2-40e3-b65f-3736927b69ef)" (RequestToken: f8f342c6-8320-9c75-8020-3b71b1131087, HandlerErrorCode: GeneralServiceException)

Expected result

As described in the documentation here:

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-autoscalinglaunchconfiguration

Setting DisableIMDSv1 to true should make the Auto Scaling group use launch templates
I would expect the resulting CloudFormation template to not use Launch Configurations

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

Tried both in Windows 11 and Ubuntu

EB CLI 3.21.0 (Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0])

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

No branches or pull requests

1 participant