Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ resource "google_apigee_instance" "apigee_instance" {
peering_cidr_range = "SLASH_22"
}

resource "google_apigee_environment" "env_dev" {
name = "dev"
org_id = google_apigee_organization.apigee_org.id
}

resource "google_apigee_api_product" "full_api_product" {
org_id = google_apigee_organization.apigee_org.id
name = "{{index $.Vars "product_name"}}"
Expand All @@ -46,7 +51,7 @@ resource "google_apigee_api_product" "full_api_product" {
quota_time_unit = "day"
quota_counter_scope = "PROXY"

environments = ["dev", "hom"]
environments = ["dev"]

# Set them in reverse order to test set
scopes = [
Expand Down Expand Up @@ -190,6 +195,7 @@ resource "google_apigee_api_product" "full_api_product" {
}

depends_on = [
google_apigee_instance.apigee_instance
google_apigee_instance.apigee_instance,
google_apigee_environment.env_dev
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ resource "google_apigee_instance" "apigee_instance" {
peering_cidr_range = "SLASH_22"
}

resource "google_apigee_environment" "env_dev" {
name = "dev"
org_id = google_apigee_organization.apigee_org.id
}

resource "google_apigee_api_product" "{{$.PrimaryResourceId}}" {
org_id = google_apigee_organization.apigee_org.id
name = "full-api-product"
Expand All @@ -87,7 +92,7 @@ resource "google_apigee_api_product" "{{$.PrimaryResourceId}}" {
quota_time_unit = "day"
quota_counter_scope = "PROXY"

environments = ["dev", "hom"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was "hom" removed from the list? Is this an environment that just isn't present in our testing project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's not needed. The environments field wasn't being validated on API side, now I cut down the example only to dev to make it easier to test/understand.

environments = ["dev"]
scopes = [
"read:weather",
"write:reports"
Expand Down Expand Up @@ -229,6 +234,7 @@ resource "google_apigee_api_product" "{{$.PrimaryResourceId}}" {
}

depends_on = [
google_apigee_instance.apigee_instance
google_apigee_instance.apigee_instance,
google_apigee_environment.env_dev
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ resource "google_apigee_instance" "apigee_instance" {
peering_cidr_range = "SLASH_22"
}

resource "google_apigee_environment" "env_dev" {
name = "dev"
org_id = google_apigee_organization.apigee_org.id
}

resource "google_apigee_api" "test_apigee_api" {
name = "hello-world"
org_id = google_apigee_organization.apigee_org.name
config_bundle = "apigee_api_bundle.zip"
}

resource "google_apigee_api_product" "full_api_product" {
org_id = google_apigee_organization.apigee_org.id
name = "{{index $.Vars "product_name"}}"
Expand All @@ -46,7 +57,7 @@ resource "google_apigee_api_product" "full_api_product" {
value = "private"
}

environments = ["dev", "hom"]
environments = ["dev"]
proxies = ["hello-world"]
api_resources = [
"/",
Expand All @@ -63,6 +74,8 @@ resource "google_apigee_api_product" "full_api_product" {
quota_counter_scope = "PROXY"

depends_on = [
google_apigee_instance.apigee_instance
google_apigee_instance.apigee_instance,
google_apigee_environment.env_dev,
google_apigee_api.test_apigee_api
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ resource "google_apigee_instance" "apigee_instance" {
peering_cidr_range = "SLASH_22"
}

resource "google_apigee_environment" "env_dev" {
name = "dev"
org_id = google_apigee_organization.apigee_org.id
}

resource "google_apigee_api" "test_apigee_api" {
name = "hello-world"
org_id = google_apigee_organization.apigee_org.name
config_bundle = "./test-fixtures/apigee_api_bundle.zip"
}

resource "google_apigee_api_product" "{{$.PrimaryResourceId}}" {
org_id = google_apigee_organization.apigee_org.id
name = "legacy-operation-api-product"
Expand All @@ -87,7 +98,7 @@ resource "google_apigee_api_product" "{{$.PrimaryResourceId}}" {
value = "private"
}

environments = ["dev", "hom"]
environments = ["dev"]
proxies = ["hello-world"]
api_resources = [
"/",
Expand All @@ -104,6 +115,8 @@ resource "google_apigee_api_product" "{{$.PrimaryResourceId}}" {
quota_counter_scope = "PROXY"

depends_on = [
google_apigee_instance.apigee_instance
google_apigee_instance.apigee_instance,
google_apigee_environment.env_dev,
google_apigee_api.test_apigee_api
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ resource "google_apigee_instance" "apigee_instance" {
org_id = google_apigee_organization.apigee_org.id
peering_cidr_range = "SLASH_22"
}
resource "google_apigee_environment" "env_dev" {
name = "dev"
org_id = google_apigee_organization.apigee_org.id
}
resource "google_apigee_api_product" "apigee_api_product" {
org_id = google_apigee_organization.apigee_org.id
name = "tf-test%{random_suffix}"
Expand All @@ -132,7 +136,7 @@ resource "google_apigee_api_product" "apigee_api_product" {
quota_time_unit = "day"
quota_counter_scope = "PROXY"

environments = ["dev", "hom"]
environments = ["dev"]
scopes = [
"read:weather",
"write:reports"
Expand Down Expand Up @@ -274,7 +278,8 @@ resource "google_apigee_api_product" "apigee_api_product" {
}

depends_on = [
google_apigee_instance.apigee_instance
google_apigee_instance.apigee_instance,
google_apigee_environment.env_dev
]
}
`, context)
Expand Down Expand Up @@ -356,6 +361,14 @@ resource "google_apigee_developer" "apigee_developer" {
google_apigee_instance.apigee_instance
]
}
resource "google_apigee_environment" "env_dev" {
name = "dev"
org_id = google_apigee_organization.apigee_org.id
}
resource "google_apigee_environment" "env_hom" {
name = "hom"
org_id = google_apigee_organization.apigee_org.id
}
resource "google_apigee_api_product" "apigee_api_product" {
org_id = google_apigee_organization.apigee_org.id
name = "tf-test%{random_suffix}"
Expand All @@ -370,7 +383,7 @@ resource "google_apigee_api_product" "apigee_api_product" {
quota_time_unit = "day"
quota_counter_scope = "PROXY"

environments = ["dev"]
environments = ["dev", "hom"]
scopes = [
"read:weather"
]
Expand Down Expand Up @@ -511,7 +524,9 @@ resource "google_apigee_api_product" "apigee_api_product" {
}

depends_on = [
google_apigee_instance.apigee_instance
google_apigee_instance.apigee_instance,
google_apigee_environment.env_dev,
google_apigee_environment.env_hom
]
}
`, context)
Expand Down
Loading