createCloudFormationChangeSet method

Future<CreateCloudFormationChangeSetResponse> createCloudFormationChangeSet({
  1. required String applicationId,
  2. required String stackName,
  3. List<String>? capabilities,
  4. String? changeSetName,
  5. String? clientToken,
  6. String? description,
  7. List<String>? notificationArns,
  8. List<ParameterValue>? parameterOverrides,
  9. List<String>? resourceTypes,
  10. RollbackConfiguration? rollbackConfiguration,
  11. String? semanticVersion,
  12. List<Tag>? tags,
  13. String? templateId,
})

Creates an AWS CloudFormation change set for the given application.

May throw TooManyRequestsException. May throw BadRequestException. May throw InternalServerErrorException. May throw ForbiddenException.

Parameter applicationId : The Amazon Resource Name (ARN) of the application.

Parameter stackName : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter capabilities : A list of values that you must specify before you can deploy certain applications. Some applications might include resources that can affect permissions in your AWS account, for example, by creating new AWS Identity and Access Management (IAM) users. For those applications, you must explicitly acknowledge their capabilities by specifying this parameter.

The only valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, and CAPABILITY_AUTO_EXPAND.

The following resources require you to specify CAPABILITY_IAM or CAPABILITY_NAMED_IAM: AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, and AWS::IAM::Role. If the application contains IAM resources, you can specify either CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

The following resources require you to specify CAPABILITY_RESOURCE_POLICY: AWS::Lambda::Permission, AWS::IAM:Policy, AWS::ApplicationAutoScaling::ScalingPolicy, AWS::S3::BucketPolicy, AWS::SQS::QueuePolicy, and AWS::SNS:TopicPolicy.

Applications that contain one or more nested applications require you to specify CAPABILITY_AUTO_EXPAND.

If your application template contains any of the above resources, we recommend that you review all permissions associated with the application before deploying. If you don't specify this parameter for an application that requires capabilities, the call will fail.

Parameter changeSetName : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter clientToken : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter description : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter notificationArns : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter parameterOverrides : A list of parameter values for the parameters of the application.

Parameter resourceTypes : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter rollbackConfiguration : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter semanticVersion : The semantic version of the application:

https://semver.org/

Parameter tags : This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.

Parameter templateId : The UUID returned by CreateCloudFormationTemplate.

Pattern: 0-9a-fA-F{8}-0-9a-fA-F{4}-0-9a-fA-F{4}-0-9a-fA-F{4}-0-9a-fA-F{12}

Implementation

Future<CreateCloudFormationChangeSetResponse> createCloudFormationChangeSet({
  required String applicationId,
  required String stackName,
  List<String>? capabilities,
  String? changeSetName,
  String? clientToken,
  String? description,
  List<String>? notificationArns,
  List<ParameterValue>? parameterOverrides,
  List<String>? resourceTypes,
  RollbackConfiguration? rollbackConfiguration,
  String? semanticVersion,
  List<Tag>? tags,
  String? templateId,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(stackName, 'stackName');
  final $payload = <String, dynamic>{
    'stackName': stackName,
    if (capabilities != null) 'capabilities': capabilities,
    if (changeSetName != null) 'changeSetName': changeSetName,
    if (clientToken != null) 'clientToken': clientToken,
    if (description != null) 'description': description,
    if (notificationArns != null) 'notificationArns': notificationArns,
    if (parameterOverrides != null) 'parameterOverrides': parameterOverrides,
    if (resourceTypes != null) 'resourceTypes': resourceTypes,
    if (rollbackConfiguration != null)
      'rollbackConfiguration': rollbackConfiguration,
    if (semanticVersion != null) 'semanticVersion': semanticVersion,
    if (tags != null) 'tags': tags,
    if (templateId != null) 'templateId': templateId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/changesets',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCloudFormationChangeSetResponse.fromJson(response);
}