Merge branch 'fast-dev-dp' of https://github.com/GoogleCloudPlatform/cloud-foundation-fabric into fast-dev-dp
This commit is contained in:
commit
f23885cacd
|
@ -11,7 +11,7 @@ module "apigee-x-instance" {
|
|||
source = "./modules/apigee-x-instance"
|
||||
name = "my-us-instance"
|
||||
region = "us-central1"
|
||||
cidr_mask = 22
|
||||
ip_range = "10.0.0.0/22"
|
||||
|
||||
apigee_org_id = "my-project"
|
||||
apigee_environments = [
|
||||
|
@ -29,7 +29,7 @@ module "apigee-x-instance" {
|
|||
source = "./modules/apigee-x-instance"
|
||||
name = "my-us-instance"
|
||||
region = "us-central1"
|
||||
cidr_mask = 16
|
||||
ip_range = "10.0.0.0/22"
|
||||
disk_encryption_key = "my-disk-key"
|
||||
|
||||
apigee_org_id = "my-project"
|
||||
|
@ -49,7 +49,7 @@ module "apigee-x-instance" {
|
|||
| name | description | type | required | default |
|
||||
|---|---|:---:|:---:|:---:|
|
||||
| [apigee_org_id](variables.tf#L32) | Apigee Organization ID. | <code>string</code> | ✓ | |
|
||||
| [cidr_mask](variables.tf#L37) | CIDR mask for the Apigee instance. | <code>number</code> | ✓ | |
|
||||
| [ip_range](variables.tf#L37) | Customer-provided CIDR block of length 22 for the Apigee instance. | <code>string</code> | ✓ | |
|
||||
| [name](variables.tf#L52) | Apigee instance name. | <code>string</code> | ✓ | |
|
||||
| [region](variables.tf#L57) | Compute region. | <code>string</code> | ✓ | |
|
||||
| [apigee_envgroups](variables.tf#L17) | Apigee Environment Groups. | <code title="map(object({ environments = list(string) hostnames = list(string) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
|
|
|
@ -18,7 +18,7 @@ resource "google_apigee_instance" "apigee_instance" {
|
|||
org_id = var.apigee_org_id
|
||||
name = var.name
|
||||
location = var.region
|
||||
peering_cidr_range = "SLASH_${var.cidr_mask}"
|
||||
ip_range = var.ip_range
|
||||
disk_encryption_key_name = var.disk_encryption_key
|
||||
}
|
||||
|
||||
|
|
|
@ -34,12 +34,12 @@ variable "apigee_org_id" {
|
|||
type = string
|
||||
}
|
||||
|
||||
variable "cidr_mask" {
|
||||
description = "CIDR mask for the Apigee instance."
|
||||
type = number
|
||||
variable "ip_range" {
|
||||
description = "Customer-provided CIDR block of length 22 for the Apigee instance."
|
||||
type = string
|
||||
validation {
|
||||
condition = contains([16, 20, 22], var.cidr_mask)
|
||||
error_message = "Invalid CIDR mask; Allowed values for cidr_mask: [16, 20, 22]."
|
||||
condition = try(cidrnetmask(var.ip_range), null) == "255.255.252.0"
|
||||
error_message = "Invalid CIDR block provided; Allowed pattern for ip_range: X.X.X.X/22."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ module "apigee-x-instance" {
|
|||
source = "../../../../modules/apigee-x-instance"
|
||||
name = var.name
|
||||
region = var.region
|
||||
cidr_mask = 22
|
||||
ip_range = var.ip_range
|
||||
|
||||
apigee_org_id = "my-project"
|
||||
apigee_environments = [
|
||||
|
|
|
@ -23,3 +23,8 @@ variable "region" {
|
|||
type = string
|
||||
default = "europe-west1"
|
||||
}
|
||||
|
||||
variable "ip_range" {
|
||||
type = string
|
||||
default = "10.0.0.0/22"
|
||||
}
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue