Skip to content

Commit d70e308

Browse files
authored
Update module versions. Update terratest (#26)
* Update module versions. Update terratest * Update module versions. Update terratest
1 parent 19ef683 commit d70e308

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

Diff for: 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 2019 Cloud Posse, LLC
189+
Copyright 2019-2021 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.

Diff for: examples/complete/main.tf

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ provider "aws" {
1515
}
1616

1717
module "vpc" {
18-
source = "cloudposse/vpc/aws"
19-
version = "0.18.1"
18+
source = "cloudposse/vpc/aws"
19+
version = "0.20.1"
20+
2021
cidr_block = var.vpc_cidr_block
2122

2223
context = module.this.context
2324
}
2425

2526
module "subnets" {
26-
source = "cloudposse/dynamic-subnets/aws"
27-
version = "0.33.0"
27+
source = "cloudposse/dynamic-subnets/aws"
28+
version = "0.37.0"
29+
2830
availability_zones = var.availability_zones
2931
vpc_id = module.vpc.vpc_id
3032
igw_id = module.vpc.igw_id

Diff for: main.tf

+7-5
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ resource "aws_docdb_cluster_instance" "default" {
6969
cluster_identifier = join("", aws_docdb_cluster.default.*.id)
7070
apply_immediately = var.apply_immediately
7171
instance_class = var.instance_class
72-
tags = module.this.tags
7372
engine = var.engine
7473
auto_minor_version_upgrade = var.auto_minor_version_upgrade
74+
tags = module.this.tags
7575
}
7676

7777
resource "aws_docdb_subnet_group" "default" {
@@ -109,8 +109,9 @@ locals {
109109
}
110110

111111
module "dns_master" {
112-
source = "cloudposse/route53-cluster-hostname/aws"
113-
version = "0.8.0"
112+
source = "cloudposse/route53-cluster-hostname/aws"
113+
version = "0.11.0"
114+
114115
enabled = module.this.enabled && var.zone_id != "" ? true : false
115116
dns_name = local.cluster_dns_name
116117
zone_id = var.zone_id
@@ -120,8 +121,9 @@ module "dns_master" {
120121
}
121122

122123
module "dns_replicas" {
123-
source = "cloudposse/route53-cluster-hostname/aws"
124-
version = "0.8.0"
124+
source = "cloudposse/route53-cluster-hostname/aws"
125+
version = "0.11.0"
126+
125127
enabled = module.this.enabled && var.zone_id != "" ? true : false
126128
dns_name = local.replicas_dns_name
127129
zone_id = var.zone_id

Diff for: test/src/examples_complete_test.go

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package test
22

33
import (
44
"fmt"
5+
"math/rand"
6+
"strconv"
57
"testing"
8+
"time"
69

710
"github.com/gruntwork-io/terratest/modules/terraform"
811
"github.com/stretchr/testify/assert"
@@ -12,13 +15,21 @@ import (
1215
func TestExamplesComplete(t *testing.T) {
1316
t.Parallel()
1417

18+
rand.Seed(time.Now().UnixNano())
19+
20+
randId := strconv.Itoa(rand.Intn(100000))
21+
attributes := []string{randId}
22+
1523
// We need to create the ALB first because terraform does not wwait for it to be in the ready state before creating ECS target group
1624
terraformOptions := &terraform.Options{
1725
// The path to where our Terraform code is located
1826
TerraformDir: "../../examples/complete",
1927
Upgrade: true,
2028
// Variables to pass to our Terraform code using -var-file options
2129
VarFiles: []string{"fixtures.us-east-2.tfvars"},
30+
Vars: map[string]interface{}{
31+
"attributes": attributes,
32+
},
2233
}
2334

2435
// At the end of the test, run `terraform destroy` to clean up any resources that were created
@@ -52,20 +63,20 @@ func TestExamplesComplete(t *testing.T) {
5263
// Run `terraform output` to get the value of an output variable
5364
securityGroupName := terraform.Output(t, terraformOptions, "security_group_name")
5465
// Verify we're getting back the outputs we expect
55-
assert.Equal(t, "eg-test-documentdb-cluster", securityGroupName)
66+
assert.Equal(t, "eg-test-documentdb-cluster-"+randId, securityGroupName)
5667

5768
// Run `terraform output` to get the value of an output variable
5869
clusterName := terraform.Output(t, terraformOptions, "cluster_name")
5970
// Verify we're getting back the outputs we expect
60-
assert.Equal(t, "eg-test-documentdb-cluster", clusterName)
71+
assert.Equal(t, "eg-test-documentdb-cluster-"+randId, clusterName)
6172

6273
// Run `terraform output` to get the value of an output variable
6374
endpoint := terraform.Output(t, terraformOptions, "endpoint")
6475
// Verify we're getting back the outputs we expect
65-
assert.Contains(t, endpoint, "eg-test-documentdb-cluster.cluster")
76+
assert.Contains(t, endpoint, "eg-test-documentdb-cluster-"+randId+".cluster")
6677

6778
// Run `terraform output` to get the value of an output variable
6879
readerEndpoint := terraform.Output(t, terraformOptions, "reader_endpoint")
6980
// Verify we're getting back the outputs we expect
70-
assert.Contains(t, readerEndpoint, "eg-test-documentdb-cluster.cluster-ro")
81+
assert.Contains(t, readerEndpoint, "eg-test-documentdb-cluster-"+randId+".cluster-ro")
7182
}

0 commit comments

Comments
 (0)