Created
October 4, 2018 02:09
-
-
Save chason/bfa678059f8b133244dd1a1cbb42afde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "template_file" "db_migrate_task" { | |
template = "${file("${path.module}/tasks/db_migrate_task_definition.json")}" | |
vars { | |
image = "${aws_ecr_repository.app.repository_url}" | |
database_username = "${var.database_username}" | |
database_password = "${var.database_password}" | |
database_endpoint = "${var.database_endpoint}" | |
database_name = "${var.database_name}" | |
log_group = "${var.project_name}" | |
region = "${var.region}" | |
sendgrid_api_key = "${var.sendgrid_api_key}" | |
} | |
} | |
resource "aws_ecs_task_definition" "db_migrate" { | |
family = "${var.environment}_db_migrate" | |
container_definitions = "${data.template_file.db_migrate_task.rendered}" | |
requires_compatibilities = ["FARGATE"] | |
network_mode = "awsvpc" | |
cpu = "256" | |
memory = "512" | |
execution_role_arn = "${aws_iam_role.ecs_execution_role.arn}" | |
task_role_arn = "${aws_iam_role.ecs_execution_role.arn}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment