From 705ee9d25eadf2a2cb67cd31b167c7d2c9650c12 Mon Sep 17 00:00:00 2001 From: Oloruntobi Olurombi Date: Tue, 27 Aug 2024 15:03:42 +0100 Subject: [PATCH] new --- .github/workflows/eks-setup.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/eks-setup.yaml b/.github/workflows/eks-setup.yaml index e9d9b28..abe3fac 100644 --- a/.github/workflows/eks-setup.yaml +++ b/.github/workflows/eks-setup.yaml @@ -5,7 +5,6 @@ on: push jobs: LogInToAWS: runs-on: ubuntu-latest - steps: - name: Set AWS Environment Variables run: | @@ -61,7 +60,6 @@ jobs: - name: Get EC2 Public IP id: get_public_ip run: echo "EC2_PUBLIC_IP=$(terraform output -raw ec2_public_ip)" >> $GITHUB_ENV - InstallTools: runs-on: ubuntu-latest @@ -84,8 +82,13 @@ jobs: - name: Wait for EC2 Instance to be Ready run: sleep 100 + - name: Print Environment Variables + run: | + echo "EC2_PUBLIC_IP=${{ env.EC2_PUBLIC_IP }}" + - name: SSH and Install AWS CLI and kubectl run: | + set -x ssh -o StrictHostKeyChecking=no -i /tmp/private_key ec2-user@${{ env.EC2_PUBLIC_IP }} << 'EOF' sudo yum install -y unzip curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" @@ -97,4 +100,4 @@ jobs: mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH kubectl version --client aws eks update-kubeconfig --region ${{ env.AWS_REGION }} --name ${{ env.EKS_CLUSTER_NAME }} - EOF \ No newline at end of file + EOF