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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.deletionExecutionRole(IRole deletionExecutionRole) Sets the value ofImageProps.getDeletionExecutionRole()distributionConfiguration(IDistributionConfiguration distributionConfiguration) Sets the value ofImageProps.getDistributionConfiguration()enhancedImageMetadataEnabled(Boolean enhancedImageMetadataEnabled) Sets the value ofImageProps.getEnhancedImageMetadataEnabled()executionRole(IRole executionRole) Sets the value ofImageProps.getExecutionRole()imageScanningEcrRepository(IRepository imageScanningEcrRepository) Sets the value ofImageProps.getImageScanningEcrRepository()imageScanningEcrTags(List<String> imageScanningEcrTags) Sets the value ofImageProps.getImageScanningEcrTags()imageScanningEnabled(Boolean imageScanningEnabled) Sets the value ofImageProps.getImageScanningEnabled()imageTestsEnabled(Boolean imageTestsEnabled) Sets the value ofImageProps.getImageTestsEnabled()infrastructureConfiguration(IInfrastructureConfiguration infrastructureConfiguration) Sets the value ofImageProps.getInfrastructureConfiguration()Sets the value ofImageProps.getLogGroup()recipe(IRecipeBase recipe) Sets the value ofImageProps.getRecipe()Sets the value ofImageProps.getTags()workflows(List<? extends WorkflowConfiguration> workflows) Sets the value ofImageProps.getWorkflows()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
recipe
Sets the value ofImageProps.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) Sets the value ofImageProps.getDeletionExecutionRole()- 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) Sets the value ofImageProps.getDistributionConfiguration()- Parameters:
distributionConfiguration- The distribution configuration used for distributing the image.- Returns:
this
-
enhancedImageMetadataEnabled
@Stability(Experimental) public ImageProps.Builder enhancedImageMetadataEnabled(Boolean enhancedImageMetadataEnabled) Sets the value ofImageProps.getEnhancedImageMetadataEnabled()- 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
Sets the value ofImageProps.getExecutionRole()- 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) Sets the value ofImageProps.getImageScanningEcrRepository()- 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 namedimage-builder-image-scanning-repositoryfor vulnerability scanning.- Returns:
this
-
imageScanningEcrTags
@Stability(Experimental) public ImageProps.Builder imageScanningEcrTags(List<String> imageScanningEcrTags) Sets the value ofImageProps.getImageScanningEcrTags()- 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) Sets the value ofImageProps.getImageScanningEnabled()- 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
Sets the value ofImageProps.getImageTestsEnabled()- Parameters:
imageTestsEnabled- Whether to run tests after building an image.- Returns:
this
-
infrastructureConfiguration
@Stability(Experimental) public ImageProps.Builder infrastructureConfiguration(IInfrastructureConfiguration infrastructureConfiguration) Sets the value ofImageProps.getInfrastructureConfiguration()- 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
Sets the value ofImageProps.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
Sets the value ofImageProps.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 ofImageProps.getWorkflows()- Parameters:
workflows- The list of workflow configurations used to build the image.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ImageProps>- Returns:
- a new instance of
ImageProps - Throws:
NullPointerException- if any required attribute was not provided
-