-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata.tf
39 lines (34 loc) · 1.21 KB
/
data.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# #################################
# ------------- SQS ------------- #
# #################################
data "aws_sqs_queue" "this" {
for_each = local.queue_name != null ? toset([local.queue_name]) : toset([])
name = each.key
}
###########################################
# ------------- API Gateway ------------- #
###########################################
data "aws_api_gateway_rest_api" "this" {
for_each = local.gtw_name != null ? toset([local.gtw_name]) : toset([])
name = each.key
}
##################################
# ------------- S3 ------------- #
##################################
data "aws_s3_bucket" "this" {
for_each = local.bucket_name != null && !local.create_bucket ? toset([local.bucket_name]) : toset([])
bucket = each.key
}
###################################
# ------------- ECR ------------- #
###################################
data "aws_ecr_repository" "this" {
for_each = var.ecr != null ? toset([var.ecr.repository]) : toset([])
name = each.key
}
data "aws_ecr_image" "this" {
for_each = var.ecr != null ? toset([var.ecr.repository]) : toset([])
repository_name = each.key
image_tag = local.image_tag
depends_on = [null_resource.build_docker_image]
}