Skip to content

Commit

Permalink
Additional TF 0.13 Fixes (#44)
Browse files Browse the repository at this point in the history
* Support terraform 0.13

* Fix example

* Fix example

* Fix example

* Fix example

* Fix example

* Fix example

* Fix example

Co-authored-by: aknysh <[email protected]>
  • Loading branch information
osterman and aknysh authored Aug 19, 2020
1 parent 38908e8 commit a32e6c8
Show file tree
Hide file tree
Showing 20 changed files with 231 additions and 212 deletions.
12 changes: 11 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Use this file to define individuals or teams that are responsible for code in a repository.
# Read more: <https://help.github.com/articles/about-codeowners/>
#
# Order is important: the last matching pattern takes the most precedence

* @cloudposse/engineering
# These owners will be the default owners for everything
* @cloudposse/engineering @cloudposse/contributors

# Cloud Posse must review any changes to Makefiles
**/Makefile @cloudposse/engineering
**/Makefile.* @cloudposse/engineering

# Cloud Posse must review any changes to GitHub actions
.github/* @cloudposse/engineering
40 changes: 40 additions & 0 deletions .github/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
version-template: '$MAJOR.$MINOR.$PATCH'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'enhancement'
patch:
labels:
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
default: 'minor'

categories:
- title: '🚀 Enhancements'
labels:
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'

change-template: |
<details>
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
$BODY
</details>
template: |
$CHANGES
19 changes: 19 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: auto-release

on:
push:
branches:
- master

jobs:
semver:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
publish: true
prerelease: false
config-name: auto-release.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: "Handle common commands"
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: rebuild-readme, terraform-fmt
permission: none
permission: triage
issue-type: pull-request

test:
Expand All @@ -24,13 +24,13 @@ jobs:
- name: "Checkout commit"
uses: actions/checkout@v2
- name: "Run tests"
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: test
permission: none
permission: triage
issue-type: pull-request
reactions: false

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Available targets:
| Name | Version |
|------|---------|
| terraform | >= 0.12.0, < 0.14.0 |
| terraform | >= 0.12.0 |
| aws | ~> 2.0 |
| local | ~> 1.2 |
| null | ~> 2.0 |
Expand Down Expand Up @@ -206,6 +206,7 @@ Available targets:
| delimiter | Delimiter between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
| ecs\_cluster\_name | ECS Cluster Name | `string` | n/a | yes |
| enabled | Enable `CodePipeline` creation | `bool` | `true` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| environment\_variables | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | <pre>list(object(<br> {<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no |
| github\_oauth\_token | GitHub OAuth Token with permissions to access private repositories | `string` | `""` | no |
Expand Down
3 changes: 2 additions & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Name | Version |
|------|---------|
| terraform | >= 0.12.0, < 0.14.0 |
| terraform | >= 0.12.0 |
| aws | ~> 2.0 |
| local | ~> 1.2 |
| null | ~> 2.0 |
Expand Down Expand Up @@ -33,6 +33,7 @@
| delimiter | Delimiter between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
| ecs\_cluster\_name | ECS Cluster Name | `string` | n/a | yes |
| enabled | Enable `CodePipeline` creation | `bool` | `true` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| environment\_variables | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | <pre>list(object(<br> {<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no |
| github\_oauth\_token | GitHub OAuth Token with permissions to access private repositories | `string` | `""` | no |
Expand Down
2 changes: 0 additions & 2 deletions examples/complete/fixtures.us-east-2.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ webhook_enabled = false

s3_bucket_force_destroy = true

cache_type = "S3"

environment_variables = [
{
name = "APP_URL"
Expand Down
26 changes: 14 additions & 12 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ provider "aws" {
}

module "label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.17.0"
namespace = var.namespace
name = var.name
stage = var.stage
delimiter = var.delimiter
attributes = var.attributes
tags = var.tags
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.17.0"
namespace = var.namespace
environment = var.environment
stage = var.stage
name = var.name
delimiter = var.delimiter
attributes = var.attributes
tags = var.tags
}

module "vpc" {
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.8.1"
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.16.1"
namespace = var.namespace
stage = var.stage
name = var.name
Expand All @@ -24,7 +25,7 @@ module "vpc" {
}

module "subnets" {
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.19.0"
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.26.0"
availability_zones = var.availability_zones
namespace = var.namespace
stage = var.stage
Expand All @@ -45,7 +46,7 @@ resource "aws_ecs_cluster" "default" {
}

module "container_definition" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.21.0"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.41.0"
container_name = var.container_name
container_image = var.container_image
container_memory = var.container_memory
Expand All @@ -58,14 +59,14 @@ module "container_definition" {
}

module "ecs_alb_service_task" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.17.0"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.39.0"
namespace = var.namespace
stage = var.stage
name = var.name
attributes = var.attributes
delimiter = var.delimiter
alb_security_group = module.vpc.vpc_default_security_group_id
container_definition_json = module.container_definition.json
container_definition_json = module.container_definition.json_map_encoded_list
ecs_cluster_arn = aws_ecs_cluster.default.arn
launch_type = var.ecs_launch_type
vpc_id = module.vpc.vpc_id
Expand All @@ -87,6 +88,7 @@ module "ecs_alb_service_task" {
module "ecs_codepipeline" {
source = "../../"
namespace = var.namespace
environment = var.environment
stage = var.stage
name = var.name
region = var.region
Expand Down
8 changes: 4 additions & 4 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ output "vpc_cidr" {
}

output "container_definition_json" {
value = module.container_definition.json
description = "JSON encoded list of container definitions for use with other terraform resources such as aws_ecs_task_definition"
value = module.container_definition.json_map_encoded_list
description = "JSON encoded list of container definitions for use with other terraform resources such as `aws_ecs_task_definition`"
}

output "container_definition_json_map" {
value = module.container_definition.json_map
description = "JSON encoded container definitions for use with other terraform resources such as aws_ecs_task_definition"
value = module.container_definition.json_map_encoded
description = "JSON encoded container definitions for use with other terraform resources such as `aws_ecs_task_definition`"
}

output "ecs_cluster_id" {
Expand Down
8 changes: 7 additions & 1 deletion examples/complete/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "region" {
type = string
description = "AWS Region for S3 bucket"
description = "AWS Region"
}

variable "availability_zones" {
Expand All @@ -18,6 +18,12 @@ variable "namespace" {
description = "Namespace (e.g. `eg` or `cp`)"
}

variable "environment" {
type = string
default = ""
description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'"
}

variable "stage" {
type = string
description = "Stage (e.g. `prod`, `dev`, `staging`)"
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.12.0"
required_version = ">= 0.12.0"

required_providers {
aws = "~> 2.0"
Expand Down
Loading

0 comments on commit a32e6c8

Please sign in to comment.