Environment variables in Elastic beanstalk not updating after cloning an environment

0

Hello,

I cloned an elastic beanstalk environment and tried either through the web console as well as the AWS CLI to change the environment variables, but changes seem to be ignored in some way as the instances have the new values I set, but in the console interface as well using AWS CLI, they show the previous values of the environment variables, like there were no changes at all. This is not supposed to work like this.

Let me give some context...

  • The environment I cloned uses platform PHP 7.4 running on 64bit Amazon Linux 2/3.5.8, which is a retired platform, just in case this can be in some way one of the causes of the issue.
  • After running command aws elasticbeanstalk describe-configuration-settings --application-name my-app --environment-name my-app-new-env, I get a configuration setting I am not sure if can be related with the issue it shows the environment variables I tried to change but is not working:
                {
                    "Namespace": "aws:cloudformation:template:parameter",
                    "OptionName": "EnvironmentVariables",
                    "Value": "APP_ENV=testing,DB_PORT=3306,MORE_VARIABLES_LIKE_THIS=withSomeOldValue,COMPOSER_HOME=/root,APP_MAINTENANCE=0,PRUEBA=1"
                },
  • I even tried deleting the current configuration settings with command aws elasticbeanstalk delete-environment-configuration --application-name my-app --environment-name my-app-new-env, but the issue remains there

A full example of the situation is: I had on the original environment the variables APP_ENV=testing and APP_MAINTENANCE=0, which are copied to the new environment. Let's say I didn't have a variable called TEST1, if I modify either by AWSCLI or AWS Console the env variable APP_ENV to production, remove APP_MAINTENANCE and add TEST1=value, the following happens:

  • Connecting to one of the EC2 instances of the environment and running command /opt/elasticbeanstalk/bin/get-config environment shows correctly APP_ENV=production and TEST1=value and doesn't show APP_MAINTENANCE, so everything seem to be fine
  • Into the Elastic Beanstalk console, environment variables remain in the original state so APP_ENV=testing, APP_MAINTENANCE still present with value 0, but TEST1=value is added to the list
질문됨 한 달 전139회 조회
1개 답변
0

If you want to remove an option setting, you should use the --options-to-remove argument

aws elasticbeanstalk update-environment --options-to-remove "Namespace=aws:cloudformation:template:parameter,OptionName=EnvironmentVariables"

See https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-configuration-methods-after.html#configuration-options-remove-awscli

AWS
progfan
답변함 14일 전

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

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

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

관련 콘텐츠