Skip to content

Commit ca654e4

Browse files
release prep and rubocop compliance (#48)
1 parent 91c031a commit ca654e4

File tree

5 files changed

+49
-34
lines changed

5 files changed

+49
-34
lines changed

CHANGELOG.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,39 @@ 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.5.0] - 2018-03-07
9+
10+
### Added
11+
12+
* `target_type` variable for targeting IPs rather than instances (nice, @angusfz 👌)
13+
* Added variables for controlling front door ALB listening ports (thanks, @egarbi ✨)
14+
* output for `target_group_name` for external consumption (boom! @ndench 🐱‍🐉)
15+
16+
### Changed
17+
18+
* Clarified variable description and bucket policy (right on, @angstwad 👏)
19+
* Docs and var description updates (everything helps, @tehmaspc 🦑)
20+
821
## [v2.4.0] - 2018-01-19
922

10-
* 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)
23+
### Added
24+
25+
* `alb_arn_suffix` output added for external consumption. (props, @mbolek 🐱‍🏍)
26+
* variables to control listener ports (wunderbar, @egarbi 🙌)
27+
28+
### Changed
29+
30+
* Remove `region` input. If you'd like to customise the AWS provider configuration,
31+
this is supported using the new `providers` input which is a core Terraform feature.
32+
[Read more.](https://www.terraform.io/docs/modules/usage.html#providers-within-modules)
1133
* update CI to use terraform 0.11.2 and KT 3.1.0.
12-
* `alb_arn_suffix` output added for external consumption.
1334
* Several formatting changes to adhere to convention.
1435

1536
## [v2.3.2] - 2017-12-18
1637

1738
### Added
1839

19-
* ARN outputs of listeners for reuse outside the module. (thanks, proj4spes! 👌)
40+
* ARN outputs of listeners for reuse outside the module. (thanks, @proj4spes! 👌)
2041

2142
## [v2.3.1] - 2017-11-27
2243

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

118139
### Changed
119140

120-
* Restructured project templates to alb dir to add testing. This is a breaking change so upping major version.
141+
* Restructured project templates to alb dir to add testing. This is a breaking
142+
change so upping major version.
121143
* Redundant examples dir removed
122144
* Updated documentation
123145

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This module has been packaged with [awspec](https://github.com/k1LoW/awspec) tes
6565
1. Install bundler and the gems from our Gemfile:
6666

6767
```bash
68-
gem install bundler; bundle install
68+
gem install bundler && bundle install
6969
```
7070

7171
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}`).

examples/test_fixtures/data.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ data "aws_caller_identity" "current" {}
22

33
data "aws_availability_zones" "available" {}
44

5-
data "aws_region" "current" {
6-
current = true
7-
}
5+
data "aws_region" "current" {}

test/integration/default/test_alb.rb

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,29 @@
1010
state_file = 'terraform.tfstate.d/kitchen-terraform-default-aws/terraform.tfstate'
1111
tf_state = JSON.parse(File.open(state_file).read)
1212
principal_account_id = tf_state['modules'][0]['outputs']['principal_account_id']['value']
13-
# rubocop:enable LineLength
14-
account_id = tf_state['modules'][0]['outputs']['account_id']['value']
15-
vpc_id = tf_state['modules'][0]['outputs']['vpc_id']['value']
16-
security_group_id = tf_state['modules'][0]['outputs']['sg_id']['value']
1713
account_id = tf_state['modules'][0]['outputs']['account_id']['value']
1814
region = tf_state['modules'][0]['outputs']['region']['value']
1915
ENV['AWS_REGION'] = region
2016
# this must match the format in examples/test_fixtures/locals.tf
2117
log_bucket_name = 'logs-' + region + '-' + account_id
18+
policy = "{
19+
\"Version\": \"2012-10-17\",
20+
\"Statement\": [
21+
{
22+
\"Sid\": \"AllowToPutLoadBalancerLogsToS3Bucket\",
23+
\"Effect\": \"Allow\",
24+
\"Principal\": {
25+
\"AWS\": \"arn:aws:iam::#{principal_account_id}:root\"
26+
},
27+
\"Action\": \"s3:PutObject\",
28+
\"Resource\": \"arn:aws:s3:::#{log_bucket_name}/#{log_location_prefix}/AWSLogs/#{account_id}/*\"
29+
}
30+
]
31+
}"
32+
# rubocop:enable LineLength
33+
log_object = "#{log_location_prefix}/AWSLogs/#{account_id}/ELBAccessLogTestFile"
34+
vpc_id = tf_state['modules'][0]['outputs']['vpc_id']['value']
35+
security_group_id = tf_state['modules'][0]['outputs']['sg_id']['value']
2236

2337
describe alb('test-alb') do
2438
it { should exist }
@@ -42,25 +56,6 @@
4256

4357
describe s3_bucket(log_bucket_name) do
4458
it { should exist }
45-
# rubocop:disable LineLength
46-
it { should have_object("#{log_location_prefix}/AWSLogs/#{account_id}/ELBAccessLogTestFile") }
47-
it do
48-
should have_policy <<~POLICY
49-
{
50-
"Version": "2012-10-17",
51-
"Statement": [
52-
{
53-
"Sid": "AllowToPutLoadBalancerLogsToS3Bucket",
54-
"Effect": "Allow",
55-
"Principal": {
56-
"AWS": "arn:aws:iam::#{principal_account_id}:root"
57-
},
58-
"Action": "s3:PutObject",
59-
"Resource": "arn:aws:s3:::#{log_bucket_name}/#{log_location_prefix}/AWSLogs/#{account_id}/*"
60-
}
61-
]
62-
}
63-
POLICY
64-
end
65-
# rubocop:enable LineLength
59+
it { should have_object(log_object) }
60+
it { should have_policy(policy) }
6661
end

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.4.0
1+
v2.5.0

0 commit comments

Comments
 (0)