AWS::EC2::KeyPairSpecifies a key pair for use with an EC2long instance as follows: + To import an existing key pair, include the PublicKeyMaterial property. + To create a new key pair, omit the PublicKeyMaterial property. When you import an existing key pair, you specify the public key material for the key. We assume that you have the private key material for the key. CFNlong does not create or return the private key material when you import a key pair. When you create a new key pair, the p...
5 configurable properties. 1 required. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
KeyName | string | RequiredCreate-only |
KeyFormat | string | Create-onlyWrite-only |
KeyType | string | Create-only |
PublicKeyMaterial | string | Create-only |
Tags | Array<Tag> | Create-only |
Values returned after the resource is created. Access these with Fn::GetAtt.
| Attribute | Type | Description |
|---|---|---|
KeyFingerprint | string | - |
KeyPairId | string | - |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::KeyPair
Resources:
MyResource:
Type: AWS::EC2::KeyPair
Properties:
KeyName: "my-keyname"
Tags:
- Key: Environment
Value: ProductionPermissions CloudFormation needs in your IAM role to manage this resource.
ec2:CreateKeyPairec2:ImportKeyPairec2:CreateTagsssm:PutParameterec2:DescribeKeyPairsec2:DescribeKeyPairsec2:DeleteKeyPairssm:DeleteParameterec2:DescribeKeyPairsEverything you need to know about EC2 on one page. HD quality, print-friendly.
Download Free InfographicKeyNameThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
KeyNameKeyTypeKeyFormatPublicKeyMaterialTags