generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from hashicorp/sync-public-and-internal-provider
[auto] Sync with Public Provider
- Loading branch information
Showing
34 changed files
with
2,125 additions
and
818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
subcategory: "" | ||
page_title: "Advanced Packer Channel Management - HCP Provider" | ||
description: |- | ||
A guide to integreting HCP Packer resources and data sources for more advanced channel management. | ||
--- | ||
|
||
# Advanced Packer Channel Management | ||
|
||
You can integrate multiple HCP Packer resources and data sources to perform advanced channel management tasks. | ||
|
||
## Setting the channel assignment on a Terraform-managed channel | ||
|
||
```terraform | ||
resource "hcp_packer_channel" "advanced" { | ||
name = "advanced" | ||
bucket_name = "alpine" | ||
} | ||
resource "hcp_packer_channel_assignment" "advanced" { | ||
bucket_name = hcp_packer_channel.advanced.bucket_name | ||
channel_name = hcp_packer_channel.advanced.name | ||
# Exactly one of version, id, or fingerprint must be set: | ||
iteration_version = 12 | ||
# iteration_id = "01H1SF9NWAK8AP25PAWDBGZ1YD" | ||
# iteration_fingerprint = "01H1ZMW0Q2W6FT4FK27FQJCFG7" | ||
} | ||
``` | ||
|
||
## Setting the channel assignment to the latest complete iteration | ||
|
||
```terraform | ||
data "hcp_packer_iteration" "alpine_latest" { | ||
bucket_name = "alpine" | ||
channel = "latest" | ||
} | ||
resource "hcp_packer_channel" "alpine_advanced" { | ||
name = "advanced" | ||
bucket_name = data.hcp_packer_iteration.alpine_latest.bucket_name | ||
} | ||
resource "hcp_packer_channel_assignment" "alpine_advanced" { | ||
bucket_name = hcp_packer_channel.alpine_advanced.bucket_name | ||
channel_name = hcp_packer_channel.alpine_advanced.name | ||
iteration_version = data.hcp_packer_iteration.alpine_latest.incremental_version | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "hcp_packer_channel_assignment Resource - terraform-provider-hcp" | ||
subcategory: "" | ||
description: |- | ||
The Packer Channel Assignment resource allows you to manage the iteration assigned to a bucket channel in an active HCP Packer Registry. | ||
--- | ||
|
||
# hcp_packer_channel_assignment (Resource) | ||
|
||
The Packer Channel Assignment resource allows you to manage the iteration assigned to a bucket channel in an active HCP Packer Registry. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "hcp_packer_channel_assignment" "staging" { | ||
bucket_name = "alpine" | ||
channel_name = "staging" | ||
# Exactly one of version, id, or fingerprint must be set: | ||
iteration_version = 12 | ||
# iteration_id = "01H1SF9NWAK8AP25PAWDBGZ1YD" | ||
# iteration_fingerprint = "01H1ZMW0Q2W6FT4FK27FQJCFG7" | ||
} | ||
# To set the channel to have no assignment, use one of the iteration attributes with their zero value. | ||
# The two string-typed iteration attributes, id and fingerprint, use "none" as their zero value. | ||
resource "hcp_packer_channel_assignment" "staging" { | ||
bucket_name = "alpine" | ||
channel_name = "staging" | ||
iteration_version = 0 | ||
# iteration_id = "none" | ||
# iteration_fingerprint = "none" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `bucket_name` (String) The slug of the HCP Packer Registry bucket where the channel is located. | ||
- `channel_name` (String) The name of the HCP Packer channel being managed. | ||
|
||
### Optional | ||
|
||
- `iteration_fingerprint` (String) The fingerprint of the iteration assigned to the channel. | ||
- `iteration_id` (String) The ID of the iteration assigned to the channel. | ||
- `iteration_version` (Number) The incremental version of the iteration assigned to the channel. | ||
- `project_id` (String) The ID of the HCP project where the channel is located. | ||
If not specified, the project specified in the HCP Provider config block will be used, if configured. | ||
If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used. | ||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `organization_id` (String) The ID of the HCP organization where this channel is located. Always the same as the associated 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 | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{bucket_name}:{channel_name} | ||
terraform import hcp_packer_channel_assignment.staging f709ec73-55d4-46d8-897d-816ebba28778:alpine:staging | ||
# Using the provider-default project ID, the import ID is: | ||
# {bucket_name}:{channel_name} | ||
terraform import hcp_packer_channel_assignment.staging alpine:staging | ||
``` |
16 changes: 16 additions & 0 deletions
16
examples/guides/packer_channel_management/assign_latest.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
data "hcp_packer_iteration" "alpine_latest" { | ||
bucket_name = "alpine" | ||
channel = "latest" | ||
} | ||
|
||
resource "hcp_packer_channel" "alpine_advanced" { | ||
name = "advanced" | ||
bucket_name = data.hcp_packer_iteration.alpine_latest.bucket_name | ||
} | ||
|
||
resource "hcp_packer_channel_assignment" "alpine_advanced" { | ||
bucket_name = hcp_packer_channel.alpine_advanced.bucket_name | ||
channel_name = hcp_packer_channel.alpine_advanced.name | ||
|
||
iteration_version = data.hcp_packer_iteration.alpine_latest.incremental_version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "hcp_packer_channel" "advanced" { | ||
name = "advanced" | ||
bucket_name = "alpine" | ||
} | ||
|
||
resource "hcp_packer_channel_assignment" "advanced" { | ||
bucket_name = hcp_packer_channel.advanced.bucket_name | ||
channel_name = hcp_packer_channel.advanced.name | ||
|
||
# Exactly one of version, id, or fingerprint must be set: | ||
iteration_version = 12 | ||
# iteration_id = "01H1SF9NWAK8AP25PAWDBGZ1YD" | ||
# iteration_fingerprint = "01H1ZMW0Q2W6FT4FK27FQJCFG7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
examples/resources/hcp_packer_channel/resource_assignment.tf
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
examples/resources/hcp_packer_channel/resource_using_latest_channel.tf
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{bucket_name}:{channel_name} | ||
terraform import hcp_packer_channel_assignment.staging f709ec73-55d4-46d8-897d-816ebba28778:alpine:staging | ||
# Using the provider-default project ID, the import ID is: | ||
# {bucket_name}:{channel_name} | ||
terraform import hcp_packer_channel_assignment.staging alpine:staging |
20 changes: 20 additions & 0 deletions
20
examples/resources/hcp_packer_channel_assignment/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "hcp_packer_channel_assignment" "staging" { | ||
bucket_name = "alpine" | ||
channel_name = "staging" | ||
|
||
# Exactly one of version, id, or fingerprint must be set: | ||
iteration_version = 12 | ||
# iteration_id = "01H1SF9NWAK8AP25PAWDBGZ1YD" | ||
# iteration_fingerprint = "01H1ZMW0Q2W6FT4FK27FQJCFG7" | ||
} | ||
|
||
# To set the channel to have no assignment, use one of the iteration attributes with their zero value. | ||
# The two string-typed iteration attributes, id and fingerprint, use "none" as their zero value. | ||
resource "hcp_packer_channel_assignment" "staging" { | ||
bucket_name = "alpine" | ||
channel_name = "staging" | ||
|
||
iteration_version = 0 | ||
# iteration_id = "none" | ||
# iteration_fingerprint = "none" | ||
} |
Oops, something went wrong.