Skip to content
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

ApigeeInstance add ipRange field #5607

Merged
merged 22 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6675fb1
Add support IAM policy for the Environment of Apigee X
xuchenma Oct 3, 2021
f03205f
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Oct 12, 2021
13f9206
Add support IAM policy for the Environment of Apigee X
xuchenma Oct 3, 2021
88604e6
Add support IAM policy for the Environment of Apigee X
xuchenma Oct 3, 2021
974e3d0
Add support IAM policy for the Environment of Apigee X
xuchenma Oct 3, 2021
a485e31
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Oct 19, 2021
702d8be
Revert all changes to test files.
xuchenma Oct 19, 2021
c506d87
Revert all changes to test files.
xuchenma Oct 19, 2021
27bca67
Revert all changes to test files.
xuchenma Oct 19, 2021
f4fde55
Add primary_resource_name to fix tests.
xuchenma Oct 19, 2021
e018130
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Oct 21, 2021
0c4ac42
Update iam_attributes.tf.erb to honor skip_test.
xuchenma Oct 25, 2021
4c435e5
Don't reject skip_tests when example is nil.
xuchenma Oct 27, 2021
eaaba25
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Oct 28, 2021
68d4249
Update mmv1/products/apigee/api.yaml
xuchenma Nov 5, 2021
1e0499e
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Nov 5, 2021
602cc27
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Nov 10, 2021
5586f70
Fix primary_resource_name for apigee organization name.
xuchenma Nov 10, 2021
e67c72f
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Dec 14, 2021
4eb8698
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Dec 15, 2021
a34302a
Merge branch 'GoogleCloudPlatform:master' into master
xuchenma Jan 7, 2022
bb39185
Add a new field "ipRange".
xuchenma Jan 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mmv1/products/apigee/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ objects:
description: |
The size of the CIDR block range that will be reserved by the instance. For valid values,
see [CidrRange](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.instances#CidrRange) on the documentation.
- !ruby/object:Api::Type::String
name: 'ipRange'
description: |
IP range represents the customer-provided CIDR block of length 22 that will be used for
the Apigee instance creation. This optional range, if provided, should be freely
available as part of larger named range the customer has allocated to the Service
Networking peering. If this is not provided, Apigee will automatically request for any
available /22 CIDR block from Service Networking. The customer should use this CIDR block
for configuring their firewall needs to allow traffic from Apigee.
Input format: "a.b.c.d/22"
- !ruby/object:Api::Type::String
name: 'description'
description: |
Expand Down
14 changes: 14 additions & 0 deletions mmv1/products/apigee/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ overrides: !ruby/object:Overrides::ResourceOverrides
skip_docs: true
# Resource creation race
skip_vcr: true
- !ruby/object:Provider::Terraform::Examples
name: "apigee_instance_ip_range"
skip_test: true
- !ruby/object:Provider::Terraform::Examples
# This is a more verbose version of the above that creates all
# the resources needed for the acceptance test.
name: "apigee_instance_ip_range_test"
primary_resource_id: "apigee_instance"
test_env_vars:
org_id: :ORG_ID
billing_account: :BILLING_ACCT
skip_docs: true
# Resource creation race
skip_vcr: true
xuchenma marked this conversation as resolved.
Show resolved Hide resolved
- !ruby/object:Provider::Terraform::Examples
name: "apigee_instance_full"
skip_test: true
Expand Down
33 changes: 33 additions & 0 deletions mmv1/templates/terraform/examples/apigee_instance_ip_range.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
data "google_client_config" "current" {}

resource "google_compute_network" "apigee_network" {
name = "apigee-network"
}

resource "google_compute_global_address" "apigee_range" {
name = "apigee-range"
purpose = "VPC_PEERING"
address_type = "INTERNAL"
prefix_length = 22
network = google_compute_network.apigee_network.id
}

resource "google_service_networking_connection" "apigee_vpc_connection" {
network = google_compute_network.apigee_network.id
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [google_compute_global_address.apigee_range.name]
}

resource "google_apigee_organization" "apigee_org" {
analytics_region = "us-central1"
project_id = data.google_client_config.current.project
authorized_network = google_compute_network.apigee_network.id
depends_on = [google_service_networking_connection.apigee_vpc_connection]
}

resource "google_apigee_instance" "apigee_instance" {
name = "tf-test%{random_suffix}"
location = "us-central1-b"
org_id = google_apigee_organization.apigee_org.id
ip_range = "10.87.8.0/22"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
resource "google_project" "project" {
project_id = "tf-test%{random_suffix}"
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
}

resource "google_project_service" "compute" {
project = google_project.project.project_id
service = "compute.googleapis.com"
}

resource "google_project_service" "servicenetworking" {
project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
}

resource "google_compute_network" "apigee_network" {
name = "apigee-network"
project = google_project.project.project_id
depends_on = [google_project_service.compute]
}

resource "google_compute_global_address" "apigee_range" {
name = "apigee-range"
purpose = "VPC_PEERING"
address_type = "INTERNAL"
prefix_length = 22
network = google_compute_network.apigee_network.id
project = google_project.project.project_id
}

resource "google_service_networking_connection" "apigee_vpc_connection" {
network = google_compute_network.apigee_network.id
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [google_compute_global_address.apigee_range.name]
depends_on = [google_project_service.servicenetworking]
}

resource "google_apigee_organization" "apigee_org" {
analytics_region = "us-central1"
project_id = google_project.project.project_id
authorized_network = google_compute_network.apigee_network.id
depends_on = [
google_service_networking_connection.apigee_vpc_connection,
google_project_service.apigee,
]
}

resource "google_apigee_instance" "<%= ctx[:primary_resource_id] %>" {
name = "tf-test%{random_suffix}"
location = "us-central1"
org_id = google_apigee_organization.apigee_org.id
ip_range = "10.87.8.0/22"
}