Skip to content

Latest commit

 

History

History
127 lines (75 loc) · 4.27 KB

File metadata and controls

127 lines (75 loc) · 4.27 KB

TF::AWS::KeyPair

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

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{
    "Type" : "TF::AWS::KeyPair",
    "Properties" : {
        "KeyName" : String,
        "KeyNamePrefix" : String,
        "PublicKey" : String,
        "Tags" : [ TagsDefinition, ... ],
        "TagsAll" : [ TagsAllDefinition, ... ]
    }
}

YAML

Type: TF::AWS::KeyPair
Properties:
    KeyName: String
    KeyNamePrefix: String
    PublicKey: String
    Tags: 
      - TagsDefinition
    TagsAll: 
      - TagsAllDefinition

Properties

KeyName

The name for the key pair.

Required: No

Type: String

Update requires: No interruption

KeyNamePrefix

Creates a unique name beginning with the specified prefix. Conflicts with key_name.

Required: No

Type: String

Update requires: No interruption

PublicKey

The public key material.

Required: Yes

Type: String

Update requires: No interruption

Tags

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

TagsAll

Required: No

Type: List of TagsAllDefinition

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the tfcfnid.

Fn::GetAtt

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.

tfcfnid

Internal identifier for tracking resource changes. Do not use.

Arn

Returns the Arn value.

Fingerprint

Returns the Fingerprint value.

Id

Returns the Id value.

KeyPairId

Returns the KeyPairId value.