Skip to content

Commit

Permalink
add and fix tests for apigee module
Browse files Browse the repository at this point in the history
  • Loading branch information
g-greatdevaks committed Sep 5, 2023
1 parent 9451dde commit 36c707f
Show file tree
Hide file tree
Showing 16 changed files with 147 additions and 17 deletions.
1 change: 1 addition & 0 deletions tests/modules/apigee/all.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ organization = {
billing_type = "Pay-as-you-go"
database_encryption_key = "123456789"
analytics_region = "europe-west1"
disable_vpc_peering = false
}
envgroups = {
test = ["test.example.com"]
Expand Down
1 change: 1 addition & 0 deletions tests/modules/apigee/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ values:
retention: DELETION_RETENTION_UNSPECIFIED
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: false

counts:
google_apigee_endpoint_attachment: 2
Expand Down
7 changes: 0 additions & 7 deletions tests/modules/apigee/instance_only.tfvars

This file was deleted.

18 changes: 18 additions & 0 deletions tests/modules/apigee/instance_only_psc_mode.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
project_id = "my-project"
organization = {
display_name = "My Organization"
description = "My Organization"
# authorized_network = "my-vpc"
runtime_type = "CLOUD"
billing_type = "Pay-as-you-go"
database_encryption_key = "123456789"
analytics_region = "europe-west1"
disable_vpc_peering = true
}
instances = {
europe-west1 = {
# runtime_ip_cidr_range = "10.0.4.0/22"
# troubleshooting_ip_cidr_range = "10.1.1.0/28"
}
}

37 changes: 37 additions & 0 deletions tests/modules/apigee/instance_only_psc_mode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

values:
google_apigee_instance.instances["europe-west1"]:
description: Terraform-managed
disk_encryption_key_name: null
display_name: null
# ip_range: 10.0.4.0/22,10.1.1.0/28
location: europe-west1
name: instance-europe-west1
google_apigee_organization.organization[0]:
analytics_region: europe-west1
# authorized_network: my-vpc
billing_type: Pay-as-you-go
description: null
display_name: null
project_id: my-project
retention: DELETION_RETENTION_UNSPECIFIED
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: true

counts:
google_apigee_instance: 1
google_apigee_organization: 1
18 changes: 18 additions & 0 deletions tests/modules/apigee/instance_only_vpc_mode.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
project_id = "my-project"
organization = {
display_name = "My Organization"
description = "My Organization"
authorized_network = "my-vpc"
runtime_type = "CLOUD"
billing_type = "Pay-as-you-go"
database_encryption_key = "123456789"
analytics_region = "europe-west1"
disable_vpc_peering = false
}
instances = {
europe-west1 = {
runtime_ip_cidr_range = "10.0.4.0/22"
troubleshooting_ip_cidr_range = "10.1.1.0/28"
}
}

37 changes: 37 additions & 0 deletions tests/modules/apigee/instance_only_vpc_mode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

values:
google_apigee_instance.instances["europe-west1"]:
description: Terraform-managed
disk_encryption_key_name: null
display_name: null
ip_range: 10.0.4.0/22,10.1.1.0/28
location: europe-west1
name: instance-europe-west1
google_apigee_organization.organization[0]:
analytics_region: europe-west1
authorized_network: my-vpc
billing_type: Pay-as-you-go
description: null
display_name: null
project_id: my-project
retention: DELETION_RETENTION_UNSPECIFIED
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: false

counts:
google_apigee_instance: 1
google_apigee_organization: 1
1 change: 1 addition & 0 deletions tests/modules/apigee/no_instances.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ organization = {
billing_type = "PAYG"
database_encryption_key = "123456789"
analytics_region = "europe-west1"
disable_vpc_peering = false
}
envgroups = {
test = ["test.example.com"]
Expand Down
1 change: 1 addition & 0 deletions tests/modules/apigee/no_instances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ values:
retention: DELETION_RETENTION_UNSPECIFIED
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: false

counts:
google_apigee_envgroup: 2
Expand Down
11 changes: 11 additions & 0 deletions tests/modules/apigee/organization_only_psc_mode.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
project_id = "my-project"
organization = {
display_name = "My Organization"
description = "My Organization"
authorized_network = null
runtime_type = "CLOUD"
billing_type = "PAYG"
database_encryption_key = "123456789"
analytics_region = "europe-west1"
disable_vpc_peering = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@
# limitations under the License.

values:
google_apigee_instance.instances["europe-west1"]:
ip_range: 10.0.4.0/22,10.1.1.0.0/28
location: europe-west1
name: "instance-europe-west1"
org_id: organizations/my-project
google_apigee_organization.organization[0]:
analytics_region: europe-west1
authorized_network: null
billing_type: PAYG
description: null
display_name: null
project_id: my-project
retention: DELETION_RETENTION_UNSPECIFIED
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: true

counts:
google_apigee_instance: 1
google_apigee_organization: 1
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ organization = {
billing_type = "PAYG"
database_encryption_key = "123456789"
analytics_region = "europe-west1"
}
disable_vpc_peering = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ values:
retention: DELETION_RETENTION_UNSPECIFIED
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: false

counts:
google_apigee_organization: 1
3 changes: 2 additions & 1 deletion tests/modules/apigee/organization_retention.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ organization = {
database_encryption_key = "123456789"
analytics_region = "europe-west1"
retention = "MINIMUM"
}
disable_vpc_peering = false
}
1 change: 1 addition & 0 deletions tests/modules/apigee/organization_retention.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ values:
retention: MINIMUM
runtime_database_encryption_key_name: '123456789'
runtime_type: CLOUD
disable_vpc_peering: false

counts:
google_apigee_organization: 1
6 changes: 4 additions & 2 deletions tests/modules/apigee/tftest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ tests:
env_only_with_api_proxy_type:
env_only_with_deployment_type:
envgroup_only:
instance_only:
instance_only_psc_mode:
instance_only_vpc_mode:
no_instances:
organization_only:
organization_only_psc_mode:
organization_only_vpc_mode:
organization_retention:

0 comments on commit 36c707f

Please sign in to comment.