Skip to content

Commit

Permalink
data files
Browse files Browse the repository at this point in the history
  • Loading branch information
awsandy committed Jul 10, 2020
1 parent ceaab8c commit 9bc2124
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/100-get-vpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ for c in `seq 0 0`; do
fi
printf "resource \"%s\" \"%s\" {" $ttft $cname > $ttft.$cname.tf
printf "}" $cname >> $ttft.$cname.tf
printf "terraform import %s.%s %s" $ttft $cname $cname > import_$ttft_$cname.sh
terraform import $ttft.$cname $cname
terraform state show $ttft.$cname > t2.txt
rm $ttft.$cname.tf
Expand Down Expand Up @@ -65,6 +66,11 @@ for c in `seq 0 0`; do
fi

done <"$file"

dfn=`printf "data_%s__%s.tf" $ttft $cname`
printf "data \"%s\" \"%s\" {\n" $ttft $cname > $dfn
printf "id = \"%s\"\n" $cname >> $dfn
printf "}\n" $ttft $cname >> $dfn

done
fi
Expand Down
6 changes: 6 additions & 0 deletions scripts/105-get-subnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ for c in `seq 0 0`; do
fi
printf "resource \"%s\" \"%s\" {" $ttft $cname > $ttft.$cname.tf
printf "}" $cname >> $ttft.$cname.tf
printf "terraform import %s.%s %s" $ttft $cname $cname > import_$ttft_$cname.sh
terraform import $ttft.$cname $cname
terraform state show $ttft.$cname > t2.txt
tfa=`printf "%s.%s" $ttft $cname`
Expand Down Expand Up @@ -70,6 +71,11 @@ for c in `seq 0 0`; do
fi

done <"$file"

dfn=`printf "data_%s__%s.tf" $ttft $cname`
printf "data \"%s\" \"%s\" {\n" $ttft $cname > $dfn
printf "id = \"%s\"\n" $cname >> $dfn
printf "}\n" $ttft $cname >> $dfn

done
fi
Expand Down

0 comments on commit 9bc2124

Please sign in to comment.