diff --git a/aws/db.tf b/aws/db.tf index f19bab7..ea42d23 100644 --- a/aws/db.tf +++ b/aws/db.tf @@ -84,9 +84,8 @@ module "db" { resource "aws_route53_record" "db_private_dns" { count = var.create_route53_internal_zone ? 1 : 0 zone_id = aws_route53_zone.internal[0].zone_id - name = "public_db.${aws_route53_zone.internal[0].name}" + name = "db.${aws_route53_zone.internal[0].name}" type = "CNAME" ttl = 60 records = [split(":", module.db.db_instance_endpoint)[0]] - } diff --git a/aws/outputs.tf b/aws/outputs.tf index ce34983..3b4526e 100644 --- a/aws/outputs.tf +++ b/aws/outputs.tf @@ -43,6 +43,16 @@ output "s3_name" { value = local.s3_name } +output "s3_bucket_name" { + description = "The S3 Bucket name of a stand." + value = local.s3_name +} + +output "s3_bucket_region" { + description = "The S3 Bucket region for a stand." + value = data.aws_region.current.name +} + output "ec2_name" { description = "The EC2 instance name of a stand." value = var.ecs_launch_type == "EC2" ? local.ec2_name : "" @@ -162,3 +172,33 @@ output "alb_internal_arn" { description = "The ARN of the external Application Load balancer" value = module.lb_int.lb_arn } + +output "datagrok_internal_endpoint" { + description = "The internal Datagrok endpoint" + value = module.lb_int.lb_dns_name +} + +output "datagrok_internal_api" { + description = "The internal Datagrok API endpoint" + value = "http://${module.lb_int.lb_dns_name}/api" +} + +output "db_instance_address" { + description = "The address of the Datagrok DB" + value = try(aws_route53_record.db_private_dns[0].name, module.db.db_instance_address) +} + +output "db_instance_port" { + description = "The port of the Datagrok DB" + value = tonumber(module.db.db_instance_port) +} + +output "db_dg_login" { + description = "The user to the Datagrok DB" + value = "datagrok" +} + +output "db_dg_password" { + description = "The password to the Datagrok DB" + value = try(random_password.db_datagrok_password[0].result, var.rds_dg_password) +}