Skip to content
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

Merged
merged 4 commits into from
Mar 21, 2018

Conversation

danawillow
Copy link
Contributor

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.

Copy link
Contributor

@paddycarver paddycarver left a 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,
},
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@paddycarver paddycarver merged commit 2f0b6b1 into hashicorp:master Mar 21, 2018
@danawillow danawillow deleted the import branch March 21, 2018 19:59
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants