From 452767e3c2a59560c058e305892062d2a31dcd4e Mon Sep 17 00:00:00 2001 From: Rosemary Wang <66625360+rosemarywang@users.noreply.github.com> Date: Mon, 6 Jul 2020 13:16:06 -0400 Subject: [PATCH 01/28] CI-159 Update Makefile --- .gitignore | 11 +- Makefile | 230 +++--------------------------- README.md | 1 - examples/minimal/variables.tf | 2 - modules/rds-postgres-sg/README.md | 2 +- 5 files changed, 33 insertions(+), 213 deletions(-) diff --git a/.gitignore b/.gitignore index 4bb20d3..55867c3 100644 --- a/.gitignore +++ b/.gitignore @@ -25,8 +25,15 @@ override.tf.json # # !example_override.tf +# Ignore terratest configuration +terratest.tf.json + # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan # example: *tfplan* -# IDE files -**/.idea/* +# Intellij +.idea/ +*.iml + +# Ignore makefile +ops-makefile diff --git a/Makefile b/Makefile index c3f79db..fa7e870 100644 --- a/Makefile +++ b/Makefile @@ -2,212 +2,28 @@ ifneq (,) .error This Makefile requires GNU Make. endif -.PHONY: help gen lint test _gen-main _gen-examples _gen-modules _lint_files _lint_fmt _pull-tf _pull-tf-docs - -CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -TF_EXAMPLES = $(sort $(dir $(wildcard $(CURRENT_DIR)examples/*/))) -TF_MODULES = $(sort $(dir $(wildcard $(CURRENT_DIR)modules/*/))) - -TF_VERSION = light -TF_DOCS_VERSION = 0.9.1 - -# Adjust your delimiter here or overwrite via make arguments -DELIM_START = -DELIM_CLOSE = - -help: - @echo "gen Generate terraform-docs output and replace in all README.md's" - @echo "lint Static source code analysis" - @echo "test Integration tests" - -gen: _pull-tf-docs - @echo "################################################################################" - @echo "# Terraform-docs generate" - @echo "################################################################################" - @$(MAKE) --no-print-directory _gen-main - @$(MAKE) --no-print-directory _gen-examples - @$(MAKE) --no-print-directory _gen-modules - -lint: _pull-tf - @$(MAKE) --no-print-directory _lint_files - @$(MAKE) --no-print-directory _lint_fmt - -test: _pull-tf - @$(foreach example,\ - $(TF_EXAMPLES),\ - DOCKER_PATH="/t/examples/$(notdir $(patsubst %/,%,$(example)))"; \ - echo "################################################################################"; \ - echo "# examples/$$( basename $${DOCKER_PATH} )"; \ - echo "################################################################################"; \ - echo; \ - echo "------------------------------------------------------------"; \ - echo "# Terraform init"; \ - echo "------------------------------------------------------------"; \ - if docker run -it --rm -v "$(CURRENT_DIR):/t" --workdir "$${DOCKER_PATH}" hashicorp/terraform:$(TF_VERSION) \ - init \ - -verify-plugins=true \ - -lock=false \ - -upgrade=true \ - -reconfigure \ - -input=false \ - -get-plugins=true \ - -get=true \ - .; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - docker run -it --rm -v "$(CURRENT_DIR):/t" --workdir "$${DOCKER_PATH}" --entrypoint=rm hashicorp/terraform:$(TF_VERSION) -rf .terraform/ || true; \ - exit 1; \ - fi; \ - echo; \ - echo "------------------------------------------------------------"; \ - echo "# Terraform validate"; \ - echo "------------------------------------------------------------"; \ - if docker run -it --rm -v "$(CURRENT_DIR):/t" --workdir "$${DOCKER_PATH}" hashicorp/terraform:$(TF_VERSION) \ - validate \ - $(ARGS) \ - .; then \ - echo "OK"; \ - docker run -it --rm -v "$(CURRENT_DIR):/t" --workdir "$${DOCKER_PATH}" --entrypoint=rm hashicorp/terraform:$(TF_VERSION) -rf .terraform/ || true; \ - else \ - echo "Failed"; \ - docker run -it --rm -v "$(CURRENT_DIR):/t" --workdir "$${DOCKER_PATH}" --entrypoint=rm hashicorp/terraform:$(TF_VERSION) -rf .terraform/ || true; \ - exit 1; \ - fi; \ - echo; \ - ) - -_gen-main: - @echo "------------------------------------------------------------" - @echo "# Main module" - @echo "------------------------------------------------------------" - @if docker run --rm \ - -v $(CURRENT_DIR):/data \ - -e DELIM_START='$(DELIM_START)' \ - -e DELIM_CLOSE='$(DELIM_CLOSE)' \ - cytopia/terraform-docs:$(TF_DOCS_VERSION) \ - terraform-docs-replace-012 --sort-inputs-by-required --with-aggregate-type-defaults md README.md; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - exit 1; \ - fi - -_gen-examples: - @$(foreach example,\ - $(TF_EXAMPLES),\ - DOCKER_PATH="examples/$(notdir $(patsubst %/,%,$(example)))"; \ - echo "------------------------------------------------------------"; \ - echo "# $${DOCKER_PATH}"; \ - echo "------------------------------------------------------------"; \ - if docker run --rm \ - -v $(CURRENT_DIR):/data \ - --workdir "/data/$${DOCKER_PATH}" \ - -e DELIM_START='$(DELIM_START)' \ - -e DELIM_CLOSE='$(DELIM_CLOSE)' \ - cytopia/terraform-docs:$(TF_DOCS_VERSION) \ - terraform-docs-replace-012 --sort-inputs-by-required --with-aggregate-type-defaults md README.md; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - exit 1; \ - fi; \ - ) - -_gen-modules: - @$(foreach module,\ - $(TF_MODULES),\ - DOCKER_PATH="modules/$(notdir $(patsubst %/,%,$(module)))"; \ - echo "------------------------------------------------------------"; \ - echo "# $${DOCKER_PATH}"; \ - echo "------------------------------------------------------------"; \ - if docker run --rm \ - -v $(CURRENT_DIR):/data \ - -e DELIM_START='$(DELIM_START)' \ - -e DELIM_CLOSE='$(DELIM_CLOSE)' \ - cytopia/terraform-docs:$(TF_DOCS_VERSION) \ - terraform-docs-replace-012 --sort-inputs-by-required --with-aggregate-type-defaults md $${DOCKER_PATH}/README.md; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - exit 1; \ - fi; \ - ) - -_lint_files: - @# Lint all non-binary files for trailing spaces - @echo "################################################################################" - @echo "# Lint files" - @echo "################################################################################" - @echo - @echo "------------------------------------------------------------" - @echo "# Trailing spaces" - @echo "------------------------------------------------------------" - find . -type f -not \( -path "*/.git/*" -o -path "*/.github/*" -o -path "*/.terraform/*" -o -path "*/.idea/*"\) -print0 \ - | xargs -0 -n1 grep -Il '' \ - | tr '\n' '\0' \ - | xargs -0 -n1 \ - sh -c 'if [ -f "$${1}" ]; then if LC_ALL=C grep --color=always -inHE "^.*[[:blank:]]+$$" "$${1}";then false; else true; fi; fi' -- - @echo - @echo "------------------------------------------------------------" - @echo "# Windows line feeds (CRLF)" - @echo "------------------------------------------------------------" - find . -type f -not \( -path "*/.git/*" -o -path "*/.github/*" -o -path "*/.terraform/*" -o -path "*/.idea/*"\) -print0 \ - | xargs -0 -n1 grep -Il '' \ - | tr '\n' '\0' \ - | xargs -0 -n1 \ - sh -c 'if [ -f "$${1}" ]; then if file "$${1}" | grep --color=always -E "[[:space:]]CRLF[[:space:]].*line"; then false; else true; fi; fi' -- - @echo - @echo "------------------------------------------------------------" - @echo "# Single trailing newline" - @echo "------------------------------------------------------------" - find . -type f -not \( -path "*/.git/*" -o -path "*/.github/*" -o -path "*/.terraform/*" -o -path "*/.idea/*"\) -print0 \ - | xargs -0 -n1 grep -Il '' \ - | tr '\n' '\0' \ - | xargs -0 -n1 \ - sh -c 'if [ -f "$${1}" ]; then if ! (tail -c 1 "$${1}" | grep -Eq "^$$" && tail -c 2 "$${1}" | grep -Eqv "^$$"); then echo "$${1}"; false; else true; fi; fi' -- - @echo - -_lint_fmt: - @# Lint all Terraform files - @echo "################################################################################" - @echo "# Terraform fmt" - @echo "################################################################################" - @echo - @echo "------------------------------------------------------------" - @echo "# *.tf files" - @echo "------------------------------------------------------------" - @if docker run --rm -v "$(CURRENT_DIR):/t:ro" --workdir "/t" hashicorp/terraform:$(TF_VERSION) \ - fmt -check=true -diff=true -write=false -list=true /t; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - exit 1; \ - fi; - @echo "------------------------------------------------------------" - @echo "# tfsec" - @echo "------------------------------------------------------------" - @if docker run --rm -v "$(CURRENT_DIR):/workdir:ro" --workdir "/workdir" tamr-docker.jfrog.io/ops/tfsec:v0.19.0 . ; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - exit 1; \ - fi; - @echo - @echo "------------------------------------------------------------" - @echo "# *.tfvars files" - @echo "------------------------------------------------------------" - @if docker run --rm --entrypoint=/bin/sh -v "$(CURRENT_DIR)/terraform:/t:ro" hashicorp/terraform:$(TF_VERSION) \ - -c "find . -name '*.tfvars' -type f -print0 | xargs -0 -n1 terraform fmt -check=true -write=false -diff=true -list=true"; then \ - echo "OK"; \ - else \ - echo "Failed"; \ - exit 1; \ - fi; - @echo +GIT_PREFIX = git@github.com + +MAKEFILE_DIR = ops-makefile +MAKEFILE_TAG = master +MAKEFILE_REPO = Datatamer/ops-makefile.git + +export BUILD_PATH ?= $(shell 'pwd') + +ifneq ($(shell grep $(MAKEFILE_REPO) $(BUILD_PATH)/.git/config),) + include $(BUILD_PATH)/Makefile.* + include $(BUILD_PATH)/modules/*/Makefile* +else ifeq (,$(firstword $(wildcard $(MAKEFILE_DIR)))) + $(shell git clone -c advice.detachedHead=false --depth=1 -b $(MAKEFILE_TAG) $(GIT_PREFIX):$(MAKEFILE_REPO)) + include $(BUILD_PATH)/$(MAKEFILE_DIR)/Makefile.* + include $(BUILD_PATH)/$(MAKEFILE_DIR)/modules/*/Makefile* +else + UPDATE := $(shell git -C ops-makefile pull) + include $(BUILD_PATH)/$(MAKEFILE_DIR)/Makefile.* + include $(BUILD_PATH)/$(MAKEFILE_DIR)/modules/*/Makefile* +endif -_pull-tf: - docker pull hashicorp/terraform:$(TF_VERSION) +EXCLUDE := $(filter-out $(MAKEFILE_DIR)/Makefile, $(wildcard $(MAKEFILE_DIR)/*)) -_pull-tf-docs: - docker pull cytopia/terraform-docs:$(TF_DOCS_VERSION) +clean: + rm -rf $(MAKEFILE_DIR) diff --git a/README.md b/README.md index b537b7d..8b7fae2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ module "rds_postgres" { postgres_name = "example_rds_postgres" parameter_group_name = "example-rds-postgres-pg" identifier_prefix = "example-rds-" - username = "exampleUsername" password = "examplePassword" diff --git a/examples/minimal/variables.tf b/examples/minimal/variables.tf index 509ead4..c602e2c 100644 --- a/examples/minimal/variables.tf +++ b/examples/minimal/variables.tf @@ -22,5 +22,3 @@ variable "pg_password" { type = string description = "Password for postgres" } - - diff --git a/modules/rds-postgres-sg/README.md b/modules/rds-postgres-sg/README.md index 6f4f70b..337ead8 100644 --- a/modules/rds-postgres-sg/README.md +++ b/modules/rds-postgres-sg/README.md @@ -11,7 +11,7 @@ module "rds_sg" { security_group_name = "examplerdssecuritygroup" additional_cidrs = ["1.2.3.4/32"] } -``` +``` ## Requirements From 293fac6aec48ccf2c7cec5f45e00be9446a214d0 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 1 Jul 2021 10:11:34 -0300 Subject: [PATCH 02/28] adding first test --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index ef66836..f266f54 100644 --- a/variables.tf +++ b/variables.tf @@ -23,7 +23,7 @@ variable "parameter_group_name" { variable "identifier_prefix" { description = "Identifier prefix for the RDS instance" - type = "string" + type = string default = "tamr-rds-" } From 1e25f16a3fea75fd93e220e9337c264528086482 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 1 Jul 2021 10:11:58 -0300 Subject: [PATCH 03/28] adding first test --- examples/test_minimal/.terraform.lock.hcl | 21 + examples/test_minimal/README.md | 24 + examples/test_minimal/local.tfvars | 6 + examples/test_minimal/main.tf | 60 ++ examples/test_minimal/outputs.tf | 8 + examples/test_minimal/variables.tf | 35 ++ go.mod | 9 + go.sum | 644 ++++++++++++++++++++++ tests/create_db_test.go | 128 +++++ 9 files changed, 935 insertions(+) create mode 100644 examples/test_minimal/.terraform.lock.hcl create mode 100644 examples/test_minimal/README.md create mode 100644 examples/test_minimal/local.tfvars create mode 100644 examples/test_minimal/main.tf create mode 100644 examples/test_minimal/outputs.tf create mode 100644 examples/test_minimal/variables.tf create mode 100644 go.mod create mode 100644 go.sum create mode 100644 tests/create_db_test.go diff --git a/examples/test_minimal/.terraform.lock.hcl b/examples/test_minimal/.terraform.lock.hcl new file mode 100644 index 0000000..335114f --- /dev/null +++ b/examples/test_minimal/.terraform.lock.hcl @@ -0,0 +1,21 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "3.47.0" + constraints = ">= 3.15.0" + hashes = [ + "h1:oiX6JcoXY6lYIdcYWmEpr7mnS4mkyDV9intCNrcjiBs=", + "zh:07bb6bda5b9fdb782dd568a2e85cfe0ab108770e2218f3411e57ed845c58af40", + "zh:0926b161a109e75bdc8691e8a32f568b4cd77a55510cf27573261fb5ba382287", + "zh:0a91adf25a78ad31d547da513db24f493d27592d3675ed291a7698351c30992d", + "zh:0f95f01e3bf0dab306ed86afb1ca00e01ce94ed6696765158d544b1569483b13", + "zh:10466a520c617354ebbee9366267e0878b091a15d49cb97846511e952bd9db90", + "zh:2fc627d3dc5a6df904591c673d640e6d3a697dcc12d1a43cf71066a47314f7c0", + "zh:a85476047ddb359acdc0db5b9cbe0a7e13c4e65289b03f6c93303d0452db450b", + "zh:cbadde98d44e8953cc78487b6788b97cff12632e9fda065bb970b001205662cb", + "zh:db05702323c5fa253d5e067458340b89126738b8f6a9847465ee3e75b0f28320", + "zh:e16cf52ff3b067adb33a75b89c03f9b03e666e2d45adb2ee296ae12b36cd5776", + "zh:fcb8f73f7f5e195e3345d5694b526e0d5e77562d2e7dd468366ee15b1be6b418", + ] +} diff --git a/examples/test_minimal/README.md b/examples/test_minimal/README.md new file mode 100644 index 0000000..c1e93a3 --- /dev/null +++ b/examples/test_minimal/README.md @@ -0,0 +1,24 @@ + +## Requirements + +No requirements. + +## Providers + +No provider. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| identifier\_prefix | Identifier prefix for the resources | `string` | n/a | yes | +| parameter\_group\_name | Name of the parameter group | `string` | n/a | yes | +| pg\_password | Password for postgres | `string` | n/a | yes | +| pg\_username | Username for postgres | `string` | n/a | yes | +| postgres\_db\_name | Name of the postgres db | `string` | n/a | yes | + +## Outputs + +No output. + + diff --git a/examples/test_minimal/local.tfvars b/examples/test_minimal/local.tfvars new file mode 100644 index 0000000..2d711b5 --- /dev/null +++ b/examples/test_minimal/local.tfvars @@ -0,0 +1,6 @@ +#postgres_name = "example-rds-postgres" +postgres_db_name = "terratest_aws_rds_example" +parameter_group_name = "terratest-aws-rds-example-rds-postgres-pg" +identifier_prefix = "terratest-aws-rds-example-" +pg_username = "tamruser" +pg_password = "tamrpassword" diff --git a/examples/test_minimal/main.tf b/examples/test_minimal/main.tf new file mode 100644 index 0000000..af7f27b --- /dev/null +++ b/examples/test_minimal/main.tf @@ -0,0 +1,60 @@ +module "rds_postgres" { + #source = "git::https://github.com/Datatamer/terraform-rds-postgres.git?ref=0.1.0" + source = "../../" + postgres_name = var.postgres_db_name + parameter_group_name = var.parameter_group_name + identifier_prefix = var.identifier_prefix + instance_class = "db.t3.medium" + + username = var.pg_username + password = var.pg_password + + subnet_name = module.vpc.database_subnet_group_name + vpc_id = module.vpc.vpc_id + + spark_cluster_sg_ids = [aws_security_group.example[0].id] #mock + tamr_vm_sg_id = aws_security_group.example[1].id #mock +} + +data "aws_region" "current" { + +} +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "3.1.0" + + name = "hugo-test-vpc" + cidr = "172.18.0.0/18" + + azs = [for i in ["a","b","c"] : "${data.aws_region.current.name}${i}"] + private_subnets = ["172.18.0.0/24", "172.18.1.0/24", "172.18.2.0/24"] + public_subnets = ["172.18.3.0/24", "172.18.4.0/24", "172.18.5.0/24"] + + database_subnets = ["172.18.6.0/24", "172.18.7.0/24", "172.18.8.0/24"] + + create_database_subnet_group = true + create_database_subnet_route_table = true + create_database_internet_gateway_route = true + + enable_nat_gateway = false + enable_vpn_gateway = false + + tags = { + Terraform = "true" + Environment = "dev" + } +} + +resource "aws_security_group" "example" { + count = 2 + # ... other configuration ... + + vpc_id = module.vpc.vpc_id + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + ipv6_cidr_blocks = ["::/0"] + } +} diff --git a/examples/test_minimal/outputs.tf b/examples/test_minimal/outputs.tf new file mode 100644 index 0000000..cde3e15 --- /dev/null +++ b/examples/test_minimal/outputs.tf @@ -0,0 +1,8 @@ +output "module_vpc" { + value = module.vpc +} + +output "module_rds" { + value = module.rds_postgres +} + diff --git a/examples/test_minimal/variables.tf b/examples/test_minimal/variables.tf new file mode 100644 index 0000000..730ea18 --- /dev/null +++ b/examples/test_minimal/variables.tf @@ -0,0 +1,35 @@ +variable "postgres_db_name" { + type = string + description = "Name of the postgres db" +} + +variable "parameter_group_name" { + type = string + description = "Name of the parameter group" +} + +variable "identifier_prefix" { + type = string + description = "Identifier prefix for the resources" +} + +variable "pg_username" { + type = string + description = "Username for postgres" +} + +variable "pg_password" { + type = string + description = "Password for postgres" +} + +# variable "spark_sg_id_list" { +# type = list(string) +# description = "List of IDs of Sec groups" +# } + + +# variable "tamr_vm_sg_id" { +# type = string +# description = "ID of Tamr VM Sec groups" +# } \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2a06bf9 --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module github.com/caylent/tamr-terraform-aws-rds-postgres + +go 1.16 + +require ( + github.com/gruntwork-io/terratest v0.36.2 + github.com/lib/pq v1.10.2 // indirect + github.com/stretchr/testify v1.4.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a0d46d4 --- /dev/null +++ b/go.sum @@ -0,0 +1,644 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.11.0/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= +github.com/Azure/go-autorest/autorest v0.11.5/go.mod h1:foo3aIXRQ90zFve3r0QiDsrjGDUwWhKl0ZOQy1CT14k= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.1/go.mod h1:ea90/jvmnAwDrSooLH4sRIehEPtG/EPUXavDh31MnA4= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.0/go.mod h1:JljT387FplPzBA31vUcvsetLKF3pec5bdAxjVU4kI2s= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= +github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= +github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= +github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.38.28 h1:2ZzgEupSluR18ClxUnHwXKyuADheZpMblXRAsHqF0tI= +github.com/aws/aws-sdk-go v1.38.28/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= +github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v0.0.0-20200109221225-a4f60165b7a3/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 h1:skJKxRtNmevLqnayafdLe2AsenqRupVmzZSqrvb5caU= +github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-containerregistry v0.0.0-20200110202235-f4fb41bf00a3/go.mod h1:2wIuQute9+hhWqvL3vEI7YB0EKluF4WcPzI1eAliazk= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/gruntwork-io/go-commons v0.8.0 h1:k/yypwrPqSeYHevLlEDmvmgQzcyTwrlZGRaxEM6G0ro= +github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78= +github.com/gruntwork-io/terratest v0.36.2 h1:5xjFlONJw0Qna2HcohCTn/KXNriLuHJB0rONmGK95iI= +github.com/gruntwork-io/terratest v0.36.2/go.mod h1:GIVJGBV1WIv1vxIG31Ycy0CuHYfXuvvkilNQuC9Wi+o= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= +github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= +github.com/hashicorp/terraform-json v0.9.0 h1:WE7+Wt93W93feOiCligElSyS0tlDzwZUtJuDGIBr8zg= +github.com/hashicorp/terraform-json v0.9.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o= +github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= +github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= +github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/oracle/oci-go-sdk v7.1.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/pquerna/otp v1.2.0 h1:/A3+Jn+cagqayeR3iHs/L62m5ue7710D35zl1zJ1kok= +github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vdemeester/k8s-pkg-credentialprovider v0.0.0-20200107171650-7c61ffa44238/go.mod h1:JwQJCMWpUDqjZrB5jpw0f5VbN7U95zxFy1ZDpoEarGo= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191205215504-7b8c8591a921/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20201110201400-7099162a900a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/api v0.19.3/go.mod h1:VF+5FT1B74Pw3KxMdKyinLo+zynBaMBiAfGMuldcNDs= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.19.3/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= +k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/client-go v0.19.3/go.mod h1:+eEMktZM+MG0KO+PTkci8xnbCZHvj9TqR6Q1XDUIJOM= +k8s.io/cloud-provider v0.17.0/go.mod h1:Ze4c3w2C0bRsjkBUoHpFi+qWe3ob1wI2/7cUn+YQIDE= +k8s.io/code-generator v0.0.0-20191121015212-c4c8f8345c7e/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= +k8s.io/component-base v0.17.0/go.mod h1:rKuRAokNMY2nn2A6LP/MiwpoaMRHpfRnrPaUJJj1Yoc= +k8s.io/csi-translation-lib v0.17.0/go.mod h1:HEF7MEz7pOLJCnxabi45IPkhSsE/KmxPQksuCrHKWls= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/tests/create_db_test.go b/tests/create_db_test.go new file mode 100644 index 0000000..a8e21f0 --- /dev/null +++ b/tests/create_db_test.go @@ -0,0 +1,128 @@ +package tests + +import ( + "database/sql" + "fmt" + "strings" + "testing" + + "github.com/gruntwork-io/terratest/modules/aws" + "github.com/gruntwork-io/terratest/modules/logger" + "github.com/gruntwork-io/terratest/modules/terraform" + terratest_testing "github.com/gruntwork-io/terratest/modules/testing" + _ "github.com/lib/pq" + "github.com/stretchr/testify/assert" +) + +func TestTerraformCreateRDS(t *testing.T) { + t.Parallel() + + namePrefix := "terratest-aws-rds-example" + // expectedName := fmt.Sprintf("%s-%s", namePrefix, strings.ToLower(random.UniqueId())) + expectedName := namePrefix // remove this later + expectedDBName := strings.ReplaceAll(expectedName, "-", "_") + //awsRegion := aws.GetRandomStableRegion(t, nil, nil) + + awsRegion := "us-east-2" // remove this later + + user := "tamruser" + pw := "tamrpassword" + expectedPort := 5432 + + terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ + // The path to where our Terraform code is located + TerraformDir: "../examples/test_minimal", + + Vars: map[string]interface{}{ + "postgres_db_name": expectedDBName, + "parameter_group_name": fmt.Sprintf("%s-rds-postgres-pg", namePrefix), + "identifier_prefix": fmt.Sprintf("%s-", namePrefix), + "pg_username": user, + "pg_password": pw, + // "spark_sg_id_list": []string{"sg-0b103ea834dfa1234"}, + // "tamr_vm_sg_id": "sg-0b103ea834dfac123", + }, + // Environment variables to set when running Terraform + EnvVars: map[string]string{ + "AWS_DEFAULT_REGION": awsRegion, + }, + }) + + // + // defer terraform.Destroy(t, terraformOptions) + // terraform.InitAndApply(t, terraformOptions) + + rds := terraform.OutputMapOfObjects(t, terraformOptions, "module_rds") + // output "rds_postgres_pg_id" + // output "rds_postgres_id" + // output "rds_sg_id" + // output "rds_hostname" + + dbInstanceID := rds["rds_postgres_id"].(string) + logger.Log(t, fmt.Sprintf("RDS object: %+v", rds)) + + // test connectivity + schemaExistsInRdsInstance := GetWhetherSchemaExistsInRdsPostgresInstance(t, rds["rds_hostname"].(string), int64(expectedPort), user, pw, expectedDBName) + + // Look up the endpoint address and port of the RDS instance + address := aws.GetAddressOfRdsInstance(t, dbInstanceID, awsRegion) + port := aws.GetPortOfRdsInstance(t, dbInstanceID, awsRegion) + + // describe rds - SG 5432 port + + // describe rds - param group + + // rds_postgres_id := rds["rds_postgres_id"].(string) + // assert.Equal(t, expectedName) + + // Lookup parameter values. All defined values are strings in the API call response + // generalLogParameterValue := aws.GetParameterValueForParameterOfRdsInstance(t, "general_log", dbInstanceID, awsRegion) + // allowSuspiciousUdfsParameterValue := aws.GetParameterValueForParameterOfRdsInstance(t, "allow-suspicious-udfs", dbInstanceID, awsRegion) + + // Lookup option values. All defined values are strings in the API call response + // mariadbAuditPluginServerAuditEventsOptionValue := aws.GetOptionSettingForOfRdsInstance(t, "MARIADB_AUDIT_PLUGIN", "SERVER_AUDIT_EVENTS", dbInstanceID, awsRegion) + + // Verify that the address is not null + assert.NotNil(t, address) + // Verify that the DB instance is listening on the port mentioned + assert.Equal(t, expectedPort, port) + // Verify that the table/schema requested for creation is actually present in the database + assert.True(t, schemaExistsInRdsInstance) + // Booleans are (string) "0", "1" + // assert.Equal(t, "0", generalLogParameterValue) + // Values not set are "". This is custom behavior defined. + // assert.Equal(t, "", allowSuspiciousUdfsParameterValue) + // assert.Equal(t, "", mariadbAuditPluginServerAuditEventsOptionValue) + // assert.Equal(t, "CONNECT", mariadbAuditPluginServerAuditEventsOptionValue) + +} + +// GetWhetherSchemaExistsInRdsPostgresInstance checks whether the specified schema/table name exists in the RDS instance +func GetWhetherSchemaExistsInRdsPostgresInstance(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) bool { + output, err := GetWhetherSchemaExistsInRdsPostgresInstanceE(t, dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) + if err != nil { + t.Fatal(err) + } + return output +} + +// GetWhetherSchemaExistsInRdsPostgresInstanceE checks whether the specified schema/table name exists in the RDS instance +func GetWhetherSchemaExistsInRdsPostgresInstanceE(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) (bool, error) { + connectionString := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s", dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) + + db, connErr := sql.Open("postgres", connectionString) + if connErr != nil { + return false, connErr + } + defer db.Close() + var ( + schemaName string + ) + sqlStatement := `SELECT "catalog_name" FROM "information_schema"."schemata" where catalog_name=$1` + row := db.QueryRow(sqlStatement, expectedSchemaName) + scanErr := row.Scan(&schemaName) + if scanErr != nil { + return false, scanErr + } + return true, nil +} From cade63ea430176f4a0f726b4b1be34afddd902ad Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 1 Jul 2021 18:59:12 -0300 Subject: [PATCH 04/28] simple test --- tests/create_db_test.go | 66 ++++++++--------------------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/tests/create_db_test.go b/tests/create_db_test.go index a8e21f0..71dd754 100644 --- a/tests/create_db_test.go +++ b/tests/create_db_test.go @@ -1,7 +1,6 @@ package tests import ( - "database/sql" "fmt" "strings" "testing" @@ -9,7 +8,6 @@ import ( "github.com/gruntwork-io/terratest/modules/aws" "github.com/gruntwork-io/terratest/modules/logger" "github.com/gruntwork-io/terratest/modules/terraform" - terratest_testing "github.com/gruntwork-io/terratest/modules/testing" _ "github.com/lib/pq" "github.com/stretchr/testify/assert" ) @@ -21,13 +19,13 @@ func TestTerraformCreateRDS(t *testing.T) { // expectedName := fmt.Sprintf("%s-%s", namePrefix, strings.ToLower(random.UniqueId())) expectedName := namePrefix // remove this later expectedDBName := strings.ReplaceAll(expectedName, "-", "_") - //awsRegion := aws.GetRandomStableRegion(t, nil, nil) - awsRegion := "us-east-2" // remove this later + //awsRegion := aws.GetRandomStableRegion(t, nil, nil) + awsRegion := "us-east-1" // remove this later user := "tamruser" pw := "tamrpassword" - expectedPort := 5432 + expectedPort := int64(5432) terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ // The path to where our Terraform code is located @@ -59,70 +57,32 @@ func TestTerraformCreateRDS(t *testing.T) { // output "rds_hostname" dbInstanceID := rds["rds_postgres_id"].(string) - logger.Log(t, fmt.Sprintf("RDS object: %+v", rds)) + // dbHostname := rds["rds_hostname"].(string) + // dbSecGroupID := rds["rds_sg_id"].(string) + // dbParamGroupID := rds["rds_postgres_pg_id"].(string) - // test connectivity - schemaExistsInRdsInstance := GetWhetherSchemaExistsInRdsPostgresInstance(t, rds["rds_hostname"].(string), int64(expectedPort), user, pw, expectedDBName) + logger.Log(t, fmt.Sprintf("RDS object: %+v", rds)) // Look up the endpoint address and port of the RDS instance address := aws.GetAddressOfRdsInstance(t, dbInstanceID, awsRegion) port := aws.GetPortOfRdsInstance(t, dbInstanceID, awsRegion) // describe rds - SG 5432 port + // aws.GetAllParametersOfRdsInstance() // describe rds - param group - // rds_postgres_id := rds["rds_postgres_id"].(string) - // assert.Equal(t, expectedName) + // test connectivity + // schemaExistsInRdsInstance := GetWhetherSchemaExistsInRdsPostgresInstance(t, rds["rds_hostname"].(string), int64(expectedPort), user, pw, expectedDBName) - // Lookup parameter values. All defined values are strings in the API call response - // generalLogParameterValue := aws.GetParameterValueForParameterOfRdsInstance(t, "general_log", dbInstanceID, awsRegion) - // allowSuspiciousUdfsParameterValue := aws.GetParameterValueForParameterOfRdsInstance(t, "allow-suspicious-udfs", dbInstanceID, awsRegion) + // Verify that the table/schema requested for creation is actually present in the database + // assert.True(t, schemaExistsInRdsInstance) - // Lookup option values. All defined values are strings in the API call response - // mariadbAuditPluginServerAuditEventsOptionValue := aws.GetOptionSettingForOfRdsInstance(t, "MARIADB_AUDIT_PLUGIN", "SERVER_AUDIT_EVENTS", dbInstanceID, awsRegion) + // assert.Equal(t, expectedName, ) // Verify that the address is not null assert.NotNil(t, address) // Verify that the DB instance is listening on the port mentioned assert.Equal(t, expectedPort, port) - // Verify that the table/schema requested for creation is actually present in the database - assert.True(t, schemaExistsInRdsInstance) - // Booleans are (string) "0", "1" - // assert.Equal(t, "0", generalLogParameterValue) - // Values not set are "". This is custom behavior defined. - // assert.Equal(t, "", allowSuspiciousUdfsParameterValue) - // assert.Equal(t, "", mariadbAuditPluginServerAuditEventsOptionValue) - // assert.Equal(t, "CONNECT", mariadbAuditPluginServerAuditEventsOptionValue) - -} - -// GetWhetherSchemaExistsInRdsPostgresInstance checks whether the specified schema/table name exists in the RDS instance -func GetWhetherSchemaExistsInRdsPostgresInstance(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) bool { - output, err := GetWhetherSchemaExistsInRdsPostgresInstanceE(t, dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) - if err != nil { - t.Fatal(err) - } - return output -} -// GetWhetherSchemaExistsInRdsPostgresInstanceE checks whether the specified schema/table name exists in the RDS instance -func GetWhetherSchemaExistsInRdsPostgresInstanceE(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) (bool, error) { - connectionString := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s", dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) - - db, connErr := sql.Open("postgres", connectionString) - if connErr != nil { - return false, connErr - } - defer db.Close() - var ( - schemaName string - ) - sqlStatement := `SELECT "catalog_name" FROM "information_schema"."schemata" where catalog_name=$1` - row := db.QueryRow(sqlStatement, expectedSchemaName) - scanErr := row.Scan(&schemaName) - if scanErr != nil { - return false, scanErr - } - return true, nil } From 5391968ae36b0c26e9f7117420c2d3b531a4a927 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 1 Jul 2021 18:59:29 -0300 Subject: [PATCH 05/28] adding helper function for connectivity test --- tests/connect_db_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/connect_db_test.go diff --git a/tests/connect_db_test.go b/tests/connect_db_test.go new file mode 100644 index 0000000..6457191 --- /dev/null +++ b/tests/connect_db_test.go @@ -0,0 +1,38 @@ +package tests + +import ( + "database/sql" + "fmt" + + terratest_testing "github.com/gruntwork-io/terratest/modules/testing" +) + +// GetWhetherSchemaExistsInRdsPostgresInstance checks whether the specified schema/table name exists in the RDS instance +func GetWhetherSchemaExistsInRdsPostgresInstance(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) bool { + output, err := GetWhetherSchemaExistsInRdsPostgresInstanceE(t, dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) + if err != nil { + t.Fatal(err) + } + return output +} + +// GetWhetherSchemaExistsInRdsPostgresInstanceE checks whether the specified schema/table name exists in the RDS instance +func GetWhetherSchemaExistsInRdsPostgresInstanceE(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) (bool, error) { + connectionString := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s", dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) + + db, connErr := sql.Open("postgres", connectionString) + if connErr != nil { + return false, connErr + } + defer db.Close() + var ( + schemaName string + ) + sqlStatement := `SELECT "catalog_name" FROM "information_schema"."schemata" where catalog_name=$1` + row := db.QueryRow(sqlStatement, expectedSchemaName) + scanErr := row.Scan(&schemaName) + if scanErr != nil { + return false, scanErr + } + return true, nil +} From 23ff23f81c736b3710bffdf1d85011f9e9c1fd57 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 15 Jul 2021 16:07:29 -0300 Subject: [PATCH 06/28] CA-18 adding initial tests --- .gitignore | 1 + examples/test_minimal/main.tf | 45 ++++++++------- examples/test_minimal/outputs.tf | 27 +++++++-- examples/test_minimal/variables.tf | 17 ++---- go.mod | 9 --- test/create_db_test.go | 93 ++++++++++++++++++++++++++++++ test/go.mod | 10 ++++ go.sum => test/go.sum | 0 tests/connect_db_test.go | 38 ------------ tests/create_db_test.go | 88 ---------------------------- 10 files changed, 157 insertions(+), 171 deletions(-) delete mode 100644 go.mod create mode 100644 test/create_db_test.go create mode 100644 test/go.mod rename go.sum => test/go.sum (100%) delete mode 100644 tests/connect_db_test.go delete mode 100644 tests/create_db_test.go diff --git a/.gitignore b/.gitignore index 55867c3..a741a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Local .terraform directories **/.terraform/* +*.terraform.lock.hcl # .tfstate files *.tfstate *.tfstate.* diff --git a/examples/test_minimal/main.tf b/examples/test_minimal/main.tf index af7f27b..f7ff472 100644 --- a/examples/test_minimal/main.tf +++ b/examples/test_minimal/main.tf @@ -1,29 +1,29 @@ module "rds_postgres" { - #source = "git::https://github.com/Datatamer/terraform-rds-postgres.git?ref=0.1.0" + #source = "git::https://github.com/Datatamer/terraform-rds-postgres.git?ref=x.y.z" source = "../../" postgres_name = var.postgres_db_name parameter_group_name = var.parameter_group_name - identifier_prefix = var.identifier_prefix + identifier_prefix = var.name_prefix instance_class = "db.t3.medium" - + engine_version = "12.5" username = var.pg_username password = var.pg_password - subnet_name = module.vpc.database_subnet_group_name + subnet_group_name = "${var.name_prefix}-subnet-group" vpc_id = module.vpc.vpc_id - spark_cluster_sg_ids = [aws_security_group.example[0].id] #mock - tamr_vm_sg_id = aws_security_group.example[1].id #mock + # Network requirement: DB subnet group needs a subnet in at least two Availability Zones + rds_subnet_ids = module.vpc.database_subnets + security_group_ids = module.rds-postgres-sg.security_group_ids } -data "aws_region" "current" { +data "aws_region" "current" { } -} module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "3.1.0" - name = "hugo-test-vpc" + name = "${var.name_prefix}vpc" cidr = "172.18.0.0/18" azs = [for i in ["a","b","c"] : "${data.aws_region.current.name}${i}"] @@ -32,7 +32,7 @@ module "vpc" { database_subnets = ["172.18.6.0/24", "172.18.7.0/24", "172.18.8.0/24"] - create_database_subnet_group = true + create_database_subnet_group = false create_database_subnet_route_table = true create_database_internet_gateway_route = true @@ -41,20 +41,23 @@ module "vpc" { tags = { Terraform = "true" + Terratest = "true" Environment = "dev" } } -resource "aws_security_group" "example" { - count = 2 - # ... other configuration ... +module "sg-ports" { + # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git//modules/rds-postgres-ports?ref=2.0.0" + source = "../../modules/rds-postgres-ports" +} +module "rds-postgres-sg" { + source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" vpc_id = module.vpc.vpc_id - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - ipv6_cidr_blocks = ["::/0"] - } -} + ingress_cidr_blocks = module.vpc.database_subnets_cidr_blocks + egress_cidr_blocks = var.egress_cidr_blocks + ingress_ports = module.sg-ports.ingress_ports + sg_name_prefix = var.name_prefix + egress_protocol = "all" + ingress_protocol = "tcp" +} \ No newline at end of file diff --git a/examples/test_minimal/outputs.tf b/examples/test_minimal/outputs.tf index cde3e15..a65b372 100644 --- a/examples/test_minimal/outputs.tf +++ b/examples/test_minimal/outputs.tf @@ -1,8 +1,27 @@ -output "module_vpc" { - value = module.vpc +output "rds_db_port" { + value = module.rds_postgres.rds_db_port } -output "module_rds" { - value = module.rds_postgres +output "rds_dbname" { + value = module.rds_postgres.rds_dbname } +output "rds_hostname" { + value = module.rds_postgres.rds_hostname +} + +output "rds_postgres_id" { + value = module.rds_postgres.rds_postgres_id +} + +output "rds_postgres_pg_id" { + value = module.rds_postgres.rds_postgres_pg_id +} + +output "rds_security_group_ids" { + value = module.rds_postgres.rds_security_group_ids +} + +output "rds_username" { + value = module.rds_postgres.rds_username +} diff --git a/examples/test_minimal/variables.tf b/examples/test_minimal/variables.tf index 730ea18..fb5d6cf 100644 --- a/examples/test_minimal/variables.tf +++ b/examples/test_minimal/variables.tf @@ -8,7 +8,7 @@ variable "parameter_group_name" { description = "Name of the parameter group" } -variable "identifier_prefix" { +variable "name_prefix" { type = string description = "Identifier prefix for the resources" } @@ -23,13 +23,8 @@ variable "pg_password" { description = "Password for postgres" } -# variable "spark_sg_id_list" { -# type = list(string) -# description = "List of IDs of Sec groups" -# } - - -# variable "tamr_vm_sg_id" { -# type = string -# description = "ID of Tamr VM Sec groups" -# } \ No newline at end of file +variable "egress_cidr_blocks" { + description = "CIDR blocks to attach to security groups for egress" + type = list(string) + default = ["0.0.0.0/0"] +} diff --git a/go.mod b/go.mod deleted file mode 100644 index 2a06bf9..0000000 --- a/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/caylent/tamr-terraform-aws-rds-postgres - -go 1.16 - -require ( - github.com/gruntwork-io/terratest v0.36.2 - github.com/lib/pq v1.10.2 // indirect - github.com/stretchr/testify v1.4.0 // indirect -) diff --git a/test/create_db_test.go b/test/create_db_test.go new file mode 100644 index 0000000..c91cd52 --- /dev/null +++ b/test/create_db_test.go @@ -0,0 +1,93 @@ +package tests + +import ( + "fmt" + "strings" + "testing" + "time" + + "github.com/aws/aws-sdk-go/service/rds" + "github.com/gruntwork-io/terratest/modules/aws" + "github.com/gruntwork-io/terratest/modules/random" + "github.com/gruntwork-io/terratest/modules/retry" + + "github.com/gruntwork-io/terratest/modules/terraform" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestTerraformCreateRDS(t *testing.T) { + t.Parallel() + + // randomId := "qurwrs" + randomId := strings.ToLower(random.UniqueId()) + namePrefix := fmt.Sprintf("%s-%s", "terratest-rds", randomId) + expectedDBName := strings.ReplaceAll(namePrefix, "-", "_") // db names don't accept hyphens + + // Getting a random region between the US ones + awsRegion := aws.GetRandomRegion(t, []string{"us-east-1", "us-east-2", "us-west-1", "us-west-2"}, nil) + // awsRegion := "us-east-1" + + expectedUser := "tamruser" + pw := "tamrpassword" + expectedPort := int64(5432) + + terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ + // The path to where our Terraform code is located + TerraformDir: "../examples/test_minimal", + + Vars: map[string]interface{}{ + "postgres_db_name": expectedDBName, + "parameter_group_name": fmt.Sprintf("%s-rds-postgres-pg", namePrefix), + "name_prefix": fmt.Sprintf("%s-", namePrefix), + "pg_username": expectedUser, + "pg_password": pw, + }, + // Environment variables to set when running Terraform + EnvVars: map[string]string{ + "AWS_DEFAULT_REGION": awsRegion, + }, + }) + + defer terraform.Destroy(t, terraformOptions) + terraform.InitAndApply(t, terraformOptions) + + ords := terraform.OutputAll(t, terraformOptions) + + oRDSInstanceID := ords["rds_postgres_id"].(string) + oRDSSGIDs := ords["rds_security_group_ids"].([]interface{}) + oRDShostname := ords["rds_hostname"].(string) + oRDSport := ords["rds_db_port"].(float64) + oRDSuser := ords["rds_username"].(string) + oDBName := ords["rds_dbname"].(string) + + // Fails test if Instance ID is nil + require.NotNil(t, oRDSInstanceID) + + // Information in RDS API can take more than 20 mins to be available. We retry for 40mins before proceeding + rdsObj := retry.DoWithRetryInterface(t, "Waiting RDS API to be available", 20, 2*time.Minute, func() (interface{}, error) { + return aws.GetRdsInstanceDetailsE(t, oRDSInstanceID, awsRegion) + }).(*rds.DBInstance) + + // Verify that the address is not null and equal to output + address := aws.GetAddressOfRdsInstance(t, oRDSInstanceID, awsRegion) + assert.NotNil(t, address) + assert.Equal(t, oRDShostname, address) + + // Verify that the DB instance is listening on the expected port and equal to output + port := aws.GetPortOfRdsInstance(t, oRDSInstanceID, awsRegion) + assert.Equal(t, expectedPort, port) + assert.Equal(t, int64(oRDSport), port) + + // Verify Sec Group IDs output is not nil + assert.NotNil(t, oRDSSGIDs) + + // Verify that user is the same as expected and equal to output + assert.Equal(t, expectedUser, *rdsObj.MasterUsername) + assert.NotNil(t, oRDSuser) + + // Verify that user is the same as expected and equal to output + assert.Equal(t, expectedDBName, *rdsObj.DBName) + assert.Equal(t, oDBName, *rdsObj.DBName) + +} diff --git a/test/go.mod b/test/go.mod new file mode 100644 index 0000000..bfa0064 --- /dev/null +++ b/test/go.mod @@ -0,0 +1,10 @@ +module github.com/Datatamer/tamr-terraform-aws-rds-postgres + +go 1.16 + +require ( + github.com/aws/aws-sdk-go v1.38.28 // indirect + github.com/gruntwork-io/terratest v0.36.2 + github.com/lib/pq v1.10.2 + github.com/stretchr/testify v1.4.0 +) diff --git a/go.sum b/test/go.sum similarity index 100% rename from go.sum rename to test/go.sum diff --git a/tests/connect_db_test.go b/tests/connect_db_test.go deleted file mode 100644 index 6457191..0000000 --- a/tests/connect_db_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package tests - -import ( - "database/sql" - "fmt" - - terratest_testing "github.com/gruntwork-io/terratest/modules/testing" -) - -// GetWhetherSchemaExistsInRdsPostgresInstance checks whether the specified schema/table name exists in the RDS instance -func GetWhetherSchemaExistsInRdsPostgresInstance(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) bool { - output, err := GetWhetherSchemaExistsInRdsPostgresInstanceE(t, dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) - if err != nil { - t.Fatal(err) - } - return output -} - -// GetWhetherSchemaExistsInRdsPostgresInstanceE checks whether the specified schema/table name exists in the RDS instance -func GetWhetherSchemaExistsInRdsPostgresInstanceE(t terratest_testing.TestingT, dbUrl string, dbPort int64, dbUsername string, dbPassword string, expectedSchemaName string) (bool, error) { - connectionString := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s", dbUrl, dbPort, dbUsername, dbPassword, expectedSchemaName) - - db, connErr := sql.Open("postgres", connectionString) - if connErr != nil { - return false, connErr - } - defer db.Close() - var ( - schemaName string - ) - sqlStatement := `SELECT "catalog_name" FROM "information_schema"."schemata" where catalog_name=$1` - row := db.QueryRow(sqlStatement, expectedSchemaName) - scanErr := row.Scan(&schemaName) - if scanErr != nil { - return false, scanErr - } - return true, nil -} diff --git a/tests/create_db_test.go b/tests/create_db_test.go deleted file mode 100644 index 71dd754..0000000 --- a/tests/create_db_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package tests - -import ( - "fmt" - "strings" - "testing" - - "github.com/gruntwork-io/terratest/modules/aws" - "github.com/gruntwork-io/terratest/modules/logger" - "github.com/gruntwork-io/terratest/modules/terraform" - _ "github.com/lib/pq" - "github.com/stretchr/testify/assert" -) - -func TestTerraformCreateRDS(t *testing.T) { - t.Parallel() - - namePrefix := "terratest-aws-rds-example" - // expectedName := fmt.Sprintf("%s-%s", namePrefix, strings.ToLower(random.UniqueId())) - expectedName := namePrefix // remove this later - expectedDBName := strings.ReplaceAll(expectedName, "-", "_") - - //awsRegion := aws.GetRandomStableRegion(t, nil, nil) - awsRegion := "us-east-1" // remove this later - - user := "tamruser" - pw := "tamrpassword" - expectedPort := int64(5432) - - terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ - // The path to where our Terraform code is located - TerraformDir: "../examples/test_minimal", - - Vars: map[string]interface{}{ - "postgres_db_name": expectedDBName, - "parameter_group_name": fmt.Sprintf("%s-rds-postgres-pg", namePrefix), - "identifier_prefix": fmt.Sprintf("%s-", namePrefix), - "pg_username": user, - "pg_password": pw, - // "spark_sg_id_list": []string{"sg-0b103ea834dfa1234"}, - // "tamr_vm_sg_id": "sg-0b103ea834dfac123", - }, - // Environment variables to set when running Terraform - EnvVars: map[string]string{ - "AWS_DEFAULT_REGION": awsRegion, - }, - }) - - // - // defer terraform.Destroy(t, terraformOptions) - // terraform.InitAndApply(t, terraformOptions) - - rds := terraform.OutputMapOfObjects(t, terraformOptions, "module_rds") - // output "rds_postgres_pg_id" - // output "rds_postgres_id" - // output "rds_sg_id" - // output "rds_hostname" - - dbInstanceID := rds["rds_postgres_id"].(string) - // dbHostname := rds["rds_hostname"].(string) - // dbSecGroupID := rds["rds_sg_id"].(string) - // dbParamGroupID := rds["rds_postgres_pg_id"].(string) - - logger.Log(t, fmt.Sprintf("RDS object: %+v", rds)) - - // Look up the endpoint address and port of the RDS instance - address := aws.GetAddressOfRdsInstance(t, dbInstanceID, awsRegion) - port := aws.GetPortOfRdsInstance(t, dbInstanceID, awsRegion) - - // describe rds - SG 5432 port - // aws.GetAllParametersOfRdsInstance() - - // describe rds - param group - - // test connectivity - // schemaExistsInRdsInstance := GetWhetherSchemaExistsInRdsPostgresInstance(t, rds["rds_hostname"].(string), int64(expectedPort), user, pw, expectedDBName) - - // Verify that the table/schema requested for creation is actually present in the database - // assert.True(t, schemaExistsInRdsInstance) - - // assert.Equal(t, expectedName, ) - - // Verify that the address is not null - assert.NotNil(t, address) - // Verify that the DB instance is listening on the port mentioned - assert.Equal(t, expectedPort, port) - -} From 620fa76487833e4cc5b5ecea222a0cdf7f4ee2c4 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 15 Jul 2021 16:15:47 -0300 Subject: [PATCH 07/28] standard for test_examples folder name --- examples/test_minimal/.terraform.lock.hcl | 21 ------------------- examples/test_minimal/local.tfvars | 6 ------ test/create_db_test.go | 2 +- .../test_minimal/README.md | 0 .../test_minimal/main.tf | 0 .../test_minimal/outputs.tf | 0 .../test_minimal/variables.tf | 0 7 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 examples/test_minimal/.terraform.lock.hcl delete mode 100644 examples/test_minimal/local.tfvars rename {examples => test_examples}/test_minimal/README.md (100%) rename {examples => test_examples}/test_minimal/main.tf (100%) rename {examples => test_examples}/test_minimal/outputs.tf (100%) rename {examples => test_examples}/test_minimal/variables.tf (100%) diff --git a/examples/test_minimal/.terraform.lock.hcl b/examples/test_minimal/.terraform.lock.hcl deleted file mode 100644 index 335114f..0000000 --- a/examples/test_minimal/.terraform.lock.hcl +++ /dev/null @@ -1,21 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "3.47.0" - constraints = ">= 3.15.0" - hashes = [ - "h1:oiX6JcoXY6lYIdcYWmEpr7mnS4mkyDV9intCNrcjiBs=", - "zh:07bb6bda5b9fdb782dd568a2e85cfe0ab108770e2218f3411e57ed845c58af40", - "zh:0926b161a109e75bdc8691e8a32f568b4cd77a55510cf27573261fb5ba382287", - "zh:0a91adf25a78ad31d547da513db24f493d27592d3675ed291a7698351c30992d", - "zh:0f95f01e3bf0dab306ed86afb1ca00e01ce94ed6696765158d544b1569483b13", - "zh:10466a520c617354ebbee9366267e0878b091a15d49cb97846511e952bd9db90", - "zh:2fc627d3dc5a6df904591c673d640e6d3a697dcc12d1a43cf71066a47314f7c0", - "zh:a85476047ddb359acdc0db5b9cbe0a7e13c4e65289b03f6c93303d0452db450b", - "zh:cbadde98d44e8953cc78487b6788b97cff12632e9fda065bb970b001205662cb", - "zh:db05702323c5fa253d5e067458340b89126738b8f6a9847465ee3e75b0f28320", - "zh:e16cf52ff3b067adb33a75b89c03f9b03e666e2d45adb2ee296ae12b36cd5776", - "zh:fcb8f73f7f5e195e3345d5694b526e0d5e77562d2e7dd468366ee15b1be6b418", - ] -} diff --git a/examples/test_minimal/local.tfvars b/examples/test_minimal/local.tfvars deleted file mode 100644 index 2d711b5..0000000 --- a/examples/test_minimal/local.tfvars +++ /dev/null @@ -1,6 +0,0 @@ -#postgres_name = "example-rds-postgres" -postgres_db_name = "terratest_aws_rds_example" -parameter_group_name = "terratest-aws-rds-example-rds-postgres-pg" -identifier_prefix = "terratest-aws-rds-example-" -pg_username = "tamruser" -pg_password = "tamrpassword" diff --git a/test/create_db_test.go b/test/create_db_test.go index c91cd52..dfd22a5 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -34,7 +34,7 @@ func TestTerraformCreateRDS(t *testing.T) { terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ // The path to where our Terraform code is located - TerraformDir: "../examples/test_minimal", + TerraformDir: "../test_examples/test_minimal", Vars: map[string]interface{}{ "postgres_db_name": expectedDBName, diff --git a/examples/test_minimal/README.md b/test_examples/test_minimal/README.md similarity index 100% rename from examples/test_minimal/README.md rename to test_examples/test_minimal/README.md diff --git a/examples/test_minimal/main.tf b/test_examples/test_minimal/main.tf similarity index 100% rename from examples/test_minimal/main.tf rename to test_examples/test_minimal/main.tf diff --git a/examples/test_minimal/outputs.tf b/test_examples/test_minimal/outputs.tf similarity index 100% rename from examples/test_minimal/outputs.tf rename to test_examples/test_minimal/outputs.tf diff --git a/examples/test_minimal/variables.tf b/test_examples/test_minimal/variables.tf similarity index 100% rename from examples/test_minimal/variables.tf rename to test_examples/test_minimal/variables.tf From 8463d01fe38c571fce31f7ba1a018d6419004386 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 15 Jul 2021 16:37:05 -0300 Subject: [PATCH 08/28] make lint, terraform/docs and fmt --- README.md | 2 +- examples/minimal/main.tf | 16 +++++----- examples/minimal/outputs.tf | 2 +- examples/minimal/variables.tf | 6 ++-- modules/rds-postgres-ports/outputs.tf | 4 +-- modules/rds-postgres-sg/README.md | 0 test_examples/test_minimal/main.tf | 42 ++++++++++++------------- test_examples/test_minimal/outputs.tf | 14 ++++----- test_examples/test_minimal/variables.tf | 4 +-- 9 files changed, 45 insertions(+), 45 deletions(-) delete mode 100644 modules/rds-postgres-sg/README.md diff --git a/README.md b/README.md index 3198376..07b5800 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ This terraform module will create: |------|-------------|------|---------|:--------:| | password | The password for the master DB user. | `string` | n/a | yes | | rds\_subnet\_ids | VPC subnet IDs in subnet group | `list(string)` | n/a | yes | -| security\_group\_ids | List of security group IDs to allow ingress from (i.e. Spark cluster SG IDs, Tamr VM SG ID) | `list(string)` | n/a | yes | +| security\_group\_ids | List of security group IDs to associate | `list(string)` | n/a | yes | | subnet\_group\_name | The name of the subnet group to add the RDS instance to | `string` | n/a | yes | | vpc\_id | VPC ID for the rds security group | `string` | n/a | yes | | additional\_cidrs | Additional CIDR to connect to RDS Postgres instance | `list(string)` | `[]` | no | diff --git a/examples/minimal/main.tf b/examples/minimal/main.tf index 36a8fc8..4bbf44c 100644 --- a/examples/minimal/main.tf +++ b/examples/minimal/main.tf @@ -11,7 +11,7 @@ module "rds_postgres" { vpc_id = var.vpc_id subnet_group_name = "example_subnet_group" # Network requirement: DB subnet group needs a subnet in at least two Availability Zones - rds_subnet_ids = var.subnet_ids + rds_subnet_ids = var.subnet_ids security_group_ids = module.rds-postgres-sg.security_group_ids } @@ -21,12 +21,12 @@ module "sg-ports" { } module "rds-postgres-sg" { - source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" - vpc_id = var.vpc_id + source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" + vpc_id = var.vpc_id ingress_cidr_blocks = var.ingress_cidr_blocks - egress_cidr_blocks = var.egress_cidr_blocks - ingress_ports = module.sg-ports.ingress_ports - sg_name_prefix = var.name_prefix - egress_protocol = "all" - ingress_protocol = "tcp" + egress_cidr_blocks = var.egress_cidr_blocks + ingress_ports = module.sg-ports.ingress_ports + sg_name_prefix = var.name_prefix + egress_protocol = "all" + ingress_protocol = "tcp" } diff --git a/examples/minimal/outputs.tf b/examples/minimal/outputs.tf index 9512893..a8da4fd 100644 --- a/examples/minimal/outputs.tf +++ b/examples/minimal/outputs.tf @@ -1,5 +1,5 @@ output "ingress_ports" { - value = module.sg-ports + value = module.sg-ports description = "List of ingress ports" } diff --git a/examples/minimal/variables.tf b/examples/minimal/variables.tf index e72210b..e5a77b1 100644 --- a/examples/minimal/variables.tf +++ b/examples/minimal/variables.tf @@ -19,11 +19,11 @@ variable "name_prefix" { variable "ingress_cidr_blocks" { description = "CIDR blocks to attach to security groups for ingress" - type = list(string) + type = list(string) } variable "egress_cidr_blocks" { description = "CIDR blocks to attach to security groups for egress" - type = list(string) - default = ["0.0.0.0/0"] + type = list(string) + default = ["0.0.0.0/0"] } diff --git a/modules/rds-postgres-ports/outputs.tf b/modules/rds-postgres-ports/outputs.tf index f5dbe82..0bbaddf 100644 --- a/modules/rds-postgres-ports/outputs.tf +++ b/modules/rds-postgres-ports/outputs.tf @@ -1,7 +1,7 @@ output "ingress_ports" { value = concat( - var.ports, - var.additional_ports, + var.ports, + var.additional_ports, ) description = "List of ingress ports" } diff --git a/modules/rds-postgres-sg/README.md b/modules/rds-postgres-sg/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/test_examples/test_minimal/main.tf b/test_examples/test_minimal/main.tf index f7ff472..65c4bd2 100644 --- a/test_examples/test_minimal/main.tf +++ b/test_examples/test_minimal/main.tf @@ -4,20 +4,20 @@ module "rds_postgres" { postgres_name = var.postgres_db_name parameter_group_name = var.parameter_group_name identifier_prefix = var.name_prefix - instance_class = "db.t3.medium" - engine_version = "12.5" - username = var.pg_username - password = var.pg_password + instance_class = "db.t3.medium" + engine_version = "12.5" + username = var.pg_username + password = var.pg_password - subnet_group_name = "${var.name_prefix}-subnet-group" - vpc_id = module.vpc.vpc_id + subnet_group_name = "${var.name_prefix}-subnet-group" + vpc_id = module.vpc.vpc_id # Network requirement: DB subnet group needs a subnet in at least two Availability Zones - rds_subnet_ids = module.vpc.database_subnets + rds_subnet_ids = module.vpc.database_subnets security_group_ids = module.rds-postgres-sg.security_group_ids } -data "aws_region" "current" { } +data "aws_region" "current" {} module "vpc" { source = "terraform-aws-modules/vpc/aws" @@ -26,11 +26,11 @@ module "vpc" { name = "${var.name_prefix}vpc" cidr = "172.18.0.0/18" - azs = [for i in ["a","b","c"] : "${data.aws_region.current.name}${i}"] + azs = [for i in ["a", "b", "c"] : "${data.aws_region.current.name}${i}"] private_subnets = ["172.18.0.0/24", "172.18.1.0/24", "172.18.2.0/24"] public_subnets = ["172.18.3.0/24", "172.18.4.0/24", "172.18.5.0/24"] - - database_subnets = ["172.18.6.0/24", "172.18.7.0/24", "172.18.8.0/24"] + + database_subnets = ["172.18.6.0/24", "172.18.7.0/24", "172.18.8.0/24"] create_database_subnet_group = false create_database_subnet_route_table = true @@ -40,8 +40,8 @@ module "vpc" { enable_vpn_gateway = false tags = { - Terraform = "true" - Terratest = "true" + Terraform = "true" + Terratest = "true" Environment = "dev" } } @@ -52,12 +52,12 @@ module "sg-ports" { } module "rds-postgres-sg" { - source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" - vpc_id = module.vpc.vpc_id + source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" + vpc_id = module.vpc.vpc_id ingress_cidr_blocks = module.vpc.database_subnets_cidr_blocks - egress_cidr_blocks = var.egress_cidr_blocks - ingress_ports = module.sg-ports.ingress_ports - sg_name_prefix = var.name_prefix - egress_protocol = "all" - ingress_protocol = "tcp" -} \ No newline at end of file + egress_cidr_blocks = var.egress_cidr_blocks + ingress_ports = module.sg-ports.ingress_ports + sg_name_prefix = var.name_prefix + egress_protocol = "all" + ingress_protocol = "tcp" +} diff --git a/test_examples/test_minimal/outputs.tf b/test_examples/test_minimal/outputs.tf index a65b372..c6505ce 100644 --- a/test_examples/test_minimal/outputs.tf +++ b/test_examples/test_minimal/outputs.tf @@ -1,27 +1,27 @@ output "rds_db_port" { - value = module.rds_postgres.rds_db_port + value = module.rds_postgres.rds_db_port } output "rds_dbname" { - value = module.rds_postgres.rds_dbname + value = module.rds_postgres.rds_dbname } output "rds_hostname" { - value = module.rds_postgres.rds_hostname + value = module.rds_postgres.rds_hostname } output "rds_postgres_id" { - value = module.rds_postgres.rds_postgres_id + value = module.rds_postgres.rds_postgres_id } output "rds_postgres_pg_id" { - value = module.rds_postgres.rds_postgres_pg_id + value = module.rds_postgres.rds_postgres_pg_id } output "rds_security_group_ids" { - value = module.rds_postgres.rds_security_group_ids + value = module.rds_postgres.rds_security_group_ids } output "rds_username" { - value = module.rds_postgres.rds_username + value = module.rds_postgres.rds_username } diff --git a/test_examples/test_minimal/variables.tf b/test_examples/test_minimal/variables.tf index fb5d6cf..5718444 100644 --- a/test_examples/test_minimal/variables.tf +++ b/test_examples/test_minimal/variables.tf @@ -25,6 +25,6 @@ variable "pg_password" { variable "egress_cidr_blocks" { description = "CIDR blocks to attach to security groups for egress" - type = list(string) - default = ["0.0.0.0/0"] + type = list(string) + default = ["0.0.0.0/0"] } From 057d8121c0f05081472ecc34270c787f9e92daf4 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 15 Jul 2021 16:47:07 -0300 Subject: [PATCH 09/28] go mod tidy --- test/go.mod | 3 +-- test/go.sum | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/test/go.mod b/test/go.mod index bfa0064..5a0fd59 100644 --- a/test/go.mod +++ b/test/go.mod @@ -3,8 +3,7 @@ module github.com/Datatamer/tamr-terraform-aws-rds-postgres go 1.16 require ( - github.com/aws/aws-sdk-go v1.38.28 // indirect + github.com/aws/aws-sdk-go v1.38.28 github.com/gruntwork-io/terratest v0.36.2 - github.com/lib/pq v1.10.2 github.com/stretchr/testify v1.4.0 ) diff --git a/test/go.sum b/test/go.sum index a0d46d4..df6de60 100644 --- a/test/go.sum +++ b/test/go.sum @@ -267,8 +267,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= From 7df5db6d8e4dd3d82a52068b0a16b06f3bcb1b8e Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 15 Jul 2021 17:37:47 -0300 Subject: [PATCH 10/28] fix comments --- test/create_db_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/create_db_test.go b/test/create_db_test.go index dfd22a5..830b7f9 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -19,14 +19,12 @@ import ( func TestTerraformCreateRDS(t *testing.T) { t.Parallel() - // randomId := "qurwrs" - randomId := strings.ToLower(random.UniqueId()) - namePrefix := fmt.Sprintf("%s-%s", "terratest-rds", randomId) - expectedDBName := strings.ReplaceAll(namePrefix, "-", "_") // db names don't accept hyphens + namePrefix := fmt.Sprintf("%s-%s", "terratest-rds", strings.ToLower(random.UniqueId())) + // db names don't accept hyphens + expectedDBName := strings.ReplaceAll(namePrefix, "-", "_") // Getting a random region between the US ones awsRegion := aws.GetRandomRegion(t, []string{"us-east-1", "us-east-2", "us-west-1", "us-west-2"}, nil) - // awsRegion := "us-east-1" expectedUser := "tamruser" pw := "tamrpassword" @@ -49,22 +47,24 @@ func TestTerraformCreateRDS(t *testing.T) { }, }) + // terraform destroy when this function returns defer terraform.Destroy(t, terraformOptions) + terraform.InitAndApply(t, terraformOptions) - ords := terraform.OutputAll(t, terraformOptions) + oRDS := terraform.OutputAll(t, terraformOptions) - oRDSInstanceID := ords["rds_postgres_id"].(string) - oRDSSGIDs := ords["rds_security_group_ids"].([]interface{}) - oRDShostname := ords["rds_hostname"].(string) - oRDSport := ords["rds_db_port"].(float64) - oRDSuser := ords["rds_username"].(string) - oDBName := ords["rds_dbname"].(string) + oRDSInstanceID := oRDS["rds_postgres_id"].(string) + oRDSSGIDs := oRDS["rds_security_group_ids"].([]interface{}) + oRDShostname := oRDS["rds_hostname"].(string) + oRDSport := oRDS["rds_db_port"].(float64) + oRDSuser := oRDS["rds_username"].(string) + oDBName := oRDS["rds_dbname"].(string) // Fails test if Instance ID is nil require.NotNil(t, oRDSInstanceID) - // Information in RDS API can take more than 20 mins to be available. We retry for 40mins before proceeding + // Information in RDS API can take more than 20 mins to be available. We retry for 40mins before failing rdsObj := retry.DoWithRetryInterface(t, "Waiting RDS API to be available", 20, 2*time.Minute, func() (interface{}, error) { return aws.GetRdsInstanceDetailsE(t, oRDSInstanceID, awsRegion) }).(*rds.DBInstance) From d030414b250acc4220c98e3f37d4ed3c1bd567d3 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 15 Sep 2021 20:27:19 -0300 Subject: [PATCH 11/28] big refactor - test_structure + testCases --- test/create_db_test.go | 162 +++++++++--------- test/test_util.go | 73 ++++++++ .../{test_minimal => minimal}/README.md | 0 test_examples/minimal/local.tfvars | 6 + .../{test_minimal => minimal}/main.tf | 8 +- .../{test_minimal => minimal}/outputs.tf | 0 .../{test_minimal => minimal}/variables.tf | 0 7 files changed, 166 insertions(+), 83 deletions(-) create mode 100644 test/test_util.go rename test_examples/{test_minimal => minimal}/README.md (100%) create mode 100644 test_examples/minimal/local.tfvars rename test_examples/{test_minimal => minimal}/main.tf (85%) rename test_examples/{test_minimal => minimal}/outputs.tf (100%) rename test_examples/{test_minimal => minimal}/variables.tf (100%) diff --git a/test/create_db_test.go b/test/create_db_test.go index 830b7f9..b82a810 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -1,93 +1,97 @@ -package tests +package test import ( "fmt" "strings" "testing" - "time" - "github.com/aws/aws-sdk-go/service/rds" "github.com/gruntwork-io/terratest/modules/aws" "github.com/gruntwork-io/terratest/modules/random" - "github.com/gruntwork-io/terratest/modules/retry" - "github.com/gruntwork-io/terratest/modules/terraform" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + test_structure "github.com/gruntwork-io/terratest/modules/test-structure" ) -func TestTerraformCreateRDS(t *testing.T) { - t.Parallel() - - namePrefix := fmt.Sprintf("%s-%s", "terratest-rds", strings.ToLower(random.UniqueId())) - // db names don't accept hyphens - expectedDBName := strings.ReplaceAll(namePrefix, "-", "_") - - // Getting a random region between the US ones - awsRegion := aws.GetRandomRegion(t, []string{"us-east-1", "us-east-2", "us-west-1", "us-west-2"}, nil) - - expectedUser := "tamruser" - pw := "tamrpassword" - expectedPort := int64(5432) - - terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ - // The path to where our Terraform code is located - TerraformDir: "../test_examples/test_minimal", - - Vars: map[string]interface{}{ - "postgres_db_name": expectedDBName, - "parameter_group_name": fmt.Sprintf("%s-rds-postgres-pg", namePrefix), - "name_prefix": fmt.Sprintf("%s-", namePrefix), - "pg_username": expectedUser, - "pg_password": pw, - }, - // Environment variables to set when running Terraform - EnvVars: map[string]string{ - "AWS_DEFAULT_REGION": awsRegion, +const expectedPw = "tamrpassword" + +func initTestCases() []RdsTestCase { + return []RdsTestCase{ + { + testName: "test1", + expectApplyError: false, + vars: map[string]interface{}{ + "pg_password": expectedPw, + "pg_username": "", + "postgres_db_name": "", + "parameter_group_name": "", + "name_prefix": "", + }, }, - }) - - // terraform destroy when this function returns - defer terraform.Destroy(t, terraformOptions) - - terraform.InitAndApply(t, terraformOptions) - - oRDS := terraform.OutputAll(t, terraformOptions) - - oRDSInstanceID := oRDS["rds_postgres_id"].(string) - oRDSSGIDs := oRDS["rds_security_group_ids"].([]interface{}) - oRDShostname := oRDS["rds_hostname"].(string) - oRDSport := oRDS["rds_db_port"].(float64) - oRDSuser := oRDS["rds_username"].(string) - oDBName := oRDS["rds_dbname"].(string) - - // Fails test if Instance ID is nil - require.NotNil(t, oRDSInstanceID) - - // Information in RDS API can take more than 20 mins to be available. We retry for 40mins before failing - rdsObj := retry.DoWithRetryInterface(t, "Waiting RDS API to be available", 20, 2*time.Minute, func() (interface{}, error) { - return aws.GetRdsInstanceDetailsE(t, oRDSInstanceID, awsRegion) - }).(*rds.DBInstance) - - // Verify that the address is not null and equal to output - address := aws.GetAddressOfRdsInstance(t, oRDSInstanceID, awsRegion) - assert.NotNil(t, address) - assert.Equal(t, oRDShostname, address) - - // Verify that the DB instance is listening on the expected port and equal to output - port := aws.GetPortOfRdsInstance(t, oRDSInstanceID, awsRegion) - assert.Equal(t, expectedPort, port) - assert.Equal(t, int64(oRDSport), port) - - // Verify Sec Group IDs output is not nil - assert.NotNil(t, oRDSSGIDs) - - // Verify that user is the same as expected and equal to output - assert.Equal(t, expectedUser, *rdsObj.MasterUsername) - assert.NotNil(t, oRDSuser) - - // Verify that user is the same as expected and equal to output - assert.Equal(t, expectedDBName, *rdsObj.DBName) - assert.Equal(t, oDBName, *rdsObj.DBName) + } +} +func TestTerraformCreateRDS(t *testing.T) { + testCases := initTestCases() + + for _, testCase := range testCases { + testCase := testCase + + t.Run(testCase.testName, func(t *testing.T) { + t.Parallel() + + // These will create a tempTestFolder for each bucketTestCase. + tempTestFolder := test_structure.CopyTerraformFolderToTemp(t, "..", "test_examples/minimal") + + // this stage will generate a random `awsRegion` and a `uniqueId` to be used in tests. + test_structure.RunTestStage(t, "pick_new_randoms", func() { + usRegions := []string{"us-east-1", "us-east-2", "us-west-1", "us-west-2"} + // This function will first check for the Env Var TERRATEST_REGION and return its value if != "" + awsRegion := aws.GetRandomStableRegion(t, usRegions, nil) + + test_structure.SaveString(t, tempTestFolder, "region", awsRegion) + test_structure.SaveString(t, tempTestFolder, "unique_id", strings.ToLower(random.UniqueId())) + }) + + defer test_structure.RunTestStage(t, "teardown", func() { + teraformOptions := test_structure.LoadTerraformOptions(t, tempTestFolder) + terraform.Destroy(t, teraformOptions) + }) + + test_structure.RunTestStage(t, "setup_options", func() { + awsRegion := test_structure.LoadString(t, tempTestFolder, "region") + uniqueID := test_structure.LoadString(t, tempTestFolder, "unique_id") + + testCase.vars["parameter_group_name"] = fmt.Sprintf("terratest-pg-%s", uniqueID) + testCase.vars["name_prefix"] = fmt.Sprintf("terratest-%s", uniqueID) + testCase.vars["pg_username"] = uniqueID + testCase.vars["postgres_db_name"] = fmt.Sprintf("db_%s", uniqueID) + + terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ + TerraformDir: tempTestFolder, + Vars: testCase.vars, + EnvVars: map[string]string{ + "AWS_REGION": awsRegion, + }, + }) + + test_structure.SaveTerraformOptions(t, tempTestFolder, terraformOptions) + }) + + test_structure.RunTestStage(t, "create_rds", func() { + terraformOptions := test_structure.LoadTerraformOptions(t, tempTestFolder) + terraform.InitAndApply(t, terraformOptions) + }) + + test_structure.RunTestStage(t, "validate", func() { + awsRegion := test_structure.LoadString(t, tempTestFolder, "region") + terraformOptions := test_structure.LoadTerraformOptions(t, tempTestFolder) + validateModuleOutputs(t, + terraformOptions, + awsRegion, + int64(5432), + testCase.vars["pg_username"].(string), + testCase.vars["postgres_db_name"].(string), + ) + }) + }) + } } diff --git a/test/test_util.go b/test/test_util.go new file mode 100644 index 0000000..881be4e --- /dev/null +++ b/test/test_util.go @@ -0,0 +1,73 @@ +package test + +import ( + "testing" + "time" + + "github.com/aws/aws-sdk-go/service/rds" + "github.com/gruntwork-io/terratest/modules/aws" + "github.com/gruntwork-io/terratest/modules/retry" + "github.com/gruntwork-io/terratest/modules/terraform" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// RdsTestCase is a struct for defining tests for Elastic Map Reduce Module +type RdsTestCase struct { + testName string + vars map[string]interface{} + expectApplyError bool +} + +func validateModuleOutputs(t *testing.T, terraformOptions *terraform.Options, awsRegion string, expectedPort int64, expectedUser string, expectedDBName string) { + + oRDS := terraform.OutputAll(t, terraformOptions) + + oRDSInstanceID := oRDS["rds_postgres_id"].(string) + oRDSSGIDs := oRDS["rds_security_group_ids"].([]interface{}) + oRDShostname := oRDS["rds_hostname"].(string) + oRDSport := oRDS["rds_db_port"].(float64) + oRDSuser := oRDS["rds_username"].(string) + oDBName := oRDS["rds_dbname"].(string) + + // Fails test if Instance ID is nil + require.NotNil(t, oRDSInstanceID) + + // Information in RDS API can take more than 20 mins to be available. We retry for 40mins before failing + rdsObj := retry.DoWithRetryInterface(t, "Waiting RDS API to be available", 20, 2*time.Minute, func() (interface{}, error) { + return aws.GetRdsInstanceDetailsE(t, oRDSInstanceID, awsRegion) + }).(*rds.DBInstance) + + t.Run("validate_address", func(t *testing.T) { + // Verify that the address is not null and equal to output + address := aws.GetAddressOfRdsInstance(t, oRDSInstanceID, awsRegion) + require.NotNil(t, address) + assert.Equal(t, oRDShostname, address) + assert.Equal(t, oRDShostname, *rdsObj.Endpoint.Address) + }) + + t.Run("validate_port", func(t *testing.T) { + // Verify that the DB instance is listening on the expected port and equal to output + port := aws.GetPortOfRdsInstance(t, oRDSInstanceID, awsRegion) + assert.Equal(t, expectedPort, port) + assert.Equal(t, int64(oRDSport), port) + }) + + t.Run("validate_SG", func(t *testing.T) { + // Verify Sec Group IDs output is not nil + assert.NotNil(t, oRDSSGIDs) + }) + + t.Run("validate_user", func(t *testing.T) { + // Verify that user is the same as expected and equal to output + assert.Equal(t, expectedUser, *rdsObj.MasterUsername) + assert.NotNil(t, oRDSuser) + }) + + t.Run("validate_dbname", func(t *testing.T) { + // Verify that dbName is the same as expected and equal to output + assert.Equal(t, expectedDBName, *rdsObj.DBName) + assert.Equal(t, oDBName, *rdsObj.DBName) + }) + +} diff --git a/test_examples/test_minimal/README.md b/test_examples/minimal/README.md similarity index 100% rename from test_examples/test_minimal/README.md rename to test_examples/minimal/README.md diff --git a/test_examples/minimal/local.tfvars b/test_examples/minimal/local.tfvars new file mode 100644 index 0000000..c60884c --- /dev/null +++ b/test_examples/minimal/local.tfvars @@ -0,0 +1,6 @@ +#postgres_name = "example-rds-postgres" +# postgres_db_name = "terratest_rds_oxpgcb" +# parameter_group_name = "terratest-rds-oxpgcb-rds-postgres-pg" +# name_prefix = "terratest-rds-oxpgcb-" +# pg_username = "tamruser" +# pg_password = "tamrpassword" diff --git a/test_examples/test_minimal/main.tf b/test_examples/minimal/main.tf similarity index 85% rename from test_examples/test_minimal/main.tf rename to test_examples/minimal/main.tf index 65c4bd2..5a1439d 100644 --- a/test_examples/test_minimal/main.tf +++ b/test_examples/minimal/main.tf @@ -26,11 +26,11 @@ module "vpc" { name = "${var.name_prefix}vpc" cidr = "172.18.0.0/18" - azs = [for i in ["a", "b", "c"] : "${data.aws_region.current.name}${i}"] - private_subnets = ["172.18.0.0/24", "172.18.1.0/24", "172.18.2.0/24"] - public_subnets = ["172.18.3.0/24", "172.18.4.0/24", "172.18.5.0/24"] + azs = [for i in ["a", "b"] : "${data.aws_region.current.name}${i}"] + private_subnets = ["172.18.0.0/24", "172.18.1.0/24"] + public_subnets = ["172.18.3.0/24", "172.18.4.0/24"] - database_subnets = ["172.18.6.0/24", "172.18.7.0/24", "172.18.8.0/24"] + database_subnets = ["172.18.6.0/24", "172.18.7.0/24"] create_database_subnet_group = false create_database_subnet_route_table = true diff --git a/test_examples/test_minimal/outputs.tf b/test_examples/minimal/outputs.tf similarity index 100% rename from test_examples/test_minimal/outputs.tf rename to test_examples/minimal/outputs.tf diff --git a/test_examples/test_minimal/variables.tf b/test_examples/minimal/variables.tf similarity index 100% rename from test_examples/test_minimal/variables.tf rename to test_examples/minimal/variables.tf From 8b979372ceaa812185e70ddf106410fe85a11047 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 15 Sep 2021 20:27:39 -0300 Subject: [PATCH 12/28] updating versions --- test/go.mod | 6 +++--- test/go.sum | 61 +++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/test/go.mod b/test/go.mod index 5a0fd59..cbb135d 100644 --- a/test/go.mod +++ b/test/go.mod @@ -3,7 +3,7 @@ module github.com/Datatamer/tamr-terraform-aws-rds-postgres go 1.16 require ( - github.com/aws/aws-sdk-go v1.38.28 - github.com/gruntwork-io/terratest v0.36.2 - github.com/stretchr/testify v1.4.0 + github.com/aws/aws-sdk-go v1.40.40 + github.com/gruntwork-io/terratest v0.37.8 + github.com/stretchr/testify v1.7.0 ) diff --git a/test/go.sum b/test/go.sum index df6de60..a9892d5 100644 --- a/test/go.sum +++ b/test/go.sum @@ -5,6 +5,7 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.51.0 h1:PvKAVQWCtlGUSlZkGW3QLelKaWq7KYv/MW1EboG8bfM= cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= @@ -67,8 +68,9 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.38.28 h1:2ZzgEupSluR18ClxUnHwXKyuADheZpMblXRAsHqF0tI= github.com/aws/aws-sdk-go v1.38.28/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.40.40 h1:U4dsfnUSswWSy+2qA0018HJBfsd9RHm3RvLqRdkRRTk= +github.com/aws/aws-sdk-go v1.40.40/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -113,12 +115,14 @@ github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avu github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s= github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4gxqlULARMQD7x0QG85lqEXTWysik= github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -140,6 +144,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= @@ -160,6 +165,7 @@ github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3a github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -180,6 +186,7 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -191,6 +198,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-containerregistry v0.0.0-20200110202235-f4fb41bf00a3/go.mod h1:2wIuQute9+hhWqvL3vEI7YB0EKluF4WcPzI1eAliazk= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -204,6 +212,7 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -215,12 +224,14 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gruntwork-io/go-commons v0.8.0 h1:k/yypwrPqSeYHevLlEDmvmgQzcyTwrlZGRaxEM6G0ro= github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78= -github.com/gruntwork-io/terratest v0.36.2 h1:5xjFlONJw0Qna2HcohCTn/KXNriLuHJB0rONmGK95iI= -github.com/gruntwork-io/terratest v0.36.2/go.mod h1:GIVJGBV1WIv1vxIG31Ycy0CuHYfXuvvkilNQuC9Wi+o= +github.com/gruntwork-io/terratest v0.37.8 h1:XCkznySLTQfQiASqgHeqc47aT9xb3zdx4Gv6kN47bWc= +github.com/gruntwork-io/terratest v0.37.8/go.mod h1:CSHpZNJdqYQ+TUrigM100jcahRUV5X6w7K2kZJ8iylY= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= @@ -228,11 +239,12 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= -github.com/hashicorp/terraform-json v0.9.0 h1:WE7+Wt93W93feOiCligElSyS0tlDzwZUtJuDGIBr8zg= -github.com/hashicorp/terraform-json v0.9.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= +github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= +github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o= @@ -248,6 +260,7 @@ github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBv github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -279,18 +292,24 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= +github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 h1:ofNAzWCcyTALn2Zv40+8XitdzCgXY6e9qvXwN9W0YXg= github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -339,6 +358,7 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -356,6 +376,7 @@ github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzu github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -364,8 +385,9 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -449,12 +471,14 @@ golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -492,17 +516,22 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -535,6 +564,7 @@ golang.org/x/tools v0.0.0-20201110201400-7099162a900a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -577,6 +607,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -587,6 +618,7 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -599,6 +631,8 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -606,11 +640,14 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/api v0.19.3 h1:GN6ntFnv44Vptj/b+OnMW7FmzkpDoIDLZRvKX3XH9aU= k8s.io/api v0.19.3/go.mod h1:VF+5FT1B74Pw3KxMdKyinLo+zynBaMBiAfGMuldcNDs= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.19.3 h1:bpIQXlKjB4cB/oNpnNnV+BybGPR7iP5oYpsOTEJ4hgc= k8s.io/apimachinery v0.19.3/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/client-go v0.19.3 h1:ctqR1nQ52NUs6LpI0w+a5U+xjYwflFwA13OJKcicMxg= k8s.io/client-go v0.19.3/go.mod h1:+eEMktZM+MG0KO+PTkci8xnbCZHvj9TqR6Q1XDUIJOM= k8s.io/cloud-provider v0.17.0/go.mod h1:Ze4c3w2C0bRsjkBUoHpFi+qWe3ob1wI2/7cUn+YQIDE= k8s.io/code-generator v0.0.0-20191121015212-c4c8f8345c7e/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= @@ -621,13 +658,16 @@ k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= @@ -636,7 +676,10 @@ modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 515375ffd2e233d1e24996e15768d790ea7bee80 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 15 Sep 2021 22:00:35 -0300 Subject: [PATCH 13/28] fixes module name --- test/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/go.mod b/test/go.mod index cbb135d..849a06f 100644 --- a/test/go.mod +++ b/test/go.mod @@ -1,4 +1,4 @@ -module github.com/Datatamer/tamr-terraform-aws-rds-postgres +module github.com/Datatamer/terraform-aws-rds-postgres go 1.16 From 4762b16cf8dfb410a4f23012779fe9d2734f8130 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Fri, 22 Oct 2021 09:11:26 -0300 Subject: [PATCH 14/28] CA-71 - update tests/ to instantiate examples/ --- examples/minimal/main.tf | 6 +-- examples/minimal/outputs.tf | 28 ++++++++++++- examples/minimal/variables.tf | 5 --- test/create_db_test.go | 27 +++++++------ test_examples/minimal/main.tf | 64 ++++++++++-------------------- test_examples/minimal/variables.tf | 35 ++++++++-------- 6 files changed, 82 insertions(+), 83 deletions(-) diff --git a/examples/minimal/main.tf b/examples/minimal/main.tf index 278d29f..df833e9 100644 --- a/examples/minimal/main.tf +++ b/examples/minimal/main.tf @@ -2,14 +2,14 @@ module "rds_postgres" { # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=3.0.0" source = "../.." - identifier_prefix = "example-rds-pg-" + identifier_prefix = "${var.name_prefix}-example-rds-pg-" postgres_name = "example0" - parameter_group_name = "example-rds-postgres-pg" + parameter_group_name = "${var.name_prefix}-example-rds-postgres-pg" username = "exampleUsername" password = "examplePassword" #tfsec:ignore:GEN003 vpc_id = var.vpc_id - subnet_group_name = "example_subnet_group" + subnet_group_name = "${var.name_prefix}_example_subnet_group" # Network requirement: DB subnet group needs a subnet in at least two Availability Zones rds_subnet_ids = var.subnet_ids security_group_ids = module.rds-postgres-sg.security_group_ids diff --git a/examples/minimal/outputs.tf b/examples/minimal/outputs.tf index a8da4fd..64eb379 100644 --- a/examples/minimal/outputs.tf +++ b/examples/minimal/outputs.tf @@ -3,6 +3,30 @@ output "ingress_ports" { description = "List of ingress ports" } -output "rds" { - value = module.rds_postgres +output "rds_db_port" { + value = module.rds_postgres.rds_db_port +} + +output "rds_dbname" { + value = module.rds_postgres.rds_dbname +} + +output "rds_hostname" { + value = module.rds_postgres.rds_hostname +} + +output "rds_postgres_id" { + value = module.rds_postgres.rds_postgres_id +} + +output "rds_postgres_pg_id" { + value = module.rds_postgres.rds_postgres_pg_id +} + +output "rds_security_group_ids" { + value = module.rds_postgres.rds_security_group_ids +} + +output "rds_username" { + value = module.rds_postgres.rds_username } diff --git a/examples/minimal/variables.tf b/examples/minimal/variables.tf index 4171772..569d7da 100644 --- a/examples/minimal/variables.tf +++ b/examples/minimal/variables.tf @@ -8,11 +8,6 @@ variable "subnet_ids" { description = "List of at least 2 subnets in different AZs for DB subnet group" } -variable "security_group_ids" { - description = "List of security group IDs to allow ingress from (i.e. Spark cluster SG IDs, Tamr VM SG ID)" - type = list(string) -} - variable "name_prefix" { description = "A string to prepend to names of resources created by this example" } diff --git a/test/create_db_test.go b/test/create_db_test.go index b82a810..d38c7a9 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -1,7 +1,6 @@ package test import ( - "fmt" "strings" "testing" @@ -11,7 +10,12 @@ import ( test_structure "github.com/gruntwork-io/terratest/modules/test-structure" ) -const expectedPw = "tamrpassword" +// These const are declared according to what is found at "../../examples/minimal/main.tf" +const ( + expectedPw = "examplePassword" + expectedUsername = "exampleUsername" + expectedDBName = "example0" +) func initTestCases() []RdsTestCase { return []RdsTestCase{ @@ -19,11 +23,11 @@ func initTestCases() []RdsTestCase { testName: "test1", expectApplyError: false, vars: map[string]interface{}{ - "pg_password": expectedPw, - "pg_username": "", - "postgres_db_name": "", - "parameter_group_name": "", - "name_prefix": "", + "vpc_cidr": "172.18.0.0/18", + "database_subnets": []string{"172.18.0.0/24", "172.18.1.0/24"}, + "egress_cidr_blocks": []string{"0.0.0.0/0"}, + "ingress_cidr_blocks": []string{"0.0.0.0/0"}, + "name_prefix": "", }, }, } @@ -60,10 +64,7 @@ func TestTerraformCreateRDS(t *testing.T) { awsRegion := test_structure.LoadString(t, tempTestFolder, "region") uniqueID := test_structure.LoadString(t, tempTestFolder, "unique_id") - testCase.vars["parameter_group_name"] = fmt.Sprintf("terratest-pg-%s", uniqueID) - testCase.vars["name_prefix"] = fmt.Sprintf("terratest-%s", uniqueID) - testCase.vars["pg_username"] = uniqueID - testCase.vars["postgres_db_name"] = fmt.Sprintf("db_%s", uniqueID) + testCase.vars["name_prefix"] = uniqueID terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ TerraformDir: tempTestFolder, @@ -88,8 +89,8 @@ func TestTerraformCreateRDS(t *testing.T) { terraformOptions, awsRegion, int64(5432), - testCase.vars["pg_username"].(string), - testCase.vars["postgres_db_name"].(string), + expectedUsername, + expectedDBName, ) }) }) diff --git a/test_examples/minimal/main.tf b/test_examples/minimal/main.tf index 5a1439d..5be15d7 100644 --- a/test_examples/minimal/main.tf +++ b/test_examples/minimal/main.tf @@ -1,63 +1,39 @@ module "rds_postgres" { #source = "git::https://github.com/Datatamer/terraform-rds-postgres.git?ref=x.y.z" - source = "../../" - postgres_name = var.postgres_db_name - parameter_group_name = var.parameter_group_name - identifier_prefix = var.name_prefix - instance_class = "db.t3.medium" - engine_version = "12.5" - username = var.pg_username - password = var.pg_password - - subnet_group_name = "${var.name_prefix}-subnet-group" - vpc_id = module.vpc.vpc_id - - # Network requirement: DB subnet group needs a subnet in at least two Availability Zones - rds_subnet_ids = module.vpc.database_subnets - security_group_ids = module.rds-postgres-sg.security_group_ids -} + source = "../../examples/minimal" -data "aws_region" "current" {} + name_prefix = var.name_prefix + ingress_cidr_blocks = var.ingress_cidr_blocks + tags = var.tags + vpc_id = module.vpc.vpc_id + subnet_ids = module.vpc.database_subnets +} module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "3.1.0" - name = "${var.name_prefix}vpc" - cidr = "172.18.0.0/18" + name = "${var.name_prefix}-terratest-vpc" + cidr = var.vpc_cidr - azs = [for i in ["a", "b"] : "${data.aws_region.current.name}${i}"] - private_subnets = ["172.18.0.0/24", "172.18.1.0/24"] - public_subnets = ["172.18.3.0/24", "172.18.4.0/24"] + azs = data.aws_availability_zones.available.names + database_subnets = var.database_subnets # ["172.18.6.0/24", "172.18.7.0/24"] - database_subnets = ["172.18.6.0/24", "172.18.7.0/24"] + // Remove these comments if you want public access to your RTB + # public_subnets = [ "172.18.0.0/24", "172.18.1.0/24" ] + # create_database_internet_gateway_route = true - create_database_subnet_group = false - create_database_subnet_route_table = true - create_database_internet_gateway_route = true + create_database_subnet_group = false + create_database_subnet_route_table = true enable_nat_gateway = false enable_vpn_gateway = false - tags = { - Terraform = "true" - Terratest = "true" - Environment = "dev" - } + tags = var.tags } -module "sg-ports" { - # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git//modules/rds-postgres-ports?ref=2.0.0" - source = "../../modules/rds-postgres-ports" -} +data "aws_region" "current" {} -module "rds-postgres-sg" { - source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" - vpc_id = module.vpc.vpc_id - ingress_cidr_blocks = module.vpc.database_subnets_cidr_blocks - egress_cidr_blocks = var.egress_cidr_blocks - ingress_ports = module.sg-ports.ingress_ports - sg_name_prefix = var.name_prefix - egress_protocol = "all" - ingress_protocol = "tcp" +data "aws_availability_zones" "available" { + state = "available" } diff --git a/test_examples/minimal/variables.tf b/test_examples/minimal/variables.tf index 5718444..a801b6c 100644 --- a/test_examples/minimal/variables.tf +++ b/test_examples/minimal/variables.tf @@ -1,30 +1,33 @@ -variable "postgres_db_name" { - type = string - description = "Name of the postgres db" -} - -variable "parameter_group_name" { - type = string - description = "Name of the parameter group" -} - variable "name_prefix" { type = string description = "Identifier prefix for the resources" } -variable "pg_username" { +variable "vpc_cidr" { type = string - description = "Username for postgres" + description = "CIDR for VPC to be created" } -variable "pg_password" { - type = string - description = "Password for postgres" +variable "database_subnets" { + description = "CIDR blocks to attach to use in subnets" + type = list(string) } variable "egress_cidr_blocks" { description = "CIDR blocks to attach to security groups for egress" type = list(string) - default = ["0.0.0.0/0"] +} + +variable "ingress_cidr_blocks" { + description = "CIDR blocks to attach to security groups for egress" + type = list(string) +} + +variable "tags" { + type = map(string) + default = { + Terraform = "true" + Terratest = "true" + Environment = "test" + } } From 97f5ba6d22bf8b29013c52ad3cded517ccc8d793 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Mon, 1 Nov 2021 23:08:33 -0300 Subject: [PATCH 15/28] using expectApplyError --- test/create_db_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/create_db_test.go b/test/create_db_test.go index d38c7a9..971e44a 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -79,7 +79,13 @@ func TestTerraformCreateRDS(t *testing.T) { test_structure.RunTestStage(t, "create_rds", func() { terraformOptions := test_structure.LoadTerraformOptions(t, tempTestFolder) - terraform.InitAndApply(t, terraformOptions) + _, err := terraform.InitAndApplyE(t, terraformOptions) + + if testCase.expectApplyError { + require.Error(t, err) + // If it failed as expected, we should skip the rest (validate function). + t.SkipNow() + } }) test_structure.RunTestStage(t, "validate", func() { From bd89420c14799142616e73c74446014ef3f23a7b Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 3 Nov 2021 10:48:21 -0300 Subject: [PATCH 16/28] 1st version of cloudwatch logs integration --- main.tf | 2 ++ outputs.tf | 8 ++++++++ variables.tf | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/main.tf b/main.tf index 0dc803b..4295ff7 100644 --- a/main.tf +++ b/main.tf @@ -46,6 +46,8 @@ resource "aws_db_instance" "rds_postgres" { apply_immediately = var.apply_immediately + enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports ? ["postgresql"] : [] + copy_tags_to_snapshot = var.copy_tags_to_snapshot tags = local.effective_tags diff --git a/outputs.tf b/outputs.tf index 45a7d00..ef8632d 100644 --- a/outputs.tf +++ b/outputs.tf @@ -28,3 +28,11 @@ output "rds_username" { output "rds_dbname" { value = aws_db_instance.rds_postgres.name } + +output "cloudwatch_logs_path" { + value = ( + var.enabled_cloudwatch_logs_exports ? + format("/aws/rds/instance/%s/postgresql", aws_db_instance.rds_postgres.id) + : "" + ) +} diff --git a/variables.tf b/variables.tf index 633fe36..589ffe9 100644 --- a/variables.tf +++ b/variables.tf @@ -154,3 +154,9 @@ variable "auto_minor_version_upgrade" { type = bool description = "Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window" } + +variable "enabled_cloudwatch_logs_exports" { + default = true + type = bool + description = "Indicates that postgresql logs will be configured to be sent automatically to Cloudwatch" +} From 3dfcd41183acaf79d47e17501bd2cb3fdccaf33f Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 3 Nov 2021 16:13:51 -0300 Subject: [PATCH 17/28] adding upgrade logs and updating local.tfvars --- main.tf | 2 +- test_examples/minimal/local.tfvars | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/main.tf b/main.tf index 4295ff7..fb8baa4 100644 --- a/main.tf +++ b/main.tf @@ -46,7 +46,7 @@ resource "aws_db_instance" "rds_postgres" { apply_immediately = var.apply_immediately - enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports ? ["postgresql"] : [] + enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports ? ["postgresql", "upgrade"] : [] copy_tags_to_snapshot = var.copy_tags_to_snapshot tags = local.effective_tags diff --git a/test_examples/minimal/local.tfvars b/test_examples/minimal/local.tfvars index c60884c..8ad60f2 100644 --- a/test_examples/minimal/local.tfvars +++ b/test_examples/minimal/local.tfvars @@ -1,6 +1,5 @@ -#postgres_name = "example-rds-postgres" -# postgres_db_name = "terratest_rds_oxpgcb" -# parameter_group_name = "terratest-rds-oxpgcb-rds-postgres-pg" -# name_prefix = "terratest-rds-oxpgcb-" -# pg_username = "tamruser" -# pg_password = "tamrpassword" +name_prefix="my-test" +vpc_cidr="172.33.0.0/18" +database_subnets=["172.33.0.0/24", "172.33.1.0/24"] +egress_cidr_blocks=["0.0.0.0/0"] +ingress_cidr_blocks=["0.0.0.0/0"] From 4eb6a4a3fc4e5d80f708add95f4b1ed28e37d065 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 3 Nov 2021 16:50:09 -0300 Subject: [PATCH 18/28] adding parameter log_statement=all --- main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.tf b/main.tf index fb8baa4..6510759 100644 --- a/main.tf +++ b/main.tf @@ -6,6 +6,10 @@ resource "aws_db_parameter_group" "rds_postgres_pg" { name = var.parameter_group_name family = var.parameter_group_family description = "TAMR RDS parameter group" + parameter { + name = "log_statement" + value = "all" + } tags = local.effective_tags } From 14a6138c3ccea354c9567dc8b5fc57829a6be211 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 3 Nov 2021 17:35:30 -0300 Subject: [PATCH 19/28] creates param group log parameters from module variables --- main.tf | 6 +++++- variables.tf | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 6510759..ba9b3df 100644 --- a/main.tf +++ b/main.tf @@ -8,7 +8,11 @@ resource "aws_db_parameter_group" "rds_postgres_pg" { description = "TAMR RDS parameter group" parameter { name = "log_statement" - value = "all" + value = var.param_log_statement + } + parameter { + name = "log_min_duration_statement" + value = var.param_log_min_duration_statement } tags = local.effective_tags } diff --git a/variables.tf b/variables.tf index 589ffe9..50b4ed0 100644 --- a/variables.tf +++ b/variables.tf @@ -27,6 +27,18 @@ variable "parameter_group_name" { default = "rds-postgres-pg" } +variable "param_log_min_duration_statement" { + description = "(ms) Sets the minimum execution time above which statements will be logged." + type = string + default = "-1" +} + +variable "param_log_statement" { + description = "Sets the type of statements logged. Valid values are none, ddl, mod, all" + type = string + default = "none" +} + variable "identifier_prefix" { description = "Identifier prefix for the RDS instance" type = string From 2c4bc484f736d651202bc58da39a2878c2a2bd61 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Tue, 16 Nov 2021 22:35:37 -0300 Subject: [PATCH 20/28] fix: adding require lib --- test/create_db_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/create_db_test.go b/test/create_db_test.go index 971e44a..7b16165 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -8,6 +8,7 @@ import ( "github.com/gruntwork-io/terratest/modules/random" "github.com/gruntwork-io/terratest/modules/terraform" test_structure "github.com/gruntwork-io/terratest/modules/test-structure" + "github.com/stretchr/testify/require" ) // These const are declared according to what is found at "../../examples/minimal/main.tf" From 1b10888766568121d0b9ce228f8b8c749d1fded6 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Fri, 19 Nov 2021 10:45:52 -0300 Subject: [PATCH 21/28] adding comments --- test/create_db_test.go | 3 +++ test/test_util.go | 1 + 2 files changed, 4 insertions(+) diff --git a/test/create_db_test.go b/test/create_db_test.go index 7b16165..12ffdd7 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -18,6 +18,7 @@ const ( expectedDBName = "example0" ) +// initTestCases initializes a list of RdsTestCase func initTestCases() []RdsTestCase { return []RdsTestCase{ { @@ -33,6 +34,8 @@ func initTestCases() []RdsTestCase { }, } } + +// TestTerraformCreateRDS runs all test cases func TestTerraformCreateRDS(t *testing.T) { testCases := initTestCases() diff --git a/test/test_util.go b/test/test_util.go index 881be4e..069e04b 100644 --- a/test/test_util.go +++ b/test/test_util.go @@ -19,6 +19,7 @@ type RdsTestCase struct { expectApplyError bool } +// validateModuleOutputs validates the values of outputs with expected values func validateModuleOutputs(t *testing.T, terraformOptions *terraform.Options, awsRegion string, expectedPort int64, expectedUser string, expectedDBName string) { oRDS := terraform.OutputAll(t, terraformOptions) From 049ecc6664c721e10ac9f2a14d562e5025a04c8d Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 20 Jan 2022 17:25:55 -0300 Subject: [PATCH 22/28] adding test README --- test/README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/README.md diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..2abf497 --- /dev/null +++ b/test/README.md @@ -0,0 +1,45 @@ +# Tests + +This folder contains automated tests for this Module. All of the tests are written in [Go](https://golang.org/). +Most of these are "integration tests" that deploy real infrastructure using Terraform and verify that infrastructure works as expected using a helper library called [Terratest](https://github.com/gruntwork-io/terratest). + + + +## WARNING WARNING WARNING + +**Note #1**: Many of these tests create real resources in an AWS account and then try to clean those resources up at the end of a test run. That means these tests may cost you money to run! When adding tests, please be considerate of the resources you create and take extra care to clean everything up when you're done! + +**Note #2**: Never forcefully shut the tests down (e.g. by hitting `CTRL + C`) or the cleanup tasks won't run! + +**Note #3**: We need to set `-timeout 60m` on all tests not because they necessarily take that long, but because Go has a default test timeout of 10 minutes, after which it forcefully kills the tests with a `SIGQUIT`, preventing the cleanup tasks from running. Therefore, we set an overlying long timeout to make sure all tests have enough time to finish and clean up. + + + +## Running the tests + +### Prerequisites + +- Install the latest version of [Go](https://golang.org/). +- Install [Terraform](https://www.terraform.io/downloads.html). +- Configure your AWS credentials using one of the [options supported by the AWS SDK](http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html). Usually, the easiest option is to set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables. + + +### Run all the tests + +```bash +go test -v -timeout 60m +``` + + +### Run a specific test + +To run a specific test called `TestFoo`: + +```bash +go test -v -timeout 60m -run TestFoo +``` + +When using `t.Run("test_name",...)` inside a test function, you may run a specific test with: +```bash +go test -v -timeout 60m -run TestFoo/test_name +``` From ecc9d933de4897b866e4ce7253c800b47650e4d6 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 23 Feb 2022 15:48:43 -0300 Subject: [PATCH 23/28] smallfix --- outputs.tf | 2 +- test/create_db_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index ef8632d..3ae1b3d 100644 --- a/outputs.tf +++ b/outputs.tf @@ -33,6 +33,6 @@ output "cloudwatch_logs_path" { value = ( var.enabled_cloudwatch_logs_exports ? format("/aws/rds/instance/%s/postgresql", aws_db_instance.rds_postgres.id) - : "" + : null ) } diff --git a/test/create_db_test.go b/test/create_db_test.go index 12ffdd7..cc4f3c0 100644 --- a/test/create_db_test.go +++ b/test/create_db_test.go @@ -22,7 +22,7 @@ const ( func initTestCases() []RdsTestCase { return []RdsTestCase{ { - testName: "test1", + testName: "minimal", expectApplyError: false, vars: map[string]interface{}{ "vpc_cidr": "172.18.0.0/18", From f42003989e35878b5ac61041b3114a8813c3055f Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 23 Feb 2022 16:37:39 -0300 Subject: [PATCH 24/28] update to README --- test_examples/minimal/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test_examples/minimal/README.md b/test_examples/minimal/README.md index c1e93a3..2b3b206 100644 --- a/test_examples/minimal/README.md +++ b/test_examples/minimal/README.md @@ -1,3 +1,15 @@ +This deploys: +- a VPC, using the AWS VPC Module. (Can change to tamr-networking later) +- the examples/minimal resources. + +Go code (Terratest) runs this and makes sure our examples are working. +The validations are: +- Address +- Port +- Security Group +- username +- dbname + ## Requirements From fea9c3fe9ba79a67e105c7615974f12daa94ca0d Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Wed, 23 Feb 2022 16:53:58 -0300 Subject: [PATCH 25/28] removing local.tfvars --- test_examples/minimal/local.tfvars | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 test_examples/minimal/local.tfvars diff --git a/test_examples/minimal/local.tfvars b/test_examples/minimal/local.tfvars deleted file mode 100644 index 8ad60f2..0000000 --- a/test_examples/minimal/local.tfvars +++ /dev/null @@ -1,5 +0,0 @@ -name_prefix="my-test" -vpc_cidr="172.33.0.0/18" -database_subnets=["172.33.0.0/24", "172.33.1.0/24"] -egress_cidr_blocks=["0.0.0.0/0"] -ingress_cidr_blocks=["0.0.0.0/0"] From 11ba9a218a39e3e7ac14789206bf72a94e0c5117 Mon Sep 17 00:00:00 2001 From: Hugo Barros Date: Thu, 24 Feb 2022 12:03:04 -0300 Subject: [PATCH 26/28] reverting change on output --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 3ae1b3d..ef8632d 100644 --- a/outputs.tf +++ b/outputs.tf @@ -33,6 +33,6 @@ output "cloudwatch_logs_path" { value = ( var.enabled_cloudwatch_logs_exports ? format("/aws/rds/instance/%s/postgresql", aws_db_instance.rds_postgres.id) - : null + : "" ) } From b1e2f02dffccbcd2defb5a440f6c1e4c8fe05954 Mon Sep 17 00:00:00 2001 From: jamoroso-caylent Date: Thu, 3 Mar 2022 14:29:03 -0500 Subject: [PATCH 27/28] Updated documentation --- examples/minimal/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/minimal/README.md b/examples/minimal/README.md index 0900300..4dee49e 100644 --- a/examples/minimal/README.md +++ b/examples/minimal/README.md @@ -13,7 +13,6 @@ No provider. |------|-------------|------|---------|:--------:| | ingress\_cidr\_blocks | CIDR blocks to attach to security groups for ingress | `list(string)` | n/a | yes | | name\_prefix | A string to prepend to names of resources created by this example | `any` | n/a | yes | -| security\_group\_ids | List of security group IDs to allow ingress from (i.e. Spark cluster SG IDs, Tamr VM SG ID) | `list(string)` | n/a | yes | | subnet\_ids | List of at least 2 subnets in different AZs for DB subnet group | `list(string)` | n/a | yes | | vpc\_id | VPC ID of network. | `string` | n/a | yes | | egress\_cidr\_blocks | CIDR blocks to attach to security groups for egress | `list(string)` |
[
"0.0.0.0/0"
]
| no | @@ -24,6 +23,12 @@ No provider. | Name | Description | |------|-------------| | ingress\_ports | List of ingress ports | -| rds | n/a | +| rds\_db\_port | n/a | +| rds\_dbname | n/a | +| rds\_hostname | n/a | +| rds\_postgres\_id | n/a | +| rds\_postgres\_pg\_id | n/a | +| rds\_security\_group\_ids | n/a | +| rds\_username | n/a | From cfa874983306fdc17aa2cbbf7501850db10fcdaa Mon Sep 17 00:00:00 2001 From: jamoroso-caylent Date: Fri, 4 Mar 2022 15:31:04 -0500 Subject: [PATCH 28/28] Changed indivual outputs to module output. --- examples/minimal/README.md | 9 +-------- examples/minimal/outputs.tf | 33 ++------------------------------ test/test_util.go | 15 ++++++++------- test_examples/minimal/outputs.tf | 28 ++------------------------- 4 files changed, 13 insertions(+), 72 deletions(-) diff --git a/examples/minimal/README.md b/examples/minimal/README.md index 4dee49e..dd36a2b 100644 --- a/examples/minimal/README.md +++ b/examples/minimal/README.md @@ -22,13 +22,6 @@ No provider. | Name | Description | |------|-------------| -| ingress\_ports | List of ingress ports | -| rds\_db\_port | n/a | -| rds\_dbname | n/a | -| rds\_hostname | n/a | -| rds\_postgres\_id | n/a | -| rds\_postgres\_pg\_id | n/a | -| rds\_security\_group\_ids | n/a | -| rds\_username | n/a | +| rds | n/a | diff --git a/examples/minimal/outputs.tf b/examples/minimal/outputs.tf index 64eb379..84813b2 100644 --- a/examples/minimal/outputs.tf +++ b/examples/minimal/outputs.tf @@ -1,32 +1,3 @@ -output "ingress_ports" { - value = module.sg-ports - description = "List of ingress ports" -} - -output "rds_db_port" { - value = module.rds_postgres.rds_db_port -} - -output "rds_dbname" { - value = module.rds_postgres.rds_dbname -} - -output "rds_hostname" { - value = module.rds_postgres.rds_hostname -} - -output "rds_postgres_id" { - value = module.rds_postgres.rds_postgres_id -} - -output "rds_postgres_pg_id" { - value = module.rds_postgres.rds_postgres_pg_id -} - -output "rds_security_group_ids" { - value = module.rds_postgres.rds_security_group_ids -} - -output "rds_username" { - value = module.rds_postgres.rds_username +output "rds" { + value = module.rds_postgres } diff --git a/test/test_util.go b/test/test_util.go index 069e04b..2218f72 100644 --- a/test/test_util.go +++ b/test/test_util.go @@ -1,6 +1,7 @@ package test import ( + "strconv" "testing" "time" @@ -22,14 +23,14 @@ type RdsTestCase struct { // validateModuleOutputs validates the values of outputs with expected values func validateModuleOutputs(t *testing.T, terraformOptions *terraform.Options, awsRegion string, expectedPort int64, expectedUser string, expectedDBName string) { - oRDS := terraform.OutputAll(t, terraformOptions) + oRDS := terraform.OutputMap(t, terraformOptions, "rds") - oRDSInstanceID := oRDS["rds_postgres_id"].(string) - oRDSSGIDs := oRDS["rds_security_group_ids"].([]interface{}) - oRDShostname := oRDS["rds_hostname"].(string) - oRDSport := oRDS["rds_db_port"].(float64) - oRDSuser := oRDS["rds_username"].(string) - oDBName := oRDS["rds_dbname"].(string) + oRDSInstanceID := oRDS["rds_postgres_id"] + oRDSSGIDs := oRDS["rds_security_group_ids"] + oRDShostname := oRDS["rds_hostname"] + oRDSport, _ := strconv.ParseInt(oRDS["rds_db_port"], 10, 64) + oRDSuser := oRDS["rds_username"] + oDBName := oRDS["rds_dbname"] // Fails test if Instance ID is nil require.NotNil(t, oRDSInstanceID) diff --git a/test_examples/minimal/outputs.tf b/test_examples/minimal/outputs.tf index c6505ce..8a551bb 100644 --- a/test_examples/minimal/outputs.tf +++ b/test_examples/minimal/outputs.tf @@ -1,27 +1,3 @@ -output "rds_db_port" { - value = module.rds_postgres.rds_db_port -} - -output "rds_dbname" { - value = module.rds_postgres.rds_dbname -} - -output "rds_hostname" { - value = module.rds_postgres.rds_hostname -} - -output "rds_postgres_id" { - value = module.rds_postgres.rds_postgres_id -} - -output "rds_postgres_pg_id" { - value = module.rds_postgres.rds_postgres_pg_id -} - -output "rds_security_group_ids" { - value = module.rds_postgres.rds_security_group_ids -} - -output "rds_username" { - value = module.rds_postgres.rds_username +output "rds" { + value = module.rds_postgres.rds }