Adding time based scheduling via ElasticBeanstalk Node JS SDK

Viewed 14

I have been trying to add time-based scheduling via AWS SDK. Here is sample code snippet

const {ElasticBeanstalkClient  ,
UpdateConfigurationTemplateCommand } = require('@aws-sdk/client-elastic-beanstalk');

const abortEnvironmentUpdateCommand =  new 
UpdateConfigurationTemplateCommand({ApplicationName:'Admin Portal',EnvironmentName:'xxxx-xxxx-v2',
"OptionSettings.member.1.Namespace": "aws:autoscaling:scheduledaction",
"OptionSettings.member.1.OptionName": "MinSize",
"OptionSettings.member.1.Value": "1",
"Operation": "UpdateConfigurationTemplate",
"OptionSettings.member.2.Namespace": "aws:autoscaling:scheduledaction",
"OptionSettings.member.2.OptionName": "MaxSize",
"OptionSettings.member.2.Value": "1",
"OptionSettings.member.3.Namespace": "aws:autoscaling:scheduledaction",
"OptionSettings.member.3.OptionName": "DesiredCapacity",
"OptionSettings.member.3.Value": "1",
"OptionSettings.member.4.Namespace": "aws:autoscaling:scheduledaction",
"OptionSettings.member.4.OptionName": "StartTime",
"OptionSettings.member.4.Value": "2022-08-18T00:00:00Z",
"TemplateName":'xxxxxTestConfiguration'});
elasticbeanstalktemp
  .send(abortEnvironmentUpdateCommand)
  .then(data => {
    console.log("Data",data);
    // do something
  })
  .catch(error => {
    console.log("Error",error);
    // error handling
  });

In response, I am getting 200 status codes but when I am applying updated configuration to the environment, it doesn't add time-based scheduling action.

Can anyone help me pointing what I am doing wrong ?

0 Answers
Related