diff --git a/modules/ssh-key/README.md b/modules/ssh-key/README.md index 3012643..b285b99 100644 --- a/modules/ssh-key/README.md +++ b/modules/ssh-key/README.md @@ -9,14 +9,14 @@ This module creates following resources. | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.5 | +| [terraform](#requirement\_terraform) | >= 1.6 | | [aws](#requirement\_aws) | >= 4.22 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.19.0 | +| [aws](#provider\_aws) | 5.48.0 | ## Modules @@ -35,7 +35,7 @@ This module creates following resources. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [name](#input\_name) | (Required) The name of the SSH key pair. | `string` | n/a | yes | -| [public\_key](#input\_public\_key) | (Optional) The public key material. | `string` | n/a | yes | +| [public\_key](#input\_public\_key) | (Required) The public key material. | `string` | n/a | yes | | [module\_tags\_enabled](#input\_module\_tags\_enabled) | (Optional) Whether to create AWS Resource Tags for the module informations. | `bool` | `true` | no | | [resource\_group\_description](#input\_resource\_group\_description) | (Optional) The description of Resource Group. | `string` | `"Managed by Terraform."` | no | | [resource\_group\_enabled](#input\_resource\_group\_enabled) | (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. | `bool` | `true` | no | @@ -50,5 +50,6 @@ This module creates following resources. | [fingerprint](#output\_fingerprint) | The MD5 public key fingerprint as specified in section 4 of RFC 4716. | | [id](#output\_id) | The ID of the SSH key pair. | | [name](#output\_name) | The name of the SSH key pair. | +| [public\_key](#output\_public\_key) | The public key material. | | [type](#output\_type) | The type of the SSH key pair. | diff --git a/modules/ssh-key/main.tf b/modules/ssh-key/main.tf index 7a1fef3..47ab41d 100644 --- a/modules/ssh-key/main.tf +++ b/modules/ssh-key/main.tf @@ -14,19 +14,13 @@ locals { } : {} } -locals { - strategy = { - "CLUSTER" = "cluster" - "PARTITION" = "partition" - "SPREAD" = "spread" - } -} - ################################################### # SSH Key Pair for EC2 Instances ################################################### +# INFO: Not supported attributes +# - `key_name_prefix` resource "aws_key_pair" "this" { key_name = var.name public_key = var.public_key diff --git a/modules/ssh-key/outputs.tf b/modules/ssh-key/outputs.tf index fc68823..806d5e0 100644 --- a/modules/ssh-key/outputs.tf +++ b/modules/ssh-key/outputs.tf @@ -13,6 +13,11 @@ output "name" { value = aws_key_pair.this.key_name } +output "public_key" { + description = "The public key material." + value = aws_key_pair.this.public_key +} + output "fingerprint" { description = "The MD5 public key fingerprint as specified in section 4 of RFC 4716." value = aws_key_pair.this.fingerprint @@ -22,3 +27,11 @@ output "type" { description = "The type of the SSH key pair." value = aws_key_pair.this.key_type } + +# output "debug" { +# value = { +# for k, v in aws_key_pair.this : +# k => v +# if !contains(["id", "key_name", "key_name_prefix", "arn", "key_pair_id", "fingerprint", "key_type", "public_key", "tags", "tags_all"], k) +# } +# } diff --git a/modules/ssh-key/variables.tf b/modules/ssh-key/variables.tf index 3598df9..5e3d687 100644 --- a/modules/ssh-key/variables.tf +++ b/modules/ssh-key/variables.tf @@ -5,7 +5,7 @@ variable "name" { } variable "public_key" { - description = "(Optional) The public key material." + description = "(Required) The public key material." type = string nullable = false } diff --git a/modules/ssh-key/versions.tf b/modules/ssh-key/versions.tf index 16131a3..7384768 100644 --- a/modules/ssh-key/versions.tf +++ b/modules/ssh-key/versions.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 1.5" + required_version = ">= 1.6" required_providers { aws = {