Skip to content

Commit

Permalink
feat: Ouput db creds (wandb#143)
Browse files Browse the repository at this point in the history
* output username

* output password

* set sensitive attribute

* formatting
  • Loading branch information
George Scott authored Sep 19, 2023
1 parent a4c29c7 commit 23ce843
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
10 changes: 5 additions & 5 deletions modules/app_eks/iam-policy-docs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ data "aws_iam_policy_document" "node_cloudwatch" {
resources = ["arn:aws:logs:*:*:*"]
}

statement {
actions = ["cloudwatch:PutMetricData"]
effect = "Allow"
resources = ["*"]
}
statement {
actions = ["cloudwatch:PutMetricData"]
effect = "Allow"
resources = ["*"]
}
}

data "aws_iam_policy_document" "node_IMDSv2" {
Expand Down
4 changes: 2 additions & 2 deletions modules/app_eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ module "eks" {
map_roles = var.map_roles
map_users = var.map_users

cluster_enabled_log_types = [ "api", "audit", "controllerManager", "scheduler" ]
cluster_enabled_log_types = ["api", "audit", "controllerManager", "scheduler"]
cluster_endpoint_private_access = true
cluster_endpoint_public_access = var.cluster_endpoint_public_access
cluster_endpoint_public_access_cidrs = var.cluster_endpoint_public_access_cidrs
cluster_log_retention_in_days = 30
cluster_log_retention_in_days = 30

cluster_encryption_config = var.kms_key_arn != "" ? [
{
Expand Down
68 changes: 34 additions & 34 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
# KMS
output "bucket_name" {
value = local.bucket_name
}
output "bucket_queue_name" {
value = local.bucket_queue_name
}
output "bucket_region" {
value = data.aws_s3_bucket.file_storage.region
}
output "cluster_id" {
value = module.app_eks.cluster_id
}

output "cluster_node_role" {
value = module.app_eks.node_role
}
output "database_connection_string" {
value = module.database.connection_string
}

output "database_username" {
value = module.database.username
}

output "database_password" {
sensitive = true
value = module.database.password
}
output "elasticache_connection_string" {
value = var.create_elasticache ? module.redis.0.connection_string : null
}
output "internal_app_port" {
value = local.internal_app_port
}
output "kms_key_arn" {
value = local.kms_key_arn
description = "The Amazon Resource Name of the KMS key used to encrypt data at rest."
}

# Network
output "network_id" {
value = local.network_id
description = "The identity of the VPC in which resources are deployed."
Expand All @@ -19,40 +51,8 @@ output "network_public_subnets" {
value = local.network_public_subnets
description = "The identities of the public subnetworks deployed within the VPC."
}

output "bucket_name" {
value = local.bucket_name
}

output "bucket_region" {
value = data.aws_s3_bucket.file_storage.region
}

output "bucket_queue_name" {
value = local.bucket_queue_name
}

output "database_connection_string" {
value = module.database.connection_string
}

output "cluster_id" {
value = module.app_eks.cluster_id
}

output "cluster_node_role" {
value = module.app_eks.node_role
}

output "url" {
value = local.url
description = "The URL to the W&B application"
}

output "internal_app_port" {
value = local.internal_app_port
}

output "elasticache_connection_string" {
value = var.create_elasticache ? module.redis.0.connection_string : null
}

0 comments on commit 23ce843

Please sign in to comment.