generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Update Contributor Docs and Resource-Specific Import Examples to Reflect Multi-Project Support #517
Merged
+170
−94
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9bfd763
Update contributing docs for multi-project support
aidan-mundy 9a1d30a
Update individual resource docs to reflect multi-project support
aidan-mundy c746e10
Regenerate docs with `make gencheck`
aidan-mundy 94f83f8
Adjust checklist wording
aidan-mundy 6e7040d
Add changelog for PR
aidan-mundy 7183b1b
Merge branch 'main' into aidan-mundy/multiproject-docs
aidan-mundy 7b15fa6
Remove redundant custom schema
aidan-mundy aabc57a
Update packer_image_iteration docs
aidan-mundy c2b0c40
Merge branch 'main' into aidan-mundy/multiproject-docs
aidan-mundy 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,3 @@ | ||
```release-note:improvement | ||
Documentation: Update contributor documentation and resource-specific import examples to reflect multi-project support. | ||
``` |
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
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {hvn_id}:{peering_id} | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{hvn_id}:{peering_id} | ||
terraform import hcp_aws_network_peering.peer f709ec73-55d4-46d8-897d-816ebba28778:main-hvn:11eb60b3-d4ec-5eed-aacc-0242ac120015 | ||
# Using the provider-default project ID, the import ID is: | ||
# {hvn_id}:{peering_id} | ||
terraform import hcp_aws_network_peering.peer main-hvn:11eb60b3-d4ec-5eed-aacc-0242ac120015 |
6 changes: 5 additions & 1 deletion
6
examples/resources/hcp_aws_transit_gateway_attachment/import.sh
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {hvn_id}:{transit_gateway_attachment_id} | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{hvn_id}:{transit_gateway_attachment_id} | ||
terraform import hcp_aws_transit_gateway_attachment.example f709ec73-55d4-46d8-897d-816ebba28778:main-hvn:example-tgw-attachment | ||
# Using the provider-default project ID, the import ID is: | ||
# {hvn_id}:{transit_gateway_attachment_id} | ||
terraform import hcp_aws_transit_gateway_attachment.example main-hvn:example-tgw-attachment |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {hvn_id}:{peering_id} | ||
terraform import hcp_azure_peering_connection.peer main-hvn:199e7e96-4d5f-4456-91f3-b6cc71f1e561 | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{hvn_id}:{peering_id} | ||
terraform import hcp_azure_peering_connection.peer f709ec73-55d4-46d8-897d-816ebba28778:main-hvn:199e7e96-4d5f-4456-91f3-b6cc71f1e561 | ||
# Using the provider-default project ID, the import ID is: | ||
# {hvn_id}:{peering_id} | ||
terraform import hcp_azure_peering_connection.peer main-hvn:199e7e96-4d5f-4456-91f3-b6cc71f1e561 |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {cluster_id} | ||
terraform import hcp_boundary_cluster.example boundary-cluster | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{cluster_id} | ||
terraform import hcp_boundary_cluster.example f709ec73-55d4-46d8-897d-816ebba28778:boundary-cluster | ||
# Using the provider-default project ID, the import ID is: | ||
# {cluster_id} | ||
terraform import hcp_boundary_cluster.example boundary-cluster |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {cluster_id} | ||
terraform import hcp_consul_cluster.example consul-cluster | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{cluster_id} | ||
terraform import hcp_consul_cluster.example f709ec73-55d4-46d8-897d-816ebba28778:consul-cluster | ||
# Using the provider-default project ID, the import ID is: | ||
# {cluster_id} | ||
terraform import hcp_consul_cluster.example consul-cluster |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {hvn_id} | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{hvn_id} | ||
terraform import hcp_hvn.example f709ec73-55d4-46d8-897d-816ebba28778:main-hvn | ||
# Using the provider-default project ID, the import ID is: | ||
# {hvn_id} | ||
terraform import hcp_hvn.example main-hvn |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
# The import ID requires the first HVN ID in the format {hvn_1_id}:{peering_id} | ||
# Only the first HVN ID is required (hvn_1_id), HVN 2 will be populated after import. | ||
|
||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{hvn_1_id}:{peering_id} | ||
terraform import hcp_hvn_peering_connection.peer_1 f709ec73-55d4-46d8-897d-816ebba28778:hvn-1:peer-1 | ||
# Using the provider-default project ID, the import ID is: | ||
# {hvn_1_id}:{peering_id} | ||
terraform import hcp_hvn_peering_connection.peer_1 hvn-1:peer-1 |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {hvn_id}:{hvn_route_id} | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{hvn_id}:{hvn_route_id} | ||
terraform import hcp_hvn_route.example f709ec73-55d4-46d8-897d-816ebba28778:main-hvn:example-hvn-route | ||
# Using the provider-default project ID, the import ID is: | ||
# {hvn_id}:{hvn_route_id} | ||
terraform import hcp_hvn_route.example main-hvn:example-hvn-route |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID requires the bucket and channel name in the following format {bucket_name}:{name} | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{bucket_name}:{channel_name} | ||
terraform import hcp_packer_channel.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.staging alpine:staging |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# The import ID is {cluster_id} | ||
terraform import hcp_vault_cluster.example vault-cluster | ||
# Using an explicit project ID, the import ID is: | ||
# {project_id}:{cluster_id} | ||
terraform import hcp_vault_cluster.example f709ec73-55d4-46d8-897d-816ebba28778:vault-cluster | ||
# Using the provider-default project ID, the import ID is: | ||
# {cluster_id} | ||
terraform import hcp_vault_cluster.example vault-cluster |
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
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.
So I believe these changes need to be added into the respective import.sh file within the resource example docs https://github.com/hashicorp/terraform-provider-hcp/tree/main/examples/resources/hcp_hvn.
These files are auto generated using templates.
Instead of relying on comments with the code block. What about creating a separate code block for the multi-project example
For example
Import
Import is supported using the following syntax:
Using an explicit project ID, the import ID is:
# {project_id}:{hvn_id} terraform import hcp_hvn.example f709ec73-55d4-46d8-897d-816ebba28778:main-hvn
Using the provider-default project ID:
# The import ID is {hvn_id} terraform import hcp_hvn.example main-hvn
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.
The changes to the .md files come from running
make gencheck
which regenerates the docs directory. The source for the changes in this PR are the import.sh files as you noted. I think you may have missed the edits to the .sh files because the sort order places them below the .md files in the GitHub file browserThere 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.
I was avoiding creating resource-specific templates if there are other clear ways of representing the information because AFAIK it prevents resources from being automatically adjusted if/when the default template changes.
I'm not sure if there actually is a scenario where we would update the default template. If there isn't one, then there's no harm in creating custom templates here.
Edit: An example of custom templates leading to drift from the default:
packer_image_iteration
andpacker_image
data sources are slightly out of sync with the format used by other data sources. Specifically, thepage_title
field is in a different order. (This is also the case for many of the resources with custom templates.)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.
Got it.. thanks for calling this out. I realize now that when I clicked into the import.sh file I was looking at the one on main and not the import.sh associated with this branch.
I understand your point about using custom templates I was under the impression that each of the resources already had a custom template. But I see that is not true.
This is a nit for sure but not one worth rocking the boat for if the import details work for folks
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.
Alternatively you can do something like the following to reduce the context of the code block