Skip to content

Commit

Permalink
fix pip cert issue and rotate ami rotation launch template as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bhayden53 committed Sep 13, 2021
1 parent 9b51b1e commit 8f19a5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ami_rotation/ami_rotation_userdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ mkdir /home/ec2-user/.aws
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
yum install terraform-0.15.4-1 -y -q
yum install git -y -q
yum install python3 -y -q

chown -R ec2-user:ec2-user /home/ec2-user/

echo "export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" >> /home/ec2-user/.bashrc
echo "export CURL_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" >> /home/ec2-user/.bashrc
mkdir -p /usr/lib/ssl
mkdir -p /etc/ssl/certs
mkdir -p /etc/pki/ca-trust/extracted/pem
ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/ssl/certs/ca-certificates.crt
ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /usr/lib/ssl/cert.pem

python3 -m pip install -q --upgrade pip && python3 -m pip install boto3 -q
yum install python3 -y -q

sudo -i -u ec2-user bash << EOF
mkdir ~/bin ~/tmp
Expand All @@ -116,6 +116,7 @@ nvm install node
npm config set registry http://registry.npmjs.org/
npm install -g awsudo
npm config set cafile /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
python3 -m pip install -q --upgrade pip && python3 -m pip install boto3 -q
cd ~
rm -rf ~/tmp
EOF
Expand Down
1 change: 1 addition & 0 deletions terraform/deploy_ami_rotate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ awsudo $ADMIN_ARN terraform plan -no-color -var "environment=${aws_env}" -out am
-target aws_batch_job_queue.batch_queue \
-target aws_batch_job_queue.model_queue \
-target aws_launch_template.hstdp \
-target aws_launch_template.ami_rotation \
-var "awsysver=${CALCLOUD_VER}" -var "awsdpver=${CALDP_VER}" -var "csys_ver=${CSYS_VER}" -var "environment=${aws_env}" -var "ci_ami=${ci_ami}" -var "ecs_ami=${ecs_ami}"

awsudo $ADMIN_ARN terraform apply -no-color "ami_rotate.out"
Expand Down

0 comments on commit 8f19a5e

Please sign in to comment.