Skip to content

Commit

Permalink
Merge pull request #98 from hashicorp/sync-public-and-internal-provider
Browse files Browse the repository at this point in the history
[auto] Sync with Public Provider
  • Loading branch information
itsjaspermilan authored Mar 15, 2023
2 parents f0d95fd + e93d581 commit efda9fc
Show file tree
Hide file tree
Showing 98 changed files with 2,446 additions and 1,005 deletions.
22 changes: 22 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Overrides the copywrite config schema version
# Default: 1
schema_version = 1

project {
# SPDX-compatible license identifier
# Leave blank if you don't wish to license the project
# Default: "MPL-2.0"
# license = ""

# Represents the year that the project initially began
# Default: <the year the repo was first created>
# copyright_year = 0

# A list of globs that should not have copyright or license headers
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
# Default: []
header_ignore = [
"examples/**"
]
}
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

archives:
- files:
# Ensure only built binary is archived
Expand Down
3 changes: 3 additions & 0 deletions .release/release-metadata.hcl
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

url_source_repository = "https://github.com/hashicorp/terraform-provider-hcp"
url_license = "https://github.com/hashicorp/terraform-provider-hcp/blob/main/LICENSE"
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
## v0.56.0 (March 15, 2023)

IMPROVEMENTS:

* Bump github.com/hashicorp/hcp-sdk-go from 0.35.0 to 0.37.0 [[GH-482](https://github.com/hashicorp/terraform-provider-hcp/pull/482)]

BUG FIXES:

* Update pricing information for vault and consul. [[GH-480](https://github.com/hashicorp/terraform-provider-hcp/pull/480)]
## v0.55.0 (March 08, 2023)

FEATURES:

* New field `ip_allowlist` for `hcp_consul_cluster` to create, or update allowed IP address ranges (CIDRs) for inbound traffic. [[GH-455](https://github.com/hashicorp/terraform-provider-hcp/pull/455)]

IMPROVEMENTS:

* Add cluster scaling acceptance tests for Azure [[GH-465](https://github.com/hashicorp/terraform-provider-hcp/pull/465)]
* Bump github.com/hashicorp/hcp-sdk-go from 0.31.0 to 0.35.0 [[GH-458](https://github.com/hashicorp/terraform-provider-hcp/pull/458)]
* Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.24.1 to 2.25.0 [[GH-459](https://github.com/hashicorp/terraform-provider-hcp/pull/459)]
* Bump google.golang.org/grpc from 1.52.3 to 1.53.0 [[GH-452](https://github.com/hashicorp/terraform-provider-hcp/pull/452)]

BUG FIXES:

* resource/hcp_packer_channel: Fix documentation for incorrectly documented attributes [[GH-462](https://github.com/hashicorp/terraform-provider-hcp/pull/462)]
## v0.54.0 (February 15, 2023)

FEATURES:

* New resource `hcp_packer_channel` to create, or update an existing, channel with or without an assigned iteration. [[GH-435](https://github.com/hashicorp/terraform-provider-hcp/pull/435)]

IMPROVEMENTS:

* Bump github.com/hashicorp/hcp-sdk-go from 0.28.0 to 0.29.0 [[GH-431](https://github.com/hashicorp/terraform-provider-hcp/pull/431)]
* Bump github.com/hashicorp/hcp-sdk-go from 0.29.0 to 0.31.0 [[GH-445](https://github.com/hashicorp/terraform-provider-hcp/pull/445)]
* Bump google.golang.org/grpc from 1.51.0 to 1.52.3 [[GH-444](https://github.com/hashicorp/terraform-provider-hcp/pull/444)]
* Refactor HCP Vault TF acceptance test harness to include test for Azure [[GH-441](https://github.com/hashicorp/terraform-provider-hcp/pull/441)]
* resource/hcp_packer_channel: Label resource as public beta [[GH-457](https://github.com/hashicorp/terraform-provider-hcp/pull/457)]

BUG FIXES:

* Do not exit acceptance test when provider returns a warning [[GH-448](https://github.com/hashicorp/terraform-provider-hcp/pull/448)]
## v0.53.0 (January 20, 2023)

FEATURES:
Expand Down
5 changes: 3 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ BUILD_ALL_PATH=${PWD}/bin
TEST?=./internal/...
GO_LINT ?= golangci-lint
GO_LINT_CONFIG_PATH ?= ./golangci-config.yml
TIMEOUT?=360m

ifeq ($(GOOS), darwin)
INSTALL_PATH=~/Library/Application\ Support/io.terraform/plugins/localhost/providers/hcp/0.0.1/darwin_$(GOARCH)
Expand Down Expand Up @@ -51,7 +52,7 @@ testacc: fmtcheck
echo "See the contributing guide for more information: https://github.com/hashicorp/terraform-provider-hcp/blob/main/contributing/writing-tests.md"; \
exit 1; \
fi
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 210m
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout $(TIMEOUT) -parallel=10

testacc-ci: fmtcheck
@if [ "$(TESTARGS)" = "-run=TestAccXXX" ]; then \
Expand All @@ -64,7 +65,7 @@ testacc-ci: fmtcheck
echo "See the contributing guide for more information: https://github.com/hashicorp/terraform-provider-hcp/blob/main/contributing/writing-tests.md"; \
exit 1; \
fi
TF_ACC=1 go test -short -coverprofile=coverage-e2e.out $(TEST) -v $(TESTARGS) -timeout 360m
TF_ACC=1 go test -short -coverprofile=coverage-e2e.out $(TEST) -v $(TESTARGS) -timeout $(TIMEOUT) -parallel=10
go tool cover -html=coverage-e2e.out -o coverage-e2e.html

depscheck:
Expand Down
10 changes: 10 additions & 0 deletions docs/data-sources/consul_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ data "hcp_consul_cluster" "example" {
- `datacenter` (String) The Consul data center name of the cluster. If not specified, it is defaulted to the value of `cluster_id`.
- `hvn_id` (String) The ID of the HVN this HCP Consul cluster is associated to.
- `id` (String) The ID of this resource.
- `ip_allowlist` (List of Object) Allowed IPV4 address ranges (CIDRs) for inbound traffic. Each entry must be a unique CIDR. Maximum 3 CIDRS supported at this time. (see [below for nested schema](#nestedatt--ip_allowlist))
- `organization_id` (String) The ID of the organization the project for this HCP Consul cluster is located.
- `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.
- `project_id` (String) The ID of the project this HCP Consul cluster is located.
Expand All @@ -64,3 +65,12 @@ Optional:
- `default` (String)


<a id="nestedatt--ip_allowlist"></a>
### Nested Schema for `ip_allowlist`

Read-Only:

- `address` (String)
- `description` (String)


2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ terraform {
required_providers {
hcp = {
source = "hashicorp/hcp"
version = "~> 0.53.0"
version = "~> 0.56.0"
}
}
}
Expand Down
15 changes: 14 additions & 1 deletion docs/resources/consul_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ resource "hcp_consul_cluster" "example" {

- `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`, `standard` and `plus` are available at this time. See [pricing information](https://cloud.hashicorp.com/pricing/consul).
- `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://www.hashicorp.com/products/consul/pricing).

### Optional

- `auto_hvn_to_hvn_peering` (Boolean) Enables automatic HVN to HVN peering when creating a secondary cluster in a federation. The alternative to using the auto-accept feature is to create an [`hcp_hvn_peering_connection`](hvn_peering_connection.md) resource that explicitly defines the HVN resources that are allowed to communicate with each other.
- `connect_enabled` (Boolean) Denotes the Consul connect feature should be enabled for this cluster. Default to true.
- `datacenter` (String) The Consul data center name of the cluster. If not specified, it is defaulted to the value of `cluster_id`.
- `ip_allowlist` (Block List, Max: 3) Allowed IPV4 address ranges (CIDRs) for inbound traffic. Each entry must be a unique CIDR. Maximum 3 CIDRS supported at this time. (see [below for nested schema](#nestedblock--ip_allowlist))
- `min_consul_version` (String) The minimum Consul patch version of the cluster. Allows only the rightmost version component to increment (E.g: `1.13.0` will allow installation of `1.13.2` and `1.13.3` etc., but not `1.14.0`). 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.
Expand Down Expand Up @@ -68,6 +69,18 @@ resource "hcp_consul_cluster" "example" {
- `self_link` (String) A unique URL identifying the HCP Consul cluster.
- `state` (String) The state of the HCP Consul cluster.

<a id="nestedblock--ip_allowlist"></a>
### Nested Schema for `ip_allowlist`

Required:

- `address` (String) IP address range in CIDR notation.

Optional:

- `description` (String) Description to help identify source (maximum 255 chars).


<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Expand Down
120 changes: 120 additions & 0 deletions docs/resources/packer_channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
page_title: "Resource hcp_packer_channel - terraform-provider-hcp"
subcategory: ""
description: |-
The Packer Channel resource allows you to manage image bucket channels within an active HCP Packer Registry.
---

# hcp_packer_channel (Resource)

-> **Note:** This resource is currently in public beta.

The Packer Channel resource allows you to manage image bucket channels within an active HCP Packer Registry.

## Example Usage

To create a channel with no assigned iteration.
```terraform
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
}
```

To create, or update an existing, channel with an assigned iteration.
```terraform
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
iteration {
id = "iteration-id"
}
}
# Update assigned iteration using an iteration fingerprint
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
iteration {
fingerprint = "fingerprint-associated-to-iteration"
}
}
# Update assigned iteration using an iteration incremental version
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
iteration {
// incremental_version is the version number assigned to a completed iteration.
incremental_version = 1
}
}
```

Using the latest channel to create a new channel with an assigned iteration.
```terraform
data "hcp_packer_image_iteration" "latest" {
bucket_name = "alpine"
channel = "latest"
}
resource "hcp_packer_channel" "staging" {
name = staging
bucket_name = alpine
iteration {
id = data.hcp_packer_image_iteration.latest.id
}
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `bucket_name` (String) The slug of the HCP Packer Registry image bucket where the channel should be created in.
- `name` (String) The name of the channel being managed.

### Optional

- `iteration` (Block List, Max: 1) The iteration assigned to the channel. (see [below for nested schema](#nestedblock--iteration))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `author_id` (String) The author of this channel.
- `created_at` (String) The creation time of this channel.
- `id` (String) The ID of this resource.
- `organization_id` (String) The ID of the HCP organization where this channel is located in.
- `project_id` (String) The ID of the HCP project where this channel is located in.
- `updated_at` (String) The time this channel was last updated.

<a id="nestedblock--iteration"></a>
### Nested Schema for `iteration`

Optional:

- `fingerprint` (String) The fingerprint of the iteration assigned to the channel.
- `id` (String) The ID of the iteration assigned to the channel.
- `incremental_version` (Number) The incremental_version of the iteration assigned to the channel.


<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `default` (String)
- `delete` (String)
- `update` (String)

## Import

Import is supported using the following syntax:

```shell
# The import ID requires the bucket and channel name in the following format {bucket_name}:{name}
terraform import hcp_packer_channel.staging alpine:staging
```
2 changes: 1 addition & 1 deletion docs/resources/vault_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "hcp_vault_cluster" "example" {
- `paths_filter` (List of String) The performance replication [paths filter](https://developer.hashicorp.com/vault/tutorials/cloud-ops/vault-replication-terraform). Applies to performance replication secondaries only and operates in "deny" mode only.
- `primary_link` (String) The `self_link` of the HCP Vault Plus tier cluster which is the primary in the performance replication setup with this HCP Vault Plus tier cluster. If not specified, it is a standalone Plus tier HCP Vault cluster.
- `public_endpoint` (Boolean) Denotes that the cluster has a public endpoint. Defaults to false.
- `tier` (String) Tier of the HCP Vault cluster. Valid options for tiers - `dev`, `starter_small`, `standard_small`, `standard_medium`, `standard_large`, `plus_small`, `plus_medium`, `plus_large`. See [pricing information](https://cloud.hashicorp.com/pricing/vault). Changing a cluster's size or tier is only available to admins. See [Scale a cluster](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/guides/vault-scaling).
- `tier` (String) Tier of the HCP Vault cluster. Valid options for tiers - `dev`, `starter_small`, `standard_small`, `standard_medium`, `standard_large`, `plus_small`, `plus_medium`, `plus_large`. See [pricing information](https://www.hashicorp.com/products/vault/pricing). Changing a cluster's size or tier is only available to admins. See [Scale a cluster](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/guides/vault-scaling).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only
Expand Down
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
hcp = {
source = "hashicorp/hcp"
version = "~> 0.53.0"
version = "~> 0.56.0"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions examples/resources/hcp_packer_channel/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The import ID requires the bucket and channel name in the following format {bucket_name}:{name}
terraform import hcp_packer_channel.staging alpine:staging
4 changes: 4 additions & 0 deletions examples/resources/hcp_packer_channel/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
}
27 changes: 27 additions & 0 deletions examples/resources/hcp_packer_channel/resource_assignment.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
iteration {
id = "iteration-id"
}
}

# Update assigned iteration using an iteration fingerprint
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
iteration {
fingerprint = "fingerprint-associated-to-iteration"
}
}

# Update assigned iteration using an iteration incremental version
resource "hcp_packer_channel" "staging" {
name = "staging"
bucket_name = "alpine"
iteration {
// incremental_version is the version number assigned to a completed iteration.
incremental_version = 1
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
data "hcp_packer_image_iteration" "latest" {
bucket_name = "alpine"
channel = "latest"
}

resource "hcp_packer_channel" "staging" {
name = staging
bucket_name = alpine
iteration {
id = data.hcp_packer_image_iteration.latest.id
}
}
Loading

0 comments on commit efda9fc

Please sign in to comment.