-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add apigee non-vpc peering mode support #1648
Closed
g-greatdevaks
wants to merge
6
commits into
GoogleCloudPlatform:master
from
g-greatdevaks:add-apigee-non-vpc-peering-mode
+348
−23
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f456754
add apigee non-vpc peering mode support
g-greatdevaks 9451dde
Merge remote-tracking branch 'primary/master' into add-apigee-non-vpc…
g-greatdevaks 36c707f
add and fix tests for apigee module
g-greatdevaks 7259c0f
fix apigee module readme tftests
g-greatdevaks 28fea9e
Merge remote-tracking branch 'primary/master' into add-apigee-non-vpc…
g-greatdevaks 4af6ac0
add preconditions and checks
g-greatdevaks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ This module simplifies the creation of a Apigee resources (organization, environ | |
|
||
## Example | ||
|
||
### All resources (CLOUD) | ||
### All resources (CLOUD - VPC Peering Provisioning Mode) | ||
|
||
```hcl | ||
module "apigee" { | ||
|
@@ -18,6 +18,7 @@ module "apigee" { | |
billing_type = "PAYG" | ||
database_encryption_key = "123456789" | ||
analytics_region = "europe-west1" | ||
disable_vpc_peering = false | ||
} | ||
envgroups = { | ||
test = ["test.example.com"] | ||
|
@@ -65,6 +66,62 @@ module "apigee" { | |
# tftest modules=1 resources=15 | ||
``` | ||
|
||
### All resources (CLOUD - Non-VPC Peering Provisioning Mode) | ||
|
||
```hcl | ||
module "apigee" { | ||
source = "./fabric/modules/apigee" | ||
project_id = "my-project" | ||
organization = { | ||
display_name = "My Organization" | ||
description = "My Organization" | ||
runtime_type = "CLOUD" | ||
billing_type = "PAYG" | ||
database_encryption_key = "123456789" | ||
analytics_region = "europe-west1" | ||
disable_vpc_peering = true | ||
} | ||
envgroups = { | ||
test = ["test.example.com"] | ||
prod = ["prod.example.com"] | ||
} | ||
environments = { | ||
apis-test = { | ||
display_name = "APIs test" | ||
description = "APIs Test" | ||
envgroups = ["test"] | ||
regions = ["europe-west1"] | ||
} | ||
apis-prod = { | ||
display_name = "APIs prod" | ||
description = "APIs prod" | ||
envgroups = ["prod"] | ||
regions = ["europe-west3"] | ||
iam = { | ||
"roles/viewer" = ["group:[email protected]"] | ||
} | ||
} | ||
} | ||
instances = { | ||
europe-west1 = {} | ||
europe-west3 = { | ||
enable_nat = true | ||
} | ||
} | ||
endpoint_attachments = { | ||
endpoint-backend-1 = { | ||
region = "europe-west1" | ||
service_attachment = "projects/my-project-1/serviceAttachments/gkebackend1" | ||
} | ||
endpoint-backend-2 = { | ||
region = "europe-west1" | ||
service_attachment = "projects/my-project-2/serviceAttachments/gkebackend2" | ||
} | ||
} | ||
} | ||
# tftest modules=1 resources=15 | ||
``` | ||
|
||
### All resources (HYBRID control plane) | ||
|
||
```hcl | ||
|
@@ -129,7 +186,7 @@ module "apigee" { | |
# tftest modules=1 resources=1 | ||
``` | ||
|
||
### New instance | ||
### New instance (VPC Peering Provisioning Mode) | ||
|
||
```hcl | ||
module "apigee" { | ||
|
@@ -145,6 +202,28 @@ module "apigee" { | |
# tftest modules=1 resources=1 | ||
``` | ||
|
||
### New instance (Non-VPC Peering Provisioning Mode) | ||
|
||
```hcl | ||
module "apigee" { | ||
source = "./fabric/modules/apigee" | ||
project_id = "my-project" | ||
organization = { | ||
display_name = "My Organization" | ||
description = "My Organization" | ||
runtime_type = "CLOUD" | ||
billing_type = "Pay-as-you-go" | ||
database_encryption_key = "123456789" | ||
analytics_region = "europe-west1" | ||
disable_vpc_peering = true | ||
} | ||
instances = { | ||
europe-west1 = {} | ||
} | ||
} | ||
# tftest modules=1 resources=2 | ||
``` | ||
|
||
### New endpoint attachment | ||
|
||
Endpoint attachments allow to implement [Apigee southbound network patterns](https://cloud.google.com/apigee/docs/api-platform/architecture/southbound-networking-patterns-endpoints#create-the-psc-attachments). | ||
|
@@ -180,13 +259,13 @@ module "apigee" { | |
|
||
| name | description | type | required | default | | ||
|---|---|:---:|:---:|:---:| | ||
| [project_id](variables.tf#L95) | Project ID. | <code>string</code> | ✓ | | | ||
| [project_id](variables.tf#L96) | Project ID. | <code>string</code> | ✓ | | | ||
| [addons_config](variables.tf#L17) | Addons configuration. | <code title="object({ advanced_api_ops = optional(bool, false) api_security = optional(bool, false) connectors_platform = optional(bool, false) integration = optional(bool, false) monetization = optional(bool, false) })">object({…})</code> | | <code>null</code> | | ||
| [endpoint_attachments](variables.tf#L29) | Endpoint attachments. | <code title="map(object({ region = string service_attachment = string }))">map(object({…}))</code> | | <code>{}</code> | | ||
| [envgroups](variables.tf#L39) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</code> | | <code>{}</code> | | ||
| [environments](variables.tf#L46) | Environments. | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") deployment_type = optional(string) api_proxy_type = optional(string) node_config = optional(object({ min_node_count = optional(number) max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = optional(list(string)) regions = optional(list(string)) }))">map(object({…}))</code> | | <code>{}</code> | | ||
| [instances](variables.tf#L65) | Instances ([REGION] => [INSTANCE]). | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") runtime_ip_cidr_range = string troubleshooting_ip_cidr_range = string disk_encryption_key = optional(string) consumer_accept_list = optional(list(string)) enable_nat = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> | | ||
| [organization](variables.tf#L80) | Apigee organization. If set to null the organization must already exist. | <code title="object({ display_name = optional(string) description = optional(string, "Terraform-managed") authorized_network = optional(string) runtime_type = optional(string, "CLOUD") billing_type = optional(string) database_encryption_key = optional(string) analytics_region = optional(string, "europe-west1") retention = optional(string) })">object({…})</code> | | <code>null</code> | | ||
| [instances](variables.tf#L65) | Instances ([REGION] => [INSTANCE]). | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") runtime_ip_cidr_range = optional(string) troubleshooting_ip_cidr_range = optional(string) disk_encryption_key = optional(string) consumer_accept_list = optional(list(string)) enable_nat = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> | | ||
| [organization](variables.tf#L80) | Apigee organization. If set to null the organization must already exist. | <code title="object({ display_name = optional(string) description = optional(string, "Terraform-managed") authorized_network = optional(string) runtime_type = optional(string, "CLOUD") billing_type = optional(string) database_encryption_key = optional(string) analytics_region = optional(string, "europe-west1") retention = optional(string) disable_vpc_peering = optional(bool, false) })">object({…})</code> | | <code>null</code> | | ||
|
||
## Outputs | ||
|
||
|
@@ -202,3 +281,4 @@ module "apigee" { | |
| [organization](outputs.tf#L55) | Organization. | | | ||
| [service_attachments](outputs.tf#L60) | Service attachments. | | | ||
<!-- END TFDOC --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
project_id = "my-project" | ||
organization = { | ||
display_name = "My Organization" | ||
description = "My Organization" | ||
runtime_type = "CLOUD" | ||
billing_type = "Pay-as-you-go" | ||
database_encryption_key = "123456789" | ||
analytics_region = "europe-west1" | ||
disable_vpc_peering = true | ||
} | ||
envgroups = { | ||
test = ["test.example.com"] | ||
prod = ["prod.example.com"] | ||
} | ||
environments = { | ||
apis-test = { | ||
display_name = "APIs test" | ||
description = "APIs Test" | ||
envgroups = ["test"] | ||
regions = ["europe-west1"] | ||
} | ||
apis-prod = { | ||
display_name = "APIs prod" | ||
description = "APIs prod" | ||
envgroups = ["prod"] | ||
regions = ["europe-west3"] | ||
iam = { | ||
"roles/viewer" = ["group:[email protected]"] | ||
} | ||
} | ||
} | ||
instances = { | ||
europe-west1 = {} | ||
europe-west3 = {} | ||
} | ||
endpoint_attachments = { | ||
endpoint-backend-1 = { | ||
region = "europe-west1" | ||
service_attachment = "projects/my-project-1/serviceAttachments/gkebackend1" | ||
} | ||
endpoint-backend-2 = { | ||
region = "europe-west1" | ||
service_attachment = "projects/my-project-2/serviceAttachments/gkebackend2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# 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_endpoint_attachment.endpoint_attachments["endpoint-backend-1"]: | ||
endpoint_attachment_id: endpoint-backend-1 | ||
location: europe-west1 | ||
service_attachment: projects/my-project-1/serviceAttachments/gkebackend1 | ||
google_apigee_endpoint_attachment.endpoint_attachments["endpoint-backend-2"]: | ||
endpoint_attachment_id: endpoint-backend-2 | ||
location: europe-west1 | ||
service_attachment: projects/my-project-2/serviceAttachments/gkebackend2 | ||
google_apigee_envgroup.envgroups["prod"]: | ||
hostnames: | ||
- prod.example.com | ||
name: prod | ||
google_apigee_envgroup.envgroups["test"]: | ||
hostnames: | ||
- test.example.com | ||
name: test | ||
google_apigee_envgroup_attachment.envgroup_attachments["apis-prod-prod"]: | ||
environment: apis-prod | ||
google_apigee_envgroup_attachment.envgroup_attachments["apis-test-test"]: | ||
environment: apis-test | ||
google_apigee_environment.environments["apis-prod"]: | ||
description: APIs prod | ||
display_name: APIs prod | ||
name: apis-prod | ||
google_apigee_environment.environments["apis-test"]: | ||
description: APIs Test | ||
display_name: APIs test | ||
name: apis-test | ||
google_apigee_environment_iam_binding.binding["apis-prod-roles/viewer"]: | ||
condition: [] | ||
env_id: apis-prod | ||
members: | ||
- group:[email protected] | ||
role: roles/viewer | ||
google_apigee_instance.instances["europe-west3"]: | ||
description: Terraform-managed | ||
disk_encryption_key_name: null | ||
display_name: null | ||
ip_range: null | ||
location: europe-west3 | ||
name: instance-europe-west3 | ||
google_apigee_instance.instances["europe-west1"]: | ||
description: Terraform-managed | ||
disk_encryption_key_name: null | ||
display_name: null | ||
ip_range: null | ||
location: europe-west1 | ||
name: instance-europe-west1 | ||
google_apigee_organization.organization[0]: | ||
analytics_region: europe-west1 | ||
authorized_network: null | ||
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_endpoint_attachment: 2 | ||
google_apigee_envgroup: 2 | ||
google_apigee_envgroup_attachment: 2 | ||
google_apigee_environment: 2 | ||
google_apigee_environment_iam_binding: 1 | ||
google_apigee_instance: 2 | ||
google_apigee_instance_attachment: 2 | ||
google_apigee_organization: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
project_id = "my-project" | ||
organization = { | ||
display_name = "My Organization" | ||
description = "My Organization" | ||
runtime_type = "CLOUD" | ||
billing_type = "Pay-as-you-go" | ||
database_encryption_key = "123456789" | ||
analytics_region = "europe-west1" | ||
disable_vpc_peering = true | ||
} | ||
instances = { | ||
europe-west1 = {} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add more examples and keep this one as it was?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.