diff --git a/examples/terraform/aws/run.sh b/examples/terraform/aws/run.sh index 31799e8..e7709ce 100755 --- a/examples/terraform/aws/run.sh +++ b/examples/terraform/aws/run.sh @@ -1,6 +1,16 @@ #!/usr/bin/env sh +# Check if file exist terraform.tfvars +if [ ! -f ./terraform.tfvars ]; then + echo "File terraform.tfvars not found!" + echo "Please create one from terraform.tfvars.example!" + exit 2 +fi +terraform init terraform apply -auto-approve -mv -i ./launchpad.new.yaml ./launchpad.$(date +"%Y-%m-%d_%H-%M").yaml -# terraform output mke_cluster | sed '1d;$d' > ./launchpad.yaml -terraform output -json | yq e -P '.mke_cluster.value' - > ./launchpad.yaml && launchpad describe config > ./launchpad.new.yaml +mv -i ./launchpad.yaml ./launchpad.$(date +"%Y-%m-%d_%H-%M").yaml +terraform output --raw mke_cluster > ./launchpad.yaml +echo "Your launchpad.yaml sample is stored in your current directory" && ls ./launchpad.yaml +echo "Apply your configuration via launchpad apply" + +exit 0 \ No newline at end of file diff --git a/examples/terraform/aws/terraform.tfvars.example b/examples/terraform/aws/terraform.tfvars.example index 19f85ba..be7250d 100644 --- a/examples/terraform/aws/terraform.tfvars.example +++ b/examples/terraform/aws/terraform.tfvars.example @@ -1,5 +1,6 @@ cluster_name = "my-mke-cluster" master_count = 1 +msr_count = 1 worker_count = 3 windows_worker_count = 0 admin_password = "orcaorcaorca"