Skip to content

Commit

Permalink
Add secrets-manager-secret-simple example (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
posquit0 authored Apr 1, 2022
1 parent 19dad97 commit fab6b27
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/secrets-manager-secret-simple/main.tf
Original file line number Diff line number Diff line change
@@ -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"
}
}
4 changes: 4 additions & 0 deletions examples/secrets-manager-secret-simple/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "secret" {
value = module.secret
sensitive = true
}
10 changes: 10 additions & 0 deletions examples/secrets-manager-secret-simple/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = "~> 1.1"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
Binary file added examples/secrets-manager-secret-value/files/binary
Binary file not shown.
60 changes: 60 additions & 0 deletions examples/secrets-manager-secret-value/main.tf
Original file line number Diff line number Diff line change
@@ -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"
}
}
8 changes: 8 additions & 0 deletions examples/secrets-manager-secret-value/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
output "secret" {
value = {
text = module.secret__text
kv = module.secret__kv
binary = module.secret__binary
}
sensitive = true
}
10 changes: 10 additions & 0 deletions examples/secrets-manager-secret-value/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = "~> 1.1"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}

0 comments on commit fab6b27

Please sign in to comment.