Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add secrets-manager-secret-simple example #5

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}