commit
b7ff8f0933
|
@ -105,5 +105,5 @@ module "test" {
|
||||||
europe-west1 = "10.0.0.0/28"
|
europe-west1 = "10.0.0.0/28"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=10 resources=64
|
# tftest modules=10 resources=65
|
||||||
```
|
```
|
||||||
|
|
|
@ -80,5 +80,5 @@ module "test" {
|
||||||
project_id = "my-project"
|
project_id = "my-project"
|
||||||
hostname = "test.myorg.org"
|
hostname = "test.myorg.org"
|
||||||
}
|
}
|
||||||
# tftest modules=18 resources=61
|
# tftest modules=18 resources=62
|
||||||
```
|
```
|
||||||
|
|
|
@ -79,5 +79,5 @@ module "test" {
|
||||||
onprem_project_id = "my-onprem-project"
|
onprem_project_id = "my-onprem-project"
|
||||||
hostname = "test.myorg.org"
|
hostname = "test.myorg.org"
|
||||||
}
|
}
|
||||||
# tftest modules=14 resources=77
|
# tftest modules=14 resources=78
|
||||||
```
|
```
|
||||||
|
|
|
@ -61,7 +61,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=14
|
# tftest modules=1 resources=15
|
||||||
```
|
```
|
||||||
|
|
||||||
### All resources (HYBRID control plane)
|
### All resources (HYBRID control plane)
|
||||||
|
@ -96,7 +96,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=8
|
# tftest modules=1 resources=9
|
||||||
```
|
```
|
||||||
|
|
||||||
### New environment group
|
### New environment group
|
||||||
|
@ -109,7 +109,7 @@ module "apigee" {
|
||||||
test = ["test.example.com"]
|
test = ["test.example.com"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=1
|
# tftest modules=1 resources=2
|
||||||
```
|
```
|
||||||
|
|
||||||
### New environment
|
### New environment
|
||||||
|
@ -125,7 +125,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=1
|
# tftest modules=1 resources=2
|
||||||
```
|
```
|
||||||
|
|
||||||
### New instance
|
### New instance
|
||||||
|
@ -141,7 +141,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=1
|
# tftest modules=1 resources=2
|
||||||
```
|
```
|
||||||
|
|
||||||
### New endpoint attachment
|
### New endpoint attachment
|
||||||
|
@ -159,6 +159,19 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# tftest modules=1 resources=2
|
||||||
|
```
|
||||||
|
|
||||||
|
### Apigee add-ons
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
module "apigee" {
|
||||||
|
source = "./fabric/modules/apigee"
|
||||||
|
project_id = "my-project"
|
||||||
|
addons_config = {
|
||||||
|
monetization = true
|
||||||
|
}
|
||||||
|
}
|
||||||
# tftest modules=1 resources=1
|
# tftest modules=1 resources=1
|
||||||
```
|
```
|
||||||
<!-- BEGIN TFDOC -->
|
<!-- BEGIN TFDOC -->
|
||||||
|
@ -166,12 +179,13 @@ module "apigee" {
|
||||||
|
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [project_id](variables.tf#L78) | Project ID. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L90) | Project ID. | <code>string</code> | ✓ | |
|
||||||
| [endpoint_attachments](variables.tf#L17) | Endpoint attachments. | <code title="map(object({ region = string service_attachment = string }))">map(object({…}))</code> | | <code>null</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> |
|
||||||
| [envgroups](variables.tf#L26) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</code> | | <code>null</code> |
|
| [endpoint_attachments](variables.tf#L29) | Endpoint attachments. | <code title="map(object({ region = string service_attachment = string }))">map(object({…}))</code> | | <code>null</code> |
|
||||||
| [environments](variables.tf#L32) | 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>null</code> |
|
| [envgroups](variables.tf#L38) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</code> | | <code>null</code> |
|
||||||
| [instances](variables.tf#L50) | 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)) }))">map(object({…}))</code> | | <code>null</code> |
|
| [environments](variables.tf#L44) | 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>null</code> |
|
||||||
| [organization](variables.tf#L63) | 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#L62) | 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)) }))">map(object({…}))</code> | | <code>null</code> |
|
||||||
|
| [organization](variables.tf#L75) | 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> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
org_id = try(google_apigee_organization.organization[0].id, "organizations/${var.project_id}")
|
org_id = try(google_apigee_organization.organization[0].id, "organizations/${var.project_id}")
|
||||||
|
org_name = try(google_apigee_organization.organization[0].name, var.project_id)
|
||||||
envgroups = coalesce(var.envgroups, {})
|
envgroups = coalesce(var.envgroups, {})
|
||||||
environments = coalesce(var.environments, {})
|
environments = coalesce(var.environments, {})
|
||||||
instances = coalesce(var.instances, {})
|
instances = coalesce(var.instances, {})
|
||||||
|
@ -119,3 +120,42 @@ resource "google_apigee_endpoint_attachment" "endpoint_attachments" {
|
||||||
location = each.value.region
|
location = each.value.region
|
||||||
service_attachment = each.value.service_attachment
|
service_attachment = each.value.service_attachment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "google_apigee_addons_config" "test_organization" {
|
||||||
|
org = local.org_name
|
||||||
|
dynamic "addons_config" {
|
||||||
|
for_each = var.addons_config == null ? [] : [""]
|
||||||
|
content {
|
||||||
|
dynamic "advanced_api_ops_config" {
|
||||||
|
for_each = var.addons_config.advanced_api_ops ? [] : [""]
|
||||||
|
content {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dynamic "api_security_config" {
|
||||||
|
for_each = var.addons_config.api_security ? [] : [""]
|
||||||
|
content {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dynamic "connectors_platform_config" {
|
||||||
|
for_each = var.addons_config.connectors_platform ? [] : [""]
|
||||||
|
content {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dynamic "integration_config" {
|
||||||
|
for_each = var.addons_config.integration ? [] : [""]
|
||||||
|
content {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dynamic "monetization_config" {
|
||||||
|
for_each = var.addons_config.monetization ? [] : [""]
|
||||||
|
content {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
variable "addons_config" {
|
||||||
|
description = "Addons configuration."
|
||||||
|
type = 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)
|
||||||
|
})
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "endpoint_attachments" {
|
variable "endpoint_attachments" {
|
||||||
description = "Endpoint attachments."
|
description = "Endpoint attachments."
|
||||||
type = map(object({
|
type = map(object({
|
||||||
|
|
Loading…
Reference in New Issue