GithubHelp home page GithubHelp logo

jameswoolfenden / terraform-aws-codepipeline Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 19.0 134 KB

Codepipeline if you must.

License: Apache License 2.0

Makefile 15.58% HCL 80.11% Shell 1.68% PowerShell 2.63%
aws module codebuild codepipeline codecommit terraform

terraform-aws-codepipeline's Introduction

terraform-aws-codepipeline

Build Status Latest Release GitHub tag (latest SemVer) Terraform Version Infrastructure Tests pre-commit checkov Infrastructure Tests

Terraform module to provision an AWS codepipeline CI/CD system. The module also creates the build itself and the example sets a deployment up for a Fargate project. The module has been fully updated to work with Terraform 0.12 and Terraform Cloud.


It's 100% Open Source and licensed under the APACHE2.

Usage

Include this repository as a module in your existing Terraform code:

module "codepipeline" {
  source         = "JamesWoolfenden/codepipeline/aws"
  version        = "0.4.21"
  artifact_store = var.artifact_store
  common_tags    = var.common_tags
  description    = var.description
  name           = var.name
  stages         = var.stages
}

Costs

From infracost: make cost Makefile target in example/examplea

✔ Calculating monthly cost estimate

Project: .

Name Monthly Qty Unit Monthly Cost

aws_s3_bucket.codepipeline
├─ Glacier deep archive
│ ├─ Storage 0 GB-months $0.00
│ ├─ PUT, COPY, POST, LIST requests 0 1k requests $0.00
│ ├─ GET, SELECT, and all other requests 0 1k requests $0.00
│ ├─ Lifecycle transition 0 1k requests $0.00
│ ├─ Retrieval requests (standard) 0 1k requests $0.00
│ ├─ Retrievals (standard) 0 GB-months $0.00
│ ├─ Retrieval requests (bulk) 0 1k requests $0.00
│ ├─ Retrievals (bulk) 0 GB-months $0.00
│ └─ Early delete (within 180 days) 0 GB-months $0.00
├─ Standard
│ ├─ Storage 0 GB-months $0.00
│ ├─ PUT, COPY, POST, LIST requests 0 1k requests $0.00
│ ├─ GET, SELECT, and all other requests 0 1k requests $0.00
│ ├─ Select data scanned 0 GB-months $0.00
│ └─ Select data returned 0 GB-months $0.00
├─ Intelligent tiering
│ ├─ Storage (frequent access) 0 GB-months $0.00
│ ├─ Storage (infrequent access) 0 GB-months $0.00
│ ├─ Monitoring and automation 0 1k objects $0.00
│ ├─ PUT, COPY, POST, LIST requests 0 1k requests $0.00
│ ├─ GET, SELECT, and all other requests 0 1k requests $0.00
│ ├─ Lifecycle transition 0 1k requests $0.00
│ ├─ Select data scanned 0 GB-months $0.00
│ ├─ Select data returned 0 GB-months $0.00
│ └─ Early delete (within 30 days) 0 GB-months $0.00
├─ Standard - infrequent access
│ ├─ Storage 0 GB-months $0.00
│ ├─ PUT, COPY, POST, LIST requests 0 1k requests $0.00
│ ├─ GET, SELECT, and all other requests 0 1k requests $0.00
│ ├─ Lifecycle transition 0 1k requests $0.00
│ ├─ Retrievals 0 GB-months $0.00
│ ├─ Select data scanned 0 GB-months $0.00
│ └─ Select data returned 0 GB-months $0.00
├─ One zone - infrequent access
│ ├─ Storage 0 GB-months $0.00
│ ├─ PUT, COPY, POST, LIST requests 0 1k requests $0.00
│ ├─ GET, SELECT, and all other requests 0 1k requests $0.00
│ ├─ Lifecycle transition 0 1k requests $0.00
│ ├─ Retrievals 0 GB-months $0.00
│ ├─ Select data scanned 0 GB-months $0.00
│ └─ Select data returned 0 GB-months $0.00
└─ Glacier
├─ Storage 0 GB-months $0.00
├─ PUT, COPY, POST, LIST requests 0 1k requests $0.00
├─ GET, SELECT, and all other requests 0 1k requests $0.00
├─ Lifecycle transition 0 1k requests $0.00
├─ Retrieval requests (standard) 0 1k requests $0.00
├─ Retrievals (standard) 0 GB-months $0.00
├─ Select data scanned (standard) 0 GB-months $0.00
├─ Select data returned (standard) 0 GB-months $0.00
├─ Retrieval requests (expedited) 0 1k requests $0.00
├─ Retrievals (expedited) 0 GB-months $0.00
├─ Select data scanned (expedited) 0 GB-months $0.00
├─ Select data returned (expedited) 0 GB-months $0.00
├─ Retrieval requests (bulk) 0 1k requests $0.00
├─ Retrievals (bulk) 0 GB-months $0.00
├─ Select data scanned (bulk) 0 GB-months $0.00
├─ Select data returned (bulk) 0 GB-months $0.00
└─ Early delete (within 90 days) 0 GB-months $0.00

PROJECT TOTAL $0.00

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_codepipeline.pipe resource
aws_iam_role.pipeline resource
aws_iam_role_policy.inline_policy resource
aws_iam_policy_document.pipeline data source
aws_region.current data source

Inputs

Name Description Type Default Required
artifact_store Map to populate the artifact block map(any) n/a yes
common_tags Implements the common tags scheme map(any) n/a yes
description Description of build project string n/a yes
kms_key_arn n/a string n/a yes
name n/a string n/a yes
policypath n/a string "" no
role_arn Optionally supply an existing role string "" no
stages This list describes each stage of the build list(any) n/a yes

Outputs

Name Description
pipeline The output of the aws_codepipeline resource
role_arn ARN of the pipeline role
role_name Name of the pipeline role created if var.role_arn is not supplied

Policy

The Terraform resource required is:

resource "aws_iam_policy" "terraform_pike" {
  name_prefix = "terraform_pike"
  path        = "/"
  description = "Pike Autogenerated policy from IAC"

  policy = jsonencode({
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "codepipeline:CreatePipeline",
                "codepipeline:DeletePipeline",
                "codepipeline:GetPipeline",
                "codepipeline:ListTagsForResource",
                "codepipeline:TagResource",
                "codepipeline:UntagResource"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "iam:CreateRole",
                "iam:DeleteRole",
                "iam:DeleteRolePolicy",
                "iam:GetRole",
                "iam:GetRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:ListInstanceProfilesForRole",
                "iam:ListRolePolicies",
                "iam:PassRole",
                "iam:PutRolePolicy"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
})
}

'stages' is a list of maps, whose format is :

Name Description Type Default Required
name Stage name string n/a yes
enabled If false, this stage will be ignored bool true no
action A map described below map n/a yes

'action' is a map whose format is described below. For more information on possible values, please refer to the AWS documentation:

Name Description Type Default Required
name Name string n/a yes
owner Owner string n/a yes
version Version string n/a yes
category Category string n/a yes
provider Provider string n/a yes
input_artifacts A list of artifacts declared as output artifacts by other actions list(string) [] no
output_artifacts A list of artifacts to be declared as inputs in other actions list(string) [] no
configuration A map whose content depends on the 5 first fields map {} no
role_arn If set, ovverrides the global role ARN for this action only string global value no
run_order Run order number null no
region If set, overrides the default region for this action only string current region no

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2023 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributors

James Woolfenden
James Woolfenden

terraform-aws-codepipeline's People

Contributors

fdmsantos avatar jameswoolfenden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

terraform-aws-codepipeline's Issues

Doesn't allow multi-action stages

Hi. Came across your module while doing some searching. Gave it a quick look. Does not seem to be a clear way to have a pipeline Stage with multiple Action blocks. Do you know that this is not possible with dynamic stages or is it merely something you didn't solution?

add type annotation to stages variable

"stages" variable doesn't have "type" annotation. when we don't specify type annotation to a variable, terraform automatically convert it to string. In addition, when iterating over the variable terraform throw an error:

"A value of type string cannot be used as the collection in a 'for' │ expression."

add type to "stages" variable

"stages" variable doesn't have "type" annotation. when we don't specify type annotation to a variable, terraform automatically convert it to string. In addition, when iterating over the variable, terraform throw an error:

"A value of type string cannot be used as the collection in a 'for' │ expression."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.