Skip to content

Commit 7212e53

Browse files
Merge pull request #14 from terraform-aws-modules/simplify_region_var_in_tests
Simplifying tests (region) and defaulting to HTTP. Resolves #2
2 parents 76bb17b + e5e1959 commit 7212e53

File tree

9 files changed

+24
-8
lines changed

9 files changed

+24
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ before_script:
3434
- terraform -v
3535

3636
script:
37-
- echo 'before_script'
37+
- echo 'script'
3838
# no terraform through docker until kitchen-terraform supports it
3939
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light init
4040
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light fmt -check=true

CHANGELOG.md

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

7+
## [2.1.0] - 2017-11-16
8+
#### Added
9+
* outputs added for listeners - these can be useful for ECR integration (🍰 @mbolek).
10+
* Moved default `alb_protocols` to HTTP to lower barier of entry in getting started.
11+
712
## [2.0.0] - 2017-11-06
813
#### Added
914
* added `create_log_bucket` and `enable_logging` to help control logging more granularly.

Gemfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
ruby '2.4.2'
22

33
source 'https://rubygems.org/' do
4-
gem 'test-kitchen'
5-
gem 'kitchen-terraform'
6-
gem 'awspec'
4+
gem 'kitchen-terraform', '~> 2.0'
75
gem 'kitchen-verifier-awspec'
6+
gem 'awspec'
87
gem 'rhcl'
98
end

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module "alb" {
4141
alb_security_groups = ["sg-edcd9784", "sg-edcd9785"]
4242
vpc_id = "vpc-abcde012"
4343
subnets = ["subnet-abcde012", "subnet-bcde012a"]
44+
alb_protocols = ["HTTPS"]
4445
certificate_arn = "arn:aws:iam::123456789012:server-certificate/test_cert-123456789012"
4546
create_log_bucket = true
4647
enable_logging = true
@@ -88,6 +89,7 @@ The [changelog](https://github.com/terraform-aws-modules/terraform-aws-alb/tree/
8889

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

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

examples/test_fixtures/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ module "alb" {
4747
vpc_id = "${module.vpc.vpc_id}"
4848
subnets = "${module.vpc.public_subnets}"
4949
certificate_arn = "${aws_iam_server_certificate.fixture_cert.arn}"
50+
alb_protocols = ["HTTPS"]
5051
health_check_path = "/"
5152
create_log_bucket = true
5253
enable_logging = true

examples/test_fixtures/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ output "sg_id" {
1717
output "account_id" {
1818
value = "${data.aws_caller_identity.fixtures.account_id}"
1919
}
20+
21+
output "region" {
22+
value = "${var.region}"
23+
}

examples/test_fixtures/variables.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ variable "log_location_prefix" {
22
default = "my-alb-logs"
33
}
44

5-
variable "region" {}
5+
variable "region" {
6+
default = "us-west-2"
7+
}

test/integration/default/local_alb.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33

44
module_vars = Rhcl.parse(File.open('examples/test_fixtures/variables.tf'))
55
log_location_prefix = module_vars['variable']['log_location_prefix']['default']
6+
67
tf_state = JSON.parse(File.open('.kitchen/kitchen-terraform/default-aws/terraform.tfstate').read)
78
principal_account_id = tf_state['modules'][0]['outputs']['principal_account_id']['value']
89
account_id = tf_state['modules'][0]['outputs']['account_id']['value']
910
vpc_id = tf_state['modules'][0]['outputs']['vpc_id']['value']
1011
security_group_id = tf_state['modules'][0]['outputs']['sg_id']['value']
1112
account_id = tf_state['modules'][0]['outputs']['account_id']['value']
13+
region = tf_state['modules'][0]['outputs']['region']['value']
14+
ENV['AWS_REGION'] = region
1215
# this must match the format in examples/test_fixtures/locals.tf
13-
log_bucket_name = 'logs-' + ENV['AWS_REGION'] + '-' + account_id
16+
log_bucket_name = 'logs-' + region + '-' + account_id
1417
# subnet_ids = tf_state['modules'][0]['outputs']['subnet_ids']['value']
1518

1619
describe alb('my-alb') do

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ variable "alb_name" {
88
}
99

1010
variable "alb_protocols" {
11-
description = "The protocols the ALB accepts. e.g.: [\"HTTPS\"]"
11+
description = "The protocols the ALB accepts. e.g.: [\"HTTP\"]"
1212
type = "list"
13-
default = ["HTTPS"]
13+
default = ["HTTP"]
1414
}
1515

1616
variable "alb_security_groups" {

0 commit comments

Comments
 (0)