2025-09-16 14:28:55 +00:00
################################################################################
2021-01-05 01:10:46 +00:00
# RDS Proxy
2025-09-16 14:28:55 +00:00
################################################################################
2021-01-05 01:10:46 +00:00
output " proxy_id " {
description = " The ID for the proxy "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy . this [ 0 ] . id , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_arn " {
description = " The Amazon Resource Name (ARN) for the proxy "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy . this [ 0 ] . arn , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_endpoint " {
description = " The endpoint that you can use to connect to the proxy "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy . this [ 0 ] . endpoint , null )
2021-01-05 01:10:46 +00:00
}
2025-09-16 14:28:55 +00:00
################################################################################
# Default Target Group
################################################################################
2021-01-05 01:10:46 +00:00
output " proxy_default_target_group_id " {
description = " The ID for the default target group "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_default_target_group . this [ 0 ] . id , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_default_target_group_arn " {
description = " The Amazon Resource Name (ARN) for the default target group "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_default_target_group . this [ 0 ] . arn , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_default_target_group_name " {
description = " The name of the default target group "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_default_target_group . this [ 0 ] . name , null )
2021-01-05 01:10:46 +00:00
}
2025-09-16 14:28:55 +00:00
################################################################################
# Target(s)
################################################################################
2021-01-05 01:10:46 +00:00
output " proxy_target_endpoint " {
description = " Hostname for the target RDS DB Instance. Only returned for `RDS_INSTANCE` type "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_instance [ 0 ] . endpoint , aws_db_proxy_target . db_cluster [ 0 ] . endpoint , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_target_id " {
description = " Identifier of `db_proxy_name`, `target_group_name`, target type (e.g. `RDS_INSTANCE` or `TRACKED_CLUSTER`), and resource identifier separated by forward slashes (/) "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_instance [ 0 ] . id , aws_db_proxy_target . db_cluster [ 0 ] . id , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_target_port " {
description = " Port for the target RDS DB Instance or Aurora DB Cluster "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_instance [ 0 ] . port , aws_db_proxy_target . db_cluster [ 0 ] . port , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_target_rds_resource_id " {
description = " Identifier representing the DB Instance or DB Cluster target "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_instance [ 0 ] . rds_resource_id , aws_db_proxy_target . db_cluster [ 0 ] . rds_resource_id , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_target_target_arn " {
description = " Amazon Resource Name (ARN) for the DB instance or DB cluster. Currently not returned by the RDS API "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_instance [ 0 ] . target_arn , aws_db_proxy_target . db_cluster [ 0 ] . target_arn , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_target_tracked_cluster_id " {
description = " DB Cluster identifier for the DB Instance target. Not returned unless manually importing an RDS_INSTANCE target that is part of a DB Cluster "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_cluster [ 0 ] . tracked_cluster_id , null )
2021-01-05 01:10:46 +00:00
}
output " proxy_target_type " {
description = " Type of target. e.g. `RDS_INSTANCE` or `TRACKED_CLUSTER` "
2023-06-09 11:30:52 +00:00
value = try ( aws_db_proxy_target . db_instance [ 0 ] . type , aws_db_proxy_target . db_cluster [ 0 ] . type , null )
2021-01-05 01:10:46 +00:00
}
2025-09-16 14:28:55 +00:00
################################################################################
# Endpoint(s)
################################################################################
2021-05-08 21:26:51 +00:00
output " db_proxy_endpoints " {
description = " Array containing the full resource object and attributes for all DB proxy endpoints created "
value = aws_db_proxy_endpoint . this
}
2025-09-16 14:28:55 +00:00
################################################################################
# CloudWatch Log Group
################################################################################
2021-01-05 01:10:46 +00:00
output " log_group_arn " {
description = " The Amazon Resource Name (ARN) of the CloudWatch log group "
2023-06-09 11:30:52 +00:00
value = try ( aws_cloudwatch_log_group . this [ 0 ] . arn , null )
2021-01-05 01:10:46 +00:00
}
2023-08-30 23:59:28 +00:00
2024-11-19 19:29:15 +00:00
output " log_group_name " {
description = " The name of the CloudWatch log group "
value = try ( aws_cloudwatch_log_group . this [ 0 ] . name , null )
}
2025-09-16 14:28:55 +00:00
################################################################################
# IAM Role
################################################################################
2023-08-30 23:59:28 +00:00
output " iam_role_arn " {
description = " The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in AWS Secrets Manager. "
value = try ( aws_iam_role . this [ 0 ] . arn , null )
}
output " iam_role_name " {
description = " IAM role name "
value = try ( aws_iam_role . this [ 0 ] . name , null )
}
output " iam_role_unique_id " {
description = " Stable and unique string identifying the IAM role "
value = try ( aws_iam_role . this [ 0 ] . unique_id , null )
}