mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-22 07:01:56 +03:00
remove template provider
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
# note: previous templatefile datasources have been replaced by the template_file() function
|
# note: previous templatefile datasources have been replaced by the template_file() function
|
||||||
|
|
||||||
data "template_cloudinit_config" "cloudinit-example" {
|
data "cloudinit_config" "cloudinit-example" {
|
||||||
gzip = false
|
gzip = false
|
||||||
base64_encode = false
|
base64_encode = false
|
||||||
|
|
||||||
part {
|
part {
|
||||||
filename = "init.cfg"
|
filename = "init.cfg"
|
||||||
content_type = "text/cloud-config"
|
content_type = "text/cloud-config"
|
||||||
content = template_file("scripts/init.cfg", {
|
content = templatefile("scripts/init.cfg", {
|
||||||
REGION = var.AWS_REGION
|
REGION = var.AWS_REGION
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
part {
|
part {
|
||||||
content_type = "text/x-shellscript"
|
content_type = "text/x-shellscript"
|
||||||
content = template_file("scripts/volumes.sh", {
|
content = templatefile("scripts/volumes.sh", {
|
||||||
DEVICE = var.INSTANCE_DEVICE_NAME
|
DEVICE = var.INSTANCE_DEVICE_NAME
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ resource "aws_instance" "example" {
|
|||||||
key_name = aws_key_pair.mykeypair.key_name
|
key_name = aws_key_pair.mykeypair.key_name
|
||||||
|
|
||||||
# user data
|
# user data
|
||||||
user_data = data.template_cloudinit_config.cloudinit-example.rendered
|
user_data = data.cloudinit_config.cloudinit-example.rendered
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_ebs_volume" "ebs-volume-1" {
|
resource "aws_ebs_volume" "ebs-volume-1" {
|
||||||
|
|||||||
Reference in New Issue
Block a user