Skip to content

Commit

Permalink
Requested changes and merged master
Browse files Browse the repository at this point in the history
  • Loading branch information
SKozlovsky committed Dec 11, 2019
1 parent 53eb84b commit 8fc5fe6
Show file tree
Hide file tree
Showing 35 changed files with 31 additions and 205 deletions.
1 change: 1 addition & 0 deletions examples/mysql-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

provider "google" {
version = "~> 2.13"
}

resource "random_id" "instance_name_suffix" {
Expand Down
3 changes: 0 additions & 3 deletions examples/mysql-private/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,11 @@ terraform destroy
|------|-------------|
| mysql\_conn | The connection name of the master instance to be used in connection strings |
| mysql\_user\_pass | The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable. |
| mysql\_version | The MySQL version to use. |
| name | The name for Cloud SQL instance |
| private\_ip\_address | The first private (PRIVATE) IPv4 address assigned for the master instance |
| project\_id | The project to run tests against |
| public\_ip\_address | The first public (PRIMARY) IPv4 address assigned for the master instance |
| region | The region of the Cloud SQL resources |
| reserved\_range\_address | The Global Address resource name |
| reserved\_range\_name | The Global Address resource name |
| tier | The tier for the master instance. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 2 additions & 0 deletions examples/mysql-private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
*/

provider "google" {
version = "~> 2.13"
}

provider "google-beta" {
version = "~> 2.13"
}

resource "random_id" "suffix" {
Expand Down
14 changes: 0 additions & 14 deletions examples/mysql-private/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,3 @@ output "private_ip_address" {
value = module.safer-mysql-db.private_ip_address
}

output "mysql_version" {
value = module.safer-mysql-db.mysql_version
description = "The MySQL version to use."
}

output "region" {
value = module.safer-mysql-db.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = module.safer-mysql-db.tier
description = "The tier for the master instance."
}
5 changes: 1 addition & 4 deletions examples/mysql-public/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,18 @@ terraform destroy
|------|-------------|:----:|:-----:|:-----:|
| authorized\_networks | List of mapped public networks authorized to access to the instances. Default - short range of GCP health-checkers IPs | list(map(string)) | `<list>` | no |
| db\_name | The name of the SQL Database instance | string | `"example-mysql-public"` | no |
| project\_id | The ID of the project in which resources will be provisioned. | string | `"null"` | no |
| project\_id | The ID of the project in which resources will be provisioned. | string | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| mysql\_conn | The connection name of the master instance to be used in connection strings |
| mysql\_user\_pass | The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable. |
| mysql\_version | The MySQL version to use. |
| name | The name for Cloud SQL instance |
| private\_ip\_address | The first private (PRIVATE) IPv4 address assigned for the master instance |
| project\_id | The project to run tests against |
| public\_ip\_address | The first public (PRIMARY) IPv4 address assigned for the master instance |
| region | The region of the Cloud SQL resources |
| tier | The tier for the master instance. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

14 changes: 0 additions & 14 deletions examples/mysql-public/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,3 @@ output "private_ip_address" {
value = module.mysql-db.private_ip_address
}

output "mysql_version" {
value = module.mysql-db.mysql_version
description = "The MySQL version to use."
}

output "region" {
value = module.mysql-db.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = module.mysql-db.tier
description = "The tier for the master instance."
}
1 change: 0 additions & 1 deletion examples/mysql-public/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

variable "project_id" {
default = null
description = "The ID of the project in which resources will be provisioned."
type = string
}
Expand Down
5 changes: 1 addition & 4 deletions examples/postgres-public/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@ terraform destroy
|------|-------------|:----:|:-----:|:-----:|
| authorized\_networks | List of mapped public networks authorized to access to the instances. Default - short range of GCP health-checkers IPs | list(map(string)) | `<list>` | no |
| db\_name | The name of the SQL Database instance | string | `"example-postgres-public"` | no |
| project\_id | The ID of the project in which resources will be provisioned. | string | `"null"` | no |
| project\_id | The ID of the project in which resources will be provisioned. | string | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| database\_version | The Postgres version to use. |
| name | The name for Cloud SQL instance |
| project\_id | The project to run tests against |
| psql\_conn | The connection name of the master instance to be used in connection strings |
| psql\_user\_pass | The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable. |
| public\_ip\_address | The first public (PRIMARY) IPv4 address assigned for the master instance |
| region | The region of the Cloud SQL resources |
| tier | The tier for the master instance. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
15 changes: 0 additions & 15 deletions examples/postgres-public/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,3 @@ output "public_ip_address" {
description = "The first public (PRIMARY) IPv4 address assigned for the master instance"
value = module.postgresql-db.public_ip_address
}

output "database_version" {
value = module.postgresql-db.database_version
description = "The Postgres version to use."
}

output "region" {
value = module.postgresql-db.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = module.postgresql-db.tier
description = "The tier for the master instance."
}
1 change: 0 additions & 1 deletion examples/postgres-public/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

variable "project_id" {
default = null
description = "The ID of the project in which resources will be provisioned."
type = string
}
Expand Down
1 change: 1 addition & 0 deletions examples/postgresql-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

provider "google" {
version = "~> 2.13"
}

resource "random_id" "instance_name_suffix" {
Expand Down
3 changes: 0 additions & 3 deletions modules/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,14 @@
| instance\_self\_link | The URI of the master instance |
| instance\_server\_ca\_cert | The CA certificate information used to connect to the SQL instance via SSL |
| instance\_service\_account\_email\_address | The service account email address assigned to the master instance |
| mysql\_version | The MySQL version to use. |
| private\_address | The private IP address assigned for the master instance |
| private\_ip\_address | The first private (PRIVATE) IPv4 address assigned for the master instance |
| public\_ip\_address | The first public (PRIMARY) IPv4 address assigned for the master instance |
| read\_replica\_instance\_names | The instance names for the read replica instances |
| region | The region of the Cloud SQL resources |
| replicas\_instance\_connection\_names | The connection names of the replica instances to be used in connection strings |
| replicas\_instance\_first\_ip\_addresses | The first IPv4 addresses of the addresses assigned for the replica instances |
| replicas\_instance\_self\_links | The URIs of the replica instances |
| replicas\_instance\_server\_ca\_certs | The CA certificates information used to connect to the replica instances via SSL |
| replicas\_instance\_service\_account\_email\_addresses | The service account email addresses assigned to the replica instances |
| tier | The tier for the master instance. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
15 changes: 0 additions & 15 deletions modules/mysql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,3 @@ output "instance_address" {
value = google_sql_database_instance.default.ip_address
description = "The IPv4 addesses assigned for the master instance"
}

output "mysql_version" {
value = var.database_version
description = "The MySQL version to use."
}

output "region" {
value = var.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = var.tier
description = "The tier for the master instance."
}
3 changes: 0 additions & 3 deletions modules/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

| Name | Description |
|------|-------------|
| database\_version | The Postgres version to use. |
| generated\_user\_password | The auto generated default user password if not input password was provided |
| instance\_address | The IPv4 addesses assigned for the master instance |
| instance\_connection\_name | The connection name of the master instance to be used in connection strings |
Expand All @@ -72,12 +71,10 @@
| private\_ip\_address | The first private (PRIVATE) IPv4 address assigned for the master instance |
| public\_ip\_address | The first public (PRIMARY) IPv4 address assigned for the master instance |
| read\_replica\_instance\_names | The instance names for the read replica instances |
| region | The region of the Cloud SQL resources |
| replicas\_instance\_connection\_names | The connection names of the replica instances to be used in connection strings |
| replicas\_instance\_ip\_addresses | The IPv4 addresses assigned for the replica instances |
| replicas\_instance\_self\_links | The URIs of the replica instances |
| replicas\_instance\_server\_ca\_certs | The CA certificates information used to connect to the replica instances via SSL |
| replicas\_instance\_service\_account\_email\_addresses | The service account email addresses assigned to the replica instances |
| tier | The tier for the master instance. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
15 changes: 0 additions & 15 deletions modules/postgresql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,3 @@ output "generated_user_password" {
value = random_id.user-password.hex
sensitive = true
}

output "database_version" {
value = var.database_version
description = "The Postgres version to use."
}

output "region" {
value = var.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = var.tier
description = "The tier for the master instance."
}
3 changes: 0 additions & 3 deletions modules/safer_mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,11 @@ mysql -S $HOME/mysql_sockets/myproject:region:instance -u user -p
| instance\_name | The instance name for the master instance |
| instance\_self\_link | The URI of the master instance |
| instance\_service\_account\_email\_address | The service account email address assigned to the master instance |
| mysql\_version | The MySQL version to use. |
| private\_ip\_address | The first private (PRIVATE) IPv4 address assigned for the master instance |
| public\_ip\_address | The first public (PRIMARY) IPv4 address assigned for the master instance |
| read\_replica\_instance\_names | The instance names for the read replica instances |
| region | The region of the Cloud SQL resources |
| replicas\_instance\_connection\_names | The connection names of the replica instances to be used in connection strings |
| replicas\_instance\_self\_links | The URIs of the replica instances |
| replicas\_instance\_service\_account\_email\_addresses | The service account email addresses assigned to the replica instances |
| tier | The tier for the master instance. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
15 changes: 0 additions & 15 deletions modules/safer_mysql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,3 @@ output "instance_address" {
value = module.safer_mysql.instance_address
description = "The IPv4 addesses assigned for the master instance"
}

output "mysql_version" {
value = var.database_version
description = "The MySQL version to use."
}

output "region" {
value = var.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = var.tier
description = "The tier for the master instance."
}
2 changes: 1 addition & 1 deletion test/fixtures/mysql-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

provider "google" {
version = "~> 2.13"
}

module "example" {
Expand Down
13 changes: 0 additions & 13 deletions test/fixtures/mysql-private/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ output "mysql_user_pass" {
description = "The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable."
}

output "mysql_version" {
description = "The MySQL version to use."
value = module.example.mysql_version
}

output "region" {
value = module.example.region
}

output "tier" {
value = module.example.tier
}

output "reserved_range_name" {
description = "The Global Address resource name"
value = module.example.reserved_range_name
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/mysql-private/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

variable "project_id" {
default = null
description = "The ID of the project in which resources will be provisioned."
type = string
}
Expand Down
15 changes: 0 additions & 15 deletions test/fixtures/mysql-public/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,3 @@ output "private_ip_address" {
description = "The first public (PRIMARY) IPv4 address assigned."
value = module.example.private_ip_address
}

output "mysql_version" {
value = module.example.mysql_version
description = "The MySQL version to use."
}

output "region" {
value = module.example.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = module.example.tier
description = "The tier for the master instance."
}
1 change: 0 additions & 1 deletion test/fixtures/mysql-public/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

variable "project_id" {
default = null
description = "The ID of the project in which resources will be provisioned."
type = string
}
Expand Down
14 changes: 0 additions & 14 deletions test/fixtures/postgres-public/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,3 @@ output "public_ip_address" {
value = module.example.public_ip_address
}

output "database_version" {
value = module.example.database_version
description = "The Postgres version to use."
}

output "region" {
value = module.example.region
description = "The region of the Cloud SQL resources"
}

output "tier" {
value = module.example.tier
description = "The tier for the master instance."
}
1 change: 0 additions & 1 deletion test/fixtures/postgres-public/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

variable "project_id" {
default = null
description = "The ID of the project in which resources will be provisioned."
type = string
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/postgresql-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

provider "google" {
version = "~> 2.13"
}

resource "random_id" "instance_name_suffix" {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/mysql-ha/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title: Google Cloud SQL
version: 0.1.0
depends:
- name: inspec-gcp
url: https://github.com/inspec/inspec-gcp/archive/master.tar.gz
url: https://github.com/inspec/inspec-gcp/archive/v0.21.4.tar.gz
attributes:
- name: project_id
type: string
Expand Down
7 changes: 4 additions & 3 deletions test/integration/mysql-private/controls/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

project_id = attribute('project_id')
basename = attribute('name')
mysql_version = attribute('mysql_version')
region = attribute('region')
tier = attribute('tier')
public_ip_address = attribute('public_ip_address')
private_ip_address = attribute('private_ip_address')
mysql_version = "MYSQL_5_6"
region = "us-central1"
tier = "db-n1-standard-1"


describe google_sql_database_instance(project: project_id, database: basename) do
let(:expected_settings) {
Expand Down
Loading

0 comments on commit 8fc5fe6

Please sign in to comment.