ImagePipeline
- class aws_cdk.aws_imagebuilder_alpha.ImagePipeline(scope, id, *, recipe, description=None, distribution_configuration=None, enhanced_image_metadata_enabled=None, execution_role=None, image_log_group=None, image_pipeline_log_group=None, image_pipeline_name=None, image_scanning_ecr_repository=None, image_scanning_ecr_tags=None, image_scanning_enabled=None, image_tests_enabled=None, infrastructure_configuration=None, schedule=None, status=None, tags=None, workflows=None)
Bases:
Resource(experimental) Represents an EC2 Image Builder Image Pipeline.
- See:
https://docs.aws.amazon.com/imagebuilder/latest/userguide/manage-pipelines.html
- Stability:
experimental
- ExampleMetadata:
infused
Example:
workflow_pipeline = imagebuilder.ImagePipeline(self, "WorkflowPipeline", recipe=example_image_recipe, workflows=[imagebuilder.WorkflowConfiguration(workflow=imagebuilder.AwsManagedWorkflow.build_image(self, "BuildWorkflow")), imagebuilder.WorkflowConfiguration(workflow=imagebuilder.AwsManagedWorkflow.test_image(self, "TestWorkflow")) ] )
- Parameters:
scope (
Construct)id (
str)recipe (
IRecipeBase) – (experimental) 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.description (
Optional[str]) – (experimental) The description of the image pipeline. Default: Nonedistribution_configuration (
Optional[IDistributionConfiguration]) – (experimental) The distribution configuration used for distributing the image. Default: Noneenhanced_image_metadata_enabled (
Optional[bool]) – (experimental) If enabled, collects additional information about the image being created, including the operating system (OS) version and package list for the AMI. Default: trueexecution_role (
Optional[IRole]) – (experimental) The execution role used to perform workflow actions to build this 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 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 generatedimage_log_group (
Optional[ILogGroup]) – (experimental) 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>. Default: - a log group will be createdimage_pipeline_log_group (
Optional[ILogGroup]) – (experimental) 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>Default: - a log group will be createdimage_pipeline_name (
Optional[str]) – (experimental) The name of the image pipeline. Default: - a name is generatedimage_scanning_ecr_repository (
Optional[IRepository]) – (experimental) 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. Default: - if scanning is enabled, a repository will be created by Image Builder if one is not providedimage_scanning_ecr_tags (
Optional[Sequence[str]]) – (experimental) The tags for Image Builder to apply to the output container image that Amazon Inspector scans. Default: Noneimage_scanning_enabled (
Optional[bool]) – (experimental) 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. Default: falseimage_tests_enabled (
Optional[bool]) – (experimental) Whether to run tests after building an image. Default: trueinfrastructure_configuration (
Optional[IInfrastructureConfiguration]) – (experimental) 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: - an infrastructure configuration will be created with the default settingsschedule (
Union[ImagePipelineSchedule,Dict[str,Any],None]) – (experimental) The schedule of the image pipeline. This configures how often and when a pipeline automatically creates a new image. Default: - none, a manual image pipeline will be createdstatus (
Optional[ImagePipelineStatus]) – (experimental) Indicates whether the pipeline is enabled to be triggered by the provided schedule. Default: ImagePipelineStatus.ENABLEDtags (
Optional[Mapping[str,str]]) – (experimental) The tags to apply to the image pipeline. Default: Noneworkflows (
Optional[Sequence[Union[WorkflowConfiguration,Dict[str,Any]]]]) – (experimental) The list of workflow configurations used to build the image. Default: - Image Builder will use a default set of workflows for the build to build, test, and distribute the image
- Stability:
experimental
Methods
- apply_removal_policy(policy)
Apply the given removal policy to this resource.
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).- Parameters:
policy (
RemovalPolicy)- Return type:
None
- grant(grantee, *actions)
(experimental) Grant custom actions to the given grantee for the image pipeline.
- Parameters:
grantee (
IGrantable) – The principal.actions (
str) – The list of actions.
- Stability:
experimental
- Return type:
- grant_default_execution_role_permissions(grantee)
(experimental) Grants the default permissions for building an image to the provided execution role.
- Parameters:
grantee (
IGrantable) – The execution role used for the image build.- Stability:
experimental
- Return type:
List[Grant]
- grant_read(grantee)
(experimental) Grant read permissions to the given grantee for the image pipeline.
- Parameters:
grantee (
IGrantable) – The principal.- Stability:
experimental
- Return type:
- grant_start_execution(grantee)
(experimental) Grant permissions to the given grantee to start an execution of the image pipeline.
- Parameters:
grantee (
IGrantable) – The principal.- Stability:
experimental
- Return type:
- on_cve_detected(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder CVE detected events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_event(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_image_build_completed(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder image build completion events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_image_build_failed(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder image build failure events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_image_build_state_change(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder image state change events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_image_build_succeeded(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder image success events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_image_pipeline_auto_disabled(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder image pipeline automatically disabled events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- on_wait_for_action(id, *, target=None, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None)
(experimental) Creates an EventBridge rule for Image Builder wait for action events.
- Parameters:
id (
str) – Unique identifier for the rule.target (
Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. UseaddTarget()to add a target.cross_stack_scope (
Optional[Construct]) – The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations. Default: - none (the main scope will be used, even for cross-stack Events)description (
Optional[str]) – A description of the rule’s purpose. Default: - No descriptionevent_pattern (
Union[EventPattern,Dict[str,Any],None]) – Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering. Default: - No additional filtering based on an event pattern.rule_name (
Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.
- See:
- Stability:
experimental
- Return type:
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- PROPERTY_INJECTION_ID = '@aws-cdk.aws-imagebuilder-alpha.ImagePipeline'
- env
The environment this resource belongs to.
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.
- execution_role
(experimental) 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.
- Stability:
experimental
- image_pipeline_arn
(experimental) The ARN of the image pipeline.
- Stability:
experimental
- image_pipeline_name
(experimental) The name of the image pipeline.
- Stability:
experimental
- infrastructure_configuration
(experimental) The infrastructure configuration used for the image build.
- Stability:
experimental
- node
The tree node.
- stack
The stack in which this resource is defined.
Static Methods
- classmethod from_image_pipeline_arn(scope, id, image_pipeline_arn)
(experimental) Import an existing image pipeline given its ARN.
- Parameters:
scope (
Construct)id (
str)image_pipeline_arn (
str)
- Stability:
experimental
- Return type:
- classmethod from_image_pipeline_name(scope, id, image_pipeline_name)
(experimental) 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.
- Parameters:
scope (
Construct)id (
str)image_pipeline_name (
str)
- Stability:
experimental
- Return type:
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.
- classmethod is_image_pipeline(x)
(experimental) Return whether the given object is an ImagePipeline.
- Parameters:
x (
Any)- Stability:
experimental
- Return type:
bool
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct)- Return type:
bool