Skip to content

Commit 64d8ff5

Browse files
kicking v2.4.0 out the door (#35)
* Remove `region` input. If you'd like to customise the AWS provider configuration, this is supported using the new `providers` input which is a core Terraform feature. [Read more.](https://www.terraform.io/docs/modules/usage.html#providers-within-modules) * update CI to use terraform 0.11.2 and KT 3.1.0. * `alb_arn_suffix` output added for external consumption. * Several formatting changes to adhere to convention.
1 parent c74dfb9 commit 64d8ff5

File tree

16 files changed

+144
-124
lines changed

16 files changed

+144
-124
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
.kitchen
77
.kitchen.local.yml
88
Gemfile.lock
9+
terraform.tfstate.d

.kitchen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ suites:
1919
verifier:
2020
name: "awspec"
2121
patterns:
22-
- "test/integration/default/local_alb.rb"
22+
- "test/integration/default/test_alb.rb"

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.2

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ before_script:
2121
- export AWS_REGION=$(docker run --env AWS_DEFAULT_REGION=us-east-2 --env AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} --env AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} garland/aws-cli-docker aws ec2 describe-regions --query 'Regions[].{Name:RegionName}' --output text | shuf | head -n1)
2222
- export TF_VAR_region=${AWS_REGION}
2323
- echo "using AWS_REGION=${AWS_REGION}"
24-
- curl --silent --output terraform.zip https://releases.hashicorp.com/terraform/0.11.0/terraform_0.11.0_linux_amd64.zip
25-
- sha256sum terraform.zip | grep "402b4333792967986383670134bb52a8948115f83ab6bda35f57fa2c3c9e9279" -q
24+
- curl --silent --output terraform.zip https://releases.hashicorp.com/terraform/0.11.2/terraform_0.11.2_linux_amd64.zip
25+
- sha256sum terraform.zip | grep "f728fa73ff2a4c4235a28de4019802531758c7c090b6ca4c024d48063ab8537b" -q
2626
- unzip terraform.zip ; rm -f terraform.zip; chmod +x terraform
2727
- mkdir -p ${HOME}/bin ; export PATH=${PATH}:${HOME}/bin; mv terraform ${HOME}/bin/
2828
- terraform -v

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
66
project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## [v2.4.0] - Unreleased
8+
## [v2.4.0] - 2018-01-19
99

1010
* Remove `region` input. If you'd like to customise the AWS provider configuration, this is supported using the new `providers` input which is a core Terraform feature. [Read more.](https://www.terraform.io/docs/modules/usage.html#providers-within-modules)
11+
* update CI to use terraform 0.11.2 and KT 3.1.0.
12+
* `alb_arn_suffix` output added for external consumption.
13+
* Several formatting changes to adhere to convention.
1114

1215
## [v2.3.2] - 2017-12-18
1316

@@ -114,8 +117,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
114117

115118
### Changed
116119

117-
* Restructured project templates to alb dir to add testing. This is a breaking
118-
change so upping major version.
120+
* Restructured project templates to alb dir to add testing. This is a breaking change so upping major version.
119121
* Redundant examples dir removed
120122
* Updated documentation
121123

Gemfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# frozen_string_literal: true
2+
13
ruby '2.4.2'
24

35
source 'https://rubygems.org/' do
4-
gem 'kitchen-verifier-awspec'
5-
gem 'rhcl'
6-
gem 'awspec'
7-
gem 'kitchen-terraform', '>= 3.0.0'
6+
gem 'awspec', '~> 1.0.0'
7+
gem 'kitchen-terraform', '~> 3.1'
8+
gem 'kitchen-verifier-awspec', '~> 0.1.1'
9+
gem 'rhcl', '~> 0.1.0'
810
end

README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# terraform-aws-alb
2+
23
A Terraform module containing common configurations for an AWS Application Load
34
Balancer (ALB) running over HTTP/HTTPS. Available through the [terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/alb/aws).
45

