Skip to content
v2.273.0

ImagePipeline L2 construct ​

Represents an EC2 Image Builder Image Pipeline.

Example ​

ts
const workflowPipeline = new imagebuilder.ImagePipeline(this, 'WorkflowPipeline', {
  recipe: exampleImageRecipe,
  workflows: [
    { workflow: imagebuilder.AmazonManagedWorkflow.buildImage(this, 'BuildWorkflow') },
    { workflow: imagebuilder.AmazonManagedWorkflow.testImage(this, 'TestWorkflow') }
  ]
});
python
workflow_pipeline = imagebuilder.ImagePipeline(self, "WorkflowPipeline",
    recipe=example_image_recipe,
    workflows=[imagebuilder.WorkflowConfiguration(workflow=imagebuilder.AmazonManagedWorkflow.build_image(self, "BuildWorkflow")), imagebuilder.WorkflowConfiguration(workflow=imagebuilder.AmazonManagedWorkflow.test_image(self, "TestWorkflow"))
    ]
)
java
ImagePipeline workflowPipeline = ImagePipeline.Builder.create(this, "WorkflowPipeline")
        .recipe(exampleImageRecipe)
        .workflows(List.of(WorkflowConfiguration.builder().workflow(AmazonManagedWorkflow.buildImage(this, "BuildWorkflow")).build(), WorkflowConfiguration.builder().workflow(AmazonManagedWorkflow.testImage(this, "TestWorkflow")).build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ImageBuilder.Alpha
var workflowPipeline = new ImagePipeline(this, "WorkflowPipeline", new ImagePipelineProps {
    Recipe = exampleImageRecipe,
    Workflows = new [] { new WorkflowConfiguration { Workflow = AmazonManagedWorkflow.BuildImage(this, "BuildWorkflow") }, new WorkflowConfiguration { Workflow = AmazonManagedWorkflow.TestImage(this, "TestWorkflow") } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2
workflowPipeline := imagebuilder.NewImagePipeline(this, jsii.String("WorkflowPipeline"), &ImagePipelineProps{
	Recipe: exampleImageRecipe,
	Workflows: []WorkflowConfiguration{
		&WorkflowConfiguration{
			Workflow: imagebuilder.AmazonManagedWorkflow_BuildImage(this, jsii.String("BuildWorkflow")),
		},
		&WorkflowConfiguration{
			Workflow: imagebuilder.AmazonManagedWorkflow_TestImage(this, jsii.String("TestWorkflow")),
		},
	},
})

Initializer ​

ts
new ImagePipeline(scope: Construct, id: string, props: ImagePipelineProps)
python
ImagePipeline(scope: Construct, id: str, props: ImagePipelineProps)
java
new ImagePipeline(Construct scope, String id, ImagePipelineProps props)
csharp
new ImagePipeline(Construct scope, string id, ImagePipelineProps props)
go
NewImagePipeline(Scope Construct, Id *string, Props ImagePipelineProps)

Construct Props ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= None#
The description of the image pipeline.
distributionConfigurationIDistributionConfigurationdistribution_configurationIDistributionConfigurationdistributionConfigurationIDistributionConfigurationDistributionConfigurationIDistributionConfigurationDistributionConfigurationIDistributionConfiguration= None#
The distribution configuration used for distributing the image.
enhancedImageMetadataEnabledbooleanenhanced_image_metadata_enabledboolenhancedImageMetadataEnabledBooleanEnhancedImageMetadataEnabledboolEnhancedImageMetadataEnabled*bool= true#
If enabled, collects additional information about the image being created, including the operating system (OS) version and package list for the AMI.
executionRoleIRoleexecution_roleIRoleexecutionRoleIRoleExecutionRoleIRoleExecutionRoleIRole= Image Builder will use the SLR i…#
The execution role used to perform workflow actions to build this image.
notes · default

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 pipeline, an execution role will be generated with the minimal permissions needed to execute the workflows.

Default: Image Builder will use the SLR if possible. Otherwise, an execution role will be generated

imageLogGroupILogGroupimage_log_groupILogGroupimageLogGroupILogGroupImageLogGroupILogGroupImageLogGroupILogGroup= a log group will be created#
The log group to use for images created from the image pipeline.

By default, a log group will be created with the format /aws/imagebuilder/<image-name>.

imagePipelineLogGroupILogGroupimage_pipeline_log_groupILogGroupimagePipelineLogGroupILogGroupImagePipelineLogGroupILogGroupImagePipelineLogGroupILogGroup= a log group will be created#
The log group to use for the image pipeline.

By default, a log group will be created with the format /aws/imagebuilder/pipeline/<pipeline-name>

imagePipelineNamestringimage_pipeline_namestrimagePipelineNameStringImagePipelineNamestringImagePipelineName*string= a name is generated#
The name of the image pipeline.
imageScanningEcrRepositoryIRepositoryimage_scanning_ecr_repositoryIRepositoryimageScanningEcrRepositoryIRepositoryImageScanningEcrRepositoryIRepositoryImageScanningEcrRepositoryIRepository= if scanning is enabled, a reposi…#
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.

default

Default: if scanning is enabled, a repository will be created by Image Builder if one is not provided

imageScanningEcrTagsstring[]image_scanning_ecr_tagstyping.List[str]imageScanningEcrTagsList<String>ImageScanningEcrTagsstring[]ImageScanningEcrTags*[]*string= None#
The tags for Image Builder to apply to the output container image that Amazon Inspector scans.
imageScanningEnabledbooleanimage_scanning_enabledboolimageScanningEnabledBooleanImageScanningEnabledboolImageScanningEnabled*bool= false#
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.
imageTestsEnabledbooleanimage_tests_enabledboolimageTestsEnabledBooleanImageTestsEnabledboolImageTestsEnabled*bool= true#
Whether to run tests after building an image.
infrastructureConfigurationIInfrastructureConfigurationinfrastructure_configurationIInfrastructureConfigurationinfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfiguration= an infrastructure configuration …#
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.

default

Default: an infrastructure configuration will be created with the default settings

recipeIRecipeBaserecipeIRecipeBaserecipeIRecipeBaseRecipeIRecipeBaseRecipeIRecipeBaserequired#
The recipe that defines the base image, components, and customizations used to build the image.

This can either be an image recipe, or a container recipe.

scheduleImagePipelineSchedulescheduleImagePipelineSchedulescheduleImagePipelineScheduleScheduleImagePipelineScheduleScheduleImagePipelineSchedule= none, a manual image pipeline wi…#
The schedule of the image pipeline.

This configures how often and when a pipeline automatically creates a new image.

default

Default: none, a manual image pipeline will be created

Indicates whether the pipeline is enabled to be triggered by the provided schedule.
tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string= None#
The tags to apply to the image pipeline.
workflowsWorkflowConfiguration[]workflowstyping.List[WorkflowConfiguration]workflowsList<WorkflowConfiguration>WorkflowsWorkflowConfiguration[]Workflows*[]WorkflowConfiguration= Image Builder will use a default…#
The list of workflow configurations used to build the image.
default

Default: Image Builder will use a default set of workflows for the build to build, test, and distribute the image

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

executionRoleIRoleexecution_roleIRoleexecutionRoleIRoleExecutionRoleIRoleExecutionRoleIRole#
The execution role used for the image build.

If there is no execution role, then the build will be executed with the AWSServiceRoleForImageBuilder service-linked role.

imagePipelineArnstringimage_pipeline_arnstrimagePipelineArnStringImagePipelineArnstringImagePipelineArn*stringrequired#
The ARN of the image pipeline.
imagePipelineNamestringimage_pipeline_namestrimagePipelineNameStringImagePipelineNamestringImagePipelineName*stringrequired#
The name of the image pipeline.
infrastructureConfigurationIInfrastructureConfigurationinfrastructure_configurationIInfrastructureConfigurationinfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfigurationrequired#
The infrastructure configuration used for the image build.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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

fromImagePipelineArn(scope: Construct, id: string, imagePipelineArn: string): IImagePipeline@staticmethod def from_image_pipeline_arn(scope: Construct, id: str, image_pipeline_arn: str) -> IImagePipelinepublic static IImagePipeline fromImagePipelineArn(Construct scope, String id, String imagePipelineArn)public static IImagePipeline FromImagePipelineArn(Construct scope, string id, string imagePipelineArn)func FromImagePipelineArn(Scope Construct, Id *string, ImagePipelineArn *string) IImagePipelinestatic#
Import an existing image pipeline given its ARN.
fromImagePipelineName(scope: Construct, id: string, imagePipelineName: string): IImagePipeline@staticmethod def from_image_pipeline_name(scope: Construct, id: str, image_pipeline_name: str) -> IImagePipelinepublic static IImagePipeline fromImagePipelineName(Construct scope, String id, String imagePipelineName)public static IImagePipeline FromImagePipelineName(Construct scope, string id, string imagePipelineName)func FromImagePipelineName(Scope Construct, Id *string, ImagePipelineName *string) IImagePipelinestatic#
Import an existing image pipeline given its name.

The provided name must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) Grant#
Grant custom actions to the given grantee for the image pipeline [disable-awslint:no-grants].
2 parameters

Parameters

  • granteegranteegranteegranteeGrantee — The principal.
  • actionsactionsactionsactionsActions — The list of actions.
grantDefaultExecutionRolePermissions(grantee: IGrantable): Grant[]def grant_default_execution_role_permissions(self, grantee: IGrantable) -> typing.List[Grant]public List<Grant> grantDefaultExecutionRolePermissions(IGrantable grantee)public Grant[] GrantDefaultExecutionRolePermissions(IGrantable grantee)func GrantDefaultExecutionRolePermissions(Grantee IGrantable) *[]Grant#
Grants the default permissions for building an image to the provided execution role.

[disable-awslint:no-grants]

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The execution role used for the image build.
grantRead(grantee: IGrantable): Grantdef grant_read(self, grantee: IGrantable) -> Grantpublic Grant grantRead(IGrantable grantee)public Grant GrantRead(IGrantable grantee)func GrantRead(Grantee IGrantable) Grant#
Grant read permissions to the given grantee for the image pipeline [disable-awslint:no-grants].
1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal.
grantStartExecution(grantee: IGrantable): Grantdef grant_start_execution(self, grantee: IGrantable) -> Grantpublic Grant grantStartExecution(IGrantable grantee)public Grant GrantStartExecution(IGrantable grantee)func GrantStartExecution(Grantee IGrantable) Grant#
Grant permissions to the given grantee to start an execution of the image pipeline [disable-awslint:no-grants].
1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isImagePipeline(x: any): boolean@staticmethod def is_image_pipeline(x: Any) -> boolpublic static Boolean isImagePipeline(Object x)public static bool IsImagePipeline(object x)func IsImagePipeline(X interface{}) *boolstatic#
Return whether the given object is an ImagePipeline.
isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
onCVEDetected(id: string, options?: OnEventOptions): Ruledef on_cve_detected(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onCVEDetected(String id, OnEventOptions options)public Rule OnCVEDetected(string id, OnEventOptions? options = null)func OnCVEDetected(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder CVE detected events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onEvent(id: string, options?: OnEventOptions): Ruledef on_event(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onEvent(String id, OnEventOptions options)public Rule OnEvent(string id, OnEventOptions? options = null)func OnEvent(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onImageBuildCompleted(id: string, options?: OnEventOptions): Ruledef on_image_build_completed(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onImageBuildCompleted(String id, OnEventOptions options)public Rule OnImageBuildCompleted(string id, OnEventOptions? options = null)func OnImageBuildCompleted(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder image build completion events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onImageBuildFailed(id: string, options?: OnEventOptions): Ruledef on_image_build_failed(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onImageBuildFailed(String id, OnEventOptions options)public Rule OnImageBuildFailed(string id, OnEventOptions? options = null)func OnImageBuildFailed(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder image build failure events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onImageBuildStateChange(id: string, options?: OnEventOptions): Ruledef on_image_build_state_change(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onImageBuildStateChange(String id, OnEventOptions options)public Rule OnImageBuildStateChange(string id, OnEventOptions? options = null)func OnImageBuildStateChange(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder image state change events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onImageBuildSucceeded(id: string, options?: OnEventOptions): Ruledef on_image_build_succeeded(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onImageBuildSucceeded(String id, OnEventOptions options)public Rule OnImageBuildSucceeded(string id, OnEventOptions? options = null)func OnImageBuildSucceeded(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder image success events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onImagePipelineAutoDisabled(id: string, options?: OnEventOptions): Ruledef on_image_pipeline_auto_disabled(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onImagePipelineAutoDisabled(String id, OnEventOptions options)public Rule OnImagePipelineAutoDisabled(string id, OnEventOptions? options = null)func OnImagePipelineAutoDisabled(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder image pipeline automatically disabled events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
onWaitForAction(id: string, options?: OnEventOptions): Ruledef on_wait_for_action(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onWaitForAction(String id, OnEventOptions options)public Rule OnWaitForAction(string id, OnEventOptions? options = null)func OnWaitForAction(Id *string, Options OnEventOptions) Rule#
Creates an EventBridge rule for Image Builder wait for action events.
2 parameters

Parameters

  • ididididId — Unique identifier for the rule.
  • optionsoptionsoptionsoptionsOptions — Configuration options for the event rule.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.