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

Dynamically setting InstanceTypes with .ebextensions is not working #175

Open
jeran-urban opened this issue Aug 26, 2024 · 2 comments
Open

Comments

@jeran-urban
Copy link

Hello,

I am having an issue trying to dynamically set the EC2's InstancTypes per environment using .ebextensions.

I have tried multiple configurations and this Stack Overflow article has a good break down of the problem with more detailed examples and some troubleshooting provided as well.

working yaml example (hard coded):

    option_settings:
        aws:ec2:instances:
            InstanceTypes: t3.small # <-- hard coded works. 

example environment variable yaml used:

    option_settings:
        aws:elasticbeanstalk:application:environment:
            ENV_INSTANCE_TYPE: t3.small

failing yaml example (using getOptionSetting fn)

    option_settings:
        aws:ec2:instances:
            InstanceTypes: {"Fn::GetOptionSetting": {"Namespace": "aws:elasticbeanstalk:application:environment", "OptionName": "ENV_INSTANCE_TYPE"}}

returns error:

    ERROR   Not a comma-separated string or array: '{"Fn::GetOptionSetting":{"Namespace":"aws:elasticbeanstalk:application:environment","OptionName":"ENV_INSTANCE_TYPE"}}'

I also tried:

  1. using custom resources.
  2. using 't3.small,t3.medium' and splitting that into 2 separate variables for the env var.
  3. using various attempts of joining/splitting the string in conjunction with the Fn::GetOptionSetting.

I do not see any issues referenced in the following documentation stating this should be an issue:

Is there something I am missing or is this not possible?

Any help with this would be greatly appreciated. Thank you.

@jeran-urban
Copy link
Author

@0xab01 are you able to provide details/documentation for official sources as to what this is for / how it works / how it fixes this issue? I appreciate your input here, but blindly downloading and executing programs with no context/vetting would not be a viable solution.

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

2 participants
@jeran-urban and others