From 3037a4f519366e088aeb975a69f14fed3fd64c3a Mon Sep 17 00:00:00 2001 From: g-greatdevaks Date: Tue, 29 Nov 2022 17:02:24 +0530 Subject: [PATCH] FIX APIGEE PAYG ENVIRONMENT NODE CONFIG Fixed the Node Configuration for Apigee PAYG specific Environments. Removed current_aggregate_node_count as it is a read-only field and cannot be taken as an input for the Apigee Environment Terraform resource. Changes committed: modified: blueprints/cloud-operations/apigee/README.md modified: blueprints/cloud-operations/apigee/variables.tf modified: modules/apigee/README.md modified: modules/apigee/main.tf modified: modules/apigee/variables.tf modified: tests/blueprints/cloud_operations/apigee/fixture/variables.tf modified: tests/modules/apigee/fixture/variables.tf --- blueprints/cloud-operations/apigee/README.md | 16 ++++++++-------- blueprints/cloud-operations/apigee/variables.tf | 5 ++--- modules/apigee/README.md | 8 ++++---- modules/apigee/main.tf | 5 ++--- modules/apigee/variables.tf | 7 +++---- .../cloud_operations/apigee/fixture/variables.tf | 5 ++--- tests/modules/apigee/fixture/variables.tf | 7 +++---- 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/blueprints/cloud-operations/apigee/README.md b/blueprints/cloud-operations/apigee/README.md index 922f038e..0802c433 100644 --- a/blueprints/cloud-operations/apigee/README.md +++ b/blueprints/cloud-operations/apigee/README.md @@ -59,15 +59,15 @@ Do the following to verify that everything works as expected. | name | description | type | required | default | |---|---|:---:|:---:|:---:| | [envgroups](variables.tf#L24) | Environment groups (NAME => [HOSTNAMES]). | map(list(string)) | ✓ | | -| [environments](variables.tf#L30) | Environments. | map(object({…})) | ✓ | | -| [instances](variables.tf#L46) | Instance. | map(object({…})) | ✓ | | -| [project_id](variables.tf#L92) | Project ID. | string | ✓ | | -| [psc_config](variables.tf#L98) | PSC configuration. | map(string) | ✓ | | +| [environments](variables.tf#L30) | Environments. | map(object({…})) | ✓ | | +| [instances](variables.tf#L45) | Instance. | map(object({…})) | ✓ | | +| [project_id](variables.tf#L91) | Project ID. | string | ✓ | | +| [psc_config](variables.tf#L97) | PSC configuration. | map(string) | ✓ | | | [datastore_name](variables.tf#L17) | Datastore. | string | | "gcs" | -| [organization](variables.tf#L60) | Apigee organization. | object({…}) | | {…} | -| [path](variables.tf#L76) | Bucket path. | string | | "/analytics" | -| [project_create](variables.tf#L83) | Parameters for the creation of the new project. | object({…}) | | null | -| [vpc_create](variables.tf#L104) | Boolean flag indicating whether the VPC should be created or not. | bool | | true | +| [organization](variables.tf#L59) | Apigee organization. | object({…}) | | {…} | +| [path](variables.tf#L75) | Bucket path. | string | | "/analytics" | +| [project_create](variables.tf#L82) | Parameters for the creation of the new project. | object({…}) | | null | +| [vpc_create](variables.tf#L103) | Boolean flag indicating whether the VPC should be created or not. | bool | | true | ## Outputs diff --git a/blueprints/cloud-operations/apigee/variables.tf b/blueprints/cloud-operations/apigee/variables.tf index 1c86621b..ba7f5d78 100644 --- a/blueprints/cloud-operations/apigee/variables.tf +++ b/blueprints/cloud-operations/apigee/variables.tf @@ -33,9 +33,8 @@ variable "environments" { display_name = optional(string) description = optional(string) node_config = optional(object({ - min_node_count = optional(number) - max_node_count = optional(number) - current_aggregate_node_count = number + min_node_count = optional(number) + max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = list(string) diff --git a/modules/apigee/README.md b/modules/apigee/README.md index 1425c8f9..62035e3c 100644 --- a/modules/apigee/README.md +++ b/modules/apigee/README.md @@ -169,12 +169,12 @@ module "apigee" { | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [project_id](variables.tf#L76) | Project ID. | string | ✓ | | +| [project_id](variables.tf#L75) | 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#L48) | Instances. | map(object({…})) | | null | -| [organization](variables.tf#L62) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | +| [environments](variables.tf#L32) | Environments. | map(object({…})) | | null | +| [instances](variables.tf#L47) | Instances. | map(object({…})) | | null | +| [organization](variables.tf#L61) | Apigee organization. If set to null the organization must already exist. | object({…}) | | null | ## Outputs diff --git a/modules/apigee/main.tf b/modules/apigee/main.tf index bc5dab48..71bcb826 100644 --- a/modules/apigee/main.tf +++ b/modules/apigee/main.tf @@ -47,9 +47,8 @@ resource "google_apigee_environment" "environments" { dynamic "node_config" { for_each = try(each.value.node_config, null) != null ? [""] : [] content { - min_node_count = node_config.min_node_count - max_node_count = node_config.max_node_count - current_aggregate_node_count = node_config.current_aggregate_node_count + min_node_count = node_config.min_node_count + max_node_count = node_config.max_node_count } } org_id = local.org_id diff --git a/modules/apigee/variables.tf b/modules/apigee/variables.tf index 8cddf9a4..266f0d34 100644 --- a/modules/apigee/variables.tf +++ b/modules/apigee/variables.tf @@ -35,9 +35,8 @@ variable "environments" { display_name = optional(string) description = optional(string, "Terraform-managed") node_config = optional(object({ - min_node_count = optional(number) - max_node_count = optional(number) - current_aggregate_node_count = number + min_node_count = optional(number) + max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = list(string) @@ -76,4 +75,4 @@ variable "organization" { variable "project_id" { description = "Project ID." type = string -} \ No newline at end of file +} diff --git a/tests/blueprints/cloud_operations/apigee/fixture/variables.tf b/tests/blueprints/cloud_operations/apigee/fixture/variables.tf index fc79ae07..d66f3874 100644 --- a/tests/blueprints/cloud_operations/apigee/fixture/variables.tf +++ b/tests/blueprints/cloud_operations/apigee/fixture/variables.tf @@ -79,9 +79,8 @@ variable "environments" { display_name = optional(string) description = optional(string) node_config = optional(object({ - min_node_count = optional(number) - max_node_count = optional(number) - current_aggregate_node_count = number + min_node_count = optional(number) + max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = list(string) diff --git a/tests/modules/apigee/fixture/variables.tf b/tests/modules/apigee/fixture/variables.tf index 8cddf9a4..266f0d34 100644 --- a/tests/modules/apigee/fixture/variables.tf +++ b/tests/modules/apigee/fixture/variables.tf @@ -35,9 +35,8 @@ variable "environments" { display_name = optional(string) description = optional(string, "Terraform-managed") node_config = optional(object({ - min_node_count = optional(number) - max_node_count = optional(number) - current_aggregate_node_count = number + min_node_count = optional(number) + max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = list(string) @@ -76,4 +75,4 @@ variable "organization" { variable "project_id" { description = "Project ID." type = string -} \ No newline at end of file +}