Skip to content

Commit 2ce1701

Browse files
author
rohit-ng
committed
refactor: extract data sources to data.tf
1 parent 8a296d4 commit 2ce1701

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

data.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
data "aws_ssm_parameter" "ecs_node_ami" {
2+
name = "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id"
3+
}
4+
5+
data "aws_vpc" "vpc" {
6+
id = var.vpc_id
7+
}

main.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
data "aws_ssm_parameter" "ecs_node_ami" {
2-
name = "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id"
3-
}
4-
51
module "postgres_security_group" {
62
source = "terraform-aws-modules/security-group/aws"
73
version = "~> 5.1.2"
@@ -86,10 +82,6 @@ module "ecs_node_security_group" {
8682
tags = local.default_tags
8783
}
8884

89-
data "aws_vpc" "vpc" {
90-
id = var.vpc_id
91-
}
92-
9385
module "internal_alb_security_group" {
9486
source = "terraform-aws-modules/security-group/aws"
9587
version = "~> 5.1.2"
@@ -161,7 +153,6 @@ module "ecs_task_security_group" {
161153
tags = local.default_tags
162154
}
163155

164-
165156
module "ecs_kong" {
166157
source = "../terraform-aws-ecs-deployment"
167158
vpc_id = var.vpc_id

0 commit comments

Comments
 (0)