Class ImageProps.Builder

java.lang.Object
software.amazon.awscdk.services.imagebuilder.alpha.ImageProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ImageProps>
Enclosing interface:
ImageProps

@Stability(Experimental) public static final class ImageProps.Builder extends Object implements software.amazon.jsii.Builder<ImageProps>
A builder for ImageProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • recipe

      @Stability(Experimental) public ImageProps.Builder recipe(IRecipeBase recipe)
      Sets the value of ImageProps.getRecipe()
      Parameters:
      recipe - The recipe that defines the base image, components, and customizations used to build the image. This parameter is required. This can either be an image recipe, or a container recipe.
      Returns:
      this
    • deletionExecutionRole

      @Stability(Experimental) public ImageProps.Builder deletionExecutionRole(IRole deletionExecutionRole)
      Parameters:
      deletionExecutionRole - The execution role to use for deleting the image as well as the underlying resources, such as the AMIs, snapshots, and containers. This role should contain resource lifecycle permissions required to delete the underlying AMIs/containers.
      Returns:
      this
    • distributionConfiguration

      @Stability(Experimental) public ImageProps.Builder distributionConfiguration(IDistributionConfiguration distributionConfiguration)
      Parameters:
      distributionConfiguration - The distribution configuration used for distributing the image.
      Returns:
      this
    • enhancedImageMetadataEnabled

      @Stability(Experimental) public ImageProps.Builder enhancedImageMetadataEnabled(Boolean enhancedImageMetadataEnabled)
      Parameters:
      enhancedImageMetadataEnabled - If enabled, collects additional information about the image being created, including the operating system (OS) version and package list for the AMI.
      Returns:
      this
    • executionRole

      @Stability(Experimental) public ImageProps.Builder executionRole(IRole executionRole)
      Parameters:
      executionRole - The execution role used to perform workflow actions to build the image. By default, the Image Builder Service Linked Role (SLR) will be created automatically and used as the execution role. However, when providing a custom set of image workflows for the image, an execution role will be generated with the minimal permissions needed to execute the workflows.
      Returns:
      this
    • imageScanningEcrRepository

      @Stability(Experimental) public ImageProps.Builder imageScanningEcrRepository(IRepository imageScanningEcrRepository)
      Parameters:
      imageScanningEcrRepository - The container repository that Amazon Inspector scans to identify findings for your container images. If a repository is not provided, Image Builder creates a repository named image-builder-image-scanning-repository for vulnerability scanning.
      Returns:
      this
    • imageScanningEcrTags

      @Stability(Experimental) public ImageProps.Builder imageScanningEcrTags(List<String> imageScanningEcrTags)
      Parameters:
      imageScanningEcrTags - The tags for Image Builder to apply to the output container image that Amazon Inspector scans.
      Returns:
      this
    • imageScanningEnabled

      @Stability(Experimental) public ImageProps.Builder imageScanningEnabled(Boolean imageScanningEnabled)
      Parameters:
      imageScanningEnabled - Indicates whether Image Builder keeps a snapshot of the vulnerability scans that Amazon Inspector runs against the build instance when you create a new image.
      Returns:
      this
    • imageTestsEnabled

      @Stability(Experimental) public ImageProps.Builder imageTestsEnabled(Boolean imageTestsEnabled)
      Parameters:
      imageTestsEnabled - Whether to run tests after building an image.
      Returns:
      this
    • infrastructureConfiguration

      @Stability(Experimental) public ImageProps.Builder infrastructureConfiguration(IInfrastructureConfiguration infrastructureConfiguration)
      Parameters:
      infrastructureConfiguration - The infrastructure configuration used for building the image. A default infrastructure configuration will be used if one is not provided.

      The default configuration will create an instance profile and role with minimal permissions needed to build the image, attached to the EC2 instance.

      IMDSv2 will be required by default on the instances used to build and test the image.

      Returns:
      this
    • logGroup

      @Stability(Experimental) public ImageProps.Builder logGroup(ILogGroup logGroup)
      Sets the value of ImageProps.getLogGroup()
      Parameters:
      logGroup - The log group to use for the image. By default, a log group will be created with the format /aws/imagebuilder/<image-name>
      Returns:
      this
    • tags

      @Stability(Experimental) public ImageProps.Builder tags(Map<String,String> tags)
      Sets the value of ImageProps.getTags()
      Parameters:
      tags - The tags to apply to the image.
      Returns:
      this
    • workflows

      @Stability(Experimental) public ImageProps.Builder workflows(List<? extends WorkflowConfiguration> workflows)
      Sets the value of ImageProps.getWorkflows()
      Parameters:
      workflows - The list of workflow configurations used to build the image.
      Returns:
      this
    • build

      @Stability(Experimental) public ImageProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<ImageProps>
      Returns:
      a new instance of ImageProps
      Throws:
      NullPointerException - if any required attribute was not provided