From 0906ddb8df6b16be646d1550f2a10a685b311241 Mon Sep 17 00:00:00 2001 From: Daniel Strebel Date: Wed, 2 Aug 2023 09:15:21 +0200 Subject: [PATCH 1/2] feat(apigee): add retention variable --- modules/apigee/README.md | 6 ++-- modules/apigee/main.tf | 1 + modules/apigee/variables.tf | 1 + .../apigee/organization_retention.tfvars | 11 ++++++++ .../apigee/organization_retention.yaml | 28 +++++++++++++++++++ tests/modules/apigee/tftest.yaml | 1 + 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 tests/modules/apigee/organization_retention.tfvars create mode 100644 tests/modules/apigee/organization_retention.yaml diff --git a/modules/apigee/README.md b/modules/apigee/README.md index bfd8d59d..6a6d6804 100644 --- a/modules/apigee/README.md +++ b/modules/apigee/README.md @@ -162,17 +162,16 @@ module "apigee" { # tftest modules=1 resources=1 ``` - ## Variables | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [project_id](variables.tf#L77) | Project ID. | string | ✓ | | +| [project_id](variables.tf#L78) | Project ID. | string | ✓ | | | [endpoint_attachments](variables.tf#L17) | Endpoint attachments. | map(object({…})) | | null | | [envgroups](variables.tf#L26) | Environment groups (NAME => [HOSTNAMES]). | map(list(string)) | | null | | [environments](variables.tf#L32) | Environments. | map(object({…})) | | null | | [instances](variables.tf#L50) | Instances ([REGION] => [INSTANCE]). | map(object({…})) | | null | -| [organization](variables.tf#L63) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | +| [organization](variables.tf#L63) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | ## Outputs @@ -186,5 +185,4 @@ module "apigee" { | [org_name](outputs.tf#L42) | Organization name. | | | [organization](outputs.tf#L47) | Organization. | | | [service_attachments](outputs.tf#L52) | Service attachments. | | - diff --git a/modules/apigee/main.tf b/modules/apigee/main.tf index c6470b95..5c7cfe4f 100644 --- a/modules/apigee/main.tf +++ b/modules/apigee/main.tf @@ -30,6 +30,7 @@ resource "google_apigee_organization" "organization" { billing_type = var.organization.billing_type runtime_type = var.organization.runtime_type runtime_database_encryption_key_name = var.organization.database_encryption_key + retention = var.organization.retention } resource "google_apigee_envgroup" "envgroups" { diff --git a/modules/apigee/variables.tf b/modules/apigee/variables.tf index 310ddc95..27053764 100644 --- a/modules/apigee/variables.tf +++ b/modules/apigee/variables.tf @@ -70,6 +70,7 @@ variable "organization" { billing_type = optional(string) database_encryption_key = optional(string) analytics_region = optional(string, "europe-west1") + retention = optional(string) }) default = null } diff --git a/tests/modules/apigee/organization_retention.tfvars b/tests/modules/apigee/organization_retention.tfvars new file mode 100644 index 00000000..d28af03a --- /dev/null +++ b/tests/modules/apigee/organization_retention.tfvars @@ -0,0 +1,11 @@ +project_id = "my-project" +organization = { + display_name = "My Organization" + description = "My Organization" + authorized_network = "my-vpc" + runtime_type = "CLOUD" + billing_type = "PAYG" + database_encryption_key = "123456789" + analytics_region = "europe-west1" + retention = "MINIMUM" +} \ No newline at end of file diff --git a/tests/modules/apigee/organization_retention.yaml b/tests/modules/apigee/organization_retention.yaml new file mode 100644 index 00000000..4af350b8 --- /dev/null +++ b/tests/modules/apigee/organization_retention.yaml @@ -0,0 +1,28 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +values: + google_apigee_organization.organization[0]: + analytics_region: europe-west1 + authorized_network: my-vpc + billing_type: PAYG + description: null + display_name: null + project_id: my-project + retention: MINIMUM + runtime_database_encryption_key_name: '123456789' + runtime_type: CLOUD + +counts: + google_apigee_organization: 1 diff --git a/tests/modules/apigee/tftest.yaml b/tests/modules/apigee/tftest.yaml index 9b381d15..f4a9944e 100644 --- a/tests/modules/apigee/tftest.yaml +++ b/tests/modules/apigee/tftest.yaml @@ -24,3 +24,4 @@ tests: instance_only: no_instances: organization_only: + organization_retention: From 702c428da455e7cd0fe3b58a0d1b5fe54f26825b Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Fri, 4 Aug 2023 13:06:59 +0200 Subject: [PATCH 2/2] Update Readme --- modules/apigee/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apigee/README.md b/modules/apigee/README.md index 6a6d6804..4bc10e9a 100644 --- a/modules/apigee/README.md +++ b/modules/apigee/README.md @@ -171,7 +171,7 @@ module "apigee" { | [envgroups](variables.tf#L26) | Environment groups (NAME => [HOSTNAMES]). | map(list(string)) | | null | | [environments](variables.tf#L32) | Environments. | map(object({…})) | | null | | [instances](variables.tf#L50) | Instances ([REGION] => [INSTANCE]). | map(object({…})) | | null | -| [organization](variables.tf#L63) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | +| [organization](variables.tf#L63) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | ## Outputs