Skip to content

Commit

Permalink
Add documentation for packer_bucket_channel resource
Browse files Browse the repository at this point in the history
  • Loading branch information
nywilken committed Dec 21, 2022
1 parent 10cd441 commit 9f05312
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 0 deletions.
70 changes: 70 additions & 0 deletions docs/resources/packer_bucket_channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
page_title: "Resource hcp_packer_bucket_channel - terraform-provider-hcp"
subcategory: ""
description: |-
The Packer Bucket Channel resource allow you to manage a channel within an active HCP Packer Registry bucket.
---

# hcp_packer_bucket_channel (Resource)

The Packer Bucket Channel resource allow you to manage a channel within an active HCP Packer Registry bucket.

## Example Usage

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

To create, or update an existing, managed channel with an assigned iteration.
```terraform
resource "hcp_packer_bucket_channel" "staging" {
name = "staging"
bucket_name = "alpine"
assigned_iteration_id = "iteration-id"
}
```

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

### Required

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

### Optional

- `assigned_iteration_id` (String) The iteration id to assign to the channel.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `assigned_iteration_version` (Number) The incremental version of the iteration assigned to the channel.
- `author_id` (String) The author of the channel.
- `created_at` (String) Creation time of this build.
- `id` (String) The ID of this resource.
- `organization_id` (String) The ID of the organization this HCP Packer registry is located in.
- `project_id` (String) The ID of the project this HCP Packer registry is located in.

<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_bucket_channel.staging alping:staging
```
2 changes: 2 additions & 0 deletions examples/resources/hcp_packer_bucket_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_bucket_channel.staging alping:staging
4 changes: 4 additions & 0 deletions examples/resources/hcp_packer_bucket_channel/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "hcp_packer_bucket_channel" "staging" {
name = "staging"
bucket_name = "alpine"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "hcp_packer_bucket_channel" "staging" {
name = "staging"
bucket_name = "alpine"
assigned_iteration_id = "iteration-id"
}
26 changes: 26 additions & 0 deletions templates/resources/packer_bucket_channel.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
page_title: "{{.Type}} {{.Name}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

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

{{ .Description | trimspace }}

## Example Usage

To create a channel with no assigned iteration.
{{ tffile "examples/resources/hcp_packer_bucket_channel/resource.tf" }}

To create, or update an existing, managed channel with an assigned iteration.
{{ tffile "examples/resources/hcp_packer_bucket_channel/resource_assignment.tf" }}

{{ .SchemaMarkdown | trimspace }}

## Import

Import is supported using the following syntax:

{{ codefile "shell" "examples/resources/hcp_packer_bucket_channel/import.sh" }}

0 comments on commit 9f05312

Please sign in to comment.