generated from aws-ia/terraform-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
data.tf
24 lines (20 loc) · 1.46 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
locals {
tags = merge(
var.resource_tags,
{
Terraform = "Managed by Terraform"
}
)
##################################################################
# Feature toggles for whether:
# - Create or reference a AWS Migration Hub Refactor Spaces environment
# - Create or reference AWS Migration Hub Refactor Spaces application(s)
# if var.environment_id is passed, assume create = `false` and environment id comes from data.awscc_refactorspaces_environment
create_environment = var.environment_id == null ? true : false
environment = local.create_environment ? module.refactor_spaces_environment[0].environment : data.awscc_refactorspaces_environment.environment[0]
# if var.application_id is passed, assume create = `false` and application id's come from the created awscc_refactorspaces_application resources in the module
create_application = var.application_id == null ? true : false
application_id_collection = local.create_application ? [for k, v in module.refactor_spaces_application : v.application.id] : ["${local.environment.environment_identifier}|${var.application_id}"]
application_objects = { for application_object in data.awscc_refactorspaces_application.application : application_object.name => application_object } # Transform collection to map to enable addressing resource by application name
service_objects = merge(module.refactor_spaces_service_defaults, module.refactor_spaces_service_non_defaults)
}