in lib/tagging.py [0:0]
def get_tag(tag_name, target_environment) -> dict:
"""
Get a tag for a given parameter and target environment.
@param tag_name: The name of the tag
@param target_environment: The environment the tag is applied to
"""
logical_id_prefix = get_logical_id_prefix()
resource_name_prefix = get_resource_name_prefix()
tag_map = {
COST_CENTER: [
f'{resource_name_prefix}:cost-center',
f'{logical_id_prefix}Infrastructure',
],
TAG_ENVIRONMENT: [
f'{resource_name_prefix}:environment',
target_environment,
],
TEAM: [
f'{resource_name_prefix}:team',
f'{logical_id_prefix}Admin',
],
APPLICATION: [
f'{resource_name_prefix}:application',
f'{logical_id_prefix}Infrastructure',
],
}
if tag_name not in tag_map:
raise AttributeError(f'Tag map does not contain a key/value for {tag_name}')
return tag_map[tag_name]