Skip to content

Commit b4bf7bb

Browse files
committed
basic example
1 parent 5c3289c commit b4bf7bb

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

examples/basic/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Basic Backend Example
2+
Creates resources for a secure backend in AWS
3+
4+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5+
## Requirements
6+
7+
No requirements.
8+
9+
## Providers
10+
11+
| Name | Version |
12+
|------|---------|
13+
| aws | n/a |
14+
15+
## Inputs
16+
17+
No input.
18+
19+
## Outputs
20+
21+
No output.
22+
23+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/basic/main.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
data "aws_caller_identity" "current" {}
2+
data "aws_region" "current" {}
3+
4+
locals {
5+
env = "sandbox"
6+
name = "example"
7+
namespace = "aws-rhythmic-sandbox"
8+
owner = "Rhythmictech Engineering"
9+
10+
extra_tags = {
11+
delete_me = "please"
12+
purpose = "testing"
13+
}
14+
}
15+
16+
module "tags" {
17+
source = "rhythmictech/tags/terraform"
18+
version = "1.0.0"
19+
20+
names = [local.name, local.env, local.namespace]
21+
22+
tags = merge({
23+
"Env" = local.env,
24+
"Namespace" = local.namespace,
25+
"Owner" = local.owner
26+
}, local.extra_tags)
27+
}
28+
29+
module "backend" {
30+
source = "../.."
31+
32+
bucket = "${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}-${module.tags.name}"
33+
region = data.aws_region.current.name
34+
tags = module.tags.tags
35+
}

0 commit comments

Comments
 (0)