@@ -7,33 +8,38 @@ Balancer (ALB) running over HTTP/HTTPS. Available through the [terraform registr
78
| master | [![build Status](https://travis-ci.org/terraform-aws-modules/terraform-aws-alb.svg?branch=master)](https://travis-ci.org/terraform-aws-modules/terraform-aws-alb) |
89

910
## Assumptions
11+
1012
* You want to create a set of resources for the ALB: namely an associated target group and listener.
11-
* You've created a Virtual Private Cloud (VPC) + subnets where you intend to put
12-
this ALB.
13+
* You've created a Virtual Private Cloud (VPC) + subnets where you intend to put this ALB.
1314
* You have one or more security groups to attach to the ALB.
1415
* You want to configure a listener for HTTPS/HTTP
1516
* You've uploaded an SSL certificate to AWS IAM if using HTTPS
1617

1718
The module supports both (mutually exclusive):
19+
1820
* Internal IP ALBs
1921
* External IP ALBs
2022

2123
It's recommended you use this module with [terraform-aws-vpc](https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws),
2224
[terraform-aws-security-group](https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws), and
2325
[terraform-aws-autoscaling](https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws/).
2426

25-
## Why ALB instead of ELB?
27+
## Why ALB instead of ELB
28+
2629
The use-case presented here appears almost identical to how one would use an ELB
2730
but we inherit a few bonuses by moving to ALB. Those are best outlined in [AWS's
2831
documentation](https://aws.amazon.com/elasticloadbalancing/applicationloadbalancer/).
2932
For an example of using ALB with ECS look no further than the [hashicorp example](https://github.com/terraform-providers/terraform-provider-aws/blob/master/examples/ecs-alb).
3033

3134
## Resources, inputs, outputs
35+
3236
[Resources](https://registry.terraform.io/modules/terraform-aws-modules/alb/aws?tab=resources), [inputs](https://registry.terraform.io/modules/terraform-aws-modules/alb/aws?tab=inputs), and [outputs](https://registry.terraform.io/modules/terraform-aws-modules/alb/aws?tab=outputs) documented in the terraform registry.
3337

3438
## Usage example
39+
3540
A full example leveraging other community modules is contained in the [examples/test_fixtures directory](https://github.com/terraform-aws-modules/terraform-aws-alb/tree/master/examples/test_fixtures). Here's the gist of using it via the Terraform registry:
36-
```
41+
42+
```hcl
3743
module "alb" {
3844
source = "terraform-aws-modules/alb/aws"
3945
alb_name = "my-alb"
@@ -46,7 +52,7 @@ module "alb" {
4652
create_log_bucket = true
4753
enable_logging = true
4854
log_bucket_name = "logs-us-east-2-123456789012"
49-
log_location_prefix = "my-alb-logs"
55+
log_location_prefix = "my-alb-logs
5056
health_check_path = "/"
5157
5258
tags {
@@ -55,41 +61,48 @@ module "alb" {
5561
}
5662
}
5763
```
58-
3. Always `terraform plan` to see your change before running `terraform apply`.
59-
4. Win the day!
6064

6165
## Testing
66+
6267
This module has been packaged with [awspec](https://github.com/k1LoW/awspec) tests through test kitchen. To run them:
68+
6369
1. Install [rvm](https://rvm.io/rvm/install) and the ruby version specified in the [Gemfile](https://github.com/terraform-aws-modules/terraform-aws-alb/tree/master/Gemfile).
64-
2. Install bundler and the gems from our Gemfile:
65-
```
70+
1. Install bundler and the gems from our Gemfile:
71+
72+
```bash
6673
gem install bundler; bundle install
6774
```
68-
3. Ensure your AWS environment is configured (i.e. credentials and region) for test and set TF_VAR_region to a valid AWS region (e.g. `export TF_VAR_region=${AWS_REGION}`).
69-
4. Test using `kitchen test` from the root of the repo.
75+
76+
1. Ensure your AWS environment is configured (i.e. credentials and region) for test and set TF_VAR_region to a valid AWS region (e.g. `export TF_VAR_region=${AWS_REGION}`).
77+
1. Test using `kitchen test` from the root of the repo.
7078

7179
## Contributing
80+
7281
Report issues/questions/feature requests on in the [Issues](https://github.com/terraform-aws-modules/terraform-aws-alb/issues) section.
7382

7483
Pull requests are welcome! Ideally create a feature branch and issue for every
7584
individual change made. These are the steps:
7685

7786
1. Fork the repo to a personal space or org.
78-
2. Create your feature branch from master (`git checkout -b my-new-feature`).
79-
4. Commit your awesome changes (`git commit -am 'Added some feature'`).
80-
5. Push to the branch (`git push origin my-new-feature`).
81-
6. Create a new Pull Request and tell us about your changes.
87+
1. Create your feature branch from master (`git checkout -b my-new-feature`).
88+
1. Commit your awesome changes (`git commit -am 'Added some feature'`).
89+
1. Push to the branch (`git push origin my-new-feature`).
90+
1. Create a new Pull Request and tell us about your changes.
8291

8392
## IAM Permissions
93+
8494
Testing and using this repo requires a minimum set of IAM permissions. Test permissions
8595
are listed in the [test_fixtures README](https://github.com/terraform-aws-modules/terraform-aws-alb/tree/master/examples/test_fixtures/README.md).
8696

8797
## Change log
98+
8899
The [changelog](https://github.com/terraform-aws-modules/terraform-aws-alb/tree/master/CHANGELOG.md) captures all important release notes.
89100

90101
## Authors
102+
91103
Created and maintained by [Brandon O'Connor](https://github.com/brandoconnor) - [email protected].
92104
Many thanks to [the contributers listed here](https://github.com/terraform-aws-modules/terraform-aws-alb/graphs/contributors)!
93105

94106
## License
107+
95108
MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-alb/tree/master/LICENSE) for full details.

data.tf

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@ data "aws_elb_service_account" "main" {}
44

55
data "aws_iam_policy_document" "bucket_policy" {
66
statement {
7-
sid = "AllowToPutLoadBalancerLogsToS3Bucket"
8-
9-
actions = [
10-
"s3:PutObject",
11-
]
12-
13-
resources = [
14-
"arn:aws:s3:::${var.log_bucket_name}/${var.log_location_prefix}/AWSLogs/${data.aws_caller_identity.current.account_id}/*",
15-
]
7+
sid = "AllowToPutLoadBalancerLogsToS3Bucket"
8+
actions = ["s3:PutObject"]
9+
resources = ["arn:aws:s3:::${var.log_bucket_name}/${var.log_location_prefix}/AWSLogs/${data.aws_caller_identity.current.account_id}/*"]
1610

1711
principals {
1812
type = "AWS"

examples/test_fixtures/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# test_fixtures example
2+
23
This set of templates serves two purposes:
34

4-
0. it shows developers how to use the module in a straightforward way as integrated with other terraform community supported modules.
5+
1. it shows developers how to use the module in a straightforward way as integrated with other terraform community supported modules.
56
1. serves as the test infrastructure for CI on the project.
67

78
## IAM Permissions
9+
810
The following IAM policy is the minimum needed to execute the module from the test suite.
9-
```
11+
12+
```json
1013
{
1114
"Version": "2012-10-17",
1215
"Statement": [
@@ -103,5 +106,4 @@ The following IAM policy is the minimum needed to execute the module from the te
103106
}
104107
]
105108
}
106-
107109
```

examples/test_fixtures/data.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
data "aws_caller_identity" "fixtures" {}
1+
data "aws_caller_identity" "current" {}
22

33
data "aws_availability_zones" "available" {}
4+
5+
data "aws_region" "current" {
6+
current = true
7+
}

0 commit comments

Comments
 (0)