Skip to content
v2.278.0

CfnContainerRecipeProps Struct ​

Properties for defining a CfnContainerRecipe.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
const cfnContainerRecipeProps: imagebuilder.CfnContainerRecipeProps = {
  containerType: 'containerType',
  name: 'name',
  parentImage: 'parentImage',
  targetRepository: {
    repositoryName: 'repositoryName',
    service: 'service',
  },
  version: 'version',

  // the properties below are optional
  components: [{
    componentArn: 'componentArn',
    parameters: [{
      name: 'name',
      value: ['value'],
    }],
  }],
  description: 'description',
  dockerfileTemplateData: 'dockerfileTemplateData',
  dockerfileTemplateUri: 'dockerfileTemplateUri',
  imageOsVersionOverride: 'imageOsVersionOverride',
  instanceConfiguration: {
    blockDeviceMappings: [{
      deviceName: 'deviceName',
      ebs: {
        deleteOnTermination: false,
        encrypted: false,
        iops: 123,
        kmsKeyId: 'kmsKeyId',
        snapshotId: 'snapshotId',
        throughput: 123,
        volumeSize: 123,
        volumeType: 'volumeType',
      },
      noDevice: 'noDevice',
      virtualName: 'virtualName',
    }],
    image: 'image',
  },
  kmsKeyId: 'kmsKeyId',
  platformOverride: 'platformOverride',
  tags: {
    tagsKey: 'tags',
  },
  workingDirectory: 'workingDirectory',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_imagebuilder as imagebuilder

cfn_container_recipe_props = imagebuilder.CfnContainerRecipeProps(
    container_type="containerType",
    name="name",
    parent_image="parentImage",
    target_repository=imagebuilder.CfnContainerRecipe.TargetContainerRepositoryProperty(
        repository_name="repositoryName",
        service="service"
    ),
    version="version",

    # the properties below are optional
    components=[imagebuilder.CfnContainerRecipe.ComponentConfigurationProperty(
        component_arn="componentArn",
        parameters=[imagebuilder.CfnContainerRecipe.ComponentParameterProperty(
            name="name",
            value=["value"]
        )]
    )],
    description="description",
    dockerfile_template_data="dockerfileTemplateData",
    dockerfile_template_uri="dockerfileTemplateUri",
    image_os_version_override="imageOsVersionOverride",
    instance_configuration=imagebuilder.CfnContainerRecipe.InstanceConfigurationProperty(
        block_device_mappings=[imagebuilder.CfnContainerRecipe.InstanceBlockDeviceMappingProperty(
            device_name="deviceName",
            ebs=imagebuilder.CfnContainerRecipe.EbsInstanceBlockDeviceSpecificationProperty(
                delete_on_termination=False,
                encrypted=False,
                iops=123,
                kms_key_id="kmsKeyId",
                snapshot_id="snapshotId",
                throughput=123,
                volume_size=123,
                volume_type="volumeType"
            ),
            no_device="noDevice",
            virtual_name="virtualName"
        )],
        image="image"
    ),
    kms_key_id="kmsKeyId",
    platform_override="platformOverride",
    tags={
        "tags_key": "tags"
    },
    working_directory="workingDirectory"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.imagebuilder.*;

CfnContainerRecipeProps cfnContainerRecipeProps = CfnContainerRecipeProps.builder()
        .containerType("containerType")
        .name("name")
        .parentImage("parentImage")
        .targetRepository(TargetContainerRepositoryProperty.builder()
                .repositoryName("repositoryName")
                .service("service")
                .build())
        .version("version")

        // the properties below are optional
        .components(List.of(ComponentConfigurationProperty.builder()
                .componentArn("componentArn")
                .parameters(List.of(ComponentParameterProperty.builder()
                        .name("name")
                        .value(List.of("value"))
                        .build()))
                .build()))
        .description("description")
        .dockerfileTemplateData("dockerfileTemplateData")
        .dockerfileTemplateUri("dockerfileTemplateUri")
        .imageOsVersionOverride("imageOsVersionOverride")
        .instanceConfiguration(InstanceConfigurationProperty.builder()
                .blockDeviceMappings(List.of(InstanceBlockDeviceMappingProperty.builder()
                        .deviceName("deviceName")
                        .ebs(EbsInstanceBlockDeviceSpecificationProperty.builder()
                                .deleteOnTermination(false)
                                .encrypted(false)
                                .iops(123)
                                .kmsKeyId("kmsKeyId")
                                .snapshotId("snapshotId")
                                .throughput(123)
                                .volumeSize(123)
                                .volumeType("volumeType")
                                .build())
                        .noDevice("noDevice")
                        .virtualName("virtualName")
                        .build()))
                .image("image")
                .build())
        .kmsKeyId("kmsKeyId")
        .platformOverride("platformOverride")
        .tags(Map.of(
                "tagsKey", "tags"))
        .workingDirectory("workingDirectory")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ImageBuilder;

var cfnContainerRecipeProps = new CfnContainerRecipeProps {
    ContainerType = "containerType",
    Name = "name",
    ParentImage = "parentImage",
    TargetRepository = new TargetContainerRepositoryProperty {
        RepositoryName = "repositoryName",
        Service = "service"
    },
    Version = "version",

    // the properties below are optional
    Components = new [] { new ComponentConfigurationProperty {
        ComponentArn = "componentArn",
        Parameters = new [] { new ComponentParameterProperty {
            Name = "name",
            Value = new [] { "value" }
        } }
    } },
    Description = "description",
    DockerfileTemplateData = "dockerfileTemplateData",
    DockerfileTemplateUri = "dockerfileTemplateUri",
    ImageOsVersionOverride = "imageOsVersionOverride",
    InstanceConfiguration = new InstanceConfigurationProperty {
        BlockDeviceMappings = new [] { new InstanceBlockDeviceMappingProperty {
            DeviceName = "deviceName",
            Ebs = new EbsInstanceBlockDeviceSpecificationProperty {
                DeleteOnTermination = false,
                Encrypted = false,
                Iops = 123,
                KmsKeyId = "kmsKeyId",
                SnapshotId = "snapshotId",
                Throughput = 123,
                VolumeSize = 123,
                VolumeType = "volumeType"
            },
            NoDevice = "noDevice",
            VirtualName = "virtualName"
        } },
        Image = "image"
    },
    KmsKeyId = "kmsKeyId",
    PlatformOverride = "platformOverride",
    Tags = new Dictionary<string, string> {
        { "tagsKey", "tags" }
    },
    WorkingDirectory = "workingDirectory"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnContainerRecipeProps := &CfnContainerRecipeProps{
	ContainerType: jsii.String("containerType"),
	Name: jsii.String("name"),
	ParentImage: jsii.String("parentImage"),
	TargetRepository: &TargetContainerRepositoryProperty{
		RepositoryName: jsii.String("repositoryName"),
		Service: jsii.String("service"),
	},
	Version: jsii.String("version"),

	// the properties below are optional
	Components: []interface{}{
		&ComponentConfigurationProperty{
			ComponentArn: jsii.String("componentArn"),
			Parameters: []interface{}{
				&ComponentParameterProperty{
					Name: jsii.String("name"),
					Value: []*string{
						jsii.String("value"),
					},
				},
			},
		},
	},
	Description: jsii.String("description"),
	DockerfileTemplateData: jsii.String("dockerfileTemplateData"),
	DockerfileTemplateUri: jsii.String("dockerfileTemplateUri"),
	ImageOsVersionOverride: jsii.String("imageOsVersionOverride"),
	InstanceConfiguration: &InstanceConfigurationProperty{
		BlockDeviceMappings: []interface{}{
			&InstanceBlockDeviceMappingProperty{
				DeviceName: jsii.String("deviceName"),
				Ebs: &EbsInstanceBlockDeviceSpecificationProperty{
					DeleteOnTermination: jsii.Boolean(false),
					Encrypted: jsii.Boolean(false),
					Iops: jsii.Number(123),
					KmsKeyId: jsii.String("kmsKeyId"),
					SnapshotId: jsii.String("snapshotId"),
					Throughput: jsii.Number(123),
					VolumeSize: jsii.Number(123),
					VolumeType: jsii.String("volumeType"),
				},
				NoDevice: jsii.String("noDevice"),
				VirtualName: jsii.String("virtualName"),
			},
		},
		Image: jsii.String("image"),
	},
	KmsKeyId: jsii.String("kmsKeyId"),
	PlatformOverride: jsii.String("platformOverride"),
	Tags: map[string]*string{
		"tagsKey": jsii.String("tags"),
	},
	WorkingDirectory: jsii.String("workingDirectory"),
}

Properties ​

componentsoptionalIResolvable | IResolvable | CfnContainerRecipe.ComponentConfigurationProperty[]componentsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ComponentConfigurationProperty]]]componentsoptionalIResolvableComponentsoptionalIResolvableComponentsoptionalinterface{} #
Build and test components that are included in the container recipe.

