Apigee addons
This commit is contained in:
@@ -61,7 +61,7 @@ module "apigee" {
|
||||
}
|
||||
}
|
||||
}
|
||||
# tftest modules=1 resources=14
|
||||
# tftest modules=1 resources=15
|
||||
```
|
||||
|
||||
### All resources (HYBRID control plane)
|
||||
@@ -96,7 +96,7 @@ module "apigee" {
|
||||
}
|
||||
}
|
||||
}
|
||||
# tftest modules=1 resources=8
|
||||
# tftest modules=1 resources=9
|
||||
```
|
||||
|
||||
### New environment group
|
||||
@@ -109,7 +109,7 @@ module "apigee" {
|
||||
test = ["test.example.com"]
|
||||
}
|
||||
}
|
||||
# tftest modules=1 resources=1
|
||||
# tftest modules=1 resources=2
|
||||
```
|
||||
|
||||
### New environment
|
||||
@@ -125,7 +125,7 @@ module "apigee" {
|
||||
}
|
||||
}
|
||||
}
|
||||
# tftest modules=1 resources=1
|
||||
# tftest modules=1 resources=2
|
||||
```
|
||||
|
||||
### New instance
|
||||
@@ -141,7 +141,7 @@ module "apigee" {
|
||||
}
|
||||
}
|
||||
}
|
||||
# tftest modules=1 resources=1
|
||||
# tftest modules=1 resources=2
|
||||
```
|
||||
|
||||
### 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
|
||||
```
|
||||
<!-- BEGIN TFDOC -->
|
||||
@@ -166,12 +179,13 @@ module "apigee" {
|
||||
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---:|:---:|:---:|
|
||||
| [project_id](variables.tf#L78) | 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> |
|
||||
| [envgroups](variables.tf#L26) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</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> |
|
||||
| [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> |
|
||||
| [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> |
|
||||
| [project_id](variables.tf#L90) | 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>null</code> |
|
||||
| [envgroups](variables.tf#L38) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</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> |
|
||||
| [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
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
locals {
|
||||
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, {})
|
||||
environments = coalesce(var.environments, {})
|
||||
instances = coalesce(var.instances, {})
|
||||
@@ -119,3 +120,42 @@ resource "google_apigee_endpoint_attachment" "endpoint_attachments" {
|
||||
location = each.value.region
|
||||
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.
|
||||
*/
|
||||
|
||||
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" {
|
||||
description = "Endpoint attachments."
|
||||
type = map(object({
|
||||
|
||||
Reference in New Issue
Block a user