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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:03.037Z") @Stability(Stable) public class CfnImage extends CfnResource implements IInspectable, 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")
         .infrastructureConfigurationArn("infrastructureConfigurationArn")
         // the properties below are optional
         .containerRecipeArn("containerRecipeArn")
         .distributionConfigurationArn("distributionConfigurationArn")
         .enhancedImageMetadataEnabled(false)
         .executionRole("executionRole")
         .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())
         .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, @NotNull CfnImageProps props)
      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. This parameter is required.
  • Method Details

    • 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.

    • 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
    • getTags

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

      @Stability(Stable) @NotNull 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(@NotNull String value)
      The Amazon Resource Name (ARN) of the infrastructure configuration that defines the environment in which your image will be built and tested.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.