Skip to content

Commit

Permalink
adding service account
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Jun 28, 2024
1 parent 94e1db9 commit 38a4827
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/application-signals-java-beta-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ jobs:

- name: Set up kubeconfig
run: |
export AWS_ENDPOINT_URL=https://api.beta.us-west-2.wesley.amazonaws.com
aws eks update-kubeconfig --name ${{ inputs.test-java-cluster-name }} --region ${{ env.AWS_DEFAULT_REGION }} --endpoint https://api.beta.us-west-2.wesley.amazonaws.com

aws eks update-kubeconfig --name ${{ inputs.test-java-cluster-name }} --region ${{ env.AWS_DEFAULT_REGION }} --endpoint https://api.beta.us-west-2.wesley.amazonaws.com --kubeconfig ~/.kube/config


- name: Install eksctl
run: |
Expand All @@ -109,9 +109,24 @@ jobs:
- name: Create role for AWS access from the sample app
id: create_service_account
run: |
KUBECONFIG=~/.kube/config
aws sts get-caller-identity
kubectl config view
ls -l ~/.kube/config
cat ~/.kube/config
echo "below is the kubeconfig"
echo $KUBECONFIG
echo "below is the contexts"
kubectl get pods -A
kubectl config get-contexts
echo "below is the current context"
kubectl config current-context
cd integration-tests/terraform/pulse
./create_service_account.sh \
chmod +x ./create-iam-service-account.sh
./create-iam-service-account.sh \
service-account-${{ env.TESTING_ID }} \
${{ env.SAMPLE_APP_NAMESPACE }} \
${{ inputs.test-java-cluster-name }} \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Exit immediately if a command exits with a non-zero status
set -e
set -x

# Define variables
SERVICE_ACCOUNT_NAME=$1
Expand All @@ -13,7 +13,7 @@ AWS_REGION=$6
AWS_ACCOUNT_ID=$7

# Retrieve the OIDC provider URL
OIDC_PROVIDER_URL=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text)
OIDC_PROVIDER_URL=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text --endpoint https://api.beta.us-west-2.wesley.amazonaws.com)

# Extract the OIDC ID
OIDC_ID=$(echo $OIDC_PROVIDER_URL | sed 's|https://oidc.eks\.[a-zA-Z0-9-]*\.amazonaws\.com/id/||')
Expand Down

0 comments on commit 38a4827

Please sign in to comment.