Skip to content

aws.ec2-key-pair resource

Description

KeyPair is an EC2 key pair imported from an existing public key. Create runs ImportKeyPair: EC2 stores the public key under a name and returns the key pair's computed id, fingerprint, and type. There is no in-place change to the key material or name, so the name and the public key are fixed once the key pair exists and a change to either replaces it. The only update is the tag set, reconciled through the EC2 tag calls keyed on the key pair id. The key name is at most 255 bytes, which EC2 enforces; no other constraint applies.

Source: internal/service/ec2/key_pair_rsrc.go:21

Example usage:

imports: {
  aws: 'github.com/cloudboss/unobin-library-aws'
}

resources: {
  example: aws.ec2-key-pair {
    # Set input fields here.
  }
}

Inputs

key-name

string

required

public-key

string

required

tags

map(string)

Input Constraints

This kind declares no extra input constraints.

Outputs

key-pair-id

string

fingerprint

string

key-type

string