hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.87k stars 9.21k forks source link

Use consistent ID separators for resource imports #27843

Open YakDriver opened 2 years ago

YakDriver commented 2 years ago

Description

For UX, it would be beneficial to have a consistent separator for resource IDs with multiple parts. This comes into play when importing. Although the different separators are documented, which separator to use should not be something practitioners need to think about.

Based on very quick research (I attempted to limit it to ID splits but it's not exact), these are the separators in use now:

The most commonly used symbol, forward slash /, is not ideal across the board because any ID including an ARN may have complications. Similarly, the second-most commonly used symbol, colon :, is part of ARNs as well. Thus, , may well be the best separator.

Here is an example of an import using a composite ID with a / separator:

$ terraform import aws_dynamodb_contributor_insights.test name:ExampleTableName/index:ExampleIndexName/123456789012
github-actions[bot] commented 2 years ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 3 weeks ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!