Difference between revisions of "Terraform resource: aws key pair"
Jump to navigation
Jump to search
(23 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | <code>aws_key_pair</code> import, do not create, an existing user-supplied key pair https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/key_pair | ||
− | + | == Example == | |
− | |||
− | |||
[[resource]] "aws_key_pair" "deployer" { | [[resource]] "aws_key_pair" "deployer" { | ||
key_name = "deployer-key" | key_name = "deployer-key" | ||
− | public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 [email protected]" | + | public_key = "[[ssh-rsa]] AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 [email protected]" |
} | } | ||
+ | |||
+ | == Errors == | ||
+ | * <code>[[Error: Incorrect attribute value type]]</code> | ||
+ | * <code>[[InvalidKeyPair.Duplicate]]</code> | ||
== Related == | == Related == | ||
* <code>[[terraform import]]</code> | * <code>[[terraform import]]</code> | ||
* <code>[[aws_instance]]</code> | * <code>[[aws_instance]]</code> | ||
+ | * <code>[[terraform plan]]</code>, <code>[[terraform apply]]</code> | ||
+ | * <code>[[key_name]]</code> | ||
+ | * <code>[[ssh -vvv]]</code> | ||
+ | * <code>[[aws ec2 create-key-pair]]</code> | ||
+ | * <code>[[ssh-keygen -t]] ed25519 -f [[~/.ssh/]]your_new_ed25519_key</code> | ||
+ | * [[Terraform resource: tls_private_key]] | ||
== See also == | == See also == | ||
− | + | * {{Terraform AWS}} | |
− | * {{Terraform}} | ||
[[Category:Terraform]] | [[Category:Terraform]] |
Latest revision as of 10:17, 10 October 2024
aws_key_pair
import, do not create, an existing user-supplied key pair https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/key_pair
Contents
Example[edit]
resource "aws_key_pair" "deployer" { key_name = "deployer-key" public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 [email protected]" }
Errors[edit]
Related[edit]
terraform import
aws_instance
terraform plan
,terraform apply
key_name
ssh -vvv
aws ec2 create-key-pair
ssh-keygen -t ed25519 -f ~/.ssh/your_new_ed25519_key
- Terraform resource: tls_private_key
See also[edit]
Advertising: