Skip to content

Commit

Permalink
Outputs: Add DB and S3 endpoint information (#79)
Browse files Browse the repository at this point in the history
* Outputs: Add DB and S3 endpoint information

* RDS: DNS name - db

* Outputs: Datagrok internal API endpoint

* Outputs: Datagrok internal API endpoint

* GitHub Actions: Refactor: Automated formatting of terraform code (#86)

Co-authored-by: dnillovna <[email protected]>

* Revert "GitHub Actions: Refactor: Automated formatting of terraform code (#86)"

This reverts commit ee2e241.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dnillovna <[email protected]>
  • Loading branch information
3 people authored Apr 11, 2024
1 parent 19f02f7 commit c7bb3b6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
3 changes: 1 addition & 2 deletions aws/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]]

}
40 changes: 40 additions & 0 deletions aws/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 : ""
Expand Down Expand Up @@ -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)
}

0 comments on commit c7bb3b6

Please sign in to comment.