generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HCP Packer new data sources and nomenclature changes #726
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
aa0d833
PRELIM: HPR-1516: Remove Deprecated Iteration Attributes
aidan-mundy d7c268b
HPR-1513: Introduce `version_fingerprint` alias for `hcp_packer_chann…
aidan-mundy 0400505
HPR-1514: Packer Nomenclature Version Data Source (#140)
aidan-mundy ae9cd61
Move HCP Packer TFC resource to Packer API V2
devashish-patel 39b3516
Fix run task data source
devashish-patel af4d6c0
Migrate Packer Channel resource to Packer API V2
devashish-patel 07bc142
File name change
devashish-patel 057ede7
Migrate Packer Channel Assignment resource to HCP Packer API V2
devashish-patel 52612bc
tests
devashish-patel 4c4f006
bump hcp-sdk-go and update packer imports
sylviamoss 23bea8c
migrate bucket names data source and fix tests
sylviamoss dcd2c68
update changelog and guides
sylviamoss 6c94e67
update changelog file name
sylviamoss 65c535b
skip test configuration when acc test are disabled
sylviamoss d2a498c
add buckets name test back
sylviamoss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
```release-note:breaking-change | ||
`data.hcp_packer_iteration`: Removed the `incremental_version` attribute. Use the `fingerprint`, `id` or `uuid` attributes instead. | ||
``` | ||
|
||
```release-note:breaking-change | ||
`hcp_packer_channel_assignment`: Removed the `iteration_version` attribute. Use the `version_fingerprint` attribute instead. | ||
``` | ||
|
||
```release-note:breaking-change | ||
`hcp_packer_channel_assignment`: Removed the `iteration_id` attribute. Use the `version_fingerprint` attribute instead. | ||
``` | ||
|
||
```release-note:deprecation | ||
`hcp_packer_channel_assignment`: The `iteration_fingerprint` attribute is now deprecated and will be removed in a future release. | ||
Refer to the `version_fingerprint` attribute release notes for more information. | ||
``` | ||
|
||
```release-note:deprecation | ||
`data.hcp_packer_image`: This data source will be removed in a future release, and is superseded by `data.hcp_packer_artifact` | ||
``` | ||
|
||
```release-note:deprecation | ||
`data.hcp_packer_iteration`: This data source will be removed in a future release, and is superseded by `data.hcp_packer_version` | ||
``` | ||
|
||
```release-note:feature | ||
`data.hcp_packer_artifact`: Added the `hcp_packer_artifact` data source, which replaces `data.hcp_packer_image` | ||
``` | ||
|
||
```release-note:feature | ||
`data.hcp_packer_version`: Added the `hcp_packer_version` data source, which replaces `data.hcp_packer_iteration` | ||
``` | ||
|
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,93 @@ | ||
--- | ||
page_title: "Data Source hcp_packer_artifact - terraform-provider-hcp" | ||
subcategory: "HCP Packer" | ||
description: |- | ||
The HCP Packer Artifact data source retrieves information about an Artifact. | ||
--- | ||
|
||
# hcp_packer_artifact (Data Source) | ||
|
||
The HCP Packer Artifact data source retrieves information about an Artifact. | ||
|
||
## Example Usage | ||
|
||
### Single artifact sourcing | ||
|
||
```terraform | ||
data "hcp_packer_artifact" "ubuntu-east" { | ||
bucket_name = "hardened-ubuntu-16-04" | ||
channel_name = "production" | ||
platform = "aws" | ||
region = "us-east-1" | ||
} | ||
|
||
output "packer-registry-ubuntu-east-1" { | ||
value = data.hcp_packer_artifact.ubuntu-east.external_identifier | ||
} | ||
``` | ||
|
||
~> **Note:** The `channel` attribute in this data source may incur a billable request to HCP Packer. This attribute is intended for convenience when using a single artifact. When sourcing multiple artifacts from a single version, the `hcp_packer_version` data source is the alternative for querying a channel just once. | ||
|
||
### Multiple artifact sourcing from a single version | ||
|
||
```terraform | ||
data "hcp_packer_version" "hardened-source" { | ||
bucket_name = "hardened-ubuntu-16-04" | ||
channel_name = "production" | ||
} | ||
|
||
data "hcp_packer_artifact" "ubuntu-east" { | ||
bucket_name = "hardened-ubuntu-16-04" | ||
version_fingerprint = data.hcp_packer_version.hardened-source.fingerprint | ||
platform = "aws" | ||
region = "us-east-1" | ||
} | ||
|
||
data "hcp_packer_artifact" "ubuntu-west" { | ||
bucket_name = "hardened-ubuntu-16-04" | ||
version_fingerprint = data.hcp_packer_version.hardened-source.fingerprint | ||
platform = "aws" | ||
region = "us-west-1" | ||
} | ||
|
||
output "packer-registry-ubuntu-east-1" { | ||
value = data.hcp_packer_artifact.ubuntu-east.external_identifier | ||
} | ||
|
||
output "packer-registry-ubuntu-west-1" { | ||
value = data.hcp_packer_artifact.ubuntu-west.external_identifier | ||
} | ||
``` | ||
|
||
~> **Note:** This data source only returns the first found artifact's metadata filtered by the given arguments, from the returned list of artifacts associated with the specified version. Therefore, if multiple artifacts exist in the same region, it will only pick one of them. In this case, you can filter artifacts by a source build name (Ex: `amazon-ebs.example`) using the `component_type` optional argument. | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `bucket_name` (String) The name of the HCP Packer Bucket where the Artifact is located. | ||
- `platform` (String) Name of the platform where the HCP Packer Artifact is stored. | ||
- `region` (String) The Region where the HCP Packer Artifact is stored, if any. | ||
|
||
### Optional | ||
|
||
- `channel_name` (String) The name of the HCP Packer Channel the Version containing this Artifact is assigned to. | ||
The Version currently assigned to the Channel will be fetched. | ||
Exactly one of `channel_name` or `version_fingerprint` must be provided. | ||
- `component_type` (String) Name of the Packer builder that built this Artifact. Ex: `amazon-ebs.example`. | ||
- `project_id` (String) The ID of the HCP Organization where the Artifact is located | ||
- `version_fingerprint` (String) The fingerprint of the HCP Packer Version where the Artifact is located. | ||
If provided in the config, it is used to fetch the Version. | ||
Exactly one of `channel_name` or `version_fingerprint` must be provided. | ||
|
||
### Read-Only | ||
|
||
- `build_id` (String) The ULID of the HCP Packer Build where the Artifact is located. | ||
- `created_at` (String) The creation time of this HCP Packer Artifact. | ||
- `external_identifier` (String) An external identifier for the HCP Packer Artifact. | ||
- `id` (String) The ULID of the HCP Packer Artifact. | ||
- `labels` (Map of String) Labels associated with the build containing this image. | ||
- `organization_id` (String) The ID of the HCP Organization where the Artifact is located | ||
- `packer_run_uuid` (String) The UUID of the build containing this image. | ||
- `revoke_at` (String) The revocation time of the HCP Packer Version containing this Artifact. This field will be null for any Version that has not been revoked or scheduled for revocation. |
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,43 @@ | ||
--- | ||
page_title: "hcp_packer_version Data Source - terraform-provider-hcp" | ||
subcategory: "HCP Packer" | ||
description: |- | ||
The HCP Packer Version data source retrieves information about a Version. | ||
--- | ||
|
||
# hcp_packer_version (Data Source) | ||
|
||
The HCP Packer Version data source retrieves information about a Version. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "hcp_packer_version" "hardened-source" { | ||
bucket_name = "hardened-ubuntu-16-04" | ||
channel_name = "dev" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `bucket_name` (String) The name of the HCP Packer Bucket where the Version is located | ||
- `channel_name` (String) The name of the HCP Packer Channel the Version is assigned to. | ||
The version currently assigned to the Channel will be fetched. | ||
|
||
### Optional | ||
|
||
- `project_id` (String) The ID of the HCP Organization where the Version is located | ||
|
||
### Read-Only | ||
|
||
- `author_id` (String) The name of the person who created this HCP Packer Version | ||
- `created_at` (String) The creation time of this HCP Packer Version | ||
- `fingerprint` (String) The fingerprint of the HCP Packer Version | ||
- `id` (String) The ULID of the HCP Packer Version | ||
- `name` (String) The name of the HCP Packer Version | ||
- `organization_id` (String) The ID of the HCP Organization where the Version is located | ||
- `revoke_at` (String) The revocation time of this HCP Packer Version. This field will be null for any Version that has not been revoked or scheduled for revocation | ||
- `updated_at` (String) The last time this HCP Packer Version was updated |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit but maybe this should say "which will replace"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you think in the future because
data.hcp_packer_iteration
is still available? I would think that it is a replacement now because the added is deprecated from the time this PR is merged too. But I want to know your line of thought