From 0d7e347d212c1dca53872288121b354ee436b390 Mon Sep 17 00:00:00 2001 From: Gerric Chaplin <1778675+gerricchaplin@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:58:12 +0100 Subject: [PATCH] TRIVIAL - Consolidate various changes across forks to one PR --- examples/minimal/main.tf | 24 +++++------ examples/minimal/outputs.tf | 2 +- examples/minimal/variables.tf | 10 ++--- module/main.tf | 77 +++++++++++++++-------------------- module/outputs.tf | 2 +- module/providers.tf | 8 ++++ module/variables.tf | 8 +++- 7 files changed, 67 insertions(+), 64 deletions(-) create mode 100644 module/providers.tf diff --git a/examples/minimal/main.tf b/examples/minimal/main.tf index 667d41e..b15a9ef 100644 --- a/examples/minimal/main.tf +++ b/examples/minimal/main.tf @@ -3,15 +3,15 @@ # provider "aws" { - access_key = "${var.aws_access_key}" - secret_key = "${var.aws_secret_key}" - region = "${var.region}" + access_key = var.aws_access_key + secret_key = var.aws_secret_key + region = var.region } provider "aws" { alias = "us-east-1" - access_key = "${var.aws_access_key}" - secret_key = "${var.aws_secret_key}" + access_key = var.aws_access_key + secret_key = var.aws_secret_key region = "us-east-1" } @@ -21,7 +21,7 @@ provider "aws" { module "basic_auth" { source = "../../module" - basic_auth_credentials = "${var.basic_auth_credentials}" + basic_auth_credentials = var.basic_auth_credentials # All Lambda@Edge functions must be put on us-east-1. providers = { @@ -34,7 +34,7 @@ module "basic_auth" { # resource "aws_s3_bucket" "test" { - bucket = "${var.s3_bucket_name}" + bucket = var.s3_bucket_name acl = "private" policy = < 0 ? aws_lambda_function.basic_auth[0].qualified_arn : null description = "Lambda function ARN with version" } diff --git a/module/providers.tf b/module/providers.tf new file mode 100644 index 0000000..6276e08 --- /dev/null +++ b/module/providers.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.0" + } + } +} diff --git a/module/variables.tf b/module/variables.tf index 4ba2a6b..2095fca 100644 --- a/module/variables.tf +++ b/module/variables.tf @@ -1,3 +1,9 @@ +variable "create" { + type = bool + default = true + description = "Whether to create this module" +} + variable "function_name" { type = string default = "basicAuth" @@ -5,6 +11,6 @@ variable "function_name" { } variable "basic_auth_credentials" { - type = map + type = map(any) description = "Credentials for Basic Authentication. Pass a map composed of 'user' and 'password'." }