File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change 1- resource "aws_ecs_cluster" "this" {
2- name = var. cluster_name
1+ module "ecs_cluster" {
2+ source = " github.com/infraspecdev/terraform-aws-ecs?ref=main"
3+ cluster_name = " atlantis"
34}
45
56resource "random_pet" "name" {
@@ -30,7 +31,7 @@ resource "aws_launch_template" "this" {
3031
3132 user_data = base64encode (<< EOF
3233#!/bin/bash
33- echo ECS_CLUSTER=${ aws_ecs_cluster . this . name } >> /etc/ecs/ecs.config
34+ echo ECS_CLUSTER=${ module . ecs_cluster . cluster_arn } >> /etc/ecs/ecs.config
3435EOF
3536 )
3637
@@ -72,7 +73,7 @@ resource "aws_autoscaling_group" "this" {
7273
7374resource "aws_ecs_service" "this" {
7475 name = var. service_name
75- cluster = aws_ecs_cluster . this . name
76+ cluster = module . ecs_cluster . cluster_arn
7677 launch_type = var. launch_type . type
7778 task_definition = aws_ecs_task_definition. this . arn
7879 desired_count = var. service_desired_count
Original file line number Diff line number Diff line change 1- output "ecs_cluster_name" {
2- description = " The name of the ECS cluster"
3- value = aws_ecs_cluster. this . name
4- }
5-
61output "ecs_service_name" {
72 description = " The name of the ECS service"
83 value = aws_ecs_service. this . name
Original file line number Diff line number Diff line change @@ -3,11 +3,6 @@ output "alb_dns_name" {
33 value = module. alb . alb_dns_name
44}
55
6- output "ecs_cluster_name" {
7- description = " The name of the ECS cluster"
8- value = module. ecs . ecs_cluster_name
9- }
10-
116output "ecs_service_name" {
127 description = " The name of the ECS service"
138 value = module. ecs . ecs_service_name
You can’t perform that action at this time.
0 commit comments