diff --git a/main.tf b/main.tf index debd5b4..86801fd 100644 --- a/main.tf +++ b/main.tf @@ -7,6 +7,8 @@ locals { user_names_map = { for idx, user in local.user_names : idx => user } } +data "aws_region" "current" {} + data "aws_s3_bucket" "landing" { count = local.enabled ? 1 : 0 @@ -106,6 +108,36 @@ resource "aws_route53_record" "main" { ] } +# Add tags for DNS info and link in AWS console +resource "null_resource" "transfer_server_dns_tags" { + count = local.enabled && length(var.domain_name) > 0 && length(var.zone_id) > 0 ? 1 : 0 + depends_on = [aws_transfer_server.default, aws_route53_record.main] + triggers = { + aws_profile = var.aws_profile + aws_region = data.aws_region.current.name + hostname = var.domain_name + zone_id = var.zone_id + transfer_server_arn = aws_transfer_server.default.arn + } + + provisioner "local-exec" { + command = <