Skip to content

Commit a32e6c8

Browse files
ostermanaknysh
andauthored
Additional TF 0.13 Fixes (#44)
* Support terraform 0.13 * Fix example * Fix example * Fix example * Fix example * Fix example * Fix example * Fix example Co-authored-by: aknysh <[email protected]>
1 parent 38908e8 commit a32e6c8

20 files changed

+231
-212
lines changed

.github/CODEOWNERS

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# Use this file to define individuals or teams that are responsible for code in a repository.
22
# Read more: <https://help.github.com/articles/about-codeowners/>
3+
#
4+
# Order is important: the last matching pattern takes the most precedence
35

4-
* @cloudposse/engineering
6+
# These owners will be the default owners for everything
7+
* @cloudposse/engineering @cloudposse/contributors
8+
9+
# Cloud Posse must review any changes to Makefiles
10+
**/Makefile @cloudposse/engineering
11+
**/Makefile.* @cloudposse/engineering
12+
13+
# Cloud Posse must review any changes to GitHub actions
14+
.github/* @cloudposse/engineering

.github/auto-release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '$MAJOR.$MINOR.$PATCH'
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
- 'enhancement'
12+
patch:
13+
labels:
14+
- 'patch'
15+
- 'fix'
16+
- 'bugfix'
17+
- 'bug'
18+
- 'hotfix'
19+
default: 'minor'
20+
21+
categories:
22+
- title: '🚀 Enhancements'
23+
labels:
24+
- 'enhancement'
25+
- title: '🐛 Bug Fixes'
26+
labels:
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- 'hotfix'
31+
32+
change-template: |
33+
<details>
34+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
35+
36+
$BODY
37+
</details>
38+
39+
template: |
40+
$CHANGES

.github/workflows/auto-release.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: auto-release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
semver:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
- uses: release-drafter/release-drafter@v5
14+
with:
15+
publish: true
16+
prerelease: false
17+
config-name: auto-release.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/chatops.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: "Handle common commands"
12-
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
12+
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
1313
with:
1414
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
1515
reaction-token: ${{ secrets.GITHUB_TOKEN }}
1616
repository: cloudposse/actions
1717
commands: rebuild-readme, terraform-fmt
18-
permission: none
18+
permission: triage
1919
issue-type: pull-request
2020

2121
test:
@@ -24,13 +24,13 @@ jobs:
2424
- name: "Checkout commit"
2525
uses: actions/checkout@v2
2626
- name: "Run tests"
27-
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
27+
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
2828
with:
2929
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
3030
reaction-token: ${{ secrets.GITHUB_TOKEN }}
3131
repository: cloudposse/actions
3232
commands: test
33-
permission: none
33+
permission: triage
3434
issue-type: pull-request
3535
reactions: false
3636

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Available targets:
175175
176176
| Name | Version |
177177
|------|---------|
178-
| terraform | >= 0.12.0, < 0.14.0 |
178+
| terraform | >= 0.12.0 |
179179
| aws | ~> 2.0 |
180180
| local | ~> 1.2 |
181181
| null | ~> 2.0 |
@@ -206,6 +206,7 @@ Available targets:
206206
| delimiter | Delimiter between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
207207
| ecs\_cluster\_name | ECS Cluster Name | `string` | n/a | yes |
208208
| enabled | Enable `CodePipeline` creation | `bool` | `true` | no |
209+
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
209210
| 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 |
210211
| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no |
211212
| github\_oauth\_token | GitHub OAuth Token with permissions to access private repositories | `string` | `""` | no |

docs/terraform.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Name | Version |
44
|------|---------|
5-
| terraform | >= 0.12.0, < 0.14.0 |
5+
| terraform | >= 0.12.0 |
66
| aws | ~> 2.0 |
77
| local | ~> 1.2 |
88
| null | ~> 2.0 |
@@ -33,6 +33,7 @@
3333
| delimiter | Delimiter between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
3434
| ecs\_cluster\_name | ECS Cluster Name | `string` | n/a | yes |
3535
| enabled | Enable `CodePipeline` creation | `bool` | `true` | no |
36+
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
3637
| 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 |
3738
| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no |
3839
| github\_oauth\_token | GitHub OAuth Token with permissions to access private repositories | `string` | `""` | no |

examples/complete/fixtures.us-east-2.tfvars

-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ webhook_enabled = false
104104

105105
s3_bucket_force_destroy = true
106106

107-
cache_type = "S3"
108-
109107
environment_variables = [
110108
{
111109
name = "APP_URL"

examples/complete/main.tf

+14-12
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ provider "aws" {
33
}
44

55
module "label" {
6-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.17.0"
7-
namespace = var.namespace
8-
name = var.name
9-
stage = var.stage
10-
delimiter = var.delimiter
11-
attributes = var.attributes
12-
tags = var.tags
6+
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.17.0"
7+
namespace = var.namespace
8+
environment = var.environment
9+
stage = var.stage
10+
name = var.name
11+
delimiter = var.delimiter
12+
attributes = var.attributes
13+
tags = var.tags
1314
}
1415

1516
module "vpc" {
16-
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.8.1"
17+
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.16.1"
1718
namespace = var.namespace
1819
stage = var.stage
1920
name = var.name
@@ -24,7 +25,7 @@ module "vpc" {
2425
}
2526

2627
module "subnets" {
27-
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.19.0"
28+
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.26.0"
2829
availability_zones = var.availability_zones
2930
namespace = var.namespace
3031
stage = var.stage
@@ -45,7 +46,7 @@ resource "aws_ecs_cluster" "default" {
4546
}
4647

4748
module "container_definition" {
48-
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.21.0"
49+
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.41.0"
4950
container_name = var.container_name
5051
container_image = var.container_image
5152
container_memory = var.container_memory
@@ -58,14 +59,14 @@ module "container_definition" {
5859
}
5960

6061
module "ecs_alb_service_task" {
61-
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.17.0"
62+
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.39.0"
6263
namespace = var.namespace
6364
stage = var.stage
6465
name = var.name
6566
attributes = var.attributes
6667
delimiter = var.delimiter
6768
alb_security_group = module.vpc.vpc_default_security_group_id
68-
container_definition_json = module.container_definition.json
69+
container_definition_json = module.container_definition.json_map_encoded_list
6970
ecs_cluster_arn = aws_ecs_cluster.default.arn
7071
launch_type = var.ecs_launch_type
7172
vpc_id = module.vpc.vpc_id
@@ -87,6 +88,7 @@ module "ecs_alb_service_task" {
8788
module "ecs_codepipeline" {
8889
source = "../../"
8990
namespace = var.namespace
91+
environment = var.environment
9092
stage = var.stage
9193
name = var.name
9294
region = var.region

examples/complete/outputs.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ output "vpc_cidr" {
1414
}
1515

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

2121
output "container_definition_json_map" {
22-
value = module.container_definition.json_map
23-
description = "JSON encoded container definitions for use with other terraform resources such as aws_ecs_task_definition"
22+
value = module.container_definition.json_map_encoded
23+
description = "JSON encoded container definitions for use with other terraform resources such as `aws_ecs_task_definition`"
2424
}
2525

2626
output "ecs_cluster_id" {

examples/complete/variables.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
variable "region" {
22
type = string
3-
description = "AWS Region for S3 bucket"
3+
description = "AWS Region"
44
}
55

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

21+
variable "environment" {
22+
type = string
23+
default = ""
24+
description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'"
25+
}
26+
2127
variable "stage" {
2228
type = string
2329
description = "Stage (e.g. `prod`, `dev`, `staging`)"

examples/complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = "~> 0.12.0"
2+
required_version = ">= 0.12.0"
33

44
required_providers {
55
aws = "~> 2.0"

0 commit comments

Comments
 (0)