CfnContainerRecipe
- class aws_cdk.aws_imagebuilder.CfnContainerRecipe(scope, id, *, components, container_type, name, parent_image, target_repository, version, description=None, dockerfile_template_data=None, dockerfile_template_uri=None, image_os_version_override=None, instance_configuration=None, kms_key_id=None, platform_override=None, tags=None, working_directory=None)
Bases:
CfnResource
A CloudFormation
AWS::ImageBuilder::ContainerRecipe
.Creates a new container recipe. Container recipes define how images are configured, tested, and assessed.
- CloudformationResource:
AWS::ImageBuilder::ContainerRecipe
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder cfn_container_recipe = imagebuilder.CfnContainerRecipe(self, "MyCfnContainerRecipe", components=[imagebuilder.CfnContainerRecipe.ComponentConfigurationProperty( component_arn="componentArn", parameters=[imagebuilder.CfnContainerRecipe.ComponentParameterProperty( name="name", value=["value"] )] )], 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 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" )
Create a new
AWS::ImageBuilder::ContainerRecipe
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
components (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ComponentConfigurationProperty
,Dict
[str
,Any
]]]]) – 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.container_type (
str
) – Specifies the type of container, such as Docker.name (
str
) – The name of the container recipe.parent_image (
str
) – The base image for the container recipe.target_repository (
Union
[IResolvable
,TargetContainerRepositoryProperty
,Dict
[str
,Any
]]) – The destination repository for the container image.version (
str
) – The semantic version of the container recipe. .. epigraph:: The semantic version has four nodes: ../. 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. Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.description (
Optional
[str
]) – The description of the container recipe.dockerfile_template_data (
Optional
[str
]) – 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.dockerfile_template_uri (
Optional
[str
]) – The S3 URI for the Dockerfile that will be used to build your container image.image_os_version_override (
Optional
[str
]) – Specifies the operating system version for the base image.instance_configuration (
Union
[IResolvable
,InstanceConfigurationProperty
,Dict
[str
,Any
],None
]) – A group of options that can be used to configure an instance for building and testing container images.kms_key_id (
Optional
[str
]) – Identifies which KMS key is used to encrypt the container image for distribution to the target Region.platform_override (
Optional
[str
]) – Specifies the operating system platform when you use a custom base image.tags (
Optional
[Mapping
[str
,str
]]) – Tags that are attached to the container recipe.working_directory (
Optional
[str
]) – The working directory for use during build and test workflows.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_depends_on(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::ImageBuilder::ContainerRecipe'
- attr_arn
Returns the Amazon Resource Name (ARN) of the container recipe.
For example,
arn:aws:imagebuilder:us-east-1:123456789012:container-recipe/mybasicrecipe/2020.12.17
.- CloudformationAttribute:
Arn
- attr_name
Returns the name of the container recipe.
- CloudformationAttribute:
Name
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- components
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.
- container_type
Specifies the type of container, such as Docker.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- description
The description of the container recipe.
- dockerfile_template_data
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.
- dockerfile_template_uri
The S3 URI for the Dockerfile that will be used to build your container image.
- image_os_version_override
Specifies the operating system version for the base image.
- instance_configuration
A group of options that can be used to configure an instance for building and testing container images.
- kms_key_id
Identifies which KMS key is used to encrypt the container image for distribution to the target Region.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- name
The name of the container recipe.
- node
The construct tree node associated with this construct.
- parent_image
The base image for the container recipe.
- platform_override
Specifies the operating system platform when you use a custom base image.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tags that are attached to the container recipe.
- target_repository
The destination repository for the container image.
- version
The semantic version of the container recipe.
The semantic version has four nodes: ../. 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.
Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.
- working_directory
The working directory for use during build and test workflows.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
) –- Return type:
bool
ComponentConfigurationProperty
- class CfnContainerRecipe.ComponentConfigurationProperty(*, component_arn=None, parameters=None)
Bases:
object
Configuration details of the component.
- Parameters:
component_arn (
Optional
[str
]) – The Amazon Resource Name (ARN) of the component.parameters (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ComponentParameterProperty
,Dict
[str
,Any
]]],None
]) –CfnContainerRecipe.ComponentConfigurationProperty.Parameters
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder component_configuration_property = imagebuilder.CfnContainerRecipe.ComponentConfigurationProperty( component_arn="componentArn", parameters=[imagebuilder.CfnContainerRecipe.ComponentParameterProperty( name="name", value=["value"] )] )
Attributes
- component_arn
The Amazon Resource Name (ARN) of the component.
- parameters
CfnContainerRecipe.ComponentConfigurationProperty.Parameters
.
ComponentParameterProperty
- class CfnContainerRecipe.ComponentParameterProperty(*, name, value)
Bases:
object
- Parameters:
name (
str
) –CfnContainerRecipe.ComponentParameterProperty.Name
.value (
Sequence
[str
]) –CfnContainerRecipe.ComponentParameterProperty.Value
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder component_parameter_property = imagebuilder.CfnContainerRecipe.ComponentParameterProperty( name="name", value=["value"] )
Attributes
- name
CfnContainerRecipe.ComponentParameterProperty.Name
.
- value
CfnContainerRecipe.ComponentParameterProperty.Value
.
EbsInstanceBlockDeviceSpecificationProperty
- class CfnContainerRecipe.EbsInstanceBlockDeviceSpecificationProperty(*, delete_on_termination=None, encrypted=None, iops=None, kms_key_id=None, snapshot_id=None, throughput=None, volume_size=None, volume_type=None)
Bases:
object
Amazon EBS-specific block device mapping specifications.
- Parameters:
delete_on_termination (
Union
[bool
,IResolvable
,None
]) – Use to configure delete on termination of the associated device.encrypted (
Union
[bool
,IResolvable
,None
]) – Use to configure device encryption.iops (
Union
[int
,float
,None
]) – Use to configure device IOPS.kms_key_id (
Optional
[str
]) – Use to configure the KMS key to use when encrypting the device.snapshot_id (
Optional
[str
]) – The snapshot that defines the device contents.throughput (
Union
[int
,float
,None
]) – For GP3 volumes only – The throughput in MiB/s that the volume supports.volume_size (
Union
[int
,float
,None
]) – Use to override the device’s volume size.volume_type (
Optional
[str
]) – Use to override the device’s volume type.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder ebs_instance_block_device_specification_property = 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" )
Attributes
- delete_on_termination
Use to configure delete on termination of the associated device.
- encrypted
Use to configure device encryption.
- iops
Use to configure device IOPS.
- kms_key_id
Use to configure the KMS key to use when encrypting the device.
- snapshot_id
The snapshot that defines the device contents.
- throughput
For GP3 volumes only – The throughput in MiB/s that the volume supports.
- volume_size
Use to override the device’s volume size.
- volume_type
Use to override the device’s volume type.
InstanceBlockDeviceMappingProperty
- class CfnContainerRecipe.InstanceBlockDeviceMappingProperty(*, device_name=None, ebs=None, no_device=None, virtual_name=None)
Bases:
object
Defines block device mappings for the instance used to configure your image.
- Parameters:
device_name (
Optional
[str
]) – The device to which these mappings apply.ebs (
Union
[IResolvable
,EbsInstanceBlockDeviceSpecificationProperty
,Dict
[str
,Any
],None
]) – Use to manage Amazon EBS-specific configuration for this mapping.no_device (
Optional
[str
]) – Use to remove a mapping from the base image.virtual_name (
Optional
[str
]) – Use to manage instance ephemeral devices.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder instance_block_device_mapping_property = 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" )
Attributes
- device_name
The device to which these mappings apply.
- ebs
Use to manage Amazon EBS-specific configuration for this mapping.
- no_device
Use to remove a mapping from the base image.
- virtual_name
Use to manage instance ephemeral devices.
InstanceConfigurationProperty
- class CfnContainerRecipe.InstanceConfigurationProperty(*, block_device_mappings=None, image=None)
Bases:
object
Defines a custom base AMI and block device mapping configurations of an instance used for building and testing container images.
- Parameters:
block_device_mappings (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,InstanceBlockDeviceMappingProperty
,Dict
[str
,Any
]]],None
]) – Defines the block devices to attach for building an instance from this Image Builder AMI.image (
Optional
[str
]) – The AMI ID to use as the base image for a container build and test instance. If not specified, Image Builder will use the appropriate ECS-optimized AMI as a base image.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder instance_configuration_property = 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" )
Attributes
- block_device_mappings
Defines the block devices to attach for building an instance from this Image Builder AMI.
- image
The AMI ID to use as the base image for a container build and test instance.
If not specified, Image Builder will use the appropriate ECS-optimized AMI as a base image.
TargetContainerRepositoryProperty
- class CfnContainerRecipe.TargetContainerRepositoryProperty(*, repository_name=None, service=None)
Bases:
object
The container repository where the output container image is stored.
- Parameters:
repository_name (
Optional
[str
]) – The name of the container repository where the output container image is stored. This name is prefixed by the repository location.service (
Optional
[str
]) – Specifies the service in which this image was registered.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_imagebuilder as imagebuilder target_container_repository_property = imagebuilder.CfnContainerRecipe.TargetContainerRepositoryProperty( repository_name="repositoryName", service="service" )
Attributes
- repository_name
The name of the container repository where the output container image is stored.
This name is prefixed by the repository location.
- service
Specifies the service in which this image was registered.