Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: wait for IAM role propagation in migration test #14060

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ describe('transformer model migration test', () => {
await updateApiSchema(projRoot, projectName, modelSchemaV2);
await amplifyPushUpdate(projRoot);

// Wait for 20s to ensure the newly-created roles have propagated
await new Promise((resolve) => setTimeout(resolve, 20000));

appSyncClient = getAppSyncClientFromProj(projRoot);

createPostMutation = /* GraphQL */ `
Expand Down
6 changes: 5 additions & 1 deletion scripts/cloud-cli-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ function authenticate {
role_name=$2
profile_name=$3
echo Authenticating terminal...
mwinit
if [[ -n $USE_FIDO_KEY ]] ; then
mwinit -s -f
else
mwinit
fi
echo Loading account credentials for Account $account_number with Role: $role_name...
ada cred update --profile="${profile_name}" --account="${account_number}" --role=${role_name} --provider=isengard --once
aws configure set region us-east-1 --profile $profile_name
Expand Down
7 changes: 6 additions & 1 deletion scripts/cloud-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ source $scriptDir/.env set
printf 'What is your PR number ? '
read PR_NUMBER

mwinit
if [[ -n $USE_FIDO_KEY ]] ; then
mwinit -s -f
else
mwinit
fi

ada cred update --profile=cb-ci-account --account=$E2E_ACCOUNT_PROD --role=CodeBuildE2E --provider=isengard --once
RESULT=$(aws codebuild start-build-batch \
--profile=cb-ci-account \
Expand Down
7 changes: 6 additions & 1 deletion scripts/cloud-rollback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ source $scriptDir/.env set
printf 'What version should I rollback to ? '
read ROLLBACK_TARGET_VERSION

mwinit
if [[ -n $USE_FIDO_KEY ]] ; then
mwinit -s -f
else
mwinit
fi

ada cred update --profile=AmplifyCLIReleaseProd --account=$RELEASE_ACCOUNT_PROD --role=CodebuildRelease --provider=isengard --once
RESULT=$(aws codebuild start-build-batch \
--profile=AmplifyCLIReleaseProd \
Expand Down
Loading