Skip to content

Resource: awsImagebuilderDistributionConfiguration

Manages an Image Builder Distribution Configuration.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.imagebuilderDistributionConfiguration.ImagebuilderDistributionConfiguration(
  this,
  "example",
  {
    distribution: [
      {
        amiDistributionConfiguration: {
          amiTags: [
            {
              costCenter: "IT",
            },
          ],
          launchPermission: {
            userIds: ["123456789012"],
          },
          name: "example-{{ imagebuilder:buildDate }}",
        },
        launchTemplateConfiguration: [
          {
            launchTemplateId: "lt-0aaa1bcde2ff3456",
          },
        ],
        region: "us-east-1",
      },
    ],
    name: "example",
  }
);

Argument Reference

The following arguments are required:

  • name - (Required) Name of the distribution configuration.
  • distribution - (Required) One or more configuration blocks with distribution settings. Detailed below.

The following arguments are optional:

  • description - (Optional) Description of the distribution configuration.
  • tags - (Optional) Key-value map of resource tags for the distribution configuration. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

distribution

The following arguments are required:

  • region - (Required) AWS Region for the distribution.

The following arguments are optional:

  • amiDistributionConfiguration - (Optional) Configuration block with Amazon Machine Image (AMI) distribution settings. Detailed below.
  • containerDistributionConfiguration - (Optional) Configuration block with container distribution settings. Detailed below.
  • fastLaunchConfiguration - (Optional) Set of Windows faster-launching configurations to use for AMI distribution. Detailed below.
  • launchTemplateConfiguration - (Optional) Set of launch template configuration settings that apply to image distribution. Detailed below.
  • licenseConfigurationArns - (Optional) Set of Amazon Resource Names (ARNs) of License Manager License Configurations.

amiDistributionConfiguration

The following arguments are optional:

  • amiTags - (Optional) Key-value map of tags to apply to the distributed AMI.
  • description - (Optional) Description to apply to the distributed AMI.
  • kmsKeyId - (Optional) Amazon Resource Name (ARN) of the Key Management Service (KMS) Key to encrypt the distributed AMI.
  • launchPermission - (Optional) Configuration block of EC2 launch permissions to apply to the distributed AMI. Detailed below.
  • name - (Optional) Name to apply to the distributed AMI.
  • targetAccountIds - (Optional) Set of AWS Account identifiers to distribute the AMI.

launchPermission

The following arguments are optional:

  • organizationArns - (Optional) Set of AWS Organization ARNs to assign.
  • organizationalUnitArns - (Optional) Set of AWS Organizational Unit ARNs to assign.
  • userGroups - (Optional) Set of EC2 launch permission user groups to assign. Use all to distribute a public AMI.
  • userIds - (Optional) Set of AWS Account identifiers to assign.

containerDistributionConfiguration

  • containerTags - (Optional) Set of tags that are attached to the container distribution configuration.
  • description - (Optional) Description of the container distribution configuration.
  • targetRepository (Required) Configuration block with the destination repository for the container distribution configuration.

targetRepository

  • repositoryName - (Required) The name of the container repository where the output container image is stored. This name is prefixed by the repository location.
  • service - (Required) The service in which this image is registered. Valid values: ecr.

fastLaunchConfiguration

  • accountId - (Required) The owner account ID for the fast-launch enabled Windows AMI.
  • enabled - (Required) A Boolean that represents the current state of faster launching for the Windows AMI. Set to true to start using Windows faster launching, or false to stop using it.
  • launchTemplate - (Optional) Configuration block for the launch template that the fast-launch enabled Windows AMI uses when it launches Windows instances to create pre-provisioned snapshots. Detailed below.
  • maxParallelLaunches - (Optional) The maximum number of parallel instances that are launched for creating resources.
  • snapshotConfiguration - (Optional) Configuration block for managing the number of snapshots that are created from pre-provisioned instances for the Windows AMI when faster launching is enabled. Detailed below.

launchTemplate

  • launchTemplateId - (Optional) The ID of the launch template to use for faster launching for a Windows AMI.
  • launchTemplateName - (Optional) The name of the launch template to use for faster launching for a Windows AMI.
  • launchTemplateVersion - (Optional) The version of the launch template to use for faster launching for a Windows AMI.

snapshotConfiguration

  • targetResourceCount - (Optional) The number of pre-provisioned snapshots to keep on hand for a fast-launch enabled Windows AMI.

launchTemplateConfiguration

  • default - (Optional) Indicates whether to set the specified Amazon EC2 launch template as the default launch template. Defaults to true.
  • accountId - The account ID that this configuration applies to.
  • launchTemplateId - (Required) The ID of the Amazon EC2 launch template to use.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - (Required) Amazon Resource Name (ARN) of the distribution configuration.
  • dateCreated - Date the distribution configuration was created.
  • dateUpdated - Date the distribution configuration was updated.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

awsImagebuilderDistributionConfigurations resources can be imported by using the Amazon Resource Name (ARN), e.g.,

$ terraform import aws_imagebuilder_distribution_configuration.example arn:aws:imagebuilder:us-east-1:123456789012:distribution-configuration/example