java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IEnvironmentAware, IImageRef, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)", date="2025-12-01T16:02:22.296Z") @Stability(Stable) public class CfnImage extends CfnResource implements IInspectable, IImageRef, ITaggable
Creates a new image.

This request will create a new image along with all of the configured output resources defined in the distribution configuration. You must specify exactly one recipe for your image, using either a ContainerRecipeArn or an ImageRecipeArn.

Example:

 // 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.*;
 CfnImage cfnImage = CfnImage.Builder.create(this, "MyCfnImage")
         .containerRecipeArn("containerRecipeArn")
         .deletionSettings(DeletionSettingsProperty.builder()
                 .executionRole("executionRole")
                 .build())
         .distributionConfigurationArn("distributionConfigurationArn")
         .enhancedImageMetadataEnabled(false)
         .executionRole("executionRole")
         .imagePipelineExecutionSettings(ImagePipelineExecutionSettingsProperty.builder()
                 .deploymentId("deploymentId")
                 .onUpdate(false)
                 .build())
         .imageRecipeArn("imageRecipeArn")
         .imageScanningConfiguration(ImageScanningConfigurationProperty.builder()
                 .ecrConfiguration(EcrConfigurationProperty.builder()
                         .containerTags(List.of("containerTags"))
                         .repositoryName("repositoryName")
                         .build())
                 .imageScanningEnabled(false)
                 .build())
         .imageTestsConfiguration(ImageTestsConfigurationProperty.builder()
                 .imageTestsEnabled(false)
                 .timeoutMinutes(123)
                 .build())
         .infrastructureConfigurationArn("infrastructureConfigurationArn")
         .loggingConfiguration(ImageLoggingConfigurationProperty.builder()
                 .logGroupName("logGroupName")
                 .build())
         .tags(Map.of(
                 "tagsKey", "tags"))
         .workflows(List.of(WorkflowConfigurationProperty.builder()
                 .onFailure("onFailure")
                 .parallelGroup("parallelGroup")
                 .parameters(List.of(WorkflowParameterProperty.builder()
                         .name("name")
                         .value(List.of("value"))
                         .build()))
                 .workflowArn("workflowArn")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnImage

      protected CfnImage(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnImage

      protected CfnImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnImage

      @Stability(Stable) public CfnImage(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnImageProps props)
      Create a new AWS::ImageBuilder::Image.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnImage

      @Stability(Stable) public CfnImage(@NotNull software.constructs.Construct scope, @NotNull String id)
      Create a new AWS::ImageBuilder::Image.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • arnForImage

      @Stability(Stable) @NotNull public static String arnForImage(@NotNull IImageRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnImage

      @Stability(Stable) @NotNull public static Boolean isCfnImage(@NotNull Object x)
      Checks whether the given object is a CfnImage.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      Returns the Amazon Resource Name (ARN) of the image.

      For example, arn:aws:imagebuilder:us-west-2:123456789012:image/mybasicrecipe/2019.12.03/1 .

    • getAttrImageId

      @Stability(Stable) @NotNull public String getAttrImageId()
      Returns the AMI ID of the Amazon EC2 AMI in the Region in which you are using Image Builder.

      Values are returned only for AMIs, and not for container images.

    • getAttrImageUri

      @Stability(Stable) @NotNull public String getAttrImageUri()
      Returns the URI for a container image created in the context Region.

      Values are returned only for container images, and not for AMIs.

    • getAttrLatestVersion

      @Stability(Stable) @NotNull public IResolvable getAttrLatestVersion()
      The latest version references of the image.
    • getAttrLatestVersionArn

      @Stability(Stable) @NotNull public String getAttrLatestVersionArn()
      The Amazon Resource Name (ARN) of the image.

      Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to that object as follows:

      • Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off entirely, or they are specified as wildcards, for example: x.x.x.
      • Version ARNs have only the first three nodes: ..
      • Build version ARNs have all four nodes, and point to a specific build for a specific version of an object.

    • getAttrLatestVersionMajor

      @Stability(Stable) @NotNull public String getAttrLatestVersionMajor()
      The latest version ARN of the created image, with the same major version.
    • getAttrLatestVersionMinor

      @Stability(Stable) @NotNull public String getAttrLatestVersionMinor()
      The latest version ARN of the created image, with the same minor version.
    • getAttrLatestVersionPatch

      @Stability(Stable) @NotNull public String getAttrLatestVersionPatch()
      The latest version ARN of the created image, with the same patch version.
    • getAttrName

      @Stability(Stable) @NotNull public String getAttrName()
      Returns the name of the image.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getImageRef

      @Stability(Stable) @NotNull public ImageReference getImageRef()
      A reference to a Image resource.
      Specified by:
      getImageRef in interface IImageRef
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getContainerRecipeArn

      @Stability(Stable) @Nullable public String getContainerRecipeArn()
      The Amazon Resource Name (ARN) of the container recipe that defines how images are configured and tested.
    • setContainerRecipeArn

      @Stability(Stable) public void setContainerRecipeArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the container recipe that defines how images are configured and tested.
    • getDeletionSettings

      @Stability(Stable) @Nullable public Object getDeletionSettings()
      The deletion settings of the image, indicating whether to delete the underlying resources in addition to the image.

      Returns union: either IResolvable or CfnImage.DeletionSettingsProperty

    • setDeletionSettings

      @Stability(Stable) public void setDeletionSettings(@Nullable IResolvable value)
      The deletion settings of the image, indicating whether to delete the underlying resources in addition to the image.
    • setDeletionSettings

      @Stability(Stable) public void setDeletionSettings(@Nullable CfnImage.DeletionSettingsProperty value)
      The deletion settings of the image, indicating whether to delete the underlying resources in addition to the image.
    • getDistributionConfigurationArn

      @Stability(Stable) @Nullable public String getDistributionConfigurationArn()
      The Amazon Resource Name (ARN) of the distribution configuration that defines and configures the outputs of your pipeline.
    • setDistributionConfigurationArn

      @Stability(Stable) public void setDistributionConfigurationArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the distribution configuration that defines and configures the outputs of your pipeline.
    • getEnhancedImageMetadataEnabled

      @Stability(Stable) @Nullable public Object getEnhancedImageMetadataEnabled()
      Collects additional information about the image being created, including the operating system (OS) version and package list.

      Returns union: either Boolean or IResolvable

    • setEnhancedImageMetadataEnabled

      @Stability(Stable) public void setEnhancedImageMetadataEnabled(@Nullable Boolean value)
      Collects additional information about the image being created, including the operating system (OS) version and package list.
    • setEnhancedImageMetadataEnabled

      @Stability(Stable) public void setEnhancedImageMetadataEnabled(@Nullable IResolvable value)
      Collects additional information about the image being created, including the operating system (OS) version and package list.
    • getExecutionRole

      @Stability(Stable) @Nullable public String getExecutionRole()
      The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions.
    • setExecutionRole

      @Stability(Stable) public void setExecutionRole(@Nullable String value)
      The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions.
    • getImagePipelineExecutionSettings

      @Stability(Stable) @Nullable public Object getImagePipelineExecutionSettings()
      The settings for starting an image pipeline execution.

      Returns union: either IResolvable or CfnImage.ImagePipelineExecutionSettingsProperty

    • setImagePipelineExecutionSettings

      @Stability(Stable) public void setImagePipelineExecutionSettings(@Nullable IResolvable value)
      The settings for starting an image pipeline execution.
    • setImagePipelineExecutionSettings

      @Stability(Stable) public void setImagePipelineExecutionSettings(@Nullable CfnImage.ImagePipelineExecutionSettingsProperty value)
      The settings for starting an image pipeline execution.
    • getImageRecipeArn

      @Stability(Stable) @Nullable public String getImageRecipeArn()
      The Amazon Resource Name (ARN) of the image recipe that defines how images are configured, tested, and assessed.
    • setImageRecipeArn

      @Stability(Stable) public void setImageRecipeArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the image recipe that defines how images are configured, tested, and assessed.
    • getImageScanningConfiguration

      @Stability(Stable) @Nullable public Object getImageScanningConfiguration()
      Contains settings for vulnerability scans.

      Returns union: either IResolvable or CfnImage.ImageScanningConfigurationProperty

    • setImageScanningConfiguration

      @Stability(Stable) public void setImageScanningConfiguration(@Nullable IResolvable value)
      Contains settings for vulnerability scans.
    • setImageScanningConfiguration

      @Stability(Stable) public void setImageScanningConfiguration(@Nullable CfnImage.ImageScanningConfigurationProperty value)
      Contains settings for vulnerability scans.
    • getImageTestsConfiguration

      @Stability(Stable) @Nullable public Object getImageTestsConfiguration()
      The image tests configuration of the image.

      Returns union: either IResolvable or CfnImage.ImageTestsConfigurationProperty

    • setImageTestsConfiguration

      @Stability(Stable) public void setImageTestsConfiguration(@Nullable IResolvable value)
      The image tests configuration of the image.
    • setImageTestsConfiguration

      @Stability(Stable) public void setImageTestsConfiguration(@Nullable CfnImage.ImageTestsConfigurationProperty value)
      The image tests configuration of the image.
    • getInfrastructureConfigurationArn

      @Stability(Stable) @Nullable public String getInfrastructureConfigurationArn()
      The Amazon Resource Name (ARN) of the infrastructure configuration that defines the environment in which your image will be built and tested.
    • setInfrastructureConfigurationArn

      @Stability(Stable) public void setInfrastructureConfigurationArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the infrastructure configuration that defines the environment in which your image will be built and tested.
    • getLoggingConfiguration

      @Stability(Stable) @Nullable public Object getLoggingConfiguration()
      The logging configuration that's defined for the image.

      Returns union: either IResolvable or CfnImage.ImageLoggingConfigurationProperty

    • setLoggingConfiguration

      @Stability(Stable) public void setLoggingConfiguration(@Nullable IResolvable value)
      The logging configuration that's defined for the image.
    • setLoggingConfiguration

      @Stability(Stable) public void setLoggingConfiguration(@Nullable CfnImage.ImageLoggingConfigurationProperty value)
      The logging configuration that's defined for the image.
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
      The tags of the image.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
      The tags of the image.
    • getWorkflows

      @Stability(Stable) @Nullable public Object getWorkflows()
      Contains an array of workflow configuration objects.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnImage.WorkflowConfigurationProperty>

    • setWorkflows

      @Stability(Stable) public void setWorkflows(@Nullable IResolvable value)
      Contains an array of workflow configuration objects.
    • setWorkflows

      @Stability(Stable) public void setWorkflows(@Nullable List<Object> value)
      Contains an array of workflow configuration objects.