Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
CloudFormation allows for creating EC2 key pairs by omitting the public key material in
AWS::EC2::KeyPair
. Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-keypair.htmlAt present, the public key is a required field in Terraform: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/key_pair#public_key
Is it possible to enable key pair creation by specifying
key_name
and leaving outpublic_key
, similar to CloudFormation?Affected Resource(s) and/or Data Source(s)
resource/aws_key_pair
Potential Terraform Configuration
References
AWS's CloudFormation guide for EC2 key pairs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-keypair.html
Would you like to implement a fix?
None