update_infrastructure_configuration
async
¶
update_infrastructure_configuration(
infrastructure_configuration_arn: InfrastructureConfigurationArn,
instance_profile_name: InstanceProfileNameType,
client_token: ClientToken,
*,
config_overrides: Optional[AsyncimagebuilderClientConfig] = None,
description: Optional[NonEmptyString] = None,
instance_types: Optional[InstanceTypeList] = None,
security_group_ids: Optional[SecurityGroupIds] = None,
subnet_id: Optional[NonEmptyString] = None,
logging: Optional[Logging] = None,
key_pair: Optional[NonEmptyString] = None,
terminate_instance_on_failure: Optional[NullableBoolean] = None,
terminate_instance_on_completion: Optional[NullableBoolean] = None,
sns_topic_arn: Optional[SnsTopicArn] = None,
resource_tags: Optional[ResourceTagMap] = None,
instance_metadata_options: Optional[InstanceMetadataOptions] = None,
placement: Optional[Placement] = None,
parent_instance: Optional[ParentInstanceConfiguration] = None,
) -> UpdateInfrastructureConfigurationResponse
Updates an infrastructure configuration. An infrastructure configuration defines the environment in which Image Builder builds and tests your image.
This operation doesn't support selective updates. The request replaces the configuration, so include every setting that you want to keep. Omitted optional properties are cleared.
Parameters:
-
infrastructure_configuration_arn(InfrastructureConfigurationArn) –The Amazon Resource Name (ARN) of the infrastructure configuration that you want to update.
-
description(Optional[NonEmptyString], default:None) –The description of the infrastructure configuration.
-
instance_types(Optional[InstanceTypeList], default:None) –The instance types of the infrastructure configuration. You can specify one or more instance types to use for this build. Image Builder picks one of these instance types based on availability. If you don't specify instance types, Image Builder selects compatible instance types automatically. If you specify a Dedicated Host, Image Builder uses only instance types that the host supports.
-
instance_profile_name(InstanceProfileNameType) –The instance profile to associate with the instance used to customize your Amazon EC2 AMI. The instance profile must exist in your account.
-
security_group_ids(Optional[SecurityGroupIds], default:None) –The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.
-
subnet_id(Optional[NonEmptyString], default:None) –The subnet ID in which to place the instance used to customize your Amazon EC2 AMI. If you specify
subnetId, you must also specify one or more security group IDs insecurityGroupIds. Otherwise, the request fails. -
logging(Optional[Logging], default:None) –The logging configuration of the infrastructure configuration. When you configure S3 logs, Image Builder writes logs from the build and test process to the specified bucket under the key prefix.
-
key_pair(Optional[NonEmptyString], default:None) –The key pair of the infrastructure configuration. You can use this to log on to and debug the instance used to create your image.
-
terminate_instance_on_failure(Optional[NullableBoolean], default:None) –Specifies whether to terminate the instance on failure. 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. Defaults to
true. -
terminate_instance_on_completion(Optional[NullableBoolean], default:None) –Specifies whether Image Builder terminates build and test instances when image creation ends without a failure (success, cancellation, or expiration). Defaults to
true. -
sns_topic_arn(Optional[SnsTopicArn], default:None) –The Amazon Resource Name (ARN) of the SNS topic to which Image Builder sends image build event notifications. Specify a standard topic. Image Builder doesn't support FIFO topics. Image Builder validates the topic when you create or update the configuration. You must have permission to publish to the topic.
EC2 Image Builder can't send notifications to SNS topics that are encrypted using keys from other accounts. If your SNS topic is encrypted, the key must be owned by the same account that owns your Image Builder resources.
-
resource_tags(Optional[ResourceTagMap], default:None) –The metadata tags to assign to the Amazon EC2 instance that Image Builder launches during the build process. Tags are formatted as key value pairs. Tag keys can't begin with
aws:or match one of the following reserved keys:CreatedBy,Ec2ImageBuilderArn,Name, orTags. -
instance_metadata_options(Optional[InstanceMetadataOptions], default:None) –The instance metadata service (IMDS) settings that Image Builder applies to the EC2 build and test instances it launches during image creation. If you don't set these options, the EC2 launch defaults for the instance apply. For more information about instance metadata options, see one of the following links:
-
Configure the instance metadata options in the Amazon EC2 User Guide for Linux instances.
-
Configure the instance metadata options in the Amazon EC2 Windows Guide for Windows instances.
-
-
placement(Optional[Placement], default:None) –The instance placement settings that define where the build and test instances that Image Builder launches during image creation run. These settings don't affect instances that you launch from the output image.
-
parent_instance(Optional[ParentInstanceConfiguration], default:None) –The Amazon EC2 Auto Scaling group that Image Builder takes the build instance from, instead of launching a new instance. This applies only to the build phase.
To use this feature, the execution role for the build must have permissions to describe the Auto Scaling group, tag the instance while it's still in the group, and detach it from the group. For more information, see Build on an instance from an Auto Scaling group in the EC2 Image Builder User Guide.
-
client_token(ClientToken) –A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.
Raises:
-
CallRateLimitExceededException–You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.
-
ClientException–A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.
-
ForbiddenException–You are not authorized to perform the requested operation.
-
IdempotentParameterMismatchException–You have specified a client token for an operation using parameter values that differ from a previous request that used the same client token.
-
InvalidRequestException–The request is malformed or otherwise invalid. Verify the request and try again.
-
ResourceInUseException–The resource that you are trying to operate on is currently in use. Review the message details and retry later.
-
ServiceException–An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.
-
ServiceUnavailableException–The service is unable to process your request at this time.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Update an infrastructure configuration The following example updates an infrastructure configuration to use larger instance types and to keep the build instance running when the image build fails.
>>> await client.update_infrastructure_configuration(infrastructure_configuration_arn='arn:aws:imagebuilder:us-west-2:111122223333:infrastructure-configuration/my-example-infrastructure', description='An infrastructure configuration for Amazon Linux builds', instance_profile_name='EC2InstanceProfileForImageBuilder', instance_types=['t3.large', 't3.xlarge'], terminate_instance_on_failure=False, client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLEbbbbb')
Source code in docs_src/capo_imagebuilder/_services/async_imagebuilder.py
6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 | |