iac_modules/example/terraform/azure/example/complete
2025-12-22 13:40:01 +08:00
..
main.tf refactor: reorganize IaC modules and examples structure 2025-12-22 13:40:01 +08:00
outputs.tf refactor: reorganize IaC modules and examples structure 2025-12-22 13:40:01 +08:00
README.md refactor: reorganize IaC modules and examples structure 2025-12-22 13:40:01 +08:00
variables.tf refactor: reorganize IaC modules and examples structure 2025-12-22 13:40:01 +08:00
versions.tf refactor: reorganize IaC modules and examples structure 2025-12-22 13:40:01 +08:00

AWS EC2 key pair

Configuration in this directory creates EC2 key pair

  • One key pair with a module created private key (private/public key pair)
  • One key pair with external provided public key material

Usage

To run this example you need to execute:

$ terraform init
$ terraform plan
$ terraform apply

Note that this example may create resources which cost money. Run terraform destroy when you don't need these resources.

Requirements

Name Version
terraform >= 1.0
aws >= 4.21
tls >= 3.4

Providers

Name Version
tls >= 3.4

Modules

Name Source Version
key_pair ../../ n/a
key_pair_disabled ../../ n/a
key_pair_external ../../ n/a

Resources

Name Type
tls_private_key.this resource

Inputs

No inputs.

Outputs

Name Description
external_key_pair_arn The key pair ARN
external_key_pair_fingerprint The MD5 public key fingerprint as specified in section 4 of RFC 4716
external_key_pair_id The key pair ID
external_key_pair_name The key pair name
external_private_key_id Unique identifier for this resource: hexadecimal representation of the SHA1 checksum of the resource
external_private_key_openssh Private key data in OpenSSH PEM (RFC 4716) format
external_private_key_pem Private key data in PEM (RFC 1421) format
external_public_key_fingerprint_md5 The fingerprint of the public key data in OpenSSH MD5 hash format, e.g. aa:bb:cc:.... Only available if the selected private key format is compatible, similarly to public_key_openssh and the ECDSA P224 limitations
external_public_key_fingerprint_sha256 The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g. SHA256:.... Only available if the selected private key format is compatible, similarly to public_key_openssh and the ECDSA P224 limitations
external_public_key_openssh The public key data in "Authorized Keys" format. This is populated only if the configured private key is supported: this includes all RSA and ED25519 keys
external_public_key_pem Public key data in PEM (RFC 1421) format
key_pair_arn The key pair ARN
key_pair_fingerprint The MD5 public key fingerprint as specified in section 4 of RFC 4716
key_pair_id The key pair ID
key_pair_name The key pair name
private_key_id Unique identifier for this resource: hexadecimal representation of the SHA1 checksum of the resource
private_key_openssh Private key data in OpenSSH PEM (RFC 4716) format
private_key_pem Private key data in PEM (RFC 1421) format
public_key_fingerprint_md5 The fingerprint of the public key data in OpenSSH MD5 hash format, e.g. aa:bb:cc:.... Only available if the selected private key format is compatible, similarly to public_key_openssh and the ECDSA P224 limitations
public_key_fingerprint_sha256 The fingerprint of the public key data in OpenSSH SHA256 hash format, e.g. SHA256:.... Only available if the selected private key format is compatible, similarly to public_key_openssh and the ECDSA P224 limitations
public_key_openssh The public key data in "Authorized Keys" format. This is populated only if the configured private key is supported: this includes all RSA and ED25519 keys
public_key_pem Public key data in PEM (RFC 1421) format