-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_data.tf
35 lines (30 loc) · 729 Bytes
/
example_data.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
locals {
domain_folders = {
"foo1.boo.pl" = "domain1"
"foo2.boo.pl" = "domain2"
"moo.net" = "domain3"
}
}
resource "aws_s3_bucket_object" "web_page" {
for_each = local.domain_folders
bucket = module.web_pages_storage.s3_bucket.id
key = "${each.value}/index.html"
content = templatefile(
"${path.module}/templates/index.html.tpl",
{
domain = each.key
}
)
content_type = "text/html"
}
resource "aws_dynamodb_table_item" "domain_folders" {
for_each = local.domain_folders
table_name = module.domain_service.dynamodb.name
hash_key = module.domain_service.dynamodb.hash_key
item = <<ITEM
{
"fqdn": {"S": "${each.key}"},
"folder": {"S": "${each.value}"}
}
ITEM
}