AWS CodePipeline Codepipeline
This page shows how to write Terraform and CloudFormation for CodePipeline Codepipeline and write them securely.
aws_codepipeline (Terraform)
The Codepipeline in CodePipeline can be configured in Terraform with the resource name aws_codepipeline
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_codepipeline" "cicd_pipeline_dev" {
name = "labthyl_networkbase_code_DEV"
role_arn = aws_iam_role.tf-codepipeline-role.arn
artifact_store {
resource "aws_codepipeline" "pms-core-dev" {
name = "PMS-CORE-DEV"
role_arn = "arn:aws:iam::561688265541:role/service-role/AWSCodePipelineServiceRole-us-east-1-PMS-API-Dev"
tags = {}
artifact_store {
Parameters
-
arn
optional computed - string -
id
optional computed - string -
name
required - string -
role_arn
required - string -
tags
optional - map from string to string -
artifact_store
set block -
stage
list block-
name
required - string -
action
list block-
category
required - string -
configuration
optional - map from string to string -
input_artifacts
optional - list of string -
name
required - string -
namespace
optional - string -
output_artifacts
optional - list of string -
owner
required - string -
provider
required - string -
region
optional computed - string -
role_arn
optional - string -
run_order
optional computed - number -
version
required - string
-
-
Explanation in Terraform Registry
Provides a CodePipeline.
AWS::CodePipeline::Pipeline (CloudFormation)
The Pipeline in CodePipeline can be configured in CloudFormation with the resource name AWS::CodePipeline::Pipeline
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: 'AWS::CodePipeline::Pipeline'
Properties:
Name: production-frontend-pipeline
RoleArn: !GetAtt
- CodePipelineServiceRole
- Arn
Type: AWS::CodePipeline::Pipeline
Properties:
RoleArn: !Ref CodePipelineServiceRole
Stages:
-
Name: GithubSource
Type: AWS::CodePipeline::Pipeline
Properties:
RoleArn:
Fn::GetAtt:
- cicdRole
- Arn
Type: AWS::CodePipeline::Pipeline
Properties:
RoleArn: !ImportValue PipelineRoleArn
Name: !Sub ${ProjectName}_pipeline
Stages:
- Name: Source
Type: AWS::CodePipeline::Pipeline
Properties:
Name: !Ref prefix
RoleArn: !GetAtt CodePipelineRole.Arn
Stages:
- Name: Source
"Type": "AWS::CodePipeline::Pipeline",
"Properties": {
"RoleArn": {
"Fn::GetAtt": [
"PipelineRoleD68726F7",
"Arn"
"Type": "AWS::CodePipeline::Pipeline",
"Properties": {
"Name": {
"Fn::Join": [
"-",
[
"Type": "AWS::CodePipeline::Pipeline",
"Properties": {
"Name": "github-events-pipeline",
"RoleArn": {
"Fn::GetAtt": [
"CodePipelineServiceRole",
"path": "/PropertyTypes/AWS::CodePipeline::Pipeline.ArtifactStore/Properties/Type/Value",
"value": {
"ValueType": "AWS::CodePipeline::Pipeline.ArtifactStore.Type"
}
},
{
"resourceType" : "AWS::CodePipeline::Pipeline",
"properties" : [ {
"propertyName" : "ArtifactStore",
"propertyType" : "AWS::CodePipeline::Pipeline::ArtifactStore",
"required" : true,
"propertyHref" : "aws-properties-codepipeline-pipeline-artifactstore.html"
Parameters
-
ArtifactStore
optional - ArtifactStore -
ArtifactStores
optional - List of ArtifactStoreMap -
DisableInboundStageTransitions
optional - List of StageTransition -
Name
optional - String -
RestartExecutionOnUpdate
optional - Boolean -
RoleArn
required - String -
Stages
required - List of StageDeclaration -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::CodePipeline::Pipeline
resource creates a CodePipeline pipeline that describes how software changes go through a release process. For more information, see What Is CodePipeline? in the AWS CodePipeline User Guide.
Frequently asked questions
What is AWS CodePipeline Codepipeline?
AWS CodePipeline Codepipeline is a resource for CodePipeline of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS CodePipeline Codepipeline?
For Terraform, the thieslei/labthyl-codepipeline-cicd and valejojohnson/AWS-VPC-Templates source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the serverless-guru/templates, serverless-barcelona/serverless-api-gw-sockets and bcx-exa/open_source_triple_continent_traditional source code examples are useful. See the CloudFormation Example section for further details.