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

pipe-labthyl_networkbase_code.tf#L8
resource "aws_codepipeline" "cicd_pipeline_dev" {

  name     = "labthyl_networkbase_code_DEV"
  role_arn = aws_iam_role.tf-codepipeline-role.arn

  artifact_store {
cd.tf#L2
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 {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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

pipeline.yml#L4
    Type: 'AWS::CodePipeline::Pipeline'
    Properties:
      Name: production-frontend-pipeline
      RoleArn: !GetAtt
        - CodePipelineServiceRole
        - Arn
codepipeline.yml#L2
  Type: AWS::CodePipeline::Pipeline
  Properties:
    RoleArn: !Ref CodePipelineServiceRole
    Stages:
      -
        Name: GithubSource
codepipeline.serverless.yml#L17
    Type: AWS::CodePipeline::Pipeline
    Properties:
      RoleArn:
        Fn::GetAtt:
          - cicdRole
          - Arn
codepipeline_master.yml#L16
    Type: AWS::CodePipeline::Pipeline
    Properties:
      RoleArn: !ImportValue PipelineRoleArn
      Name: !Sub ${ProjectName}_pipeline
      Stages:
        - Name: Source
codepipeline.yml#L12
    Type: AWS::CodePipeline::Pipeline
    Properties:
      Name: !Ref prefix
      RoleArn: !GetAtt CodePipelineRole.Arn
      Stages:
        - Name: Source
integ.pipeline-jenkins.expected.json#L90
      "Type": "AWS::CodePipeline::Pipeline",
      "Properties": {
        "RoleArn": {
          "Fn::GetAtt": [
            "PipelineRoleD68726F7",
            "Arn"
sam%2Bappsync.json#L780
            "Type": "AWS::CodePipeline::Pipeline",
            "Properties": {
                "Name": {
                    "Fn::Join": [
                        "-",
                        [
template-codepipeline-github-events-json.json#L146
            "Type": "AWS::CodePipeline::Pipeline",
            "Properties": {
                "Name": "github-events-pipeline",
                "RoleArn": {
                    "Fn::GetAtt": [
                        "CodePipelineServiceRole",
aws_codepipeline.json#L11
    "path": "/PropertyTypes/AWS::CodePipeline::Pipeline.ArtifactStore/Properties/Type/Value",
    "value": {
      "ValueType": "AWS::CodePipeline::Pipeline.ArtifactStore.Type"
    }
  },
  {
CodePipeline.json#L103
  "resourceType" : "AWS::CodePipeline::Pipeline",
  "properties" : [ {
    "propertyName" : "ArtifactStore",
    "propertyType" : "AWS::CodePipeline::Pipeline::ArtifactStore",
    "required" : true,
    "propertyHref" : "aws-properties-codepipeline-pipeline-artifactstore.html"

Parameters

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.