mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-22 07:01:56 +03:00
remove template_file provider
This commit is contained in:
@@ -1,18 +1,13 @@
|
|||||||
data "template_file" "jenkins-init" {
|
data "cloudinit_config" "cloudinit-jenkins" {
|
||||||
template = file("scripts/jenkins-init.sh")
|
|
||||||
vars = {
|
|
||||||
DEVICE = var.INSTANCE_DEVICE_NAME
|
|
||||||
JENKINS_VERSION = var.JENKINS_VERSION
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data "template_cloudinit_config" "cloudinit-jenkins" {
|
|
||||||
gzip = false
|
gzip = false
|
||||||
base64_encode = false
|
base64_encode = false
|
||||||
|
|
||||||
part {
|
part {
|
||||||
content_type = "text/x-shellscript"
|
content_type = "text/x-shellscript"
|
||||||
content = data.template_file.jenkins-init.rendered
|
content = templatefile("scripts/jenkins-init.sh", {
|
||||||
|
DEVICE = var.INSTANCE_DEVICE_NAME
|
||||||
|
JENKINS_VERSION = var.JENKINS_VERSION
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ resource "aws_instance" "jenkins-instance" {
|
|||||||
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-jenkins.rendered
|
user_data = data.cloudinit_config.cloudinit-jenkins.rendered
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_ebs_volume" "jenkins-data" {
|
resource "aws_ebs_volume" "jenkins-data" {
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
# app
|
# app
|
||||||
|
|
||||||
data "template_file" "myapp-task-definition-template" {
|
|
||||||
template = file("templates/app.json.tpl")
|
|
||||||
vars = {
|
|
||||||
REPOSITORY_URL = replace(aws_ecr_repository.myapp.repository_url, "https://", "")
|
|
||||||
APP_VERSION = var.MYAPP_VERSION
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "aws_ecs_task_definition" "myapp-task-definition" {
|
resource "aws_ecs_task_definition" "myapp-task-definition" {
|
||||||
family = "myapp"
|
family = "myapp"
|
||||||
container_definitions = data.template_file.myapp-task-definition-template.rendered
|
container_definitions = templatefile("templates/app.json.tpl", {
|
||||||
|
REPOSITORY_URL = replace(aws_ecr_repository.myapp.repository_url, "https://", "")
|
||||||
|
APP_VERSION = var.MYAPP_VERSION
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_ecs_service" "myapp-service" {
|
resource "aws_ecs_service" "myapp-service" {
|
||||||
|
|||||||
Reference in New Issue
Block a user