-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add import support for random id and random integer #20
Conversation
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.
Request for one more test, but otherwise looks good to me!
ImportState: true, | ||
ImportStateId: "3,1,3,12345", | ||
ImportStateVerify: true, | ||
}, |
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.
Ideally, we'd see a version of this that didn't set the Seed, just to exercise that code path, too.
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.
That's a difficult test to write: the import tests create a resource and then import it and check that the result matches. How would you go about guaranteeing that the resource will be created in that first step with a particular result without the seed?
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.
That's a fair question! Request rescinded.
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Allow importing random resources to be able to replace a config value with a value interpolated from the random provider without experiencing diffs.
See hashicorp/terraform-provider-google#1054 (which then unblocks hashicorp/terraform-provider-google#780) for more information on why this is a useful feature.
Once this is merged, I'll add import support for the remaining random resources for completeness.