tempmc/src/data.tf.etlua

32 lines
757 B
Plaintext

<% local config = require "config" %>
<% local e = require "express" %>
resource "aws_s3_object" "object" {
bucket = "<%- config.bucket_name %>"
key = "instance.zip"
source = "${path.module}/data/instance.zip"
etag = filemd5("${path.module}/data/instance.zip")
}
resource "aws_s3_object" "site" {
bucket = "<%- config.bucket_name %>"
key = "index.html"
source = "${path.module}/data/index.html"
etag = filemd5("${path.module}/data/index.html")
}
<% for filename, value in pairs(config.config.client) do %>
<% if e.is_immediate(value) then %>
resource "aws_s3_object" "config-<%- filename:gsub("[^A-Za-z0-9]","-") %>" {
bucket = "<%- config.bucket_name %>"
key = "<%- filename %>"
content = <<EOS
<%- value[1] %>
EOS
}
<% end %>
<% end %>