We are using eb_deployer which under the hood uses ElasticBeanstalk Ruby Aws Sdk. The Aws::ElasticBeanstalk::Client#update_environment
method is used in particular to trigger a deployment. I'm trying to make use of RollingWithAdditionalBatch
deployment policy however this settings seems to be ignored when the environment update is initiated via mentioned sdk method.
Inside of option_settings
parameter of update_environment
we have:
{
"namespace"=>"aws:elasticbeanstalk:command",
"option_name"=>"DeploymentPolicy",
"value"=>"RollingWithAdditionalBatch"
},
However despite the above the deployment is using Rolling strategy as far as I can tell:
2017-01-11 15:59:42 UTC+0100 INFO Environment update completed successfully.
2017-01-11 15:59:42 UTC+0100 INFO Successfully deployed new configuration to environment.
2017-01-11 15:59:42 UTC+0100 INFO New application version was deployed to running EC2 instances.
2017-01-11 15:58:32 UTC+0100 INFO Deploying new version to instance(s).
2017-01-11 15:57:57 UTC+0100 INFO Updating environment ENV_ID configuration settings.
You can find the details of the method call in the update-environment-call.txt.
After some more tests it turned out that the issue might not necessarily be related to aws-sdk-ruby. The following invocation:
client.update_environment(
environment_id:"ENV_ID",
version_label:"backend.1762",
option_settings:[{
"namespace"=>"aws:elasticbeanstalk:command",
"option_name"=>"DeploymentPolicy",
"value"=>"RollingWithAdditionalBatch"
},{
"namespace"=>"aws:ec2:vpc",
"option_name"=>"VPCId",
"value"=>"VPC_ID_ABC"
}]
)
Triggers Rolling deployment.
However if we remove the VPC setting then Rolling with additional batch is invoked as requested:
client.update_environment(
environment_id:"ENV_ID",
version_label:"backend.1762",
option_settings:[{
"namespace"=>"aws:elasticbeanstalk:command",
"option_name"=>"DeploymentPolicy",
"value"=>"RollingWithAdditionalBatch"
}]
)
Between subsequent calls to update_environment
the only parameter that has different value is version_label
.
Steps to reproduce the problem:
Step 1. We call update_environment with version_label: 1
and certain option_settings
. The option_settings include RollingWithAdditionalBatch
but also have other settings i.e. VPCId
. The environment is updated properly and the RollingWithAdditionalBatch
shows up as a configured value in AWS Web Console.
Step 2,3,4,5,... We call update_environment
with version_label: n
and the same option_settings
as in Step 1. The new version of application is deployed using Rolling strategy which in my view is unexpected.
However if we perform Step 2,3,5 and in option_settings
provide only a single option for RollingWithAdditionalBatch
then the new version is deployed correctly using RollingWithAdditionalBatch
.