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 <luigidifraia+workrelated@gmail.com>
  • Loading branch information
luigidifraiawork committed Jul 5, 2023
1 parent 53527b1 commit 5494014
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 28 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
82 changes: 55 additions & 27 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,121 +26,148 @@ output "workers_iam_role_arn" {
}

output "rwx_filestore_id" {
value = var.storage_type == "ha" ? aws_efs_file_system.efs-fs[0].id : null
description = "The ID that identifies the file system."
value = var.storage_type == "ha" ? aws_efs_file_system.efs-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" ? aws_efs_file_system.efs-fs[0].dns_name : module.nfs[0].private_dns
)
}

output "rwx_filestore_path" {
description = "OS path used for the file system."
value = (var.storage_type == "none"
? null
: var.storage_type == "ha" ? "/" : "/export"
)
}

output "efs_arn" {
value = var.storage_type == "ha" ? aws_efs_file_system.efs-fs[0].arn : null
description = "Amazon Resource Name of the file system."
value = var.storage_type == "ha" ? 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" {
value = module.vpc.nat_public_ips[0]
description = "List of public Elastic IPs created for AWS NAT Gateway."
value = module.vpc.nat_public_ips[0]
}

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 = data.aws_eks_cluster.cluster.version
description = "Kubernetes master version."
value = data.aws_eks_cluster.cluster.version
}

0 comments on commit 5494014

Please sign in to comment.