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

providers/aws: set LC ID after creation #1518

Merged
merged 2 commits into from
Apr 14, 2015
Merged

providers/aws: set LC ID after creation #1518

merged 2 commits into from
Apr 14, 2015

Conversation

mitchellh
Copy link
Contributor

This is a pretty critical bug where the LC ID is set before creation. In the case creation fails, it still sets the ID. The "critical" part of this bug comes from a very specific edge case we hit on our side:

  1. Create LC with name "foo"
  2. Create 2nd LC with name "foo" - error creating name conflict
  3. Change 2nd LC name, apply
  4. Result: LC "foo" deleted

d.SetId(config_name)
configName := fmt.Sprintf("terraform-%s", base64.URLEncoding.EncodeToString(hash[:]))
log.Printf("[DEBUG] Computed Launch config name: %s", configName)
createLaunchConfigurationOpts.LaunchConfigurationName = aws.String(configName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createLaunchConfigurationOpts.LaunchConfigurationName = aws.String(configName) could be moved out of the if/else block and set with id, but just a nitpick

@catsby
Copy link
Contributor

catsby commented Apr 14, 2015

LGTM 👍

@mitchellh
Copy link
Contributor Author

Good catch. I'll do that and merge.

@mitchellh
Copy link
Contributor Author

Mergin'

mitchellh added a commit that referenced this pull request Apr 14, 2015
providers/aws: set LC ID after creation
@mitchellh mitchellh merged commit 0eb69bc into master Apr 14, 2015
@mitchellh mitchellh deleted the b-lc-id branch April 14, 2015 15:23
@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants