Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AWS Provider V5 #112

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": [
"config:base",
":preserveSemverRanges"
":preserveSemverRanges",
":rebaseStalePrs"
],
"baseBranches": ["main", "master", "/^release\\/v\\d{1,2}$/"],
"baseBranches": ["main"],
"labels": ["auto-update"],
"dependencyDashboardAutoclose": true,
"enabledManagers": ["terraform"],
"terraform": {
"ignorePaths": ["**/context.tf", "examples/**"]
"ignorePaths": ["**/context.tf"]
}
}
1 change: 1 addition & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'docs/**'
- 'examples/**'
- 'test/**'
- 'README.*'

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ permissions:

jobs:
terraform-module:
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release.yml@main
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release-published.yml@main
63 changes: 14 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ Terraform Module for CI/CD with AWS Code Pipeline using GitHub webhook triggers
---

This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
[<img align="right" title="Share via Email" src="https://docs.cloudposse.com/images/ionicons/ios-email-outline-2.0.1-16x16-999999.svg"/>][share_email]
[<img align="right" title="Share on Google+" src="https://docs.cloudposse.com/images/ionicons/social-googleplus-outline-2.0.1-16x16-999999.svg" />][share_googleplus]
[<img align="right" title="Share on Facebook" src="https://docs.cloudposse.com/images/ionicons/social-facebook-outline-2.0.1-16x16-999999.svg" />][share_facebook]
[<img align="right" title="Share on Reddit" src="https://docs.cloudposse.com/images/ionicons/social-reddit-outline-2.0.1-16x16-999999.svg" />][share_reddit]
[<img align="right" title="Share on LinkedIn" src="https://docs.cloudposse.com/images/ionicons/social-linkedin-outline-2.0.1-16x16-999999.svg" />][share_linkedin]
[<img align="right" title="Share on Twitter" src="https://docs.cloudposse.com/images/ionicons/social-twitter-outline-2.0.1-16x16-999999.svg" />][share_twitter]


[![Terraform Open Source Modules](https://docs.cloudposse.com/images/terraform-open-source-modules.svg)][terraform_modules]
Expand Down Expand Up @@ -88,10 +82,6 @@ We highly recommend that in your code you pin the version to the exact version y
using so that your infrastructure remains stable, and update versions in a
systematic way so that they do not catch you by surprise.

Also, because of a bug in the Terraform registry ([hashicorp/terraform#21417](https://github.com/hashicorp/terraform/issues/21417)),
the registry shows many of our inputs as required when in fact they are optional.
The table below correctly indicates which inputs are required.



For a complete example, see [examples/complete](examples/complete).
Expand Down Expand Up @@ -207,7 +197,7 @@ Available targets:

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.1 |

Expand Down Expand Up @@ -343,8 +333,6 @@ Available targets:

Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/terraform-aws-ecs-codepipeline)! (it helps us **a lot**)

Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)



## Related Projects
Expand Down Expand Up @@ -401,10 +389,6 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our

Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.

## Discourse Forums

Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.

## Newsletter

Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
Expand All @@ -415,7 +399,18 @@ Sign up for [our newsletter][newsletter] that covers everything on our technolog

[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours]

## Contributing
## ✨ Contributing



This project is under active development, and we encourage contributions from our community.
Many thanks to our outstanding contributors:

<a href="https://github.com/cloudposse/terraform-aws-ecs-codepipeline/graphs/contributors">
<img src="https://contrib.rocks/image?repo=cloudposse/terraform-aws-ecs-codepipeline&max=24" />
</a>



### Bug Reports & Feature Requests

Expand Down Expand Up @@ -489,29 +484,7 @@ We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. W

We offer [paid support][commercial_support] on all of our projects.

Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.



### Contributors

<!-- markdownlint-disable -->
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sarkis Varozian][sarkis_avatar]][sarkis_homepage]<br/>[Sarkis Varozian][sarkis_homepage] | [![Joe Niland][joe-niland_avatar]][joe-niland_homepage]<br/>[Joe Niland][joe-niland_homepage] |
|---|---|---|---|---|
<!-- markdownlint-restore -->

