> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ContainerInstanceImage

Represents a container instance image that is used to launch the instance used for building the container for an EC2 Image Builder container build.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/base-image.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-imagebuilder-alpha/lib/base-image.ts#L142)

## Example

```ts
const containerRecipe = new imagebuilder.ContainerRecipe(this, 'InstanceConfigContainerRecipe', {
  baseImage: imagebuilder.BaseContainerImage.fromDockerHub('amazonlinux', 'latest'),
  targetRepository: imagebuilder.Repository.fromEcr(
    ecr.Repository.fromRepositoryName(this, 'Repository', 'my-container-repo')
  ),
  // Custom ECS-optimized AMI for building
  instanceImage: imagebuilder.ContainerInstanceImage.fromSsmParameterName(
    '/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id'
  ),
  // Additional storage for build process
  instanceBlockDevices: [
    {
      deviceName: '/dev/xvda',
      volume: ec2.BlockDeviceVolume.ebs(50, {
        encrypted: true,
        volumeType: ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
      })
    }
  ]
});
```

## Properties

- `image`: string (required) — The rendered container instance image to use.

## Methods

- `fromAmiId(amiId: string): ContainerInstanceImage // chainable` (static) — The AMI ID to use to launch the instance for building the container image.

  **Parameters**

  - `amiId` — The AMI ID to use as the container instance image.

- `fromSsmParameter(parameter: IStringParameter): ContainerInstanceImage // chainable` (static) — The SSM parameter to use to launch the instance for building the container image.

  **Parameters**

  - `parameter` — The SSM parameter to use as the container instance image.

- `fromSsmParameterName(parameterName: string): ContainerInstanceImage // chainable` (static) — The ARN of the SSM parameter used to launch the instance for building the container image.

  **Parameters**

  - `parameterName` — The name of the SSM parameter used as the container instance image.

- `fromString(containerInstanceImageString: string): ContainerInstanceImage // chainable` (static) — The string value of the container instance image to use in a container recipe.

  This can either be:
  - an SSM parameter reference, prefixed with `ssm:` and followed by the parameter name or ARN
  - an AMI ID

  **Parameters**

  - `containerInstanceImageString` — The container instance image as a direct string value.
