From 37d9a8dc23136f3a4f2280d00cadcfc3a24b63ea Mon Sep 17 00:00:00 2001 From: Eduardo Bizarro Date: Fri, 6 Dec 2019 13:34:28 -0300 Subject: [PATCH] public_key --- README.md | 1 + main.tf | 2 +- variables.tf | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2683eec..be4c23a 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ Special thanks to [villasv/aws-airflow-stack](https://github.com/villasv/aws-air | load\_example\_dags | Load the example DAGs distributed with Airflow. Useful if deploying a stack for demonstrating a few topologies, operators and scheduling strategies. | string | `"false"` | no | | private\_key | Enter the content of the SSH Private Key to run provisioner. | string | `"null"` | no | | private\_key\_path | Enter the path to the SSH Private Key to run provisioner. | string | `"~/.ssh/id_rsa"` | no | +| public\_key | Enter the content of the SSH Public Key to run provisioner. | string | `"null"` | no | | public\_key\_path | Enter the path to the SSH Public Key to add to AWS. | string | `"~/.ssh/id_rsa.pub"` | no | | rbac | Enable support for Role-Based Access Control (RBAC). | string | `"false"` | no | | root\_volume\_delete\_on\_termination | Whether the volume should be destroyed on instance termination. | string | `"true"` | no | diff --git a/main.tf b/main.tf index a787f32..cbe07ea 100644 --- a/main.tf +++ b/main.tf @@ -8,7 +8,7 @@ resource "aws_key_pair" "auth" { key_name = var.key_name != "" ? var.key_name : module.airflow_labels.id - public_key = file(var.public_key_path) + public_key = coalesce(var.public_key, file(var.public_key_path)) } # ------------------------------------------- diff --git a/variables.tf b/variables.tf index 924a304..2994f7d 100644 --- a/variables.tf +++ b/variables.tf @@ -35,6 +35,11 @@ variable "private_key" { default = null } +variable "public_key" { + description = "Enter the content of the SSH Public Key to run provisioner." + default = null +} + variable "private_key_path" { description = "Enter the path to the SSH Private Key to run provisioner." default = "~/.ssh/id_rsa"