environment specific option_setings for beanstalk

0

I am currently working on configuring the .ebextensions file to add environment properties for my AWS Elastic Beanstalk application. So far, I have been successful in adding properties using a single .config file.

However, I have a requirement where I need to configure multiple option_settings files to accommodate different properties for different environments. For example, I have a development (dev) environment and a test environment, each requiring its own set of properties.

I am wondering if there is a way to use different settings files based on the environment I am deploying to. Ideally, I would like to achieve a similar behavior to the profile-based configuration in the Spring framework.

Any guidance or suggestions on how to accomplish this would be greatly appreciated.

Thank you in advance for your assistance.

Javeed
질문됨 2달 전251회 조회
1개 답변
0

Hello.

How about using "Fn::GetOptionSetting"?
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions-functions.html#ebextensions-functions-getoptionsetting

By using "Fn::GetOptionSetting", you can set "option_settings" as an environment variable when creating the environment.

option_settings:
  aws:elasticbeanstalk:environment:
    LoadBalancerType: application

  aws:elbv2:loadbalancer:
    IdleTimeout: 300

  aws:elbv2:listener:443:
    DefaultProcess: default
    ListenerEnabled: 'true'
    Protocol: HTTPS
    SSLCertificateArns:
      "Fn::GetOptionSetting":
        Namespace: "aws:elasticbeanstalk:application:environment"
        OptionName: "ACM_CERT_ARN"
        DefaultValue: ""
eb create --envvars "ACM_CERT_ARN=${cert_arn}" test
profile picture
전문가
답변함 2달 전
  • I want to use the .config files differently for each env. I am wondering if we can load a config file based on the env we are deploying.

    let say i have 3 env dev, test, perf and all these have different config files, i want one of these needs to be loaded based on the beanstalk env.

  • As far as I know, I don't think that's possible. For example, if you are using CI/CD and have a configuration that copies the .config file according to the environment variables during deployment, it may be possible.

  • Okay thanks for looking into it, we can try doing at the project packaging level, to include the appropriate env file, but that still not work how exactly i wanted to do it

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