Skip to content

Commit

Permalink
added resource reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kunduso committed May 5, 2024
1 parent cbe65e5 commit 7190e34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions deploy/ecs_iam_roles.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role
resource "aws_iam_role" "ecs_task_role" {
name = "${var.name}-task-role"

# Terraform's "jsonencode" function converts a
# Terraform expression result to valid JSON syntax.
assume_role_policy = jsonencode({
Expand All @@ -25,9 +25,10 @@ resource "aws_iam_role" "ecs_task_role" {
]
})
}

#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role
resource "aws_iam_role" "ecs_task_execution_role" {
name = "${var.name}-task-execution-role"

# Terraform's "jsonencode" function converts a
# Terraform expression result to valid JSON syntax.
assume_role_policy = jsonencode({
Expand Down
2 changes: 1 addition & 1 deletion deploy/ecs_service.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service
resource "aws_ecs_service" "service" {
name = var.name
cluster = local.infra_output["cluster_id"]
Expand Down
1 change: 1 addition & 0 deletions deploy/ecs_task.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition
resource "aws_ecs_task_definition" "web_app" {
family = var.name
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
Expand Down

0 comments on commit 7190e34

Please sign in to comment.