This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
AWS::ImageBuilder::ImagePipeline
An image pipeline is the automation configuration for building secure OS images on AWS. The Image Builder image pipeline is associated with an image recipe that defines the build, validation, and test phases for an image build lifecycle. An image pipeline can be associated with an infrastructure configuration that defines where your image is built. You can define attributes, such as instance types, a subnet for your VPC, security groups, logging, and other infrastructure-related configurations. You can also associate your image pipeline with a distribution configuration to define how you would like to deploy your image.
Syntax
To declare this entity in your CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::ImageBuilder::ImagePipeline", "Properties" : { "ContainerRecipeArn" :String, "Description" :String, "DistributionConfigurationArn" :String, "EnhancedImageMetadataEnabled" :Boolean, "ExecutionRole" :String, "ImageRecipeArn" :String, "ImageScanningConfiguration" :ImageScanningConfiguration, "ImageTags" :{, "ImageTestsConfiguration" :Key:Value, ...}ImageTestsConfiguration, "InfrastructureConfigurationArn" :String, "LoggingConfiguration" :PipelineLoggingConfiguration, "Name" :String, "Schedule" :Schedule, "Status" :String, "Tags" :{, "Workflows" :Key:Value, ...}[ WorkflowConfiguration, ... ]} }
YAML
Type: AWS::ImageBuilder::ImagePipeline Properties: ContainerRecipeArn:StringDescription:StringDistributionConfigurationArn:StringEnhancedImageMetadataEnabled:BooleanExecutionRole:StringImageRecipeArn:StringImageScanningConfiguration:ImageScanningConfigurationImageTags:ImageTestsConfiguration:Key:ValueImageTestsConfigurationInfrastructureConfigurationArn:StringLoggingConfiguration:PipelineLoggingConfigurationName:StringSchedule:ScheduleStatus:StringTags:Workflows:Key:Value- WorkflowConfiguration
Properties
ContainerRecipeArn-
The Amazon Resource Name (ARN) of the container recipe that is used for this pipeline.
Required: No
Type: String
Update requires: No interruption
Description-
The description of the image pipeline.
Required: No
Type: String
Minimum:
1Maximum:
1024Update requires: No interruption
DistributionConfigurationArn-
The Amazon Resource Name (ARN) of the distribution configuration associated with this image pipeline.
Required: No
Type: String
Update requires: No interruption
EnhancedImageMetadataEnabled-
Collects additional information about the image being created, including the operating system (OS) version and package list. This information is used to enhance the overall experience of using EC2 Image Builder. Enabled by default.
Required: No
Type: Boolean
Update requires: No interruption
ExecutionRole-
The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions.
Required: No
Type: String
Pattern:
^(?:arn:aws(?:-[a-z]+)*:iam::[0-9]{12}:role/)?[a-zA-Z_0-9+=,.@\-_/]+$Minimum:
1Maximum:
2048Update requires: No interruption
ImageRecipeArn-
The Amazon Resource Name (ARN) of the image recipe associated with this image pipeline.
Required: No
Type: String
Update requires: No interruption
ImageScanningConfiguration-
Contains settings for vulnerability scans.
Required: No
Type: ImageScanningConfiguration
Update requires: No interruption
-
The tags to apply to every image that this pipeline produces. Unlike the
Tagsproperty, which tags the pipeline resource itself,ImageTagstag each image version that the pipeline creates. These tags appear on the resulting AMI or container image. To tag the AMI during the Build phase before distribution, use theAmiTagsproperty on the image recipe instead.Required: No
Type: Object of String
Pattern:
.{1,}Update requires: No interruption
ImageTestsConfiguration-
The image tests configuration of the image pipeline.
Required: No
Type: ImageTestsConfiguration
Update requires: No interruption
InfrastructureConfigurationArn-
The Amazon Resource Name (ARN) of the infrastructure configuration associated with this image pipeline.
Required: No
Type: String
Update requires: No interruption
LoggingConfiguration-
Defines logging configuration for the output image.
Required: No
Type: PipelineLoggingConfiguration
Update requires: No interruption
Name-
The name of the image pipeline.
Required: No
Type: String
Pattern:
^[-_A-Za-z-0-9][-_A-Za-z0-9 ]{1,126}[-_A-Za-z-0-9]$Update requires: Replacement
Schedule-
The schedule of the image pipeline.
Required: No
Type: Schedule
Update requires: No interruption
Status-
The status of the image pipeline.
Required: No
Type: String
Allowed values:
DISABLED | ENABLEDUpdate requires: No interruption
-
The tags of this image pipeline.
Required: No
Type: Object of String
Pattern:
.{1,}Update requires: No interruption
Workflows-
Contains the workflows that run for the image pipeline.
Required: No
Type: Array of WorkflowConfiguration
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource ARN, such as
arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/mywindows2016pipeline.
For more information about using the Ref function, see Ref.
Fn::GetAtt
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.
Arn-
Returns the Amazon Resource Name (ARN) of the image pipeline. For example,
arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/mywindows2016pipeline. DeploymentId-
Returns the deployment ID of the pipeline. The deployment ID changes each time the pipeline configuration changes. Use this attribute to set the
ImagePipelineExecutionSettings.DeploymentIdproperty of anAWS::ImageBuilder::Imageresource, so that the pipeline runs when your template creates or updates the image resource. Name-
Returns the name of the image pipeline.
Examples
Create an image pipeline
The following example shows the template for the ImagePipeline resource in both YAML and JSON format.
YAML
Resources: ImagePipelineAllParameters: Type: 'AWS::ImageBuilder::ImagePipeline' Properties: Name: 'image-pipeline-name' Description: 'description' ImageRecipeArn: !Ref ImageRecipeArn InfrastructureConfigurationArn: !Ref InfrastructureConfigurationArn DistributionConfigurationArn: !Ref DistributionConfigurationArn ImageTestsConfiguration: ImageTestsEnabled: false TimeoutMinutes: 90 Schedule: ScheduleExpression: 'cron(0 0 * * ? *)' PipelineExecutionStartCondition: 'EXPRESSION_MATCH_ONLY' Status: 'DISABLED' Tags: CustomerImagePipelineTagKey1: 'CustomerImagePipelineTagValue1' CustomerImagePipelineTagKey2: 'CustomerImagePipelineTagValue2'
JSON
{ "Resources": { "ImagePipelineAllParameters": { "Type": "AWS::ImageBuilder::ImagePipeline", "Properties": { "Name": "image-pipeline-name", "Description": "description", "ImageRecipeArn": { "Ref": "ImageRecipeArn" }, "InfrastructureConfigurationArn": { "Ref": "InfrastructureConfigurationArn" }, "DistributionConfigurationArn": { "Ref": "DistributionConfigurationArn" }, "ImageTestsConfiguration": { "ImageTestsEnabled": false, "TimeoutMinutes": 90 }, "Schedule": { "ScheduleExpression": "cron(0 0 * * ? *)", "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY" }, "Status": "DISABLED", "Tags": { "CustomerImagePipelineTagKey1": "CustomerImagePipelineTagValue1", "CustomerImagePipelineTagKey2": "CustomerImagePipelineTagValue2" } } } } }
Create an image pipeline with workflows and logging
The following example creates an image pipeline that uses a custom workflow, writes logs to a custom Amazon CloudWatch Logs log group, and applies tags to the images it produces.
YAML
Resources: PipelineWithWorkflows: Type: AWS::ImageBuilder::ImagePipeline Properties: Name: pipeline-with-workflows ImageRecipeArn: !Ref ImageRecipeArn InfrastructureConfigurationArn: !Ref InfrastructureConfigurationArn DistributionConfigurationArn: !Ref DistributionConfigurationArn ExecutionRole: !GetAtt PipelineExecutionRole.Arn Workflows: - WorkflowArn: !GetAtt BuildWorkflow.Arn OnFailure: ABORT - WorkflowArn: !GetAtt TestWorkflow.Arn OnFailure: CONTINUE ParallelGroup: test-group LoggingConfiguration: PipelineLogGroupName: /mycompany/imagebuilder/pipelines ImageLogGroupName: /mycompany/imagebuilder/images ImageTags: Application: web-server BuildDate: '{{ imagebuilder:buildDate }}' Schedule: ScheduleExpression: 'cron(0 8 ? * mon *)' PipelineExecutionStartCondition: EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE Status: ENABLED
JSON
{ "Resources": { "PipelineWithWorkflows": { "Type": "AWS::ImageBuilder::ImagePipeline", "Properties": { "Name": "pipeline-with-workflows", "ImageRecipeArn": { "Ref": "ImageRecipeArn" }, "InfrastructureConfigurationArn": { "Ref": "InfrastructureConfigurationArn" }, "DistributionConfigurationArn": { "Ref": "DistributionConfigurationArn" }, "ExecutionRole": { "Fn::GetAtt": ["PipelineExecutionRole", "Arn"] }, "Workflows": [ { "WorkflowArn": { "Fn::GetAtt": ["BuildWorkflow", "Arn"] }, "OnFailure": "ABORT" }, { "WorkflowArn": { "Fn::GetAtt": ["TestWorkflow", "Arn"] }, "OnFailure": "CONTINUE", "ParallelGroup": "test-group" } ], "LoggingConfiguration": { "PipelineLogGroupName": "/mycompany/imagebuilder/pipelines", "ImageLogGroupName": "/mycompany/imagebuilder/images" }, "ImageTags": { "Application": "web-server", "BuildDate": "{{ imagebuilder:buildDate }}" }, "Schedule": { "ScheduleExpression": "cron(0 8 ? * mon *)", "PipelineExecutionStartCondition": "EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE" }, "Status": "ENABLED" } } } }