-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
out of the box, this is not working #11099
Comments
@tgtwm1github What does your Terraform configuration look like? |
There is no additional setup... I downloaded the example for two tier setup
and run....
git clone https://github.com/terraform-providers/terraform-provider-aws.git
path for my example: $whereever-it-was-downloaded/examples/two-tier/
The default configuration main.tf has an ec2 creation followed by logging
into the server and install and start nginx....
When I run terraform apply, it prompts for the keypair name and the "pub"
file location...
Here are the sequence of events and the catch 22 I see...
1 If I provide a keypair name that already exists in AWS, it errors saying
that the keypair exists...
so If I let it create a key pair, the pub file for that key will not
exist so the terraform apply will not even start...
2. So, I create a keypair, download the pem file and run ssh-keygen -y -f
and create a .pub file with the output.
Then, I run terraform apply, this time, when prompted for keypair name, I
give a name that does not exist in AWS ....
Then when prompted for the location/path of the "pub" file, I provide the
location where I create it from the step 2...
Now , the ec2 instance is created but it fails to login to the instance to
install nginx...
The only change I made is I have updated the main.tf to change from
"Ubuntu" to "ec2-user"....
I would like to mention that once the instance is created, I can from my
client,
do ssh -i pem-file ec2-user@aws-ec2-instance it works.
do ssh -i pub-file ec2-user@aws-ec2-instance it works.
Thanks,
Ganesh
mobile origin; e&oe
…On Wed, Dec 4, 2019, 6:42 AM Anders ***@***.***> wrote:
@tgtwm1github <https://github.com/tgtwm1github> What does your Terraform
configuration look like?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11099>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHL3W2DEPZOD43RPQIRBI43QW6JR3ANCNFSM4JURFQZQ>
.
|
Please try my comment and let me know #1493 (comment) - take note of the edit to do the public key as a sensitive variable as well (yes you can copy paste those entire keys into the value for the variables) |
Hey @tgtwm1github 👋 Thank you for taking the time to file this issue. Were you able to get your configuration working after reviewing the additional information from the comments above? |
ec2 Instance creation is ok
but ssh into instance is not working.
The text was updated successfully, but these errors were encountered: