Skip to content

Commit

Permalink
docs: add description for all outputs without one
Browse files Browse the repository at this point in the history
Signed-off-by: Luigi Di Fraia <[email protected]>
  • Loading branch information
luigidifraiawork authored and jarpat committed Dec 1, 2023
1 parent 56062b3 commit 3e49935
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 26 deletions.
2 changes: 1 addition & 1 deletion linting-configs/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rule "terraform_deprecated_interpolation" {

# Disallow output declarations without description.
rule "terraform_documented_outputs" {
enabled = false
enabled = true
}

# Disallow variable declarations without description.
Expand Down
78 changes: 53 additions & 25 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ output "cluster_endpoint" {
}

output "kube_config" {
value = module.kubeconfig.kube_config
sensitive = true
description = "Kubernetes cluster authentication information for kubectl."
value = module.kubeconfig.kube_config
sensitive = true
}

output "cluster_iam_role_arn" {
Expand All @@ -25,12 +26,14 @@ output "workers_iam_role_arn" {
}

output "rwx_filestore_id" {
value = (var.storage_type == "ha" && local.storage_type_backend == "efs"
description = "The ID that identifies the file system."
value = (var.storage_type == "ha" && local.storage_type_backend == "efs"
? aws_efs_file_system.efs-fs[0].id
: var.storage_type == "ha" && local.storage_type_backend == "ontap" ? aws_fsx_ontap_file_system.ontap-fs[0].id : null)
}

output "rwx_filestore_endpoint" {
description = "The DNS name for the file system."
value = (var.storage_type == "none"
? null
: var.storage_type == "ha" && local.storage_type_backend == "efs" ? aws_efs_file_system.efs-fs[0].dns_name
Expand All @@ -39,6 +42,7 @@ output "rwx_filestore_endpoint" {
}

output "rwx_filestore_path" {
description = "OS path used for the file system."
value = (var.storage_type == "none"
? null
: local.storage_type_backend == "efs" ? "/"
Expand All @@ -47,105 +51,129 @@ output "rwx_filestore_path" {
}

output "efs_arn" {
description = "Amazon Resource Name of the file system."
value = var.storage_type == "ha" && local.storage_type_backend == "efs" ? aws_efs_file_system.efs-fs[0].arn : null
}

output "jump_private_ip" {
value = var.create_jump_vm ? module.jump[0].private_ip_address : null
description = "Private IP address associated with the Jump Server instance."
value = var.create_jump_vm ? module.jump[0].private_ip_address : null
}

output "jump_public_ip" {
value = var.create_jump_vm ? module.jump[0].public_ip_address : null
description = "Public IP address associated with the Jump Server instance."
value = var.create_jump_vm ? module.jump[0].public_ip_address : null
}

output "jump_admin_username" {
value = var.create_jump_vm ? module.jump[0].admin_username : null
description = "Admin username for the Jump Server instance."
value = var.create_jump_vm ? module.jump[0].admin_username : null
}

output "jump_private_dns" {
value = var.create_jump_vm ? module.jump[0].private_dns : null
description = "Private DNS name assigned to the Jump Server instance."
value = var.create_jump_vm ? module.jump[0].private_dns : null
}

output "jump_public_dns" {
value = var.create_jump_vm ? module.jump[0].public_dns : null
description = "Public DNS name assigned to the Jump Server instance."
value = var.create_jump_vm ? module.jump[0].public_dns : null
}

output "jump_rwx_filestore_path" {
description = "OS path used in cloud-init for NFS integration."
value = (var.storage_type != "none"
? var.create_jump_vm ? var.jump_rwx_filestore_path : null
: null
)
}

output "nfs_private_ip" {
value = var.storage_type == "standard" ? module.nfs[0].private_ip_address : null
description = "Private IP address associated with the NFS Server instance."
value = var.storage_type == "standard" ? module.nfs[0].private_ip_address : null
}

output "nfs_public_ip" {
value = var.storage_type == "standard" ? module.nfs[0].public_ip_address : null
description = "Public IP address associated with the NFS Server instance."
value = var.storage_type == "standard" ? module.nfs[0].public_ip_address : null
}

output "nfs_admin_username" {
value = var.storage_type == "standard" ? module.nfs[0].admin_username : null
description = "Admin username for the NFS Server instance."
value = var.storage_type == "standard" ? module.nfs[0].admin_username : null
}

output "nfs_private_dns" {
value = var.storage_type == "standard" ? module.nfs[0].private_dns : null
description = "Private DNS name assigned to the NFS Server instance."
value = var.storage_type == "standard" ? module.nfs[0].private_dns : null
}

output "nfs_public_dns" {
value = var.storage_type == "standard" ? module.nfs[0].public_dns : null
description = "Public DNS name assigned to the NFS Server instance."
value = var.storage_type == "standard" ? module.nfs[0].public_dns : null
}

#postgres
output "postgres_servers" {
value = length(module.postgresql) != 0 ? local.postgres_outputs : null
sensitive = true
description = "Map of PostgreSQL server objects."
value = length(module.postgresql) != 0 ? local.postgres_outputs : null
sensitive = true
}

output "nat_ip" {
description = "List of public Elastic IPs created for AWS NAT Gateway."
value = module.vpc.create_nat_gateway ? module.vpc.nat_public_ips[0] : null
}

output "prefix" {
value = var.prefix
description = "The prefix used in the name for all cloud resources created by this script."
value = var.prefix
}

output "cluster_name" {
value = local.cluster_name
description = "EKS cluster name."
value = local.cluster_name
}

output "provider" {
value = "aws"
description = "Public cloud provider infrastructure components are deployed for."
value = "aws"
}

output "location" {
value = var.location
description = "AWS Region where all resources in this script were provisioned."
value = var.location
}

## Reference for Amazon ECR private registries: https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html
output "cr_endpoint" {
value = "https://${data.aws_caller_identity.terraform.account_id}.dkr.ecr.${var.location}.amazonaws.com"
description = "The default private registry URL."
value = "https://${data.aws_caller_identity.terraform.account_id}.dkr.ecr.${var.location}.amazonaws.com"
}

output "cluster_node_pool_mode" {
value = var.cluster_node_pool_mode
description = "Cluster node configuration."
value = var.cluster_node_pool_mode
}

output "autoscaler_account" {
value = var.autoscaling_enabled ? module.autoscaling[0].autoscaler_account : null
description = "ARN of IAM role for cluster-autoscaler."
value = var.autoscaling_enabled ? module.autoscaling[0].autoscaler_account : null
}

output "cluster_api_mode" {
value = var.cluster_api_mode
description = "Use Public or Private IP address for the cluster API endpoint."
value = var.cluster_api_mode
}

output "ebs_csi_account" {
value = module.ebs.ebs_csi_account
description = "ARN of IAM role for ebs-csi-controller Service Account."
value = module.ebs.ebs_csi_account
}

output "k8s_version" {
value = module.eks.cluster_version
description = "Kubernetes master version."
value = module.eks.cluster_version
}

output "aws_shared_credentials_file" {
Expand Down

0 comments on commit 3e49935

Please sign in to comment.