From 3d958cfd4fb63c2a0e064abb2701290d452a6843 Mon Sep 17 00:00:00 2001 From: prateek Date: Fri, 6 Sep 2024 14:44:12 +0530 Subject: [PATCH] fix: updated some variable description to make them more clear (#561) --- README.md | 6 +++--- tests/pr_test.go | 2 +- variables.tf | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8d538eb..1629d42 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,8 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [cloud\_service\_by\_crn](#input\_cloud\_service\_by\_crn) | List of cloud service CRNs. The keys are the CRN. The values (all optional) give some level of control on the created VPEs. Each CRN will have a unique endpoint gateways created. For a list of supported services, see the docs [here](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services). |
set(
object({
crn = string
vpe_name = optional(string) # Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
service_name = optional(string) # Name of the service used to compute the name of the VPE. If not specified, the service name will be obtained from the crn.
allow_dns_resolution_binding = optional(bool, true)
})
)
| `[]` | no | -| [cloud\_services](#input\_cloud\_services) | List of cloud services to create an endpoint gateway. The keys are the service names, the values (all optional) give some level of control on the created VPEs. |
set(object({
service_name = string
vpe_name = optional(string), # Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
allow_dns_resolution_binding = optional(bool, false)
}))
| `[]` | no | +| [cloud\_service\_by\_crn](#input\_cloud\_service\_by\_crn) | The list of cloud service CRNs used to create endpoint gateways. Use this list to identify services that are not supported by service name in the `cloud_services` variable. For a list of supported services, see [VPE-enabled services](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services). If `service_name` is not specified, the CRN is used to find the name. If `vpe_name` is not specified in the list, VPE names are created in the format `--`. The value that you specify for `vpc_name` must be known at Terraform plan time. |
set(
object({
crn = string
vpe_name = optional(string) # Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
service_name = optional(string) # Name of the service used to compute the name of the VPE. If not specified, the service name will be obtained from the crn.
allow_dns_resolution_binding = optional(bool, true)
})
)
| `[]` | no | +| [cloud\_services](#input\_cloud\_services) | The list of cloud services used to create endpoint gateways. If `vpe_name` is not specified in the list, VPE names are created in the format `--`. The value that you specify for `vpc_name` must be known at Terraform plan time. |
set(object({
service_name = string
vpe_name = optional(string), # Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
allow_dns_resolution_binding = optional(bool, false)
}))
| `[]` | no | | [prefix](#input\_prefix) | The prefix that you would like to append to your resources | `string` | `"vpe"` | no | | [region](#input\_region) | The region where VPC and services are deployed | `string` | `"us-south"` | no | | [resource\_group\_id](#input\_resource\_group\_id) | ID of the resource group where endpoint gateways will be provisioned | `string` | `null` | no | @@ -127,7 +127,7 @@ No modules. | [service\_endpoints](#input\_service\_endpoints) | Service endpoints to use to create endpoint gateways. Can be `public`, or `private`. | `string` | `"private"` | no | | [subnet\_zone\_list](#input\_subnet\_zone\_list) | List of subnets in the VPC where gateways and reserved IPs will be provisioned. This value is intended to use the `subnet_zone_list` output from the Landing Zone VPC Subnet Module (https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vpc) or from templates using that module for subnet creation. |
list(
object({
name = string
id = string
zone = string
cidr = optional(string)
})
)
| `[]` | no | | [vpc\_id](#input\_vpc\_id) | ID of the VPC where the Endpoint Gateways will be created | `string` | `null` | no | -| [vpc\_name](#input\_vpc\_name) | Name of the VPC where the Endpoint Gateways will be created. This value is used to dynamically generate VPE names. | `string` | `"vpc"` | no | +| [vpc\_name](#input\_vpc\_name) | A label that can be used as a short name for virtual private endpoints. If `vpe_name` is not specified in the `cloud_services` or `cloud_service_by_crn` input variable lists, VPE names are created in the format `--`. The value that you specify for `vpc_name` must be known at Terraform plan time. | `string` | `"vpc"` | no | ### Outputs diff --git a/tests/pr_test.go b/tests/pr_test.go index 959d540..b690092 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -115,6 +115,6 @@ func TestRunEveryMultiTenantExample(t *testing.T) { options := setupOptions(t, "vpe-allmt", "examples/basic") output, err := options.RunTestConsistency() - assert.Nil(t, err, "This should not have errored") + assert.Nil(t, err, "This should not have errored.") assert.NotNil(t, output, "Expected some output") } diff --git a/variables.tf b/variables.tf index 2ca796e..d0c5650 100644 --- a/variables.tf +++ b/variables.tf @@ -15,7 +15,7 @@ variable "prefix" { } variable "vpc_name" { - description = "Name of the VPC where the Endpoint Gateways will be created. This value is used to dynamically generate VPE names." + description = "A label that can be used as a short name for virtual private endpoints. If `vpe_name` is not specified in the `cloud_services` or `cloud_service_by_crn` input variable lists, VPE names are created in the format `--`. The value that you specify for `vpc_name` must be known at Terraform plan time." type = string default = "vpc" } @@ -59,7 +59,7 @@ variable "security_group_ids" { variable "cloud_services" { - description = "List of cloud services to create an endpoint gateway. The keys are the service names, the values (all optional) give some level of control on the created VPEs." + description = "The list of cloud services used to create endpoint gateways. If `vpe_name` is not specified in the list, VPE names are created in the format `--`. The value that you specify for `vpc_name` must be known at Terraform plan time." type = set(object({ service_name = string vpe_name = optional(string), # Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name. @@ -67,7 +67,7 @@ variable "cloud_services" { })) default = [] validation { - error_message = "Currently the service you're trying to add is not supported. Any other VPE services must be added using `cloud_service_by_crn`." + error_message = "The service you're trying to add is not supported. For a list of supported services, see [VPE-enabled services](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services). You can add unsupported services in the `cloud_service_by_crn` variable." condition = length(var.cloud_services) == 0 ? true : length([ for service in var.cloud_services : service.service_name if !contains([ @@ -110,7 +110,7 @@ variable "cloud_services" { } variable "cloud_service_by_crn" { - description = "List of cloud service CRNs. The keys are the CRN. The values (all optional) give some level of control on the created VPEs. Each CRN will have a unique endpoint gateways created. For a list of supported services, see the docs [here](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services)." + description = "The list of cloud service CRNs used to create endpoint gateways. Use this list to identify services that are not supported by service name in the `cloud_services` variable. For a list of supported services, see [VPE-enabled services](https://cloud.ibm.com/docs/vpc?topic=vpc-vpe-supported-services). If `service_name` is not specified, the CRN is used to find the name. If `vpe_name` is not specified in the list, VPE names are created in the format `--`. The value that you specify for `vpc_name` must be known at Terraform plan time." type = set( object({ crn = string