Skip to content

Commit 0529839

Browse files
authored
Merge pull request #76 from SKozlovsky/feature/update-tests-to-exercise-examples
Enhancement. Update tests to exercise examples
2 parents e241f40 + 5ec5218 commit 0529839

File tree

78 files changed

+1294
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1294
-873
lines changed

build/int.cloudbuild.yaml

Lines changed: 33 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,50 @@ steps:
2222
- 'TF_VAR_folder_id=$_FOLDER_ID'
2323
- 'TF_VAR_billing_account=$_BILLING_ACCOUNT'
2424

25-
- id: create-postgresql-simple-local
25+
- id: create-postgresql-public-local
2626
waitFor:
2727
- prepare
2828
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
29-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create postgresql-simple-local']
30-
- id: converge-postgresql-simple-local
29+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create postgresql-public-local']
30+
- id: converge-postgresql-public-local
3131
waitFor:
32-
- create-postgresql-simple-local
32+
- create-postgresql-public-local
3333
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
34-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge postgresql-simple-local']
34+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge postgresql-public-local']
3535
timeout: 3600s
36-
- id: verify-postgresql-simple-local
36+
- id: verify-postgresql-public-local
3737
waitFor:
38-
- converge-postgresql-simple-local
38+
- converge-postgresql-public-local
3939
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
40-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify postgresql-simple-local']
41-
- id: destroy-postgresql-simple-local
40+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify postgresql-public-local']
41+
- id: destroy-postgresql-public-local
4242
waitFor:
43-
- verify-postgresql-simple-local
43+
- verify-postgresql-public-local
4444
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
45-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy postgresql-simple-local']
45+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy postgresql-public-local']
4646
timeout: 1800s
4747

48-
- id: create-mysql-simple-local
48+
- id: create-mysql-public-local
4949
waitFor:
5050
- prepare
5151
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
52-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create mysql-simple-local']
53-
- id: converge-mysql-simple-local
52+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create mysql-public-local']
53+
- id: converge-mysql-public-local
5454
waitFor:
55-
- create-mysql-simple-local
55+
- create-mysql-public-local
5656
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
57-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge mysql-simple-local']
57+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge mysql-public-local']
5858
timeout: 3600s
59-
- id: verify-mysql-simple-local
59+
- id: verify-mysql-public-local
6060
waitFor:
61-
- converge-mysql-simple-local
61+
- converge-mysql-public-local
6262
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
63-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify mysql-simple-local']
64-
- id: destroy-mysql-simple-local
63+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify mysql-public-local']
64+
- id: destroy-mysql-public-local
6565
waitFor:
66-
- verify-mysql-simple-local
66+
- verify-mysql-public-local
6767
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
68-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy mysql-simple-local']
68+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy mysql-public-local']
6969
timeout: 1800s
7070

7171
- id: create-mysql-ha-local
@@ -114,50 +114,27 @@ steps:
114114
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy postgresql-ha-local']
115115
timeout: 1800s
116116

117-
- id: create-mysql-simple-safer-local
117+
- id: create-mysql-private-local
118118
waitFor:
119119
- prepare
120120
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
121-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create mysql-simple-safer-local']
122-
- id: converge-mysql-simple-safer-local
121+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create mysql-private-local']
122+
- id: converge-mysql-private-local
123123
waitFor:
124-
- create-mysql-simple-safer-local
124+
- create-mysql-private-local
125125
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
126-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge mysql-simple-safer-local']
126+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge mysql-private-local']
127127
timeout: 3600s
128-
- id: verify-mysql-simple-safer-local
128+
- id: verify-mysql-private-local
129129
waitFor:
130-
- converge-mysql-simple-safer-local
130+
- converge-mysql-private-local
131131
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
132-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify mysql-simple-safer-local']
133-
- id: destroy-mysql-simple-safer-local
132+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify mysql-private-local']
133+
- id: destroy-mysql-private-local
134134
waitFor:
135-
- verify-mysql-simple-safer-local
135+
- verify-mysql-private-local
136136
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
137-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy mysql-simple-safer-local']
138-
timeout: 1800s
139-
140-
- id: create-private-service-access-local
141-
waitFor:
142-
- prepare
143-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
144-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create private-service-access-local']
145-
- id: converge-private-service-access-local
146-
waitFor:
147-
- create-private-service-access-local
148-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
149-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge private-service-access-local']
150-
timeout: 3600s
151-
- id: verify-private-service-access-local
152-
waitFor:
153-
- converge-private-service-access-local
154-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
155-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify private-service-access-local']
156-
- id: destroy-private-service-access-local
157-
waitFor:
158-
- verify-private-service-access-local
159-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
160-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy private-service-access-local']
137+
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy mysql-private-local']
161138
timeout: 1800s
162139

163140
tags:

examples/mysql-and-postgres-private/main.tf

Lines changed: 0 additions & 136 deletions
This file was deleted.

examples/mysql-and-postgres-private/variables.tf

Lines changed: 0 additions & 49 deletions
This file was deleted.

examples/mysql-ha/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Cloud SQL Database Example
2+
3+
This example shows how to create the public MySQL HA Cloud cluster using the Terraform module.
4+
5+
## Run Terraform
6+
7+
Create resources with terraform:
8+
9+
```bash
10+
terraform init
11+
terraform plan
12+
terraform apply
13+
```
14+
15+
To remove all resources created by terraform:
16+
17+
```bash
18+
terraform destroy
19+
```
20+
21+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
22+
## Inputs
23+
24+
| Name | Description | Type | Default | Required |
25+
|------|-------------|:----:|:-----:|:-----:|
26+
| mysql\_ha\_external\_ip\_range | The ip range to allow connecting from/to Cloud SQL | string | `"192.10.10.10/32"` | no |
27+
| mysql\_ha\_name | The name for Cloud SQL instance | string | `"tf-mysql-ha"` | no |
28+
| project\_id | The project to run tests against | string | n/a | yes |
29+
30+
## Outputs
31+
32+
| Name | Description |
33+
|------|-------------|
34+
| authorized\_network | |
35+
| name | |
36+
| project\_id | |
37+
38+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0 commit comments

Comments
 (0)