Add ip_range variable to apigee-x-instance module (#485)

* Add ip_range variable for apigee-x-instance module

* Add variable definition and validation for ip_range

* Update the validation rule for ip_range variable
This commit is contained in:
Saurabh Shivgunde
2022-02-03 00:02:26 +05:30
committed by GitHub
parent e279818b55
commit 4e86fbcd04
6 changed files with 19 additions and 14 deletions

View File

@@ -15,10 +15,10 @@
*/
module "apigee-x-instance" {
source = "../../../../modules/apigee-x-instance"
name = var.name
region = var.region
cidr_mask = 22
source = "../../../../modules/apigee-x-instance"
name = var.name
region = var.region
ip_range = var.ip_range
apigee_org_id = "my-project"
apigee_environments = [

View File

@@ -23,3 +23,8 @@ variable "region" {
type = string
default = "europe-west1"
}
variable "ip_range" {
type = string
default = "10.0.0.0/22"
}

View File

@@ -39,6 +39,6 @@ def test_instance(resources):
instances = [r['values'] for r in resources if r['type']
== 'google_apigee_instance']
assert len(instances) == 1
assert instances[0]['peering_cidr_range'] == 'SLASH_22'
assert instances[0]['ip_range'] == '10.0.0.0/22'
assert instances[0]['name'] == 'my-test-instance'
assert instances[0]['location'] == 'europe-west1'