Skip to content

Commit

Permalink
updaing lab with netcubed AMI instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
HuskyHacks committed Sep 1, 2024
1 parent e20c355 commit 9e9f903
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
23 changes: 14 additions & 9 deletions aws-lab/instances.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "aws_instance" "remnux" {

resource "aws_instance" "guacamole" {
count = var.enable_guacamole ? 1 : 0
ami = var.guacamole-ami # bitnami guacamole 72d31fe1-c724-49d3-8981-a32cfbe0189e
ami = var.guacamole-ami #

instance_type = "t2.medium"

Expand Down Expand Up @@ -67,12 +67,17 @@ resource "time_sleep" "wait_5_min" {
create_duration = "5m"
}

# netCUBE's Guacamole instance uses default creds:
# username: guacadmin
# password: [the instance ID]
# so we don't need to retrieve the creds anymore

# Get Guacamole credentials from get-console-output
data "external" "guacamole_credentials" {
count = var.enable_guacamole ? 1 : 0
program = ["bash", "get_password.sh"]
query = {
"instanceid" = data.aws_instance.guacamole_id[0].id
}
depends_on = [time_sleep.wait_5_min]
}
#data "external" "guacamole_credentials" {
# count = var.enable_guacamole ? 1 : 0
# program = ["bash", "get_password.sh"]
# query = {
# "instanceid" = data.aws_instance.guacamole_id[0].id
# }
# depends_on = [time_sleep.wait_5_min]
#}
18 changes: 14 additions & 4 deletions aws-lab/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ output "guacamole_public_ip" {
value = var.enable_guacamole == false ? null : aws_instance.guacamole[0].public_ip
}

output "guacamole_credentials" {
description = "Guacamole credentials"
value = var.enable_guacamole == false ? null : data.external.guacamole_credentials[0].result
}
#output "guacamole_credentials" {
# description = "Guacamole credentials"
# value = var.enable_guacamole == false ? null : data.external.guacamole_credentials[0].result
#}

output "flarevm_credentials" {
description = "Default credentials for the PMAT FLARE-VM base AMI. PLEASE CHANGE THESE!"
Expand All @@ -27,3 +27,13 @@ output "remnux_credentials" {
description = "Default credentials for the PMAT REMnux base AMI. PLEASE CHANGE THESE!"
value = "remnux:malware"
}

output "guacamole_default_username" {
description = "Default netCUBE Guacamole server username"
value = "guacadmin"
}

output "guacamole_default_password" {
description = "Instance ID of the Guacamole server, which is also the default password"
value = data.aws_instance.guacamole_id[0].id
}

0 comments on commit 9e9f903

Please sign in to comment.