updateInfrastructureConfiguration method

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

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

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

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 EC2 AMI.

Parameter clientToken : The idempotency token used to make this request idempotent.

Parameter description : The description of the infrastructure configuration.

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. This can be used to log on to and debug the instance used to create your image.

Parameter logging : The logging configuration of the infrastructure configuration.

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 EC2 AMI.

Parameter snsTopicArn : The SNS topic on which to send image build events.

Parameter subnetId : The subnet ID to place the instance used to customize your 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,
  List<String>? instanceTypes,
  String? keyPair,
  Logging? logging,
  Map<String, String>? resourceTags,
  List<String>? securityGroupIds,
  String? snsTopicArn,
  String? subnetId,
  bool? terminateInstanceOnFailure,
}) async {
  ArgumentError.checkNotNull(
      infrastructureConfigurationArn, 'infrastructureConfigurationArn');
  ArgumentError.checkNotNull(instanceProfileName, 'instanceProfileName');
  _s.validateStringLength(
    'instanceProfileName',
    instanceProfileName,
    1,
    1024,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    36,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    1024,
  );
  _s.validateStringLength(
    'keyPair',
    keyPair,
    1,
    1024,
  );
  _s.validateStringLength(
    'subnetId',
    subnetId,
    1,
    1024,
  );
  final $payload = <String, dynamic>{
    'infrastructureConfigurationArn': infrastructureConfigurationArn,
    'instanceProfileName': instanceProfileName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (instanceTypes != null) 'instanceTypes': instanceTypes,
    if (keyPair != null) 'keyPair': keyPair,
    if (logging != null) 'logging': logging,
    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);
}