@@ -35,6 +35,10 @@ inputs:
35
35
API_SERVER_URL :
36
36
description : ' API Server URL'
37
37
required : true
38
+ EKS_ARN :
39
+ description : ' EKS ARN'
40
+ required : true
41
+
38
42
39
43
runs :
40
44
using : composite
@@ -47,22 +51,59 @@ runs:
47
51
- name : Check out repository code
48
52
uses : actions/checkout@v3
49
53
54
+ - name : Install AWS CLI v2
55
+ run : |
56
+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
57
+ unzip awscliv2.zip
58
+ sudo ./aws/install --update
59
+ aws --version
60
+ shell : bash
61
+
62
+
63
+ - name : Configure & Authenticate to AWS
64
+ run : |
65
+ if [[ -z "${{ inputs.DEV_AWS_ACCESS_KEY }}" || -z "${{ inputs.DEV_AWS_SECRET_KEY }}" ]]; then
66
+ echo "Error: AWS credentials not provided!"
67
+ exit 1
68
+ fi
69
+
70
+ mkdir -p ~/.aws
71
+
72
+ # Store credentials in ~/.aws/credentials (preferred method)
73
+ cat <<EOF > ~/.aws/credentials
74
+ [default]
75
+ aws_access_key_id=${{ inputs.DEV_AWS_ACCESS_KEY }}
76
+ aws_secret_access_key=${{ inputs.DEV_AWS_SECRET_KEY }}
77
+ region=us-east-1
78
+ EOF
79
+
80
+ # Set up AWS CLI to use the correct profile
81
+ aws configure set default.region us-east-1
82
+
83
+ # Verify credentials
84
+ aws sts get-caller-identity
85
+ shell : bash
86
+
87
+
50
88
- name : Setup Kubeconfig
51
89
run : |
52
90
mkdir -p $HOME/.kube
53
91
echo "${{ inputs.KUBECONFIG }}" > $HOME/.kube/config
54
92
export KUBECONFIG=$HOME/.kube/config
93
+
94
+ aws sts get-caller-identity
95
+
96
+ # Ensure kubeconfig is updated with correct IAM role
97
+ aws eks update-kubeconfig --name runhouse-k8s --region us-east-1
98
+ aws eks list-clusters
99
+
55
100
kubectl config view
101
+ kubectl config get-contexts
102
+
56
103
sudo apt-get update
57
104
sudo apt-get install -y socat netcat-openbsd
58
105
shell : bash
59
106
60
- - name : Configure & Authenticate to AWS
61
- run : |
62
- aws configure set aws_access_key_id ${{ inputs.DEV_AWS_ACCESS_KEY }}
63
- aws configure set aws_secret_access_key ${{ inputs.DEV_AWS_SECRET_KEY }}
64
- aws configure set default.region us-east-1
65
- shell : bash
66
107
67
108
- name : Authenticate to Google Cloud
68
109
uses : google-github-actions/auth@v1
0 commit comments