updateInfrastructureConfiguration method

Future<UpdateInfrastructureConfigurationResponse> updateInfrastructureConfiguration({
  1. required String infrastructureConfigurationArn,
  2. required String instanceProfileName,
  3. String? clientToken,
  4. String? description,
  5. InstanceMetadataOptions? instanceMetadataOptions,
  6. List<String>? instanceTypes,
  7. String? keyPair,
  8. Logging? logging,
  9. Placement? placement,
  10. Map<String, String>? resourceTags,
  11. List<String>? securityGroupIds,
  12. String? snsTopicArn,
  13. String? subnetId,
  14. bool? terminateInstanceOnFailure,
})

Updates a new infrastructure configuration. An infrastructure configuration defines the environment in which your image will be built and tested.

May throw CallRateLimitExceededException. May throw ClientException. May throw ForbiddenException. May throw IdempotentParameterMismatchException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ServiceException. May throw ServiceUnavailableException.

Parameter infrastructureConfigurationArn : The Amazon Resource Name (ARN) of the infrastructure configuration that you want to update.

Parameter instanceProfileName : The instance profile to associate with the instance used to customize your Amazon EC2 AMI.

Parameter clientToken : Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

Parameter description : The description of the infrastructure configuration.

Parameter instanceMetadataOptions : The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances. For more information about instance metadata options, see one of the following links:

Parameter instanceTypes : The instance types of the infrastructure configuration. You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.

Parameter keyPair : The key pair of the infrastructure configuration. You can use this to log on to and debug the instance used to create your image.

Parameter logging : The logging configuration of the infrastructure configuration.

Parameter placement : The instance placement settings that define where the instances that are launched from your image will run.

Parameter resourceTags : The tags attached to the resource created by Image Builder.

Parameter securityGroupIds : The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.

Parameter snsTopicArn : The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.

Parameter subnetId : The subnet ID to place the instance used to customize your Amazon EC2 AMI in.

Parameter terminateInstanceOnFailure : The terminate instance on failure setting of the infrastructure configuration. Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.

Implementation

Future<UpdateInfrastructureConfigurationResponse>
    updateInfrastructureConfiguration({
  required String infrastructureConfigurationArn,
  required String instanceProfileName,
  String? clientToken,
  String? description,
  InstanceMetadataOptions? instanceMetadataOptions,
  List<String>? instanceTypes,
  String? keyPair,
  Logging? logging,
  Placement? placement,
  Map<String, String>? resourceTags,
  List<String>? securityGroupIds,
  String? snsTopicArn,
  String? subnetId,
  bool? terminateInstanceOnFailure,
}) async {
  final $payload = <String, dynamic>{
    'infrastructureConfigurationArn': infrastructureConfigurationArn,
    'instanceProfileName': instanceProfileName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (instanceMetadataOptions != null)
      'instanceMetadataOptions': instanceMetadataOptions,
    if (instanceTypes != null) 'instanceTypes': instanceTypes,
    if (keyPair != null) 'keyPair': keyPair,
    if (logging != null) 'logging': logging,
    if (placement != null) 'placement': placement,
    if (resourceTags != null) 'resourceTags': resourceTags,
    if (securityGroupIds != null) 'securityGroupIds': securityGroupIds,
    if (snsTopicArn != null) 'snsTopicArn': snsTopicArn,
    if (subnetId != null) 'subnetId': subnetId,
    if (terminateInstanceOnFailure != null)
      'terminateInstanceOnFailure': terminateInstanceOnFailure,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/UpdateInfrastructureConfiguration',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateInfrastructureConfigurationResponse.fromJson(response);
}