Recipes require a minimum of one build component, and can have a maximum of 20 build and test components in any combination.

containerTypestringcontainer_typestrcontainerTypeStringContainerTypestringContainerType*string required #
Specifies the type of container, such as Docker.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
The description of the container recipe.
dockerfileTemplateDataoptionalstringdockerfile_template_dataoptionalstrdockerfileTemplateDataoptionalStringDockerfileTemplateDataoptionalstringDockerfileTemplateDataoptional*string #
Dockerfiles are text documents that are used to build Docker containers, and ensure that they contain all of the elements required by the application running inside.

The template data consists of contextual variables where Image Builder places build information or scripts, based on your container image recipe.

dockerfileTemplateUrioptionalstringdockerfile_template_urioptionalstrdockerfileTemplateUrioptionalStringDockerfileTemplateUrioptionalstringDockerfileTemplateUrioptional*string #
The S3 URI for the Dockerfile that will be used to build your container image.
imageOsVersionOverrideoptionalstringimage_os_version_overrideoptionalstrimageOsVersionOverrideoptionalStringImageOsVersionOverrideoptionalstringImageOsVersionOverrideoptional*string #
Specifies the operating system version for the base image.
instanceConfigurationoptionalIResolvable | CfnContainerRecipe.InstanceConfigurationPropertyinstance_configurationoptionaltyping.Union[IResolvable, InstanceConfigurationProperty]instanceConfigurationoptionalIResolvableInstanceConfigurationoptionalIResolvableInstanceConfigurationoptionalinterface{} #
A group of options that can be used to configure an instance for building and testing container images.
kmsKeyIdoptionalstringkms_key_idoptionalstrkmsKeyIdoptionalStringKmsKeyIdoptionalstringKmsKeyIdoptional*string #
The Amazon Resource Name (ARN) that uniquely identifies which KMS key is used to encrypt the container image for distribution to the target Region.

