Open colinbjohnson opened 3 years ago
@colinbjohnson The option setting from update-stack would override updates from elasticbeanstalk cli for the same environment, this is the expected behavior. Option settings should be added to the cfn template if the template would be reused. Are there any updates/features you are looking for this behavior?
Hi there, we ran into the same issue, we would like to manage the variable from our CI/CD, however every time we do a change in the CF file ALL variables are erased.
We specifically did not set any aws:elasticbeanstalk:application:environment
but we still have some OptionSettings
in AWS::ElasticBeanstalk::ConfigurationTemplate
is it why they get erased ?
I expect CF to not interact with my variable since I do not tell him to do so.
Should I open another ticket ?
1. Title
AWS::ElasticBeanstalk::Environment-OptionSettings
: Updates Can Remove Environment Variables2. Scope of request
AWS::ElasticBeanstalk::Environment-OptionSettings - aws:elasticbeanstalk:application:environment
3. Expected behavior
In Create or Update, a AWS::ElasticBeanstalk::Environment-OptionSettings - change should not
remove aws:elasticbeanstalk:application:environment environment variables added outside of CloudFormation (the present behavior) - the behavior when updating other resources (i.e. a S3 bucket) with property outside of CloudFormation is to leave these properties alone
but rather could:
aws:elasticbeanstalk:application:environment
values) will be removedreset
(where allOptionSettings
are returned to values in CloudFormation stack),updateoradd
(where allOptionSettings
are updated or added and existing configuration is left untouched)OptionSettings
documentation is updated to reflect manually created environment variables will be removed.Feel free to describe other desired and relevant implementation details.
4. Suggest specific test cases
To test this:
create a CloudFormation stack using the template below
The create the stack using a command similar to the following:
aws cloudformation create-stack --stack-name EBwithEnvVars --capabilities CAPABILITY_IAM --template-body file://elasticbeanstalk_with_envvars.yaml
update an OptionSetting outside of CloudFormation
Example: outside of CloudFormation add an environment variable or c:
modify an OptionSettings property and run an "Update Stack" using a command similar to the below:
Example: change the following:
then run the following:
aws cloudformation update-stack --stack-name EBwithEnvVars --capabilities CAPABILITY_IAM --template-body file://elasticbeanstalk_with_envvars.yaml
confirm the manually add Environment Variable has been removed
Configuration of environment variables outside of CloudFormation have been removed - in the case above this would have removed the environment variable
COUNTRY
.5. Helpful Links to speed up research and evaluation
NA
6. Category
Use the categories as displayed in the AWS Management Console (simplified):
7. Any additional context
I'm not sure what the correct behavior should be... I know that existing changes made outside of CloudFormation are not removed (i.e. a property on an S3 bucket) and I know that any change that results in configuration removal is surprising behavior.