Skip to content

Commit

Permalink
add plus tier (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshasselberg authored Jun 18, 2021
1 parent 0d909a0 commit 70febf9
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 25 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 @@ -52,7 +52,7 @@ data "hcp_consul_cluster" "example" {
- **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`. 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.
- **tier** (String) The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
7 changes: 5 additions & 2 deletions docs/resources/consul_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ description: |-

# hcp_consul_cluster (Resource)

-> **Note:** The `primary_link` attribute is related to federation, a feature that is currently in private beta.

-> **Note:** The `plus` tier is currently in private beta.

The Consul cluster resource allows you to manage an HCP Consul cluster.

## Example Usage
Expand All @@ -26,15 +30,14 @@ resource "hcp_consul_cluster" "example" {
}
```

-> **Note:** The `primary_link` attribute is related to federation, a feature that is currently in private beta.
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **cluster_id** (String) The ID of the HCP Consul cluster.
- **hvn_id** (String) The ID of the HVN this HCP Consul cluster is associated to.
- **tier** (String) The tier that the HCP Consul cluster will be provisioned as. Only `development` and `standard` are available at this time.
- **tier** (String) The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time. See [pricing information](https://cloud.hashicorp.com/pricing/consul).

### Optional

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/google/uuid v1.2.0
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/hcl/v2 v2.8.2 // indirect
github.com/hashicorp/hcp-sdk-go v0.8.0
github.com/hashicorp/hcp-sdk-go v0.9.0
github.com/hashicorp/terraform-exec v0.13.3 // indirect
github.com/hashicorp/terraform-plugin-docs v0.4.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0
Expand Down
72 changes: 57 additions & 15 deletions go.sum

Large diffs are not rendered by default.

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 @@ -113,7 +113,7 @@ func dataSourceConsulCluster() *schema.Resource {
Computed: true,
},
"tier": {
Description: "The tier that the HCP Consul cluster will be provisioned as. Only `development` and `standard` are available at this time.",
Description: "The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time.",
Type: schema.TypeString,
Computed: true,
},
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/resource_consul_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ func resourceConsulCluster() *schema.Resource {
ValidateDiagFunc: validateSlugID,
},
"tier": {
// TODO: link to HCP Consul feature tier page when it is available
Description: "The tier that the HCP Consul cluster will be provisioned as. Only `development` and `standard` are available at this time.",
Description: "The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time. See [pricing information](https://cloud.hashicorp.com/pricing/consul).",
Type: schema.TypeString,
Required: true,
ForceNew: true,
Expand Down
16 changes: 14 additions & 2 deletions internal/provider/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,18 @@ func Test_validateConsulClusterTier(t *testing.T) {
input string
expected diag.Diagnostics
}{
"development": {
input: "development",
expected: nil,
},
"standard": {
input: "standard",
expected: nil,
},
"plus": {
input: "plus",
expected: nil,
},
"valid tier lowercase": {
input: "development",
expected: nil,
Expand All @@ -284,8 +296,8 @@ func Test_validateConsulClusterTier(t *testing.T) {
expected: diag.Diagnostics{
diag.Diagnostic{
Severity: diag.Error,
Summary: "expected dev to be one of [DEVELOPMENT STANDARD]",
Detail: "expected dev to be one of [DEVELOPMENT STANDARD] (value is case-insensitive).",
Summary: "expected dev to be one of [DEVELOPMENT STANDARD PLUS]",
Detail: "expected dev to be one of [DEVELOPMENT STANDARD PLUS] (value is case-insensitive).",
AttributePath: nil,
},
},
Expand Down
5 changes: 4 additions & 1 deletion templates/resources/consul_cluster.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ description: |-

# {{.Type}} ({{.Name}})

-> **Note:** The `primary_link` attribute is related to federation, a feature that is currently in private beta.

-> **Note:** The `plus` tier is currently in private beta.

{{ .Description | trimspace }}

## Example Usage

{{ tffile "examples/resources/hcp_consul_cluster/resource.tf" }}

-> **Note:** The `primary_link` attribute is related to federation, a feature that is currently in private beta.
{{ .SchemaMarkdown | trimspace }}

## Import
Expand Down

0 comments on commit 70febf9

Please sign in to comment.