Skip to content

Commit

Permalink
HCS-1805-hotfix: Set "computed=true" option for the vm size (#100)
Browse files Browse the repository at this point in the history
`size` is an optional field on Consul cluster create. If customers have
not specified it in the config, without the "computer=true" option
it forces recreation of the cluster.
  • Loading branch information
riddhi89 authored Apr 9, 2021
1 parent c409c3f commit 2a7ea06
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/consul_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data "hcp_consul_cluster" "example" {
- **region** (String) The region where the HCP Consul cluster is located.
- **scale** (Number) The the number of Consul server nodes in the cluster.
- **self_link** (String) A unique URL identifying the HCP Consul cluster.
- **size** (String) The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`.
- **size** (String) The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`. For more details - https://cloud.hashicorp.com/pricing/consul
- **tier** (String) The tier that the HCP Consul cluster will be provisioned as. Only `development` and `standard` are available at this time.

<a id="nestedblock--timeouts"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/consul_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "hcp_consul_cluster" "example" {
- **min_consul_version** (String) The minimum Consul version of the cluster. If not specified, it is defaulted to the version that is currently recommended by HCP.
- **primary_link** (String) The `self_link` of the HCP Consul cluster which is the primary in the federation setup with this HCP Consul cluster. If not specified, it is a standalone cluster.
- **public_endpoint** (Boolean) Denotes that the cluster has a public endpoint for the Consul UI. Defaults to false.
- **size** (String) The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`.
- **size** (String) The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`. For more details - https://cloud.hashicorp.com/pricing/consul
- **timeouts** (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-only
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_consul_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func dataSourceConsulCluster() *schema.Resource {
Computed: true,
},
"size": {
Description: "The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`.",
Description: "The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`. For more details - https://cloud.hashicorp.com/pricing/consul",
Type: schema.TypeString,
Computed: true,
},
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_consul_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ func resourceConsulCluster() *schema.Resource {
ForceNew: true,
},
"size": {
// TODO: Add a link to the HCP Consul size details when it is available here - https://cloud.hashicorp.com/pricing/consul#FAQ
Description: "The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`.",
Description: "The t-shirt size representation of each server VM that this Consul cluster is provisioned with. Valid option for development tier - `x_small`. Valid options for other tiers - `small`, `medium`, `large`. For more details - https://cloud.hashicorp.com/pricing/consul",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateDiagFunc: validateConsulClusterSize,
DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool {
return strings.ToLower(old) == strings.ToLower(new)
Expand Down

0 comments on commit 2a7ea06

Please sign in to comment.