Apigee add paid only variables and examples

This commit is contained in:
Daniel Strebel 2021-08-05 13:21:57 +02:00
parent 9c4bb0562f
commit e8b01064f6
7 changed files with 103 additions and 28 deletions

View File

@ -2,22 +2,17 @@
This module allows managing a single Apigee organization and its environments and environmentgroups. This module allows managing a single Apigee organization and its environments and environmentgroups.
## TODO
- [ ] N/A
## Examples ## Examples
### Apigee X Evaluation Organization ### Apigee X Evaluation Organization
```hcl ```hcl
module "apigee" { module "apigee-organization" {
source = "./modules/apigee" source = "./modules/apigee-organization"
project_id = "my-project" project_id = "my-project"
analytics_region = "us-central1" analytics_region = "us-central1"
runtime_type = "CLOUD" runtime_type = "CLOUD"
authorized_network = "my-vpc" authorized_network = "my-vpc"
peering_range = "10.0.0.0/16"
apigee_environments = [ apigee_environments = [
"eval1", "eval1",
"eval2" "eval2"
@ -37,11 +32,51 @@ module "apigee" {
# tftest:modules=1:resources=6 # tftest:modules=1:resources=6
``` ```
### Apigee hybrid Evaluation Organization ### Apigee X Paid Organization
```hcl ```hcl
module "apigee" { module "apigee-organization" {
source = "./modules/apigee" source = "./modules/apigee-organization"
project_id = "my-project"
analytics_region = "us-central1"
runtime_type = "CLOUD"
authorized_network = "my-vpc"
database_encryption_key = "my-data-key"
apigee_environments = [
"dev1",
"dev2",
"test1",
"test2"
]
apigee_envgroups = {
dev = {
environments = [
"dev1",
"dev2"
]
hostnames = [
"dev.api.example.com"
]
}
test = {
environments = [
"test1",
"test2"
]
hostnames = [
"test.api.example.com"
]
}
}
}
# tftest:modules=1:resources=11
```
### Apigee hybrid Organization
```hcl
module "apigee-organization" {
source = "./modules/apigee-organization"
project_id = "my-project" project_id = "my-project"
analytics_region = "us-central1" analytics_region = "us-central1"
runtime_type = "HYBRID" runtime_type = "HYBRID"

View File

@ -26,12 +26,13 @@ locals {
} }
resource "google_apigee_organization" "apigee_org" { resource "google_apigee_organization" "apigee_org" {
project_id = var.project_id project_id = var.project_id
analytics_region = var.analytics_region analytics_region = var.analytics_region
display_name = var.display_name display_name = var.display_name
description = var.description description = var.description
runtime_type = var.runtime_type runtime_type = var.runtime_type
authorized_network = var.authorized_network authorized_network = var.authorized_network
runtime_database_encryption_key_name = var.database_encryption_key
} }
resource "google_apigee_environment" "apigee_env" { resource "google_apigee_environment" "apigee_env" {

View File

@ -40,6 +40,12 @@ variable "apigee_environments" {
default = [] default = []
} }
variable "database_encryption_key" {
description = "Cloud KMS key name used for encrypting the data that is stored and replicated across runtime instances (immutable, used in Apigee X only)."
type = string
default = null
}
variable "description" { variable "description" {
description = "Description of the Apigee Organization." description = "Description of the Apigee Organization."
type = string type = string

View File

@ -2,10 +2,6 @@
This module allows managing a single Apigee X instance and its environment attachments. This module allows managing a single Apigee X instance and its environment attachments.
## TODO
- [ ] N/A
## Examples ## Examples
### Apigee X Evaluation Instance ### Apigee X Evaluation Instance
@ -26,5 +22,26 @@ module "apigee-x-instance" {
# tftest:modules=1:resources=3 # tftest:modules=1:resources=3
``` ```
### Apigee X Paid Instance
```hcl
module "apigee-x-instance" {
source = "./modules/apigee-x-instance"
name = "my-us-instance"
region = "us-central1"
cidr_mask = 16
disk_encryption_key = "my-disk-key"
apigee_org_id = "my-project"
apigee_environments = [
"dev1",
"dev2",
"test1",
"test2"
]
}
# tftest:modules=1:resources=5
```
<!-- BEGIN TFDOC --> <!-- BEGIN TFDOC -->
<!-- END TFDOC --> <!-- END TFDOC -->

View File

@ -15,11 +15,11 @@
*/ */
resource "google_apigee_instance" "apigee_instance" { resource "google_apigee_instance" "apigee_instance" {
org_id = var.apigee_org_id org_id = var.apigee_org_id
name = var.name name = var.name
location = var.region location = var.region
peering_cidr_range = "SLASH_${var.cidr_mask}" peering_cidr_range = "SLASH_${var.cidr_mask}"
#disk_encryption_key_name = google_kms_crypto_key.apigee_key.id disk_encryption_key_name = var.disk_encryption_key
} }
resource "google_apigee_instance_attachment" "apigee_instance_attchment" { resource "google_apigee_instance_attachment" "apigee_instance_attchment" {

View File

@ -14,12 +14,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
*/ */
output "endpoint" {
description = "Internal endpoint of the Apigee instance."
value = google_apigee_instance.apigee_instance.host
}
output "id" {
description = "Apigee instance ID."
value = google_apigee_instance.apigee_instance.id
}
output "instance" { output "instance" {
description = "Apigee instance." description = "Apigee instance."
value = google_apigee_instance.apigee_instance value = google_apigee_instance.apigee_instance
} }
output "endpoint" { output "port" {
description = "Internal endpoint of the Apigee instance." description = "Port number of the internal endpoint of the Apigee instance."
value = google_apigee_instance.apigee_instance.host value = google_apigee_instance.apigee_instance.port
} }

View File

@ -43,6 +43,12 @@ variable "cidr_mask" {
} }
} }
variable "disk_encryption_key" {
description = "Customer Managed Encryption Key (CMEK) used for disk and volume encryption (required for PAID Apigee Orgs only)."
type = string
default = null
}
variable "name" { variable "name" {
description = "Apigee instance name." description = "Apigee instance name."
type = string type = string