Open sbwrege2z opened 3 years ago
It would be nice to be able to import a key pair into a region using Cloud Formation.
It is already possible to do this in the AWS console, and you can do this using the AWS CLI:
aws ec2 import-key-pair --key-name default-bastion-key --public-key-material "<base 64 encoded public key here>"
I know it is possible to reference key pair names that already exist in cloud formation template parameters like this:
BastionKey: Description: Name of an key pair for SSH access to the Bastion Host Type: "AWS::EC2::KeyPair::KeyName" Default: default-bastion-key
... and then use the KeyName in the property of an instance.
It would be great if importing the public key was possible using CloudFormation templates.
Here is an example Private Resource Type (Resource Provider) that does that: https://github.com/WeAreCloudar/cloudformation-samples/tree/main/resource_providers/cloudar_ec2_keypair
It would be nice to be able to import a key pair into a region using Cloud Formation.
It is already possible to do this in the AWS console, and you can do this using the AWS CLI:
aws ec2 import-key-pair --key-name default-bastion-key --public-key-material "<base 64 encoded public key here>"
I know it is possible to reference key pair names that already exist in cloud formation template parameters like this:
... and then use the KeyName in the property of an instance.
It would be great if importing the public key was possible using CloudFormation templates.