Skip to content

Commit 853d20a

Browse files
Various fixes and improvements. Use latest Security Group module. Bump module versions. Update GitHub workflows (#203)
* Update module versions and GitHub workflows * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Auto Format * Update module versions, add shared ALB * Auto Format * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Auto Format * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Update module versions, add shared ALB * Updates * Updates * Updates Co-authored-by: cloudpossebot <[email protected]>
1 parent d69a432 commit 853d20a

36 files changed

+2511
-597
lines changed

.github/CODEOWNERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
# Cloud Posse must review any changes to standard context definition,
1717
# but some changes can be rubber-stamped.
18-
**/*.tf @cloudposse/engineering @cloudposse/approvers
19-
README.yaml @cloudposse/engineering @cloudposse/approvers
18+
**/*.tf @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
19+
README.yaml @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2020
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2121
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2222

.github/auto-release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ version-resolver:
1717
- 'bugfix'
1818
- 'bug'
1919
- 'hotfix'
20+
- 'no-release'
2021
default: 'minor'
2122

2223
categories:
@@ -46,7 +47,7 @@ template: |
4647
4748
replacers:
4849
# Remove irrelevant information from Renovate bot
49-
- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm'
50+
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
5051
replace: ''
5152
# Remove Renovate bot banner image
5253
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'

.github/mergify.yml

+7
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ pull_request_rules:
5656
changes_requested: true
5757
approved: true
5858
message: "This Pull Request has been updated, so we're dismissing all reviews."
59+
60+
- name: "close Pull Requests without files changed"
61+
conditions:
62+
- "#files=0"
63+
actions:
64+
close:
65+
message: "This pull request has been automatically closed by Mergify because there are no longer any changes."

.github/workflows/auto-format.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
auto-format:
88
runs-on: ubuntu-latest
9-
container: cloudposse/build-harness:slim-latest
9+
container: cloudposse/build-harness:latest
1010
steps:
1111
# Checkout the pull request branch
1212
# "An action in a workflow run can’t trigger a new workflow run. For example, if an action pushes code using
@@ -29,6 +29,8 @@ jobs:
2929
- name: Auto Format
3030
if: github.event.pull_request.state == 'open'
3131
shell: bash
32+
env:
33+
GITHUB_TOKEN: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
3234
run: make BUILD_HARNESS_PATH=/build-harness PACKAGES_PREFER_HOST=true -f /build-harness/templates/Makefile.build-harness pr/auto-format/host
3335

3436
# Commit changes (if any) to the PR branch

.github/workflows/auto-release.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ name: auto-release
33
on:
44
push:
55
branches:
6-
- master
6+
- main
7+
- master
8+
- production
79

810
jobs:
911
publish:
1012
runs-on: ubuntu-latest
1113
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.PUBLIC_REPO_ACCESS_TOKEN }}
14+
# Get PR from merged commit to master
15+
- uses: actions-ecosystem/action-get-merged-pull-request@v1
16+
id: get-merged-pull-request
17+
with:
18+
github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
19+
# Drafts your next Release notes as Pull Requests are merged into "main"
20+
- uses: release-drafter/release-drafter@v5
21+
with:
22+
publish: ${{ !contains(steps.get-merged-pull-request.outputs.labels, 'no-release') }}
23+
prerelease: false
24+
config-name: auto-release.yml
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}

.github/workflows/validate-codeowners.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Validate Codeowners
22
on:
3+
workflow_dispatch:
4+
35
pull_request:
46

57
jobs:

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2017-2020 Cloud Posse, LLC
189+
Copyright 2017-2022 Cloud Posse, LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

+120-92
Large diffs are not rendered by default.

README.yaml