[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
[goruha_homepage]: https://github.com/goruha
[goruha_avatar]: https://img.cloudposse.com/150x150/https://github.com/goruha.png
[aknysh_homepage]: https://github.com/aknysh
[aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png
[sarkis_homepage]: https://github.com/sarkis
[sarkis_avatar]: https://img.cloudposse.com/150x150/https://github.com/sarkis.png
[joe-niland_homepage]: https://github.com/joe-niland
[joe-niland_avatar]: https://img.cloudposse.com/150x150/https://github.com/joe-niland.png

[![README Footer][readme_footer_img]][readme_footer_link]
Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]
<!-- markdownlint-disable -->
[logo]: https://cloudposse.com/logo-300x69.svg
Expand All @@ -521,12 +494,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=jobs
[hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=hire
[slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=slack
[linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=linkedin
[twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=twitter
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=testimonial
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=office_hours
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=newsletter
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=discourse
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=email
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=commercial_support
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=we_love_open_source
Expand All @@ -537,11 +508,5 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=readme_footer_link
[readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img
[readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ecs-codepipeline&utm_content=readme_commercial_support_link
[share_twitter]: https://twitter.com/intent/tweet/?text=terraform-aws-ecs-codepipeline&url=https://github.com/cloudposse/terraform-aws-ecs-codepipeline
[share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=terraform-aws-ecs-codepipeline&url=https://github.com/cloudposse/terraform-aws-ecs-codepipeline
[share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/terraform-aws-ecs-codepipeline
[share_facebook]: https://facebook.com/sharer/sharer.php?u=https://github.com/cloudposse/terraform-aws-ecs-codepipeline
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-ecs-codepipeline
[share_email]: mailto:?subject=terraform-aws-ecs-codepipeline&body=https://github.com/cloudposse/terraform-aws-ecs-codepipeline
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-ecs-codepipeline?pixel&cs=github&cm=readme&an=terraform-aws-ecs-codepipeline
<!-- markdownlint-restore -->
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.1 |

Expand Down
18 changes: 10 additions & 8 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ provider "aws" {
}

module "vpc" {
source = "cloudposse/vpc/aws"
version = "0.18.1"
cidr_block = var.vpc_cidr_block
source = "cloudposse/vpc/aws"
version = "2.1.1"

ipv4_primary_cidr_block = var.vpc_cidr_block

context = module.this.context
}

module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "0.39.3"
source = "cloudposse/dynamic-subnets/aws"
version = "2.4.1"

availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = module.vpc.igw_id
cidr_block = module.vpc.vpc_cidr_block
nat_gateway_enabled = true
igw_id = [module.vpc.igw_id]
ipv4_cidr_block = [module.vpc.vpc_cidr_block]
nat_gateway_enabled = false
nat_instance_enabled = false

context = module.this.context
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.13.0"
required_version = ">= 1.3"

required_providers {
aws = {
Expand Down
42 changes: 21 additions & 21 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ data "aws_iam_policy_document" "assume_role" {

resource "aws_iam_role_policy_attachment" "default" {
count = module.this.enabled ? 1 : 0
role = join("", aws_iam_role.default.*.id)
policy_arn = join("", aws_iam_policy.default.*.arn)
role = join("", aws_iam_role.default[*].id)
policy_arn = join("", aws_iam_policy.default[*].arn)
}

resource "aws_iam_policy" "default" {
Expand Down Expand Up @@ -86,8 +86,8 @@ data "aws_iam_policy_document" "default" {

resource "aws_iam_role_policy_attachment" "s3" {
count = module.this.enabled ? 1 : 0
role = join("", aws_iam_role.default.*.id)
policy_arn = join("", aws_iam_policy.s3.*.arn)
role = join("", aws_iam_role.default[*].id)
policy_arn = join("", aws_iam_policy.s3[*].arn)
}

module "codepipeline_s3_policy_label" {
Expand All @@ -101,7 +101,7 @@ module "codepipeline_s3_policy_label" {
resource "aws_iam_policy" "s3" {
count = module.this.enabled ? 1 : 0
name = module.codepipeline_s3_policy_label.id
policy = join("", data.aws_iam_policy_document.s3.*.json)
policy = join("", data.aws_iam_policy_document.s3[*].json)
}

data "aws_iam_policy_document" "s3" {
Expand All @@ -118,8 +118,8 @@ data "aws_iam_policy_document" "s3" {
]

resources = [
join("", aws_s3_bucket.default.*.arn),
"${join("", aws_s3_bucket.default.*.arn)}/*"
join("", aws_s3_bucket.default[*].arn),
"${join("", aws_s3_bucket.default[*].arn)}/*"
]

effect = "Allow"
Expand All @@ -128,8 +128,8 @@ data "aws_iam_policy_document" "s3" {

resource "aws_iam_role_policy_attachment" "codebuild" {
count = module.this.enabled ? 1 : 0
role = join("", aws_iam_role.default.*.id)
policy_arn = join("", aws_iam_policy.codebuild.*.arn)
role = join("", aws_iam_role.default[*].id)
policy_arn = join("", aws_iam_policy.codebuild[*].arn)
}

module "codebuild_label" {
Expand Down Expand Up @@ -162,8 +162,8 @@ data "aws_iam_policy_document" "codebuild" {
# https://docs.aws.amazon.com/codepipeline/latest/userguide/connections-permissions.html
resource "aws_iam_role_policy_attachment" "codestar" {
count = local.codestar_enabled ? 1 : 0
role = join("", aws_iam_role.default.*.id)
policy_arn = join("", aws_iam_policy.codestar.*.arn)
role = join("", aws_iam_role.default[*].id)
policy_arn = join("", aws_iam_policy.codestar[*].arn)
}

module "codestar_label" {
Expand All @@ -178,7 +178,7 @@ module "codestar_label" {
resource "aws_iam_policy" "codestar" {
count = local.codestar_enabled ? 1 : 0
name = module.codestar_label.id
policy = join("", data.aws_iam_policy_document.codestar.*.json)
policy = join("", data.aws_iam_policy_document.codestar[*].json)
}

data "aws_iam_policy_document" "codestar" {
Expand Down Expand Up @@ -242,13 +242,13 @@ module "codebuild" {
resource "aws_iam_role_policy_attachment" "codebuild_s3" {
count = module.this.enabled ? 1 : 0
role = module.codebuild.role_id
policy_arn = join("", aws_iam_policy.s3.*.arn)
policy_arn = join("", aws_iam_policy.s3[*].arn)
}

resource "aws_iam_role_policy_attachment" "codebuild_codestar" {
count = local.codestar_enabled && var.codestar_output_artifact_format == "CODEBUILD_CLONE_REF" ? 1 : 0
role = module.codebuild.role_id
policy_arn = join("", aws_iam_policy.codestar.*.arn)
policy_arn = join("", aws_iam_policy.codestar[*].arn)
}

resource "aws_iam_role_policy_attachment" "codebuild_extras" {
Expand All @@ -260,10 +260,10 @@ resource "aws_iam_role_policy_attachment" "codebuild_extras" {
resource "aws_codepipeline" "default" {
count = module.this.enabled && var.github_oauth_token != "" ? 1 : 0
name = module.codepipeline_label.id
role_arn = join("", aws_iam_role.default.*.arn)
role_arn = join("", aws_iam_role.default[*].arn)
max-lobur marked this conversation as resolved.
Show resolved Hide resolved

artifact_store {
location = join("", aws_s3_bucket.default.*.bucket)
location = join("", aws_s3_bucket.default[*].bucket)
type = "S3"
}

Expand Down Expand Up @@ -343,10 +343,10 @@ resource "aws_codepipeline" "default" {
resource "aws_codepipeline" "bitbucket" {
count = local.codestar_enabled ? 1 : 0
name = module.codepipeline_label.id
role_arn = join("", aws_iam_role.default.*.arn)
role_arn = join("", aws_iam_role.default[*].arn)
max-lobur marked this conversation as resolved.
Show resolved Hide resolved
max-lobur marked this conversation as resolved.
Show resolved Hide resolved

artifact_store {
location = join("", aws_s3_bucket.default.*.bucket)
location = join("", aws_s3_bucket.default[*].bucket)
type = "S3"
}

Expand Down Expand Up @@ -426,16 +426,16 @@ resource "random_string" "webhook_secret" {
}

locals {
webhook_secret = join("", random_string.webhook_secret.*.result)
webhook_url = join("", aws_codepipeline_webhook.webhook.*.url)
webhook_secret = join("", random_string.webhook_secret[*].result)
webhook_url = join("", aws_codepipeline_webhook.webhook[*].url)
}

resource "aws_codepipeline_webhook" "webhook" {
count = module.this.enabled && var.webhook_enabled ? 1 : 0
name = module.codepipeline_label.id
authentication = var.webhook_authentication
target_action = var.webhook_target_action
target_pipeline = join("", aws_codepipeline.default.*.name)
target_pipeline = join("", aws_codepipeline.default[*].name)

authentication_configuration {
secret_token = local.webhook_secret
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ output "badge_url" {

output "webhook_id" {
description = "The CodePipeline webhook's ID"
value = join("", aws_codepipeline_webhook.webhook.*.id)
value = join("", aws_codepipeline_webhook.webhook[*].id)
}

output "webhook_url" {
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.13.0"
required_version = ">= 1.3"

required_providers {
aws = {
Expand Down