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

aws_instance: set windows_password attr on windows instances #30

Closed
hashibot opened this issue Jun 13, 2017 · 13 comments
Closed

aws_instance: set windows_password attr on windows instances #30

hashibot opened this issue Jun 13, 2017 · 13 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@hashibot
Copy link

This issue was originally opened by @phinze as hashicorp/terraform#3148. It was migrated here as part of the provider split. The original body of the issue is below.


On Read for AWS instances, if platform is Windows, call GetPasswordData and populate a windows_password attribute with its contents.

This should allow the remote_exec provisioner to be used on Windows instances like this:

resource "aws_instance" "foo" {
  # ...
  provisioner "remote-exec" {
    connection {
      type     = "winrm"
      password = "${self.windows_password}"
    }
  }
}
@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 13, 2017
@hashibot
Copy link
Author

This comment was originally opened by @antonosmond as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


👍 Thanks for raising this Paul it's exactly what we need!
My preference would be a world-wide ban on anything Windows related but unfortunately I don't think that's going to happen any time soon and I'm stuck trying to deal with the hell that is Windows Server in the cloud!

@hashibot
Copy link
Author

This comment was originally opened by @adamveld12 as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


What if you can provide the pem key file used to create the instance and terraform just deals with decrypting the password itself with the key? This works in principle similarly to how Packer works with Windows instances. (Packer generates a temp key file, creates the resource with it, and then gets the password for access from what I can tell).

This would be consistent with how the SSH connection works (they both would be taking a private key in this case) so it seems like it would bring some nice consistency with how they both work.

@hashibot
Copy link
Author

This comment was originally opened by @epsilon-jpage as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


This is also a blocker for me. I need to be able to perform remote execs on a windows server but want Terraform to query AWS for the Windows password and not need me to key it in or put it in a file.

@hashibot
Copy link
Author

This comment was originally opened by @johnjelinek as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


👍

@hashibot
Copy link
Author

This comment was originally opened by @deftflux as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


I started a pull request #5675 that implements this, since we need this function too. It works a little differently than described here, mainly to avoid the decrypted password from ending up in the terraform state file. This is my first time developing for terraform (and in Go for that matter), so I'd appreciate some feedback.

@hashibot
Copy link
Author

This comment was originally opened by @mojowrkn as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


Also a blocker here, any updates?

@hashibot
Copy link
Author

This comment was originally opened by @deftflux as hashicorp/terraform#3148 (comment). It was migrated here as part of the provider split. The original comment is below.


Back when I implemented this feature, it worked for me. It may need to be merged with changes released since then. However, we no longer need to use terraform to provision windows instances in our particular use case, so I haven't done any more work on it.

The pull request is only missing acceptance tests. At that point, it should meet their development guidelines. Someone with some experience writing acceptance tests for terraform would be able to do this much quicker than I could. Anyone?

@smastrorocco
Copy link

Any update on this?

@meyertime
Copy link

meyertime commented Nov 8, 2017

@smastrorocco Boom! One piece of the puzzle is ready: #2219

Show your support over there to get it merged.

@smastrorocco
Copy link

@deftflux Nice, I commented over there. Thanks!

@radeksimko radeksimko added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jan 25, 2018
@bflad
Copy link
Contributor

bflad commented Mar 13, 2018

#2219 has been merged into master and will be released in v1.12.0 of the AWS provider, likely at the end of next week. Thanks for your patience and shout out to @deftflux! 🎉

@bflad bflad closed this as completed Mar 13, 2018
@bflad bflad added this to the v1.12.0 milestone Mar 13, 2018
@bflad
Copy link
Contributor

bflad commented Mar 23, 2018

This has been released in version 1.12.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 7, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

No branches or pull requests

5 participants