mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-22 03:01:53 +03:00
new aws provider fixes for s3, template_file
This commit is contained in:
@@ -3,12 +3,10 @@
|
||||
#
|
||||
resource "aws_s3_bucket" "codebuild-cache" {
|
||||
bucket = "demo-codebuild-cache-${random_string.random.result}"
|
||||
acl = "private"
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket" "demo-artifacts" {
|
||||
bucket = "demo-artifacts-${random_string.random.result}"
|
||||
acl = "private"
|
||||
|
||||
lifecycle_rule {
|
||||
id = "clean-up"
|
||||
|
||||
+7
-15
@@ -1,16 +1,4 @@
|
||||
data "template_file" "init-script" {
|
||||
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
|
||||
}
|
||||
}
|
||||
# note: previous templatefile datasources have been replaced by the template_file() function
|
||||
|
||||
data "template_cloudinit_config" "cloudinit-example" {
|
||||
gzip = false
|
||||
@@ -19,12 +7,16 @@ data "template_cloudinit_config" "cloudinit-example" {
|
||||
part {
|
||||
filename = "init.cfg"
|
||||
content_type = "text/cloud-config"
|
||||
content = data.template_file.init-script.rendered
|
||||
content = template_file("scripts/init.cfg", {
|
||||
REGION = var.AWS_REGION
|
||||
})
|
||||
}
|
||||
|
||||
part {
|
||||
content_type = "text/x-shellscript"
|
||||
content = data.template_file.shell-script.rendered
|
||||
content = template_file("scripts/volumes.sh", {
|
||||
DEVICE = var.INSTANCE_DEVICE_NAME
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
resource "aws_s3_bucket" "b" {
|
||||
bucket = "mybucket-c29df1"
|
||||
acl = "private"
|
||||
|
||||
tags = {
|
||||
Name = "mybucket-c29df1"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
resource "aws_s3_bucket" "terraform-state" {
|
||||
bucket = "terraform-state-a2b6219"
|
||||
acl = "private"
|
||||
|
||||
tags = {
|
||||
Name = "Terraform state"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
resource "aws_s3_bucket" "terraform-state" {
|
||||
bucket = "terraform-state-${random_string.random.result}"
|
||||
acl = "private"
|
||||
|
||||
tags = {
|
||||
Name = "Terraform state"
|
||||
|
||||
Reference in New Issue
Block a user