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

provider/aws: allow key_pair name to be generated #1751

Merged
merged 1 commit into from
Apr 30, 2015

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Apr 30, 2015

No description provided.

@knuckolls
Copy link
Contributor

Just curious, what is the use case for this?

@phinze
Copy link
Contributor Author

phinze commented Apr 30, 2015

As a module author, I'd like to be able to create a module that includes a key_pair.
I don't care about the name, I only know I don't want it to collide with anything else in the account.

This allows my module to be used multiple times in the same account without having to do anything funky like adding a user-specified unique name parameter.

@phinze
Copy link
Contributor Author

phinze commented Apr 30, 2015

For my money, TF should do this for every AWS resource that must have a unique name.

I'd like to enhance the feature down the road so that we can let users define a custom prefix (while retaining the UUID suffix) to help folks who want to visually distinguish stuff.

@knuckolls
Copy link
Contributor

Interesting. That makes sense. Thanks for the infobits. 👍
On Apr 30, 2015 8:45 AM, "Paul Hinze" [email protected] wrote:

For my money, TF should do this for every AWS resource that must have a
unique name.

I'd like to enhance the feature down the road so that we can let users
define a custom prefix (while retaining the UUID suffix) to help folks who
want to visually distinguish stuff.


Reply to this email directly or view it on GitHub
#1751 (comment).

@catsby
Copy link
Contributor

catsby commented Apr 30, 2015

LGTM 🚀

phinze added a commit that referenced this pull request Apr 30, 2015
I forgot to add `Computed: true` when I made the "key_name" field
optional in #1751.

This made the behavior:

 * Name generated in Create and set as ID
 * Follow up plan (without refresh)
 * Name got cleared out on Read, causing a bad diff.

We can automatically catch bugs like this if we add yet another
verification step to our resource acceptance tests -> a post
Refresh+Plan that we verify is empty.

I left the non-refresh Plan verification in, because it's important that
_both_ of these are empty after an Apply.
phinze added a commit that referenced this pull request Apr 30, 2015
I forgot to add `Computed: true` when I made the "key_name" field
optional in #1751.

This made the behavior:

 * Name generated in Create and set as ID
 * Follow up plan (without refresh) was nice and empty
 * During refresh, name gets cleared out on Read, causing a bad diff on
   subsequent plans

We can automatically catch bugs like this if we add yet another
verification step to our resource acceptance tests -> a post
Refresh+Plan that we verify is empty.

I left the non-refresh Plan verification in, because it's important that
_both_ of these are empty after an Apply.
As a module author, I'd like to be able to create a module that includes
a key_pair.  I don't care about the name, I only know I don't want it to
collide with anything else in the account.

This allows my module to be used multiple times in the same account
without having to do anything funky like adding a user-specified unique
name parameter.
@mitchellh
Copy link
Contributor

LGTM

phinze added a commit that referenced this pull request Apr 30, 2015
provider/aws: allow key_pair name to be generated
@phinze phinze merged commit 7ff18ec into master Apr 30, 2015
@phinze phinze deleted the f-aws-key-name-gen-name branch April 30, 2015 17:15
phinze added a commit that referenced this pull request Apr 30, 2015
I forgot to add `Computed: true` when I made the "key_name" field
optional in #1751.

This made the behavior:

 * Name generated in Create and set as ID
 * Follow up plan (without refresh) was nice and empty
 * During refresh, name gets cleared out on Read, causing a bad diff on
   subsequent plans

We can automatically catch bugs like this if we add yet another
verification step to our resource acceptance tests -> a post
Refresh+Plan that we verify is empty.

I left the non-refresh Plan verification in, because it's important that
_both_ of these are empty after an Apply.
@ghost
Copy link

ghost commented May 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
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.

4 participants