diff --git a/modules/apigee/README.md b/modules/apigee/README.md
index bfd8d59d0c..4bc10e9a62 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 c6470b951c..5c7cfe4ff2 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 310ddc9525..2705376449 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 0000000000..d28af03a95
--- /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 0000000000..4af350b863
--- /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 9b381d15d2..f4a9944ea7 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: