Skip to content

Commit 92e2fa2

Browse files
committed
In the apigee module now both the /22 and /28 peering IP ranges are passed at instance creation
1 parent ac8698b commit 92e2fa2

File tree

16 files changed

+103
-80
lines changed

16 files changed

+103
-80
lines changed

blueprints/apigee/bigquery-analytics/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ Do the following to verify that everything works as expected.
6060
|---|---|:---:|:---:|:---:|
6161
| [envgroups](variables.tf#L24) | Environment groups (NAME => [HOSTNAMES]). | <code>map&#40;list&#40;string&#41;&#41;</code> || |
6262
| [environments](variables.tf#L30) | Environments. | <code title="map&#40;object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string&#41;&#10; node_config &#61; optional&#40;object&#40;&#123;&#10; min_node_count &#61; optional&#40;number&#41;&#10; max_node_count &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;&#41;&#10; envgroups &#61; list&#40;string&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> || |
63-
| [instances](variables.tf#L45) | Instance. | <code title="map&#40;object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string&#41;&#10; region &#61; string&#10; environments &#61; list&#40;string&#41;&#10; psa_ip_cidr_range &#61; string&#10; disk_encryption_key &#61; optional&#40;string&#41;&#10; consumer_accept_list &#61; optional&#40;list&#40;string&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> || |
64-
| [project_id](variables.tf#L91) | Project ID. | <code>string</code> || |
65-
| [psc_config](variables.tf#L97) | PSC configuration. | <code>map&#40;string&#41;</code> || |
63+
| [instances](variables.tf#L45) | Instance. | <code title="map&#40;object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string&#41;&#10; region &#61; string&#10; environments &#61; list&#40;string&#41;&#10; runtime_ip_cidr_range &#61; string&#10; troubleshooting_ip_cidr_range &#61; string&#10; disk_encryption_key &#61; optional&#40;string&#41;&#10; consumer_accept_list &#61; optional&#40;list&#40;string&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> || |
64+
| [project_id](variables.tf#L92) | Project ID. | <code>string</code> || |
65+
| [psc_config](variables.tf#L98) | PSC configuration. | <code>map&#40;string&#41;</code> || |
6666
| [datastore_name](variables.tf#L17) | Datastore. | <code>string</code> | | <code>&#34;gcs&#34;</code> |
67-
| [organization](variables.tf#L59) | Apigee organization. | <code title="object&#40;&#123;&#10; display_name &#61; optional&#40;string, &#34;Apigee organization created by tf module&#34;&#41;&#10; description &#61; optional&#40;string, &#34;Apigee organization created by tf module&#34;&#41;&#10; authorized_network &#61; optional&#40;string, &#34;vpc&#34;&#41;&#10; runtime_type &#61; optional&#40;string, &#34;CLOUD&#34;&#41;&#10; billing_type &#61; optional&#40;string&#41;&#10; database_encryption_key &#61; optional&#40;string&#41;&#10; analytics_region &#61; optional&#40;string, &#34;europe-west1&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10;&#125;">&#123;&#8230;&#125;</code> |
68-
| [path](variables.tf#L75) | Bucket path. | <code>string</code> | | <code>&#34;&#47;analytics&#34;</code> |
69-
| [project_create](variables.tf#L82) | Parameters for the creation of the new project. | <code title="object&#40;&#123;&#10; billing_account_id &#61; string&#10; parent &#61; string&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
70-
| [vpc_create](variables.tf#L103) | Boolean flag indicating whether the VPC should be created or not. | <code>bool</code> | | <code>true</code> |
67+
| [organization](variables.tf#L60) | Apigee organization. | <code title="object&#40;&#123;&#10; display_name &#61; optional&#40;string, &#34;Apigee organization created by tf module&#34;&#41;&#10; description &#61; optional&#40;string, &#34;Apigee organization created by tf module&#34;&#41;&#10; authorized_network &#61; optional&#40;string, &#34;vpc&#34;&#41;&#10; runtime_type &#61; optional&#40;string, &#34;CLOUD&#34;&#41;&#10; billing_type &#61; optional&#40;string&#41;&#10; database_encryption_key &#61; optional&#40;string&#41;&#10; analytics_region &#61; optional&#40;string, &#34;europe-west1&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10;&#125;">&#123;&#8230;&#125;</code> |
68+
| [path](variables.tf#L76) | Bucket path. | <code>string</code> | | <code>&#34;&#47;analytics&#34;</code> |
69+
| [project_create](variables.tf#L83) | Parameters for the creation of the new project. | <code title="object&#40;&#123;&#10; billing_account_id &#61; string&#10; parent &#61; string&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
70+
| [vpc_create](variables.tf#L104) | Boolean flag indicating whether the VPC should be created or not. | <code>bool</code> | | <code>true</code> |
7171

7272
## Outputs
7373

blueprints/apigee/bigquery-analytics/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ module "vpc" {
6868
region = k
6969
}]
7070
psa_config = {
71-
ranges = {
72-
for k, v in var.instances : "apigee-${k}" => v.psa_ip_cidr_range
73-
}
71+
ranges = merge({ for k, v in var.instances :
72+
"apigee-runtime-${k}" => v.runtime_ip_cidr_range
73+
}, { for k, v in var.instances :
74+
"apigee-troubleshooting-${k}" => v.troubleshooting_ip_cidr_range
75+
}
76+
)
7477
}
7578
}
7679

blueprints/apigee/bigquery-analytics/terraform.tfvars.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ instances = {
1515
instance-ew1 = {
1616
region = "europe-west1"
1717
environments = ["apis-test"]
18-
psa_ip_cidr_range = "10.0.4.0/22"
18+
runtime_ip_cidr_range = "10.0.4.0/22"
19+
troubleshooting_ip_cidr_range = "10.1.1.0/28"
1920
}
2021
}
2122
psc_config = {

blueprints/apigee/bigquery-analytics/variables.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ variable "environments" {
4545
variable "instances" {
4646
description = "Instance."
4747
type = map(object({
48-
display_name = optional(string)
49-
description = optional(string)
50-
region = string
51-
environments = list(string)
52-
psa_ip_cidr_range = string
53-
disk_encryption_key = optional(string)
54-
consumer_accept_list = optional(list(string))
48+
display_name = optional(string)
49+
description = optional(string)
50+
region = string
51+
environments = list(string)
52+
runtime_ip_cidr_range = string
53+
troubleshooting_ip_cidr_range = string
54+
disk_encryption_key = optional(string)
55+
consumer_accept_list = optional(list(string))
5556
}))
5657
nullable = false
5758
}

blueprints/apigee/network-patterns/nb-glb-psc-neg-sb-psc-ilbl7-hybrid-neg/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ Do the following to verify that everything works as expected.
4646
| name | description | type | required | default |
4747
|---|---|:---:|:---:|:---:|
4848
| [apigee_project_id](variables.tf#L17) | Project ID. | <code>string</code> || |
49-
| [billing_account_id](variables.tf#L47) | Parameters for the creation of the new project. | <code>string</code> || |
50-
| [hostname](variables.tf#L52) | Host name. | <code>string</code> || |
51-
| [onprem_project_id](variables.tf#L57) | Project ID. | <code>string</code> || |
52-
| [parent](variables.tf#L75) | Parent (organizations/organizationID or folders/folderID). | <code>string</code> || |
49+
| [billing_account_id](variables.tf#L53) | Parameters for the creation of the new project. | <code>string</code> || |
50+
| [hostname](variables.tf#L58) | Host name. | <code>string</code> || |
51+
| [onprem_project_id](variables.tf#L63) | Project ID. | <code>string</code> || |
52+
| [parent](variables.tf#L81) | Parent (organizations/organizationID or folders/folderID). | <code>string</code> || |
5353
| [apigee_proxy_only_subnet_ip_cidr_range](variables.tf#L23) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.2.1.0&#47;24&#34;</code> |
54-
| [apigee_psa_ip_cidr_range](variables.tf#L29) | Apigee PSA IP CIDR range. | <code>string</code> | | <code>&#34;10.0.4.0&#47;22&#34;</code> |
55-
| [apigee_psc_subnet_ip_cidr_range](variables.tf#L35) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.2.2.0&#47;24&#34;</code> |
54+
| [apigee_psc_subnet_ip_cidr_range](variables.tf#L29) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.2.2.0&#47;24&#34;</code> |
55+
| [apigee_runtime_ip_cidr_range](variables.tf#L35) | Apigee PSA IP CIDR range. | <code>string</code> | | <code>&#34;10.0.4.0&#47;22&#34;</code> |
5656
| [apigee_subnet_ip_cidr_range](variables.tf#L41) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.2.0.0&#47;24&#34;</code> |
57-
| [onprem_proxy_only_subnet_ip_cidr_range](variables.tf#L63) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.1.1.0&#47;24&#34;</code> |
58-
| [onprem_subnet_ip_cidr_range](variables.tf#L69) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.1.0.0&#47;24&#34;</code> |
59-
| [region](variables.tf#L80) | Region. | <code>string</code> | | <code>&#34;europe-west1&#34;</code> |
60-
| [zone](variables.tf#L86) | Zone. | <code>string</code> | | <code>&#34;europe-west1-c&#34;</code> |
57+
| [apigee_troubleshooting_ip_cidr_range](variables.tf#L47) | Apigee PSA IP CIDR range. | <code>string</code> | | <code>&#34;10.1.0.0&#47;28&#34;</code> |
58+
| [onprem_proxy_only_subnet_ip_cidr_range](variables.tf#L69) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.1.1.0&#47;24&#34;</code> |
59+
| [onprem_subnet_ip_cidr_range](variables.tf#L75) | Subnet IP CIDR range. | <code>string</code> | | <code>&#34;10.1.0.0&#47;24&#34;</code> |
60+
| [region](variables.tf#L86) | Region. | <code>string</code> | | <code>&#34;europe-west1&#34;</code> |
61+
| [zone](variables.tf#L92) | Zone. | <code>string</code> | | <code>&#34;europe-west1-c&#34;</code> |
6162

6263
## Outputs
6364

blueprints/apigee/network-patterns/nb-glb-psc-neg-sb-psc-ilbl7-hybrid-neg/apigee.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ module "apigee_vpc" {
5757
}]
5858
psa_config = {
5959
ranges = {
60-
"apigee" = var.apigee_psa_ip_cidr_range
60+
"apigee-runtime" = var.apigee_runtime_ip_cidr_range
61+
"apigee-troubleshooting" = var.apigee_troubleshooting_ip_cidr_range
6162
}
6263
}
6364
}
@@ -79,9 +80,10 @@ module "apigee" {
7980
}
8081
instances = {
8182
instance-1 = {
82-
region = var.region
83-
environments = [local.environment]
84-
psa_ip_cidr_range = var.apigee_psa_ip_cidr_range
83+
region = var.region
84+
environments = [local.environment]
85+
runtime_ip_cidr_range = var.apigee_runtime_ip_cidr_range
86+
troubleshooting_ip_cidr_range = var.apigee_troubleshooting_ip_cidr_range
8587
}
8688
}
8789
endpoint_attachments = {

blueprints/apigee/network-patterns/nb-glb-psc-neg-sb-psc-ilbl7-hybrid-neg/variables.tf

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,30 @@ variable "apigee_proxy_only_subnet_ip_cidr_range" {
2626
default = "10.2.1.0/24"
2727
}
2828

29-
variable "apigee_psa_ip_cidr_range" {
30-
description = "Apigee PSA IP CIDR range."
31-
type = string
32-
default = "10.0.4.0/22"
33-
}
34-
3529
variable "apigee_psc_subnet_ip_cidr_range" {
3630
description = "Subnet IP CIDR range."
3731
type = string
3832
default = "10.2.2.0/24"
3933
}
4034

35+
variable "apigee_runtime_ip_cidr_range" {
36+
description = "Apigee PSA IP CIDR range."
37+
type = string
38+
default = "10.0.4.0/22"
39+
}
40+
4141
variable "apigee_subnet_ip_cidr_range" {
4242
description = "Subnet IP CIDR range."
4343
type = string
4444
default = "10.2.0.0/24"
4545
}
4646

47+
variable "apigee_troubleshooting_ip_cidr_range" {
48+
description = "Apigee PSA IP CIDR range."
49+
type = string
50+
default = "10.1.0.0/28"
51+
}
52+
4753
variable "billing_account_id" {
4854
description = "Parameters for the creation of the new project."
4955
type = string

modules/apigee/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ module "apigee" {
4444
}
4545
instances = {
4646
instance-test-ew1 = {
47-
region = "europe-west1"
48-
environments = ["apis-test"]
49-
psa_ip_cidr_range = "10.0.4.0/22"
47+
region = "europe-west1"
48+
environments = ["apis-test"]
49+
runtime_ip_cidr_range = "10.0.4.0/22"
50+
troubleshooting_ip_cidr_range = "10.1.1.0.0/28"
5051
}
5152
instance-prod-ew3 = {
52-
region = "europe-west3"
53-
environments = ["apis-prod"]
54-
psa_ip_cidr_range = "10.0.5.0/22"
53+
region = "europe-west3"
54+
environments = ["apis-prod"]
55+
runtime_ip_cidr_range = "10.0.5.0/22"
56+
troubleshooting_ip_cidr_range = "10.1.16.0/28"
5557
}
5658
}
5759
endpoint_attachments = {
@@ -141,9 +143,10 @@ module "apigee" {
141143
project_id = "my-project"
142144
instances = {
143145
instance-test-ew1 = {
144-
region = "europe-west1"
145-
environments = ["apis-test"]
146-
psa_ip_cidr_range = "10.0.4.0/22"
146+
region = "europe-west1"
147+
environments = ["apis-test"]
148+
runtime_ip_cidr_range = "10.0.4.0/22"
149+
troubleshooting_ip_cidr_range = "10.1.1.0/28"
147150
}
148151
}
149152
}
@@ -173,12 +176,12 @@ module "apigee" {
173176

174177
| name | description | type | required | default |
175178
|---|---|:---:|:---:|:---:|
176-
| [project_id](variables.tf#L77) | Project ID. | <code>string</code> || |
179+
| [project_id](variables.tf#L78) | Project ID. | <code>string</code> || |
177180
| [endpoint_attachments](variables.tf#L17) | Endpoint attachments. | <code title="map&#40;object&#40;&#123;&#10; region &#61; string&#10; service_attachment &#61; string&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>null</code> |
178181
| [envgroups](variables.tf#L26) | Environment groups (NAME => [HOSTNAMES]). | <code>map&#40;list&#40;string&#41;&#41;</code> | | <code>null</code> |
179182
| [environments](variables.tf#L32) | Environments. | <code title="map&#40;object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Terraform-managed&#34;&#41;&#10; deployment_type &#61; optional&#40;string&#41;&#10; api_proxy_type &#61; optional&#40;string&#41;&#10; node_config &#61; optional&#40;object&#40;&#123;&#10; min_node_count &#61; optional&#40;number&#41;&#10; max_node_count &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;&#41;&#10; envgroups &#61; list&#40;string&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>null</code> |
180-
| [instances](variables.tf#L49) | Instances. | <code title="map&#40;object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Terraform-managed&#34;&#41;&#10; region &#61; string&#10; environments &#61; list&#40;string&#41;&#10; psa_ip_cidr_range &#61; string&#10; disk_encryption_key &#61; optional&#40;string&#41;&#10; consumer_accept_list &#61; optional&#40;list&#40;string&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>null</code> |
181-
| [organization](variables.tf#L63) | Apigee organization. If set to null the organization must already exist. | <code title="object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Terraform-managed&#34;&#41;&#10; authorized_network &#61; optional&#40;string&#41;&#10; runtime_type &#61; optional&#40;string, &#34;CLOUD&#34;&#41;&#10; billing_type &#61; optional&#40;string&#41;&#10; database_encryption_key &#61; optional&#40;string&#41;&#10; analytics_region &#61; optional&#40;string, &#34;europe-west1&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
183+
| [instances](variables.tf#L49) | Instances. | <code title="map&#40;object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Terraform-managed&#34;&#41;&#10; region &#61; string&#10; environments &#61; list&#40;string&#41;&#10; runtime_ip_cidr_range &#61; string&#10; troubleshooting_ip_cidr_range &#61; string&#10; disk_encryption_key &#61; optional&#40;string&#41;&#10; consumer_accept_list &#61; optional&#40;list&#40;string&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>null</code> |
184+
| [organization](variables.tf#L64) | Apigee organization. If set to null the organization must already exist. | <code title="object&#40;&#123;&#10; display_name &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Terraform-managed&#34;&#41;&#10; authorized_network &#61; optional&#40;string&#41;&#10; runtime_type &#61; optional&#40;string, &#34;CLOUD&#34;&#41;&#10; billing_type &#61; optional&#40;string&#41;&#10; database_encryption_key &#61; optional&#40;string&#41;&#10; analytics_region &#61; optional&#40;string, &#34;europe-west1&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
182185

183186
## Outputs
184187

modules/apigee/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ resource "google_apigee_instance" "instances" {
9393
description = each.value.description
9494
location = each.value.region
9595
org_id = local.org_id
96-
ip_range = each.value.psa_ip_cidr_range
96+
ip_range = "${each.value.runtime_ip_cidr_range},${each.value.troubleshooting_ip_cidr_range}"
9797
disk_encryption_key_name = each.value.disk_encryption_key
9898
consumer_accept_list = each.value.consumer_accept_list
9999
}

modules/apigee/variables.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ variable "environments" {
4949
variable "instances" {
5050
description = "Instances."
5151
type = map(object({
52-
display_name = optional(string)
53-
description = optional(string, "Terraform-managed")
54-
region = string
55-
environments = list(string)
56-
psa_ip_cidr_range = string
57-
disk_encryption_key = optional(string)
58-
consumer_accept_list = optional(list(string))
52+
display_name = optional(string)
53+
description = optional(string, "Terraform-managed")
54+
region = string
55+
environments = list(string)
56+
runtime_ip_cidr_range = string
57+
troubleshooting_ip_cidr_range = string
58+
disk_encryption_key = optional(string)
59+
consumer_accept_list = optional(list(string))
5960
}))
6061
default = null
6162
}

0 commit comments

Comments
 (0)