+94-79
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@ related:
4949
description: "Terraform Module to define an ElasticBeanstalk Application"
5050
url: "https://github.com/cloudposse/terraform-aws-elastic-beanstalk-application"
5151
- name: "geodesic"
52-
description: " Geodesic is the fastest way to get up and running with a rock solid, production grade cloud platform built on strictly Open Source tools."
52+
description: "Geodesic is the fastest way to get up and running with a rock solid, production grade cloud platform built on strictly Open Source tools."
5353
url: "https://github.com/cloudposse/geodesic"
5454
- name: "terraform-aws-elasticache-cloudwatch-sns-alarms"
55-
description: " Terraform module that configures CloudWatch SNS alerts for ElastiCache"
55+
description: "Terraform module that configures CloudWatch SNS alerts for ElastiCache"
5656
url: "https://github.com/cloudposse/terraform-aws-elasticache-cloudwatch-sns-alarms"
57+
- name: "General options for all Elastic Beanstalk environments"
58+
description: "General configuration options for all Elastic Beanstalk environments"
59+
url: "https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html"
5760

5861
# Short description of this project
5962
description: |-
@@ -76,108 +79,120 @@ usage: |-
7679
provider "aws" {
7780
region = var.region
7881
}
79-
82+
8083
module "vpc" {
81-
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.8.0"
82-
namespace = var.namespace
83-
stage = var.stage
84-
name = var.name
84+
source = "cloudposse/vpc/aws"
85+
# Cloud Posse recommends pinning every module to a specific version
86+
version = "x.x.x"
87+
8588
cidr_block = "172.16.0.0/16"
89+
90+
context = module.this.context
8691
}
87-
92+
8893
module "subnets" {
89-
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.16.0"
94+
source = "cloudposse/dynamic-subnets/aws"
95+
# Cloud Posse recommends pinning every module to a specific version
96+
version = "x.x.x"
97+
9098
availability_zones = var.availability_zones
91-
namespace = var.namespace
92-
stage = var.stage
93-
name = var.name
9499
vpc_id = module.vpc.vpc_id
95100
igw_id = module.vpc.igw_id
96101
cidr_block = module.vpc.vpc_cidr_block
97102
nat_gateway_enabled = true
98103
nat_instance_enabled = false
104+
105+
context = module.this.context
99106
}
100-
107+
101108
module "elastic_beanstalk_application" {
102-
source = "git::https://github.com/cloudposse/terraform-aws-elastic-beanstalk-application.git?ref=tags/0.3.0"
103-
namespace = var.namespace
104-
stage = var.stage
105-
name = var.name
106-
description = "Test elastic_beanstalk_application"
109+
source = "cloudposse/elastic-beanstalk-application/aws"
110+
# Cloud Posse recommends pinning every module to a specific version
111+
version = "x.x.x"
112+
113+
description = "Test Elastic Beanstalk application"
114+
115+
context = module.this.context
107116
}
108-
117+
109118
module "elastic_beanstalk_environment" {
110-
source = "cloudposse/elastic-beanstalk-environment/aws"
111-
# Cloud Posse recommends pinning every module to a specific version
112-
# version = "x.x.x"
113-
namespace = var.namespace
114-
stage = var.stage
115-
name = var.name
116-
description = "Test elastic_beanstalk_environment"
117-
region = var.region
118-
availability_zone_selector = "Any 2"
119-
dns_zone_id = var.dns_zone_id
119+
source = "../../"
120+
121+
description = var.description
122+
region = var.region
123+
availability_zone_selector = var.availability_zone_selector
124+
dns_zone_id = var.dns_zone_id
125+
126+
wait_for_ready_timeout = var.wait_for_ready_timeout
120127
elastic_beanstalk_application_name = module.elastic_beanstalk_application.elastic_beanstalk_application_name
121-
122-
instance_type = "t3.small"
123-
autoscale_min = 1
124-
autoscale_max = 2
125-
updating_min_in_service = 0
126-
updating_max_batch = 1
127-
128-
loadbalancer_type = "application"
128+
environment_type = var.environment_type
129+
loadbalancer_type = var.loadbalancer_type
130+
elb_scheme = var.elb_scheme
131+
tier = var.tier
132+
version_label = var.version_label
133+
force_destroy = var.force_destroy
134+
135+
instance_type = var.instance_type
136+
root_volume_size = var.root_volume_size
137+
root_volume_type = var.root_volume_type
138+
139+
autoscale_min = var.autoscale_min
140+
autoscale_max = var.autoscale_max
141+
autoscale_measure_name = var.autoscale_measure_name
142+
autoscale_statistic = var.autoscale_statistic
143+
autoscale_unit = var.autoscale_unit
144+
autoscale_lower_bound = var.autoscale_lower_bound
145+
autoscale_lower_increment = var.autoscale_lower_increment
146+
autoscale_upper_bound = var.autoscale_upper_bound
147+
autoscale_upper_increment = var.autoscale_upper_increment
148+
129149
vpc_id = module.vpc.vpc_id
130150
loadbalancer_subnets = module.subnets.public_subnet_ids
131151
application_subnets = module.subnets.private_subnet_ids
132-
security_group_rules = [
133-
{
134-
type = "egress"
135-
from_port = 0
136-
to_port = 65535
137-
protocol = "-1"
138-
cidr_blocks = ["0.0.0.0/0"]
139-
source_security_group_id = null
140-
description = "Allow all outbound traffic"
141-
},
152+
153+
allow_all_egress = true
154+
155+
additional_security_group_rules = [
142156
{
143157
type = "ingress"
144158
from_port = 0
145159
to_port = 65535
146160
protocol = "-1"
147-
source_security_group_id = [module.vpc.vpc_default_security_group_id]
148-
cidr_blocks = null
149-
description = "Allow all ingress traffic from trusted Security Groups"
150-
},
161+
source_security_group_id = module.vpc.vpc_default_security_group_id
162+
description = "Allow all inbound traffic from trusted Security Groups"
163+
}
151164
]
165+
166+
rolling_update_enabled = var.rolling_update_enabled
167+
rolling_update_type = var.rolling_update_type
168+
updating_min_in_service = var.updating_min_in_service
169+
updating_max_batch = var.updating_max_batch
170+
171+
healthcheck_url = var.healthcheck_url
172+
application_port = var.application_port
173+
174+
solution_stack_name = var.solution_stack_name
175+
additional_settings = var.additional_settings
176+
env_vars = var.env_vars
177+
178+
extended_ec2_policy_document = data.aws_iam_policy_document.minimal_s3_permissions.json
179+
prefer_legacy_ssm_policy = false
152180
prefer_legacy_service_policy = false
153-
154-
// https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html
155-
// https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.docker
156-
solution_stack_name = "64bit Amazon Linux 2018.03 v2.12.17 running Docker 18.06.1-ce"
157-
158-
additional_settings = [
159-
{
160-
namespace = "aws:elasticbeanstalk:application:environment"
161-
name = "DB_HOST"
162-
value = "xxxxxxxxxxxxxx"
163-
},
164-
{
165-
namespace = "aws:elasticbeanstalk:application:environment"
166-
name = "DB_USERNAME"
167-
value = "yyyyyyyyyyyyy"
168-
},
169-
{
170-
namespace = "aws:elasticbeanstalk:application:environment"
171-
name = "DB_PASSWORD"
172-
value = "zzzzzzzzzzzzzzzzzzz"
173-
},
174-
{
175-
namespace = "aws:elasticbeanstalk:application:environment"
176-
name = "ANOTHER_ENV_VAR"
177-
value = "123456789"
178-
}
181+
scheduled_actions = var.scheduled_actions
182+
183+
context = module.this.context
184+
}
185+
186+
data "aws_iam_policy_document" "minimal_s3_permissions" {
187+
statement {
188+
sid = "AllowS3OperationsOnElasticBeanstalkBuckets"
189+
actions = [
190+
"s3:ListAllMyBuckets",
191+
"s3:GetBucketLocation"
179192
]
193+
resources = ["*"]
180194
}
195+
}
181196
```
182197
183198
include:
@@ -188,11 +203,11 @@ include:
188203
contributors:
189204
- name: "Erik Osterman"
190205
homepage: "https://github.com/osterman"
191-
avatar: "http://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144"
206+
avatar: "https://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144"
192207
github: "osterman"
193208
- name: "Igor Rodionov"
194209
homepage: "https://github.com/goruha/"
195-
avatar: "http://s.gravatar.com/avatar/bc70834d32ed4517568a1feb0b9be7e2?s=144"
210+
avatar: "https://s.gravatar.com/avatar/bc70834d32ed4517568a1feb0b9be7e2?s=144"
196211
github: "goruha"
197212
- name: "Andriy Knysh"
198213
homepage: "https://github.com/aknysh/"

0 commit comments

Comments
 (0)