updateDeploymentGroup method

Future<UpdateDeploymentGroupOutput> updateDeploymentGroup({
  1. required String applicationName,
  2. required String currentDeploymentGroupName,
  3. AlarmConfiguration? alarmConfiguration,
  4. AutoRollbackConfiguration? autoRollbackConfiguration,
  5. List<String>? autoScalingGroups,
  6. BlueGreenDeploymentConfiguration? blueGreenDeploymentConfiguration,
  7. String? deploymentConfigName,
  8. DeploymentStyle? deploymentStyle,
  9. List<EC2TagFilter>? ec2TagFilters,
  10. EC2TagSet? ec2TagSet,
  11. List<ECSService>? ecsServices,
  12. LoadBalancerInfo? loadBalancerInfo,
  13. String? newDeploymentGroupName,
  14. List<TagFilter>? onPremisesInstanceTagFilters,
  15. OnPremisesTagSet? onPremisesTagSet,
  16. String? serviceRoleArn,
  17. List<TriggerConfig>? triggerConfigurations,
})

Changes information about a deployment group.

May throw ApplicationNameRequiredException. May throw InvalidApplicationNameException. May throw ApplicationDoesNotExistException. May throw InvalidDeploymentGroupNameException. May throw DeploymentGroupAlreadyExistsException. May throw DeploymentGroupNameRequiredException. May throw DeploymentGroupDoesNotExistException. May throw InvalidEC2TagException. May throw InvalidTagException. May throw InvalidAutoScalingGroupException. May throw InvalidDeploymentConfigNameException. May throw DeploymentConfigDoesNotExistException. May throw InvalidRoleException. May throw LifecycleHookLimitExceededException. May throw InvalidTriggerConfigException. May throw TriggerTargetsLimitExceededException. May throw InvalidAlarmConfigException. May throw AlarmsLimitExceededException. May throw InvalidAutoRollbackConfigException. May throw InvalidLoadBalancerInfoException. May throw InvalidDeploymentStyleException. May throw InvalidBlueGreenDeploymentConfigurationException. May throw InvalidEC2TagCombinationException. May throw InvalidOnPremisesTagCombinationException. May throw TagSetListLimitExceededException. May throw InvalidInputException. May throw ThrottlingException. May throw InvalidECSServiceException. May throw InvalidTargetGroupPairException. May throw ECSServiceMappingLimitExceededException. May throw InvalidTrafficRoutingConfigurationException.

Parameter applicationName : The application name that corresponds to the deployment group to update.

Parameter currentDeploymentGroupName : The current name of the deployment group.

Parameter alarmConfiguration : Information to add or change about Amazon CloudWatch alarms when the deployment group is updated.

Parameter autoRollbackConfiguration : Information for an automatic rollback configuration that is added or changed when a deployment group is updated.

Parameter autoScalingGroups : The replacement list of Auto Scaling groups to be included in the deployment group, if you want to change them. To keep the Auto Scaling groups, enter their names. To remove Auto Scaling groups, do not enter any Auto Scaling group names.

Parameter blueGreenDeploymentConfiguration : Information about blue/green deployment options for a deployment group.

Parameter deploymentConfigName : The replacement deployment configuration name to use, if you want to change it.

Parameter deploymentStyle : Information about the type of deployment, either in-place or blue/green, you want to run and whether to route deployment traffic behind a load balancer.

Parameter ec2TagFilters : The replacement set of Amazon EC2 tags on which to filter, if you want to change them. To keep the existing tags, enter their names. To remove tags, do not enter any tag names.

Parameter ec2TagSet : Information about groups of tags applied to on-premises instances. The deployment group includes only EC2 instances identified by all the tag groups.

Parameter ecsServices : The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name pair using the format <clustername>:<servicename>.

Parameter loadBalancerInfo : Information about the load balancer used in a deployment.

Parameter newDeploymentGroupName : The new name of the deployment group, if you want to change it.

Parameter onPremisesInstanceTagFilters : The replacement set of on-premises instance tags on which to filter, if you want to change them. To keep the existing tags, enter their names. To remove tags, do not enter any tag names.

Parameter onPremisesTagSet : Information about an on-premises instance tag set. The deployment group includes only on-premises instances identified by all the tag groups.

Parameter serviceRoleArn : A replacement ARN for the service role, if you want to change it.

Parameter triggerConfigurations : Information about triggers to change when the deployment group is updated. For examples, see Edit a Trigger in a CodeDeploy Deployment Group in the AWS CodeDeploy User Guide.

Implementation

Future<UpdateDeploymentGroupOutput> updateDeploymentGroup({
  required String applicationName,
  required String currentDeploymentGroupName,
  AlarmConfiguration? alarmConfiguration,
  AutoRollbackConfiguration? autoRollbackConfiguration,
  List<String>? autoScalingGroups,
  BlueGreenDeploymentConfiguration? blueGreenDeploymentConfiguration,
  String? deploymentConfigName,
  DeploymentStyle? deploymentStyle,
  List<EC2TagFilter>? ec2TagFilters,
  EC2TagSet? ec2TagSet,
  List<ECSService>? ecsServices,
  LoadBalancerInfo? loadBalancerInfo,
  String? newDeploymentGroupName,
  List<TagFilter>? onPremisesInstanceTagFilters,
  OnPremisesTagSet? onPremisesTagSet,
  String? serviceRoleArn,
  List<TriggerConfig>? triggerConfigurations,
}) async {
  ArgumentError.checkNotNull(applicationName, 'applicationName');
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      currentDeploymentGroupName, 'currentDeploymentGroupName');
  _s.validateStringLength(
    'currentDeploymentGroupName',
    currentDeploymentGroupName,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'deploymentConfigName',
    deploymentConfigName,
    1,
    100,
  );
  _s.validateStringLength(
    'newDeploymentGroupName',
    newDeploymentGroupName,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.UpdateDeploymentGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'applicationName': applicationName,
      'currentDeploymentGroupName': currentDeploymentGroupName,
      if (alarmConfiguration != null)
        'alarmConfiguration': alarmConfiguration,
      if (autoRollbackConfiguration != null)
        'autoRollbackConfiguration': autoRollbackConfiguration,
      if (autoScalingGroups != null) 'autoScalingGroups': autoScalingGroups,
      if (blueGreenDeploymentConfiguration != null)
        'blueGreenDeploymentConfiguration': blueGreenDeploymentConfiguration,
      if (deploymentConfigName != null)
        'deploymentConfigName': deploymentConfigName,
      if (deploymentStyle != null) 'deploymentStyle': deploymentStyle,
      if (ec2TagFilters != null) 'ec2TagFilters': ec2TagFilters,
      if (ec2TagSet != null) 'ec2TagSet': ec2TagSet,
      if (ecsServices != null) 'ecsServices': ecsServices,
      if (loadBalancerInfo != null) 'loadBalancerInfo': loadBalancerInfo,
      if (newDeploymentGroupName != null)
        'newDeploymentGroupName': newDeploymentGroupName,
      if (onPremisesInstanceTagFilters != null)
        'onPremisesInstanceTagFilters': onPremisesInstanceTagFilters,
      if (onPremisesTagSet != null) 'onPremisesTagSet': onPremisesTagSet,
      if (serviceRoleArn != null) 'serviceRoleArn': serviceRoleArn,
      if (triggerConfigurations != null)
        'triggerConfigurations': triggerConfigurations,
    },
  );

  return UpdateDeploymentGroupOutput.fromJson(jsonResponse.body);
}