This template imports an existing key pair and specifies it when launching an EC2 instance. The `AWS::EC2::KeyPair` resource is used to import the key pair with the `KeyName` property set to 'NameForMyImportedKeyPair' and the `PublicKeyMaterial` property set to the public key material. The `AWS::EC2::Instance` resource is used to launch the EC2 instance with the `ImageId` property set to 'ami-123456789012' and the `KeyName` property set to the `ImportedKeyPair` resource.

ImportedKeyPair
AWS::EC2::KeyPair


Ec2Instance
AWS::EC2::Instance


CloudFormation Template

Share Template