---
title: "PUT /CreateInfrastructureConfiguration"
method: PUT
path: "/CreateInfrastructureConfiguration"
---

# PUT /CreateInfrastructureConfiguration

`PUT /CreateInfrastructureConfiguration`

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

## Request body

- object
  - `name` string, required — The name of the infrastructure configuration.
  - `description` string — The description of the infrastructure configuration.
  - `instanceTypes` InstanceType[] — 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.
  - `instanceProfileName` string, required — The instance profile to associate with the instance used to customize your Amazon EC2 AMI.
  - `securityGroupIds` NonEmptyString[] — The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.
  - `subnetId` string — The subnet ID in which to place the instance used to customize your Amazon EC2 AMI.
  - `logging` object — Logging configuration defines where Image Builder uploads your logs.
    - `s3Logs` object — 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 — <p>The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.</p> <note> <p>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.</p> </note>
  - `resourceTags` object — The tags attached to the resource created by Image Builder.
  - `instanceMetadataOptions` object — The instance metadata options that apply to the HTTP requests that pipeline builds use to launch EC2 build and test instances. For more information about instance metadata options, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 User Guide</i> </i> for Linux instances, or <a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 Windows Guide</i> </i> for Windows instances.
    - `httpTokens` string — <p>Indicates whether a signed token header is required for instance metadata retrieval requests. The values affect the response as follows:</p> <ul> <li> <p> <b>required</b> – When you retrieve the IAM role credentials, version 2.0 credentials are returned in all cases.</p> </li> <li> <p> <b>optional</b> – 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.</p> </li> </ul> <p>The default setting is <b>optional</b>.</p>
    - `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` object — The tags of the infrastructure configuration.
  - `clientToken` string, required — The idempotency token used to make this request idempotent.

## Response `200`

Success

- CreateInfrastructureConfigurationResponse
  - `requestId` string — The request ID that uniquely identifies this request.
  - `clientToken` string — The idempotency token used to make this request idempotent.
  - `infrastructureConfigurationArn` string — The Amazon Resource Name (ARN) of the infrastructure configuration that was created by this request.

## Other responses

- `480` — ServiceException
- `481` — ClientException
- `482` — ServiceUnavailableException
- `483` — InvalidRequestException
- `484` — IdempotentParameterMismatchException
- `485` — ForbiddenException
- `486` — CallRateLimitExceededException
- `487` — ResourceInUseException
- `488` — ResourceAlreadyExistsException
- `489` — ServiceQuotaExceededException

---

[API](https://skmtc.net/aws/apis/imagebuilder.md) · [All operations](https://skmtc.net/aws/apis/imagebuilder/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/imagebuilder/versions/cfe68d8f8262/schema)
