Consider this CI/CD scenario:
In dev stage I want to deploy my stack with an Ec2 Instance and EC2 key pair from a CF.
From the docs I understand the Cloud Formation Resource, can point to an existing Key that can be created from the AWS Management Console and no other way.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-keypair.html
I want to create my Key with the stack, so that I can use it to ssh in the instance. I would provide the value to my SSH through an env var, therefore I would be the only one knowing the key value.
Is anyone aware of a solution for this scenario?