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
-
arnoptional computed - string -
idoptional computed - string -
namerequired - string -
role_arnrequired - string -
tagsoptional - map from string to string -
artifact_storeset block -
stagelist block-
namerequired - string -
actionlist block-
categoryrequired - string -
configurationoptional - map from string to string -
input_artifactsoptional - list of string -
namerequired - string -
namespaceoptional - string -
output_artifactsoptional - list of string -
ownerrequired - string -
providerrequired - string -
regionoptional computed - string -
role_arnoptional - string -
run_orderoptional computed - number -
versionrequired - 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
-
ArtifactStoreoptional - ArtifactStore -
ArtifactStoresoptional - List of ArtifactStoreMap -
DisableInboundStageTransitionsoptional - List of StageTransition -
Nameoptional - String -
RestartExecutionOnUpdateoptional - Boolean -
RoleArnrequired - String -
Stagesrequired - List of StageDeclaration -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::CodePipeline::Pipelineresource 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.