imagebuilder / Client / create_infrastructure_configuration
create_infrastructure_configuration#
- imagebuilder.Client.create_infrastructure_configuration(**kwargs)#
Creates a new infrastructure configuration. An infrastructure configuration defines the environment in which your image will be built and tested.
See also: AWS API Documentation
Request Syntax
response = client.create_infrastructure_configuration( name='string', description='string', instanceTypes=[ 'string', ], instanceProfileName='string', securityGroupIds=[ 'string', ], subnetId='string', logging={ 's3Logs': { 's3BucketName': 'string', 's3KeyPrefix': 'string' } }, keyPair='string', terminateInstanceOnFailure=True|False, snsTopicArn='string', resourceTags={ 'string': 'string' }, instanceMetadataOptions={ 'httpTokens': 'string', 'httpPutResponseHopLimit': 123 }, tags={ 'string': 'string' }, placement={ 'availabilityZone': 'string', 'tenancy': 'default'|'dedicated'|'host', 'hostId': 'string', 'hostResourceGroupArn': 'string' }, clientToken='string' )
- Parameters:
name (string) –
[REQUIRED]
The name of the infrastructure configuration.
description (string) – The description of the infrastructure configuration.
instanceTypes (list) –
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.
(string) –
instanceProfileName (string) –
[REQUIRED]
The instance profile to associate with the instance used to customize your Amazon EC2 AMI.
securityGroupIds (list) –
The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.
(string) –
subnetId (string) – The subnet ID in which to place the instance used to customize your Amazon EC2 AMI.
logging (dict) –
The logging configuration of the infrastructure configuration.
s3Logs (dict) –
The Amazon S3 logging configuration.
s3BucketName (string) –
The S3 bucket in which to store the logs.
s3KeyPrefix (string) –
The Amazon S3 path to the bucket where the logs are stored.
keyPair (string) – The key pair of the infrastructure configuration. You can use this to log on to and debug the instance used to create your image.
terminateInstanceOnFailure (boolean) – 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.
snsTopicArn (string) –
The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.
Note
EC2 Image Builder is unable to send notifications to SNS topics that are encrypted using keys from other accounts. The key that is used to encrypt the SNS topic must reside in the account that the Image Builder service runs under.
resourceTags (dict) –
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.
(string) –
(string) –
instanceMetadataOptions (dict) –
The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances.
httpTokens (string) –
Indicates whether a signed token header is required for instance metadata retrieval requests. The values affect the response as follows:
required – When you retrieve the IAM role credentials, version 2.0 credentials are returned in all cases.
optional – You can include a signed token header in your request to retrieve instance metadata, or you can leave it out. If you include it, version 2.0 credentials are returned for the IAM role. Otherwise, version 1.0 credentials are returned.
The default setting is optional.
httpPutResponseHopLimit (integer) –
Limit the number of hops that an instance metadata request can traverse to reach its destination. The default is one hop. However, if HTTP tokens are required, container image builds need a minimum of two hops.
tags (dict) –
The metadata tags to assign to the infrastructure configuration resource that Image Builder creates as output. Tags are formatted as key value pairs.
(string) –
(string) –
placement (dict) –
The instance placement settings that define where the instances that are launched from your image will run.
availabilityZone (string) –
The Availability Zone where your build and test instances will launch.
tenancy (string) –
The tenancy of the instance. An instance with a tenancy of
dedicated
runs on single-tenant hardware. An instance with a tenancy ofhost
runs on a Dedicated Host.If tenancy is set to
host
, then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don’t specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.hostId (string) –
The ID of the Dedicated Host on which build and test instances run. This only applies if
tenancy
ishost
. If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.hostResourceGroupArn (string) –
The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if
tenancy
ishost
. If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.
clientToken (string) –
[REQUIRED]
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'requestId': 'string', 'clientToken': 'string', 'infrastructureConfigurationArn': 'string' }
Response Structure
(dict) –
requestId (string) –
The request ID that uniquely identifies this request.
clientToken (string) –
The client token that uniquely identifies the request.
infrastructureConfigurationArn (string) –
The Amazon Resource Name (ARN) of the infrastructure configuration that was created by this request.
Exceptions
imagebuilder.Client.exceptions.ServiceException
imagebuilder.Client.exceptions.ClientException
imagebuilder.Client.exceptions.ServiceUnavailableException
imagebuilder.Client.exceptions.InvalidRequestException
imagebuilder.Client.exceptions.IdempotentParameterMismatchException
imagebuilder.Client.exceptions.ForbiddenException
imagebuilder.Client.exceptions.CallRateLimitExceededException
imagebuilder.Client.exceptions.ResourceInUseException
imagebuilder.Client.exceptions.ResourceAlreadyExistsException
imagebuilder.Client.exceptions.ServiceQuotaExceededException