updateEnvironment method

Future<EnvironmentDescription> updateEnvironment({
  1. String? applicationName,
  2. String? description,
  3. String? environmentId,
  4. String? environmentName,
  5. String? groupName,
  6. List<ConfigurationOptionSetting>? optionSettings,
  7. List<OptionSpecification>? optionsToRemove,
  8. String? platformArn,
  9. String? solutionStackName,
  10. String? templateName,
  11. EnvironmentTier? tier,
  12. String? versionLabel,
})

Updates the environment description, deploys a new application version, updates the configuration settings to an entirely new configuration template, or updates select configuration option values in the running environment.

Attempting to update both the release and configuration is not allowed and AWS Elastic Beanstalk returns an InvalidParameterCombination error.

When updating the configuration settings to a new template or individual settings, a draft configuration is created and DescribeConfigurationSettings for this environment returns two setting descriptions with different DeploymentStatus values.

May throw InsufficientPrivilegesException. May throw TooManyBucketsException.

Parameter applicationName : The name of the application with which the environment is associated.

Parameter description : If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.

Parameter environmentId : The ID of the environment to update.

If no environment with this ID exists, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.

Parameter environmentName : The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.

Parameter groupName : The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See Environment Manifest (env.yaml) for details.

Parameter optionSettings : If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.

Parameter optionsToRemove : A list of custom user-defined configuration options to remove from the configuration set for this environment.

Parameter platformArn : The ARN of the platform, if used.

Parameter solutionStackName : This specifies the platform version that the environment will run after the environment is updated.

Parameter templateName : If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Parameter tier : This specifies the tier to use to update the environment.

Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns InvalidParameterValue error.

Parameter versionLabel : If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an InvalidParameterValue error.

Implementation

Future<EnvironmentDescription> updateEnvironment({
  String? applicationName,
  String? description,
  String? environmentId,
  String? environmentName,
  String? groupName,
  List<ConfigurationOptionSetting>? optionSettings,
  List<OptionSpecification>? optionsToRemove,
  String? platformArn,
  String? solutionStackName,
  String? templateName,
  EnvironmentTier? tier,
  String? versionLabel,
}) async {
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    100,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    200,
  );
  _s.validateStringLength(
    'environmentName',
    environmentName,
    4,
    40,
  );
  _s.validateStringLength(
    'groupName',
    groupName,
    1,
    19,
  );
  _s.validateStringLength(
    'templateName',
    templateName,
    1,
    100,
  );
  _s.validateStringLength(
    'versionLabel',
    versionLabel,
    1,
    100,
  );
  final $request = <String, dynamic>{};
  applicationName?.also((arg) => $request['ApplicationName'] = arg);
  description?.also((arg) => $request['Description'] = arg);
  environmentId?.also((arg) => $request['EnvironmentId'] = arg);
  environmentName?.also((arg) => $request['EnvironmentName'] = arg);
  groupName?.also((arg) => $request['GroupName'] = arg);
  optionSettings?.also((arg) => $request['OptionSettings'] = arg);
  optionsToRemove?.also((arg) => $request['OptionsToRemove'] = arg);
  platformArn?.also((arg) => $request['PlatformArn'] = arg);
  solutionStackName?.also((arg) => $request['SolutionStackName'] = arg);
  templateName?.also((arg) => $request['TemplateName'] = arg);
  tier?.also((arg) => $request['Tier'] = arg);
  versionLabel?.also((arg) => $request['VersionLabel'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'UpdateEnvironment',
    version: '2010-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['UpdateEnvironmentMessage'],
    shapes: shapes,
    resultWrapper: 'UpdateEnvironmentResult',
  );
  return EnvironmentDescription.fromXml($result);
}