ImagePipeline L2 construct
Represents an EC2 Image Builder Image Pipeline.
Example
const workflowPipeline = new imagebuilder.ImagePipeline(this, 'WorkflowPipeline', {
recipe: exampleImageRecipe,
workflows: [
{ workflow: imagebuilder.AmazonManagedWorkflow.buildImage(this, 'BuildWorkflow') },
{ workflow: imagebuilder.AmazonManagedWorkflow.testImage(this, 'TestWorkflow') }
]
});
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"))
]
)
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();
// 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") } }
});
// 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
new ImagePipeline(scope: Construct, id: string, props: ImagePipelineProps)
ImagePipeline(scope: Construct, id: str, props: ImagePipelineProps)
new ImagePipeline(Construct scope, String id, ImagePipelineProps props)
new ImagePipeline(Construct scope, string id, ImagePipelineProps props)
NewImagePipeline(Scope Construct, Id *string, Props ImagePipelineProps)
Construct Props
distributionConfigurationIDistributionConfigurationdistribution_configurationIDistributionConfigurationdistributionConfigurationIDistributionConfigurationDistributionConfigurationIDistributionConfigurationDistributionConfigurationIDistributionConfiguration= None#enhancedImageMetadataEnabledbooleanenhanced_image_metadata_enabledboolenhancedImageMetadataEnabledBooleanEnhancedImageMetadataEnabledboolEnhancedImageMetadataEnabled*bool= true#executionRoleIRoleexecution_roleIRoleexecutionRoleIRoleExecutionRoleIRoleExecutionRoleIRole= Image Builder will use the SLR i…#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#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#By default, a log group will be created with the format /aws/imagebuilder/pipeline/<pipeline-name>
imagePipelineNamestringimage_pipeline_namestrimagePipelineNameStringImagePipelineNamestringImagePipelineName*string= a name is generated#imageScanningEcrRepositoryIRepositoryimage_scanning_ecr_repositoryIRepositoryimageScanningEcrRepositoryIRepositoryImageScanningEcrRepositoryIRepositoryImageScanningEcrRepositoryIRepository= if scanning is enabled, a reposi…#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#imageScanningEnabledbooleanimage_scanning_enabledboolimageScanningEnabledBooleanImageScanningEnabledboolImageScanningEnabled*bool= false#imageTestsEnabledbooleanimage_tests_enabledboolimageTestsEnabledBooleanImageTestsEnabledboolImageTestsEnabled*bool= true#infrastructureConfigurationIInfrastructureConfigurationinfrastructure_configurationIInfrastructureConfigurationinfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfiguration= an infrastructure configuration …#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
This can either be an image recipe, or a container recipe.
scheduleImagePipelineSchedulescheduleImagePipelineSchedulescheduleImagePipelineScheduleScheduleImagePipelineScheduleScheduleImagePipelineSchedule= none, a manual image pipeline wi…#This configures how often and when a pipeline automatically creates a new image.
default
Default: none, a manual image pipeline will be created
statusImagePipelineStatusstatusImagePipelineStatusstatusImagePipelineStatusStatusImagePipelineStatusStatusImagePipelineStatus= ImagePipelineStatus.ENABLED#tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string= None#workflowsWorkflowConfiguration[]workflowstyping.List[WorkflowConfiguration]workflowsList<WorkflowConfiguration>WorkflowsWorkflowConfiguration[]Workflows*[]WorkflowConfiguration= Image Builder will use a default…#default
Default: Image Builder will use a default set of workflows for the build to build, test, and distribute the image
Properties
envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#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.
If there is no execution role, then the build will be executed with the AWSServiceRoleForImageBuilder service-linked role.
imagePipelineArnstringimage_pipeline_arnstrimagePipelineArnStringImagePipelineArnstringImagePipelineArn*stringrequired#imagePipelineNamestringimage_pipeline_namestrimagePipelineNameStringImagePipelineNamestringImagePipelineName*stringrequired#infrastructureConfigurationIInfrastructureConfigurationinfrastructure_configurationIInfrastructureConfigurationinfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfigurationInfrastructureConfigurationIInfrastructureConfigurationrequired#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#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)#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)#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#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#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#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#[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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.