Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit dcc8340

Browse files
authored
Merge pull request #64 from gruntwork-io/aws-provider-3
Update repo to work with AWS Provider 3.x
2 parents 3a1c23b + f65ca00 commit dcc8340

File tree

24 files changed

+784
-815
lines changed

24 files changed

+784
-815
lines changed

.circleci/config.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ defaults: &defaults
44
machine:
55
image: circleci/classic:201711-01
66
environment:
7-
GRUNTWORK_INSTALLER_VERSION: v0.0.21
8-
TERRATEST_LOG_PARSER_VERSION: v0.13.24
9-
MODULE_CI_VERSION: v0.13.15
10-
TERRAFORM_VERSION: 0.12.2
7+
GRUNTWORK_INSTALLER_VERSION: v0.0.29
8+
TERRATEST_LOG_PARSER_VERSION: v0.29.0
9+
MODULE_CI_VERSION: v0.28.1
10+
TERRAFORM_VERSION: 0.12.29
1111
TERRAGRUNT_VERSION: NONE
1212
PACKER_VERSION: 1.4.1
13-
GOLANG_VERSION: 1.11
13+
GOLANG_VERSION: 1.14
1414

1515
version: 2
1616
jobs:
@@ -26,21 +26,16 @@ jobs:
2626
- restore_cache:
2727
keys:
2828
- v2-external-dep
29-
- v2-dep-{{ checksum "test/Gopkg.lock" }}
3029
# Use the Gruntwork Installer to install the gruntwork-module-circleci-helpers
3130
- run: curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version "${GRUNTWORK_INSTALLER_VERSION}"
3231
- run: gruntwork-install --module-name "gruntwork-module-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "${MODULE_CI_VERSION}"
3332
- run: gruntwork-install --binary-name "terratest_log_parser" --repo "https://github.com/gruntwork-io/terratest" --tag "${TERRATEST_LOG_PARSER_VERSION}"
34-
- run: configure-environment-for-gruntwork-module --circle-ci-2-machine-executor --terraform-version ${TERRAFORM_VERSION} --terragrunt-version ${TERRAGRUNT_VERSION} --packer-version ${PACKER_VERSION} --use-go-dep --go-version ${GOLANG_VERSION} --go-src-path test
33+
- run: configure-environment-for-gruntwork-module --terraform-version ${TERRAFORM_VERSION} --terragrunt-version ${TERRAGRUNT_VERSION} --packer-version ${PACKER_VERSION} --go-version ${GOLANG_VERSION}
3534
- save_cache:
3635
key: v2-external-dep
3736
paths:
3837
- $HOME/terraform
3938
- $HOME/packer
40-
- save_cache:
41-
key: v2-dep-{{ checksum "test/Gopkg.lock" }}
42-
paths:
43-
- $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/test/vendor
4439

4540
# Install external dependencies
4641
- run: DEBIAN_FRONTEND=noninteractive sudo apt-get update && sudo apt-get install -y python-pip
@@ -83,7 +78,7 @@ jobs:
8378
- run: gruntwork-install --module-name "gruntwork-module-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "${MODULE_CI_VERSION}"
8479
- run: gruntwork-install --module-name "build-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "${MODULE_CI_VERSION}"
8580
- run: gruntwork-install --module-name "aws-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "${MODULE_CI_VERSION}"
86-
- run: configure-environment-for-gruntwork-module --circle-ci-2-machine-executor --go-src-path test --use-go-dep --terraform-version NONE --terragrunt-version NONE --glide-version NONE
81+
- run: configure-environment-for-gruntwork-module --terraform-version NONE --terragrunt-version NONE
8782

8883
- run: ~/project/.circleci/publish-amis.sh "ubuntu-ami"
8984
- run: ~/project/.circleci/publish-amis.sh "amazon-linux-ami"

examples/couchbase-ami/couchbase.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"pause_before": "5s",
106106
"inline": [
107107
"apt-get update",
108-
"DEBIAN_FRONTEND=noninteractive apt-get install -y git"
108+
"DEBIAN_FRONTEND=noninteractive apt-get install -y git lsb-release"
109109
],
110110
"only": ["ubuntu-docker", "ubuntu-18-docker"]
111111
},{
@@ -141,7 +141,7 @@
141141
"destination": "/tmp/terraform-aws-couchbase/modules"
142142
},{
143143
"type": "file",
144-
"source": "{{template_dir}}/sync_gateway.json",
144+
"source": "{{template_dir}}/sync_gateway_{{user `edition`}}.json",
145145
"destination": "/tmp/terraform-aws-couchbase/sync_gateway.json"
146146
},{
147147
"type": "shell",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"adminInterface": "<ADMIN_INTERFACE>",
3+
"interface": "<INTERFACE>",
4+
"databases": {
5+
"<DB_NAME>": {
6+
"server": "<SERVERS>",
7+
"username": "<DB_USERNAME>",
8+
"password": "<DB_PASSWORD>",
9+
"bucket": "<BUCKET_NAME>",
10+
"num_index_replicas": 0,
11+
"users": {"GUEST": {"disabled": false, "admin_channels": ["*"]}}
12+
}
13+
},
14+
"logging": {
15+
"default": {
16+
"logFilePath": "/home/sync_gateway/logs/sync-gateway.log",
17+
"logKeys": ["*"],
18+
"logLevel": "info",
19+
"rotation": {
20+
"maxsize": 100,
21+
"maxage": 30,
22+
"maxbackups": 5,
23+
"localtime": true
24+
}
25+
}
26+
}
27+
}

examples/couchbase-ami/sync_gateway.json renamed to examples/couchbase-ami/sync_gateway_enterprise.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
}
2424
}
2525
}
26-
}
26+
}

examples/couchbase-cluster-mds/user-data/user-data-couchbase-data-nodes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function create_test_resources {
6060

6161
run_couchbase_cli_with_retry \
6262
"Create RBAC user $user_name" \
63-
"SUCCESS: RBAC user set" \
63+
"SUCCESS:" \
6464
"$max_retries" \
6565
"$sleep_between_retries_sec" \
6666
"user-manage" \
@@ -78,7 +78,7 @@ function create_test_resources {
7878

7979
run_couchbase_cli_with_retry \
8080
"Create bucket $bucket_name" \
81-
"SUCCESS: Bucket created" \
81+
"SUCCESS:" \
8282
"$max_retries" \
8383
"$sleep_between_retries_sec" \
8484
"bucket-create" \

examples/couchbase-cluster-simple-dns-tls/user-data/user-data.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function create_test_resources {
5656

5757
run_couchbase_cli_with_retry \
5858
"Create RBAC user $user_name" \
59-
"SUCCESS: RBAC user set" \
59+
"SUCCESS:" \
6060
"$max_retries" \
6161
"$sleep_between_retries_sec" \
6262
"user-manage" \
@@ -74,7 +74,7 @@ function create_test_resources {
7474

7575
run_couchbase_cli_with_retry \
7676
"Create bucket $bucket_name" \
77-
"SUCCESS: Bucket created" \
77+
"SUCCESS:" \
7878
"$max_retries" \
7979
"$sleep_between_retries_sec" \
8080
"bucket-create" \

examples/couchbase-cluster-simple/user-data/user-data.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function create_test_resources {
5757

5858
run_couchbase_cli_with_retry \
5959
"Create RBAC user $user_name" \
60-
"SUCCESS: RBAC user set" \
60+
"SUCCESS:" \
6161
"$max_retries" \
6262
"$sleep_between_retries_sec" \
6363
"user-manage" \
@@ -75,7 +75,7 @@ function create_test_resources {
7575

7676
run_couchbase_cli_with_retry \
7777
"Create bucket $bucket_name" \
78-
"SUCCESS: Bucket created" \
78+
"SUCCESS:" \
7979
"$max_retries" \
8080
"$sleep_between_retries_sec" \
8181
"bucket-create" \

examples/couchbase-multi-datacenter-replication/user-data/user-data-primary.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function create_test_resources {
4242

4343
run_couchbase_cli_with_retry \
4444
"Create RBAC user $user_name" \
45-
"SUCCESS: RBAC user set" \
45+
"SUCCESS:" \
4646
"$max_retries" \
4747
"$sleep_between_retries_sec" \
4848
"user-manage" \
@@ -60,7 +60,7 @@ function create_test_resources {
6060

6161
run_couchbase_cli_with_retry \
6262
"Create bucket $bucket_name" \
63-
"SUCCESS: Bucket created" \
63+
"SUCCESS:" \
6464
"$max_retries" \
6565
"$sleep_between_retries_sec" \
6666
"bucket-create" \

examples/couchbase-multi-datacenter-replication/user-data/user-data-replica.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function create_test_resources {
4242

4343
run_couchbase_cli_with_retry \
4444
"Create RBAC user $user_name" \
45-
"SUCCESS: RBAC user set" \
45+
"SUCCESS:" \
4646
"$max_retries" \
4747
"$sleep_between_retries_sec" \
4848
"user-manage" \
@@ -60,7 +60,7 @@ function create_test_resources {
6060

6161
run_couchbase_cli_with_retry \
6262
"Create bucket $bucket_name" \
63-
"SUCCESS: Bucket created" \
63+
"SUCCESS:" \
6464
"$max_retries" \
6565
"$sleep_between_retries_sec" \
6666
"bucket-create" \

modules/couchbase-cluster/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ resource "aws_autoscaling_group" "autoscaling_group" {
4040
propagate_at_launch = tag.value["propagate_at_launch"]
4141
}
4242
}
43+
44+
# When using `aws_autoscaling_attachment` resources to manage target group and loadbalancer attachments, we need to
45+
# ignore changes to these properties as they are updated in the cloud and not terraform.
46+
lifecycle {
47+
ignore_changes = [load_balancers, target_group_arns]
48+
}
4349
}
4450

4551
# ---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)