From 52d4ffad026551ebdc6090b8c451fe4dc09ea488 Mon Sep 17 00:00:00 2001 From: Byungjin Park Date: Sat, 2 Apr 2022 04:29:23 +0900 Subject: [PATCH 1/2] Add secrets-manager-secret-simple example --- .../secrets-manager-secret-simple/main.tf | 21 +++++++++++++++++++ .../secrets-manager-secret-simple/outputs.tf | 4 ++++ .../secrets-manager-secret-simple/versions.tf | 10 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 examples/secrets-manager-secret-simple/main.tf create mode 100644 examples/secrets-manager-secret-simple/outputs.tf create mode 100644 examples/secrets-manager-secret-simple/versions.tf diff --git a/examples/secrets-manager-secret-simple/main.tf b/examples/secrets-manager-secret-simple/main.tf new file mode 100644 index 0000000..5f584c7 --- /dev/null +++ b/examples/secrets-manager-secret-simple/main.tf @@ -0,0 +1,21 @@ +provider "aws" { + region = "us-east-1" +} + + +################################################### +# Secrets Manager Secret +################################################### + +module "secret" { + source = "../../modules/secrets-manager-secret" + # source = "tedilabs/secret/aws//modules/secrets-manager-secret" + # version = "~> 0.2.0" + + name = "app/secrets-manager-secret/simple" + description = "Managed by Terraform." + + tags = { + "project" = "terraform-aws-secret-examples" + } +} diff --git a/examples/secrets-manager-secret-simple/outputs.tf b/examples/secrets-manager-secret-simple/outputs.tf new file mode 100644 index 0000000..62f1ee2 --- /dev/null +++ b/examples/secrets-manager-secret-simple/outputs.tf @@ -0,0 +1,4 @@ +output "secret" { + value = module.secret + sensitive = true +} diff --git a/examples/secrets-manager-secret-simple/versions.tf b/examples/secrets-manager-secret-simple/versions.tf new file mode 100644 index 0000000..a93b011 --- /dev/null +++ b/examples/secrets-manager-secret-simple/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = "~> 1.1" + + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.0" + } + } +} From 06773a4e81f8519d6fcfefa39539e081c9f95e64 Mon Sep 17 00:00:00 2001 From: Byungjin Park Date: Sat, 2 Apr 2022 04:29:39 +0900 Subject: [PATCH 2/2] Add secrets-manager-secret-value example --- .../secrets-manager-secret-value/files/binary | Bin 0 -> 513 bytes examples/secrets-manager-secret-value/main.tf | 60 ++++++++++++++++++ .../secrets-manager-secret-value/outputs.tf | 8 +++ .../secrets-manager-secret-value/versions.tf | 10 +++ 4 files changed, 78 insertions(+) create mode 100644 examples/secrets-manager-secret-value/files/binary create mode 100644 examples/secrets-manager-secret-value/main.tf create mode 100644 examples/secrets-manager-secret-value/outputs.tf create mode 100644 examples/secrets-manager-secret-value/versions.tf diff --git a/examples/secrets-manager-secret-value/files/binary b/examples/secrets-manager-secret-value/files/binary new file mode 100644 index 0000000000000000000000000000000000000000..43ff95e57f51905cb31867aeb608439cf1fc41ee GIT binary patch literal 513 zcmWlWOHWf_5Qb^ha;lIZ2t6pK(iS*MYoH02q{1V&Vp0fDS|Fud0wg8aw8w+-&{6?6 zgy=?hELac&EM2)^<4$6tK`sdi`~>(F%vsDgGw-}J-{c)g4HTfE1W->m!1bb_WsHAc zAba!mXA|h2XV32U&C5sXc-q&VSdZ%^X;73FDTa&$?c&Y9d#&BDV%~w1UsY<0`(hX0 zOR4l&<+r$a*9W7hx};+P8C(gm<3q_pvIt#_7O}ka2u7mBAjm60!EQa%y~L`;>t&?# z;?pVT^N6F$<>cx>1EWAW$ap^7MMCc)$)$UW7um@6Uf^-D@YEzH+ctNN#5^vA41Oyt zrt$wbOizYL1vrBabp_?@^TZ%Tu6KVx+>$IFy! literal 0 HcmV?d00001 diff --git a/examples/secrets-manager-secret-value/main.tf b/examples/secrets-manager-secret-value/main.tf new file mode 100644 index 0000000..409f592 --- /dev/null +++ b/examples/secrets-manager-secret-value/main.tf @@ -0,0 +1,60 @@ +provider "aws" { + region = "us-east-1" +} + + +################################################### +# Secrets Manager Secret +################################################### + +module "secret__text" { + source = "../../modules/secrets-manager-secret" + # source = "tedilabs/secret/aws//modules/secrets-manager-secret" + # version = "~> 0.2.0" + + name = "app/secrets-manager-secret/value/text" + description = "Managed by Terraform." + + type = "TEXT" + value = "this_is_the_secret" + + tags = { + "project" = "terraform-aws-secret-examples" + } +} + +module "secret__kv" { + source = "../../modules/secrets-manager-secret" + # source = "tedilabs/secret/aws//modules/secrets-manager-secret" + # version = "~> 0.2.0" + + name = "app/secrets-manager-secret/value/kv" + description = "Managed by Terraform." + + type = "KEY_VALUE" + value = { + a = "foo" + b = "bar" + c = "foobar" + } + + tags = { + "project" = "terraform-aws-secret-examples" + } +} + +module "secret__binary" { + source = "../../modules/secrets-manager-secret" + # source = "tedilabs/secret/aws//modules/secrets-manager-secret" + # version = "~> 0.2.0" + + name = "app/secrets-manager-secret/value/binary" + description = "Managed by Terraform." + + type = "BINARY" + value = filebase64("${path.module}/files/binary") + + tags = { + "project" = "terraform-aws-secret-examples" + } +} diff --git a/examples/secrets-manager-secret-value/outputs.tf b/examples/secrets-manager-secret-value/outputs.tf new file mode 100644 index 0000000..d3b15d4 --- /dev/null +++ b/examples/secrets-manager-secret-value/outputs.tf @@ -0,0 +1,8 @@ +output "secret" { + value = { + text = module.secret__text + kv = module.secret__kv + binary = module.secret__binary + } + sensitive = true +} diff --git a/examples/secrets-manager-secret-value/versions.tf b/examples/secrets-manager-secret-value/versions.tf new file mode 100644 index 0000000..a93b011 --- /dev/null +++ b/examples/secrets-manager-secret-value/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = "~> 1.1" + + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.0" + } + } +}