new aws provider fixes for s3, template_file

This commit is contained in:
Edward Viaene
2022-02-24 09:07:29 -05:00
parent f0b08d766d
commit b6dbf6aaf8
5 changed files with 7 additions and 20 deletions
-2
View File
@@ -3,12 +3,10 @@
# #
resource "aws_s3_bucket" "codebuild-cache" { resource "aws_s3_bucket" "codebuild-cache" {
bucket = "demo-codebuild-cache-${random_string.random.result}" bucket = "demo-codebuild-cache-${random_string.random.result}"
acl = "private"
} }
resource "aws_s3_bucket" "demo-artifacts" { resource "aws_s3_bucket" "demo-artifacts" {
bucket = "demo-artifacts-${random_string.random.result}" bucket = "demo-artifacts-${random_string.random.result}"
acl = "private"
lifecycle_rule { lifecycle_rule {
id = "clean-up" id = "clean-up"
+7 -15
View File
@@ -1,16 +1,4 @@
data "template_file" "init-script" { # note: previous templatefile datasources have been replaced by the template_file() function
template = file("scripts/init.cfg")
vars = {
REGION = var.AWS_REGION
}
}
data "template_file" "shell-script" {
template = file("scripts/volumes.sh")
vars = {
DEVICE = var.INSTANCE_DEVICE_NAME
}
}
data "template_cloudinit_config" "cloudinit-example" { data "template_cloudinit_config" "cloudinit-example" {
gzip = false gzip = false
@@ -19,12 +7,16 @@ data "template_cloudinit_config" "cloudinit-example" {
part { part {
filename = "init.cfg" filename = "init.cfg"
content_type = "text/cloud-config" content_type = "text/cloud-config"
content = data.template_file.init-script.rendered content = template_file("scripts/init.cfg", {
REGION = var.AWS_REGION
})
} }
part { part {
content_type = "text/x-shellscript" content_type = "text/x-shellscript"
content = data.template_file.shell-script.rendered content = template_file("scripts/volumes.sh", {
DEVICE = var.INSTANCE_DEVICE_NAME
})
} }
} }
-1
View File
@@ -1,6 +1,5 @@
resource "aws_s3_bucket" "b" { resource "aws_s3_bucket" "b" {
bucket = "mybucket-c29df1" bucket = "mybucket-c29df1"
acl = "private"
tags = { tags = {
Name = "mybucket-c29df1" Name = "mybucket-c29df1"
-1
View File
@@ -1,6 +1,5 @@
resource "aws_s3_bucket" "terraform-state" { resource "aws_s3_bucket" "terraform-state" {
bucket = "terraform-state-a2b6219" bucket = "terraform-state-a2b6219"
acl = "private"
tags = { tags = {
Name = "Terraform state" Name = "Terraform state"
-1
View File
@@ -1,6 +1,5 @@
resource "aws_s3_bucket" "terraform-state" { resource "aws_s3_bucket" "terraform-state" {
bucket = "terraform-state-${random_string.random.result}" bucket = "terraform-state-${random_string.random.result}"
acl = "private"
tags = { tags = {
Name = "Terraform state" Name = "Terraform state"