This can be either the Key ARN or the Alias ARN. For more information, see Key identifiers (KeyId) in the AWS Key Management Service Developer Guide .

namestringnamestrnameStringNamestringName*string required #
The name of the container recipe.
parentImagestringparent_imagestrparentImageStringParentImagestringParentImage*string required #
The base image for customizations specified in the container recipe.

This can contain an Image Builder image resource ARN or a container image URI, for example amazonlinux:latest .

platformOverrideoptionalstringplatform_overrideoptionalstrplatformOverrideoptionalStringPlatformOverrideoptionalstringPlatformOverrideoptional*string #
Specifies the operating system platform when you use a custom base image.
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #
Tags that are attached to the container recipe.
targetRepositoryIResolvable | CfnContainerRecipe.TargetContainerRepositoryPropertytarget_repositorytyping.Union[IResolvable, TargetContainerRepositoryProperty]targetRepositoryIResolvableTargetRepositoryIResolvableTargetRepositoryinterface{} required #
The destination repository for the container image.
versionstringversionstrversionStringVersionstringVersion*string required #
The semantic version of the container recipe. This version follows the semantic version syntax.
notes

The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign values for the first three, and can filter on all of them.

Assignment: For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.

Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.

workingDirectoryoptionalstringworking_directoryoptionalstrworkingDirectoryoptionalStringWorkingDirectoryoptionalstringWorkingDirectoryoptional*string #
The working directory for use during build and test workflows.