From 71092a702f3571775660be3c14bd0c80111c0df5 Mon Sep 17 00:00:00 2001 From: Greg Hendrickson Date: Fri, 17 Nov 2023 11:22:13 -0800 Subject: [PATCH] syntax in tfvars. update userdata to base64 encode --- aws/aws_simple/modules/ec2/ec2-east/terraform.tfvars | 4 ++-- aws/aws_simple/modules/ec2/ec2-east/user-data.sh | 4 ++-- aws/aws_simple/modules/ec2/ec2-east/variables.tf | 2 -- aws/aws_simple/modules/ec2/ec2-west/terraform.tfvars | 4 ++-- aws/aws_simple/modules/ec2/ec2-west/user-data.sh | 4 ++-- aws/aws_simple/modules/ec2/ec2-west/variables.tf | 2 -- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/aws/aws_simple/modules/ec2/ec2-east/terraform.tfvars b/aws/aws_simple/modules/ec2/ec2-east/terraform.tfvars index 62c817a..a3c3722 100644 --- a/aws/aws_simple/modules/ec2/ec2-east/terraform.tfvars +++ b/aws/aws_simple/modules/ec2/ec2-east/terraform.tfvars @@ -1,2 +1,2 @@ -min_size = 3 -max_size = 10 \ No newline at end of file +min_size = "3" +max_size = "10" \ No newline at end of file diff --git a/aws/aws_simple/modules/ec2/ec2-east/user-data.sh b/aws/aws_simple/modules/ec2/ec2-east/user-data.sh index bb81c28..b845ff9 100644 --- a/aws/aws_simple/modules/ec2/ec2-east/user-data.sh +++ b/aws/aws_simple/modules/ec2/ec2-east/user-data.sh @@ -16,8 +16,8 @@ sudo chmod 600 /home/greg/.ssh/authorized_keys sudo chown -R greg:greg /home/greg/.ssh # Add your public key to authorized_keys -sudo echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCdOF80z0piQEnYzNCu2OGvOJdm7+3wfDuiC+Jzi8VbSC5VW4iJAQXOuDNGLzyqNi6uMjI77xpEL6Xzn29uJiQti6Y/LxhOZwNNIQiGUpFco1wkBYeBFbtgHQxsMLwumrxQGEj2fyCiSrACAPyy/l1fP4mlN7abBGD5aozBrYKxXPS/kfwO5nsWmw27RgTzfHJzie2dUU3ew/kd7td3wEdWrRXq8wNbu+yvAyiog54huUUWmYZwY3QVwXr6R1wsVudawM6BEl45QFq+hdB4t83azHG94XLy2NCAncohdU7zP40nsbvIDyh+4wIKeU90z6TLrXfHUYuBT6/ky7qOFm/Ym1QG4zCDz3jin8Qoa31PGaObzj/zoMJXgOXKcp16W0j9SZAenvnSfuWUEfBR1yBRR0T5Wg5v1vi7KGBTATaz8el802uliL+yZbGtMbNpAPGR5nK5C4yorf8yVYvIgo/LJaWCDND2O1e2mdut1WyRmvIwMnq7PFZT8zAsgGXfhDM= greg@ligma -" >> /home/greg/.ssh/authorized_keys +sudo echo " +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCdOF80z0piQEnYzNCu2OGvOJdm7+3wfDuiC+Jzi8VbSC5VW4iJAQXOuDNGLzyqNi6uMjI77xpEL6Xzn29uJiQti6Y/LxhOZwNNIQiGUpFco1wkBYeBFbtgHQxsMLwumrxQGEj2fyCiSrACAPyy/l1fP4mlN7abBGD5aozBrYKxXPS/kfwO5nsWmw27RgTzfHJzie2dUU3ew/kd7td3wEdWrRXq8wNbu+yvAyiog54huUUWmYZwY3QVwXr6R1wsVudawM6BEl45QFq+hdB4t83azHG94XLy2NCAncohdU7zP40nsbvIDyh+4wIKeU90z6TLrXfHUYuBT6/ky7qOFm/Ym1QG4zCDz3jin8Qoa31PGaObzj/zoMJXgOXKcp16W0j9SZAenvnSfuWUEfBR1yBRR0T5Wg5v1vi7KGBTATaz8el802uliL+yZbGtMbNpAPGR5nK5C4yorf8yVYvIgo/LJaWCDND2O1e2mdut1WyRmvIwMnq7PFZT8zAsgGXfhDM= greg@ligma" >> /home/greg/.ssh/authorized_keys # Set hostname INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) diff --git a/aws/aws_simple/modules/ec2/ec2-east/variables.tf b/aws/aws_simple/modules/ec2/ec2-east/variables.tf index 068b688..db897bd 100644 --- a/aws/aws_simple/modules/ec2/ec2-east/variables.tf +++ b/aws/aws_simple/modules/ec2/ec2-east/variables.tf @@ -3,13 +3,11 @@ variable "min_size" { type = number description = "Minimum number of instances in the Auto Scaling Group" - default = 1 } variable "max_size" { type = number description = "Maximum number of instances in the Auto Scaling Group" - default = 1 } diff --git a/aws/aws_simple/modules/ec2/ec2-west/terraform.tfvars b/aws/aws_simple/modules/ec2/ec2-west/terraform.tfvars index 62c817a..a3c3722 100644 --- a/aws/aws_simple/modules/ec2/ec2-west/terraform.tfvars +++ b/aws/aws_simple/modules/ec2/ec2-west/terraform.tfvars @@ -1,2 +1,2 @@ -min_size = 3 -max_size = 10 \ No newline at end of file +min_size = "3" +max_size = "10" \ No newline at end of file diff --git a/aws/aws_simple/modules/ec2/ec2-west/user-data.sh b/aws/aws_simple/modules/ec2/ec2-west/user-data.sh index bb81c28..b845ff9 100644 --- a/aws/aws_simple/modules/ec2/ec2-west/user-data.sh +++ b/aws/aws_simple/modules/ec2/ec2-west/user-data.sh @@ -16,8 +16,8 @@ sudo chmod 600 /home/greg/.ssh/authorized_keys sudo chown -R greg:greg /home/greg/.ssh # Add your public key to authorized_keys -sudo echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCdOF80z0piQEnYzNCu2OGvOJdm7+3wfDuiC+Jzi8VbSC5VW4iJAQXOuDNGLzyqNi6uMjI77xpEL6Xzn29uJiQti6Y/LxhOZwNNIQiGUpFco1wkBYeBFbtgHQxsMLwumrxQGEj2fyCiSrACAPyy/l1fP4mlN7abBGD5aozBrYKxXPS/kfwO5nsWmw27RgTzfHJzie2dUU3ew/kd7td3wEdWrRXq8wNbu+yvAyiog54huUUWmYZwY3QVwXr6R1wsVudawM6BEl45QFq+hdB4t83azHG94XLy2NCAncohdU7zP40nsbvIDyh+4wIKeU90z6TLrXfHUYuBT6/ky7qOFm/Ym1QG4zCDz3jin8Qoa31PGaObzj/zoMJXgOXKcp16W0j9SZAenvnSfuWUEfBR1yBRR0T5Wg5v1vi7KGBTATaz8el802uliL+yZbGtMbNpAPGR5nK5C4yorf8yVYvIgo/LJaWCDND2O1e2mdut1WyRmvIwMnq7PFZT8zAsgGXfhDM= greg@ligma -" >> /home/greg/.ssh/authorized_keys +sudo echo " +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCdOF80z0piQEnYzNCu2OGvOJdm7+3wfDuiC+Jzi8VbSC5VW4iJAQXOuDNGLzyqNi6uMjI77xpEL6Xzn29uJiQti6Y/LxhOZwNNIQiGUpFco1wkBYeBFbtgHQxsMLwumrxQGEj2fyCiSrACAPyy/l1fP4mlN7abBGD5aozBrYKxXPS/kfwO5nsWmw27RgTzfHJzie2dUU3ew/kd7td3wEdWrRXq8wNbu+yvAyiog54huUUWmYZwY3QVwXr6R1wsVudawM6BEl45QFq+hdB4t83azHG94XLy2NCAncohdU7zP40nsbvIDyh+4wIKeU90z6TLrXfHUYuBT6/ky7qOFm/Ym1QG4zCDz3jin8Qoa31PGaObzj/zoMJXgOXKcp16W0j9SZAenvnSfuWUEfBR1yBRR0T5Wg5v1vi7KGBTATaz8el802uliL+yZbGtMbNpAPGR5nK5C4yorf8yVYvIgo/LJaWCDND2O1e2mdut1WyRmvIwMnq7PFZT8zAsgGXfhDM= greg@ligma" >> /home/greg/.ssh/authorized_keys # Set hostname INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) diff --git a/aws/aws_simple/modules/ec2/ec2-west/variables.tf b/aws/aws_simple/modules/ec2/ec2-west/variables.tf index 13e92ed..dd4bd97 100644 --- a/aws/aws_simple/modules/ec2/ec2-west/variables.tf +++ b/aws/aws_simple/modules/ec2/ec2-west/variables.tf @@ -3,13 +3,11 @@ variable "min_size" { type = number description = "Minimum number of instances in the Auto Scaling Group" - default = 1 } variable "max_size" { type = number description = "Maximum number of instances in the Auto Scaling Group" - default = 1 } variable "us_west_subnet_1_id" {