-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ApigeeInstance add ipRange field (#5607)
* Add support IAM policy for the Environment of Apigee X * Add support IAM policy for the Environment of Apigee X * Add support IAM policy for the Environment of Apigee X * Add support IAM policy for the Environment of Apigee X * Revert all changes to test files. * Revert all changes to test files. * Revert all changes to test files. * Add primary_resource_name to fix tests. * Update iam_attributes.tf.erb to honor skip_test. * Don't reject skip_tests when example is nil. * Update mmv1/products/apigee/api.yaml Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com> * Fix primary_resource_name for apigee organization name. * Add a new field "ipRange". Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
- Loading branch information
Showing
4 changed files
with
117 additions
and
0 deletions.
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
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
33 changes: 33 additions & 0 deletions
33
mmv1/templates/terraform/examples/apigee_instance_ip_range.tf.erb
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,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" | ||
} |
60 changes: 60 additions & 0 deletions
60
mmv1/templates/terraform/examples/apigee_instance_ip_range_test.tf.erb
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,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" | ||
} |