Skip to content

Commit

Permalink
chore: improve output cluster helper commands
Browse files Browse the repository at this point in the history
  • Loading branch information
assafgi committed Oct 10, 2024
1 parent 601ee99 commit 4c672c7
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,33 @@ output "sg_ids" {
}

output "cluster_helper_commands" {
value = <<EOT
aws ec2 describe-instances --instance-ids $(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name ${local.asg_name} --region ${local.region} --query "AutoScalingGroups[].Instances[].InstanceId" --output text) --region ${local.region} --query 'Reservations[].Instances[].${local.ips_type}' --output json
value = {
"get_ips" = <<EOT
aws ec2 describe-instances \
--instance-ids $(aws autoscaling describe-auto-scaling-groups \
--auto-scaling-group-name ${local.asg_name} \
--region ${local.region} \
--query "AutoScalingGroups[].Instances[].InstanceId" --output text) \
--region ${local.region} \
--query 'Reservations[].Instances[].${local.ips_type}' \
--output json
EOT
"get_password" = <<EOT
aws secretsmanager get-secret-value \
--secret-id ${local.weka_admin_password_secret_id} \
--region ${local.region} \
--query SecretString \
--output text
EOT
"get_status" = <<EOT
# for nfs use: --payload '{"type": "progress", "protocl": "nfs"}'
aws lambda invoke --function-name ${aws_lambda_function.status_lambda.function_name} --payload '{"type": "progress"}' --region ${local.region} --cli-binary-format raw-in-base64-out /dev/stdout
aws secretsmanager get-secret-value --secret-id ${local.weka_admin_password_secret_id} --region ${local.region} --query SecretString --output text
aws lambda invoke \
--function-name ${aws_lambda_function.status_lambda.function_name} \
--payload '{"type": "progress"}' \
--region ${local.region} \
--cli-binary-format raw-in-base64-out /dev/stdout
EOT
}
}

output "client_helper_commands" {
Expand Down

0 comments on commit 4c672c7

Please sign in to comment.