{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ec2-image-builder/json-schema/amazon-ec2-image-builder-create-infrastructure-configuration-request-schema.json",
  "title": "CreateInfrastructureConfigurationRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ec2-image-builder-createinfrastructureconfiguration-api-openapi.yml#/components/schemas/CreateInfrastructureConfigurationRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the infrastructure configuration. Infrastructure configuration names must be unique to your account in each Amazon Web Services Region. Image Builder generates the infrastructure configuration ARN from a normalized form of the name, so names that differ only in case, spaces, or underscores count as the same name."
    },
    "description": {
      "type": "string",
      "description": "The description of the infrastructure configuration."
    },
    "instanceTypes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "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."
    },
    "instanceProfileName": {
      "type": "string",
      "description": "The instance profile to associate with the instance used to customize your Amazon EC2 AMI. The instance profile must exist in your account."
    },
    "securityGroupIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The security group IDs to associate with the instance used to customize your Amazon EC2 AMI."
    },
    "subnetId": {
      "type": "string",
      "description": "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 in securityGroupIds. Otherwise, the request fails."
    },
    "logging": {
      "$ref": "#/$defs/Logging"
    },
    "keyPair": {
      "type": "string",
      "description": "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": {
      "type": "boolean",
      "description": "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."
    },
    "terminateInstanceOnCompletion": {
      "type": "boolean",
      "description": "Specifies whether Image Builder terminates build and test instances when image creation ends without a failure (success, cancellation, or expiration). Defaults to true."
    },
    "snsTopicArn": {
      "type": "string",
      "description": "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."
    },
    "resourceTags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "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, or Tags."
    },
    "instanceMetadataOptions": {
      "$ref": "#/$defs/InstanceMetadataOptions"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The metadata tags to assign to the infrastructure configuration resource that Image Builder creates as output. Tags are formatted as key value pairs."
    },
    "placement": {
      "$ref": "#/$defs/Placement"
    },
    "parentInstance": {
      "$ref": "#/$defs/ParentInstanceConfiguration"
    },
    "clientToken": {
      "type": "string",
      "description": "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."
    },
    "dryRun": {
      "type": "boolean",
      "description": "Validates the required permissions and request parameters without performing the operation. If validation succeeds, the operation returns a DryRunOperationException error response."
    }
  },
  "required": [
    "name",
    "instanceProfileName",
    "clientToken"
  ],
  "$defs": {
    "AutoScalingGroupConfiguration": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the Auto Scaling group, in the same account and Amazon Web Services Region as the infrastructure configuration. To specify a group, you must have permissions to describe it."
        },
        "capacityWaitTimeoutSeconds": {
          "type": "integer",
          "description": "The number of seconds that Image Builder waits for an instance to become available in the group before the build fails. If you set this value to 0 or omit it, the build fails as soon as the group has no instance available."
        }
      },
      "required": [
        "name"
      ]
    },
    "InstanceMetadataOptions": {
      "type": "object",
      "properties": {
        "httpTokens": {
          "type": "string",
          "description": "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. If you don't set a value, the EC2 launch default applies to the build and test instances. That default depends on"
        },
        "httpPutResponseHopLimit": {
          "type": "integer",
          "description": "Limit the number of hops that an instance metadata request can traverse to reach its destination. If you don't set a value, the EC2 launch default for the instance applies. If HTTP tokens are required, container image builds need a minimum of two hops."
        }
      }
    },
    "Logging": {
      "type": "object",
      "properties": {
        "s3Logs": {
          "$ref": "#/$defs/S3Logs"
        }
      }
    },
    "ParentInstanceConfiguration": {
      "type": "object",
      "properties": {
        "autoScalingGroup": {
          "$ref": "#/$defs/AutoScalingGroupConfiguration"
        }
      },
      "required": [
        "autoScalingGroup"
      ]
    },
    "Placement": {
      "type": "object",
      "properties": {
        "availabilityZone": {
          "type": "string",
          "description": "The Availability Zone where your build and test instances will launch."
        },
        "tenancy": {
          "type": "string",
          "enum": [
            "default",
            "dedicated",
            "host"
          ],
          "description": "The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware. An instance with a tenancy of host 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": {
          "type": "string",
          "description": "The ID of the Dedicated Host on which build and test instances run. This only applies if tenancy is host."
        },
        "hostResourceGroupArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances. This only applies if tenancy is host."
        }
      }
    },
    "S3Logs": {
      "type": "object",
      "properties": {
        "s3BucketName": {
          "type": "string",
          "description": "The name of an existing Amazon S3 bucket where Image Builder saves build logs. The bucket isn't validated when you create or update the configuration, and Image Builder doesn't create it. The instance profile associated with this infrastructure configuration must have permission to write to the bucket."
        },
        "s3KeyPrefix": {
          "type": "string",
          "description": "The Amazon S3 key prefix under which Image Builder writes build and test logs in the bucket."
        }
      }
    }
  }
}