Skip to content

Commit

Permalink
volume size in gb, fix hardcoded region
Browse files Browse the repository at this point in the history
  • Loading branch information
Miserlou committed Aug 31, 2018
1 parent ea2d3ac commit d72aa4e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion infrastructure/disk.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "aws_efs_mount_target" "data_refinery_efs_1b" {
resource "aws_ebs_volume" "data_refinery_ebs" {
count = "${var.max_clients}"
availability_zone = "${var.region}a"
size = 1600 # 1.6TB
size = "${var.volume_size_in_gb}" # 1600 = 1.6TB
type = "st1" # Throughput Optimized HDD
tags {
Name = "data-refinery-ebs-${count.index}-${var.user}-${var.stage}"
Expand Down
7 changes: 6 additions & 1 deletion infrastructure/list_hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
# ./list_hosts rjones > hosts
# ./connect_cluster.sh

aws ec2 describe-instances --filters "Name=tag:User,Values=$1" | jq '.Reservations[0].Instances' | grep PublicDnsName | tr -d '"' | sed "s/PublicDnsName: //g" | tr -d "," | awk '{$1=$1};1' | uniq
if [[ $# -eq 0 ]] ; then
echo "Hey, you need to supply a user!"
exit 0
fi

/Users/rjones/Library/Python/2.7/bin/aws ec2 describe-instances --filters "Name=tag:User,Values=$1" | grep PublicDnsName | tr -d '"' | sed "s/PublicDnsName: //g" | tr -d "," | awk '{$1=$1};1' | uniq
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ done

COUNTER=0
while [ $COUNTER -lt 99 ]; do
EBS_VOLUME_INDEX=`aws ec2 describe-volumes --filters "Name=tag:Index,Values=*" "Name=volume-id,Values=$EBS_VOLUME_ID" --query "Volumes[*].{ID:VolumeId,Tag:Tags}" --region us-east-1 | jq ".[0].Tag[$COUNTER].Value" | tr -d '"'`
EBS_VOLUME_INDEX=`aws ec2 describe-volumes --filters "Name=tag:Index,Values=*" "Name=volume-id,Values=$EBS_VOLUME_ID" --query "Volumes[*].{ID:VolumeId,Tag:Tags}" --region ${region} | jq ".[0].Tag[$COUNTER].Value" | tr -d '"'`
if echo "$EBS_VOLUME_INDEX" | egrep -q '^\-?[0-9]+$'; then
echo "$EBS_VOLUME_INDEX is an integer!"
break # This is a Volume Index
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ variable "foreman_instance_type" {
default = "t2.micro"
}

variable "volume_size_in_gb" {
default = "500"
}

# Output our production environment variables.
output "environment_variables" {
value = [
Expand Down

0 comments on commit d72aa4e

Please sign in to comment.