Add ability to add EC2 key-pair
See original GitHub issuePlease add the ability to create EC2 key pairs via CDK.
Use Case
I would like not to have to interact with AWS Console at all. Want my keys git-versioned and manageable from CDK.
Proposed Solution
key = aws_ec2.KeyPair(
key_name="autoscaled",
public_key="ssh-rsa AAAABBBBBCCC...",
)
Other
Couldn’t find a way how to do that in documentation. I believe this is not doable with CDK right now.
Seems the only way is to manually add key-pair via web Console and use key_name
string parameter for the EC2 machine:
https://stackoverflow.com/questions/57572065/how-can-i-access-an-ec2-instance-created-by-cdk
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
Issue Analytics
- State:
- Created 4 years ago
- Reactions:43
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Amazon EC2 key pairs and Linux instances
You can use Amazon EC2 to create your key pairs. You can also use a third-party tool to create your key pairs, and...
Read more >Add Keypair to existing EC2 instance - Stack Overflow
Create a key-value pair from EC2 -> Key Pairs (Under NETWORK & SECURITY tab); Go to Elasticbeanstalk and click on your application; Go...
Read more >How to Add a New Key Pair to an AWS EC2 Instance for ...
Login to your AWS Management Console, then go to EC2 Management Console. After that go to “Network & Security” in the navigation pane...
Read more >How To Change AWS EC2 Key Pair - ClayDesk E-Learning Blog
Instructions From AWS EC2 Support · Change pem login · go to your EC2 Console · Under NETWORK & SECURITY, click on Key...
Read more >Adding Keypair to existing EC2 instance | Edureka Community
No you can't. The reason is KeyPair associated to an instance cannot be replicated or replaced. It is a one time thing. There...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would be great to have
Also I need this feature when I create a newly instance so I don’t need to interact with the AWS Console. It would be great!!!