mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-29 07:01:53 +03:00
removed deprecated lines
This commit is contained in:
@@ -1,15 +1,18 @@
|
|||||||
provider "cloudinit" {}
|
provider "cloudinit" {}
|
||||||
|
|
||||||
resource "template_file" "init-script" {
|
data "template_file" "init-script" {
|
||||||
template = "${file("scripts/init.cfg")}"
|
template = "${file("scripts/init.cfg")}"
|
||||||
vars {
|
vars {
|
||||||
region = "${var.AWS_REGION}"
|
REGION = "${var.AWS_REGION}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resource "template_file" "shell-script" {
|
data "template_file" "shell-script" {
|
||||||
template = "${file("scripts/volumes.sh")}"
|
template = "${file("scripts/volumes.sh")}"
|
||||||
|
vars {
|
||||||
|
DEVICE = "${var.INSTANCE_DEVICE_NAME}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
resource "template_cloudinit_config" "cloudinit-example" {
|
data "template_cloudinit_config" "cloudinit-example" {
|
||||||
|
|
||||||
gzip = false
|
gzip = false
|
||||||
base64_encode = false
|
base64_encode = false
|
||||||
@@ -17,12 +20,12 @@ resource "template_cloudinit_config" "cloudinit-example" {
|
|||||||
part {
|
part {
|
||||||
filename = "init.cfg"
|
filename = "init.cfg"
|
||||||
content_type = "text/cloud-config"
|
content_type = "text/cloud-config"
|
||||||
content = "${template_file.init-script.rendered}"
|
content = "${data.template_file.init-script.rendered}"
|
||||||
}
|
}
|
||||||
|
|
||||||
part {
|
part {
|
||||||
content_type = "text/x-shellscript"
|
content_type = "text/x-shellscript"
|
||||||
content = "${template_file.shell-script.rendered}"
|
content = "${data.template_file.shell-script.rendered}"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ resource "aws_ebs_volume" "ebs-volume-1" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_volume_attachment" "ebs-volume-1-attachment" {
|
resource "aws_volume_attachment" "ebs-volume-1-attachment" {
|
||||||
device_name = "/dev/xvdh"
|
device_name = "${var.INSTANCE_DEVICE_NAME}"
|
||||||
volume_id = "${aws_ebs_volume.ebs-volume-1.id}"
|
volume_id = "${aws_ebs_volume.ebs-volume-1.id}"
|
||||||
instance_id = "${aws_instance.example.id}"
|
instance_id = "${aws_instance.example.id}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
vgchange -ay
|
vgchange -ay
|
||||||
|
|
||||||
DEVICE="/dev/xvdh"
|
|
||||||
|
|
||||||
DEVICE_FS=`blkid -o value -s TYPE ${DEVICE}`
|
DEVICE_FS=`blkid -o value -s TYPE ${DEVICE}`
|
||||||
exit 0
|
exit 0
|
||||||
pvcreate ${DEVICE}
|
pvcreate ${DEVICE}
|
||||||
|
|||||||
@@ -15,3 +15,6 @@ variable "AMIS" {
|
|||||||
eu-west-1 = "ami-844e0bf7"
|
eu-west-1 = "ami-844e0bf7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
variable "INSTANCE_DEVICE_NAME" {
|
||||||
|
default = "/dev/xvdh"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user