mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-22 05:01:55 +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" {
|
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
@@ -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,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,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,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"
|
||||||
|
|||||||
Reference in New Issue
Block a user