Skip to content

Commit

Permalink
eks fix
Browse files Browse the repository at this point in the history
  • Loading branch information
awsandy committed Sep 30, 2020
1 parent 6d58ea9 commit 7e31eeb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
8 changes: 6 additions & 2 deletions aws2tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,9 @@ echo "Terraform Plan ..."
terraform plan .

echo "---------------------------------------------------------------------------"
echo "aws2tf output files are in aws2tf/generated/tf.$mysub"
echo "---------------------------------------------------------------------------"
echo "aws2tf output files are in generated/tf.$mysub"
echo "---------------------------------------------------------------------------"

if [ "$t" == "eks" ]; then
echo "aws eks update-kubeconfig --name $i"
fi
2 changes: 1 addition & 1 deletion scripts/051-get-iam-role-policies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for c in `seq 0 0`; do
count=`echo $awsout | jq ".${pref[(${c})]} | length"`
if [ "$count" -gt "0" ]; then
count=`expr $count - 1`
echo $count
#echo $count
for i in `seq 0 $count`; do
pname=`echo $awsout | jq ".${pref[(${c})]}[(${i})]" | tr -d '"'`
awsout2=`$AWS iam get-role-policy --role-name ${1} --policy-name ${pname}`
Expand Down
2 changes: 1 addition & 1 deletion scripts/111-get-dhcp-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for c in `seq 0 0`; do
#echo $cm
awsout=`eval $cm`
count=`echo $awsout | jq ".${pref[(${c})]} | length"`
echo "count=$count"
#echo "count=$count"
if [ "$count" -gt "0" ]; then
count=`expr $count - 1`
for i in `seq 0 $count`; do
Expand Down
4 changes: 4 additions & 0 deletions scripts/161-get-vpce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ for c in `seq 0 0`; do
t1=`echo $t1 | tr -d '"|,'`
t1=`printf "aws_security_group.%s.id," $t1`
fi
if [[ "$t1" == *"rtb-"* ]]; then
t1=`echo $t1 | tr -d '"|,'`
t1=`printf "aws_route_table.%s.id," $t1`
fi

fi
if [ "$skip" == "0" ]; then
Expand Down
14 changes: 13 additions & 1 deletion scripts/300-get-eks-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if [ "$kcount" -gt "0" ]; then
for ts in `cat tf2.tmp` ; do
terraform state rm $ts > t2.txt
done



## this needs to loop !!
Expand All @@ -65,6 +65,7 @@ if [ "$kcount" -gt "0" ]; then
## need these or will it do it's own ?
../../scripts/140*.sh $tcmd # route table
../../scripts/141*.sh $tcmd # route table assoc
../../scripts/161*.sh $tcmd # vpce

rarn=`echo $awsout | jq ".${pref[(${c})]}.roleArn" | tr -d '"'`
#echo "rarn=$rarn"
Expand Down Expand Up @@ -150,6 +151,12 @@ if [ "$kcount" -gt "0" ]; then
if [[ ${tt1} == *":"* ]];then
t1=`printf "\"%s\"=%s" $tt1 $tt2`
fi
#if [[ ${tt1} == "endpoint_public_access" ]];then
# # must start public and flick over
# t1=`printf "\"%s\"= false" $tt1`
#fi


if [[ ${tt1} == "arn" ]];then skip=1; fi
if [[ ${tt1} == "id" ]];then skip=1; fi
if [[ ${tt1} == "role_arn" ]];then
Expand Down Expand Up @@ -224,6 +231,11 @@ if [ "$kcount" -gt "0" ]; then
done # k
fi

#### potfix private net
#### endpoint_public_access = true



echo "fmt"
terraform fmt
echo "validate"
Expand Down
3 changes: 2 additions & 1 deletion scripts/get-eks-cluster-nodegroups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if [ "$kcount" -gt "0" ]; then
rm $ttft.$cname.tf
#ls *.tf
cat t2.txt | perl -pe 's/\x1b.*?[mGKH]//g' > t1.txt

mv="version"
file="t1.txt"
fn=`printf "%s__%s.tf" $ttft $cname`
echo $aws2tfmess > $fn
Expand Down Expand Up @@ -109,6 +109,7 @@ if [ "$kcount" -gt "0" ]; then
if [[ ${tt1} == "version" ]];then
if [ "$iscust" == "1" ]; then
skip=1;
iscust=0 # skip first occurance but not the second
fi
fi
if [[ ${tt1} == "release_version" ]];then
Expand Down

0 comments on commit 7e31eeb

Please sign in to comment.