Provides an EC2 key pair resource. A key pair is used to control login access to EC2 instances.
Currently this resource requires an existing user-supplied key pair. This key pair's public key will be registered with AWS to allow logging-in to EC2 instances.
When importing an existing key pair the public key material may be in any format supported by AWS. Supported formats (per the AWS documentation) are:
- OpenSSH public key format (the format in ~/.ssh/authorized_keys)
- Base64 encoded DER format
- SSH public key file format as specified in RFC4716
To declare this entity in your AWS CloudFormation template, use the following syntax:
{ "Type" : "TF::AWS::KeyPair", "Properties" : { "KeyName" : String, "KeyNamePrefix" : String, "PublicKey" : String, "Tags" : [ TagsDefinition, ... ], "TagsAll" : [ TagsAllDefinition, ... ] } }
Type: TF::AWS::KeyPair Properties: KeyName: String KeyNamePrefix: String PublicKey: String Tags: - TagsDefinition TagsAll: - TagsAllDefinition
The name for the key pair.
Required: No
Type: String
Update requires: No interruption
Creates a unique name beginning with the specified prefix. Conflicts with key_name
.
Required: No
Type: String
Update requires: No interruption
The public key material.
Required: Yes
Type: String
Update requires: No interruption
Key-value map of resource tags. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Required: No
Type: List of TagsDefinition
Update requires: No interruption
Required: No
Type: List of TagsAllDefinition
Update requires: No interruption
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref returns the tfcfnid.
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt.
Internal identifier for tracking resource changes. Do not use.
Returns the Arn
value.
Returns the Fingerprint
value.
Returns the Id
value.
Returns the KeyPairId
value.