From 5f78e89d23ad46eddcddde8714f8b63abe8639d8 Mon Sep 17 00:00:00 2001 From: thaddmt <68032955+thaddmt@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:35:42 -0700 Subject: [PATCH] chore(ai): update script for pulling down envs (#5750) --- .github/workflow-samples/tagged-release.yml | 1 + .github/workflows/reusable-e2e.yml | 17 +++++++++++++++++ .github/workflows/test-internal-prs.yml | 1 + .../ai/ai-conversation/amplify_outputs.js | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflow-samples/tagged-release.yml b/.github/workflow-samples/tagged-release.yml index 7d2cdebee1c..eb9a2753fc6 100644 --- a/.github/workflow-samples/tagged-release.yml +++ b/.github/workflow-samples/tagged-release.yml @@ -49,6 +49,7 @@ jobs: STORAGE_E2E_ROLE_ARN: ${{ secrets.STORAGE_E2E_ROLE_ARN }} IN_APP_MESSAGING_E2E_ROLE_ARN: ${{ secrets.IN_APP_MESSAGING_E2E_ROLE_ARN }} LIVENESS_E2E_ROLE_ARN: ${{ secrets.LIVENESS_E2E_ROLE_ARN }} + AI_E2E_ROLE_ARN: ${{ secrets.AI_E2E_ROLE_ARN }} DOMAIN: ${{ secrets.DOMAIN }} PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }} USERNAME: ${{ secrets.USERNAME }} diff --git a/.github/workflows/reusable-e2e.yml b/.github/workflows/reusable-e2e.yml index 92ce60244f9..fe21fa3bbcb 100644 --- a/.github/workflows/reusable-e2e.yml +++ b/.github/workflows/reusable-e2e.yml @@ -32,6 +32,8 @@ on: required: true LIVENESS_E2E_ROLE_ARN: required: true + AI_E2E_ROLE_ARN: + required: true DOMAIN: required: true PHONE_NUMBER: @@ -287,6 +289,21 @@ jobs: - name: Pull down In-app-messaging AWS environments run: yarn environments in-app-messaging pull + - name: Configure ai credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 https://github.com/aws-actions/configure-aws-credentials/commit/e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + aws-region: us-west-2 + role-to-assume: ${{ secrets.AI_E2E_ROLE_ARN }} + + - name: Create temp AWS profile + run: | + aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && \ + aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && \ + aws configure set aws_session_token $AWS_SESSION_TOKEN && \ + aws configure set default.region $AWS_REGION + - name: Pull down AI AWS environments + run: yarn environments ai pull + - name: Delete AWS profile run: rm -rf ~/.aws diff --git a/.github/workflows/test-internal-prs.yml b/.github/workflows/test-internal-prs.yml index 9ab87b82220..ee41622aaa6 100644 --- a/.github/workflows/test-internal-prs.yml +++ b/.github/workflows/test-internal-prs.yml @@ -127,6 +127,7 @@ jobs: STORAGE_E2E_ROLE_ARN: ${{ secrets.STORAGE_E2E_ROLE_ARN }} LIVENESS_E2E_ROLE_ARN: ${{ secrets.LIVENESS_E2E_ROLE_ARN }} IN_APP_MESSAGING_E2E_ROLE_ARN: ${{ secrets.IN_APP_MESSAGING_E2E_ROLE_ARN }} + AI_E2E_ROLE_ARN: ${{ secrets.AI_E2E_ROLE_ARN }} DOMAIN: ${{ secrets.DOMAIN }} PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }} USERNAME: ${{ secrets.USERNAME }} diff --git a/examples/next/pages/ui/components/ai/ai-conversation/amplify_outputs.js b/examples/next/pages/ui/components/ai/ai-conversation/amplify_outputs.js index 2496824a932..2f1016412fd 100644 --- a/examples/next/pages/ui/components/ai/ai-conversation/amplify_outputs.js +++ b/examples/next/pages/ui/components/ai/ai-conversation/amplify_outputs.js @@ -1,2 +1,2 @@ -const amplifyOutputs = {}; +import amplifyOutputs from '@environments/ai/gen2/amplify_outputs'; export default amplifyOutputs;