diff --git a/.circleci/amplify_init.exp b/.circleci/amplify_init.exp
index 0005e0aa76a..5e76d24d053 100644
--- a/.circleci/amplify_init.exp
+++ b/.circleci/amplify_init.exp
@@ -31,6 +31,6 @@ send -- "$env(AWS_SECRET_ACCESS_KEY)\r"
expect -exact "region:"
log_user 1;
send -- "j\r"
-expect "Help improve Amplify CLI by sharing non sensitive configurations on failures"
+expect "Help improve Amplify CLI by sharing non-sensitive project configurations on failures"
send -- "\r"
interact;
diff --git a/.circleci/cb-publish-step-1-set-versions.sh b/.circleci/cb-publish-step-1-set-versions.sh
new file mode 100755
index 00000000000..7f1dfeeacca
--- /dev/null
+++ b/.circleci/cb-publish-step-1-set-versions.sh
@@ -0,0 +1,38 @@
+#!/bin/bash -e
+
+git config --global user.name aws-amplify-bot
+git config --global user.email aws@amazon.com
+
+if [[ "$PROJECT_NAME" == "TaggedReleaseWithoutE2E" ]]; then
+ if [ -z "$NPM_TAG" ]; then
+ echo "Tag name is missing. Make sure CodeBuild workflow was started with NPM_TAG environment variable"
+ exit 1
+ fi
+
+ if [[ "$BRANCH_NAME" == "main" ]] || [[ "$BRANCH_NAME" == "dev" ]] || [[ "$BRANCH_NAME" == "hotfix" ]] || [[ "$BRANCH_NAME" == "release" ]]; then
+ echo "You can't use $BRANCH_NAME for tagged release"
+ exit 1
+ fi
+
+ npx lerna version --exact --preid=$NPM_TAG --conventional-commits --conventional-prerelease --yes --no-push --include-merged-tags --message "chore(release): Publish tagged release $NPM_TAG" --no-commit-hooks --force-publish '@aws-amplify/cli-internal'
+
+# @latest release
+elif [[ "$PROJECT_NAME" == "Release" ]]; then
+
+ if [[ "$BRANCH_NAME" != "release" ]]; then
+ echo "Release must run from release branch. Branch provided was $BRANCH_NAME."
+ exit 1
+ fi
+
+ # create release commit and release tags
+ npx lerna version --exact --conventional-commits --conventional-graduate --yes --no-push --include-merged-tags --message "chore(release): Publish latest" --no-commit-hooks --force-publish '@aws-amplify/cli-internal'
+
+# release candidate
+elif [[ "$PROJECT_NAME" == "RC" ]]; then
+ # create release commit and release tags
+ npx lerna version --preid=rc.$(git rev-parse --short=15 HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish rc" --no-commit-hooks --force-publish '@aws-amplify/cli-internal'
+# local publish for testing / building binary, dev branch build, e2e tests
+else
+ # create release commit and release tags
+ npx lerna version --preid=dev.$(git rev-parse HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish dev" --no-commit-hooks --force-publish '@aws-amplify/cli-internal'
+fi
diff --git a/.circleci/publish-step-2-verdaccio.sh b/.circleci/cb-publish-step-2-verdaccio.sh
similarity index 76%
rename from .circleci/publish-step-2-verdaccio.sh
rename to .circleci/cb-publish-step-2-verdaccio.sh
index c27881e6d6d..45e2c359b14 100755
--- a/.circleci/publish-step-2-verdaccio.sh
+++ b/.circleci/cb-publish-step-2-verdaccio.sh
@@ -8,8 +8,15 @@ function lernaPublishExitOnFailure {
set -e
# run lerna publish with the args that were passed to this function
# duplicate stdout to a temp file
- # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
- npx lerna publish "$@" | tee /tmp/publish-results && grep -qvz "lerna ERR!" < /tmp/publish-results
+ npx lerna publish "$@" 2>&1 | tee /tmp/publish-results
+ # grep the temp file for the lerna err token and return exit 1
+ number_of_lerna_errors=$(grep "lerna ERR" /tmp/publish-results | wc -l)
+ if [[ number_of_lerna_errors -gt 0 ]]; then
+ echo "Fail! Lerna error."
+ exit 1;
+ else
+ echo "Success! Lerna publish succeeded."
+ fi
}
npmRegistryUrl=$(npm get registry)
diff --git a/.circleci/publish-step-3-npm.sh b/.circleci/cb-publish-step-3-npm.sh
similarity index 58%
rename from .circleci/publish-step-3-npm.sh
rename to .circleci/cb-publish-step-3-npm.sh
index f0f3765c79d..a779aff6c15 100755
--- a/.circleci/publish-step-3-npm.sh
+++ b/.circleci/cb-publish-step-3-npm.sh
@@ -8,8 +8,15 @@ function lernaPublishExitOnFailure {
set -e
# run lerna publish with the args that were passed to this function
# duplicate stdout to a temp file
- # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
- npx lerna publish "$@" | tee /tmp/publish-results && grep -qvz "lerna ERR!" < /tmp/publish-results
+ npx lerna publish "$@" 2>&1 | tee /tmp/publish-results
+ # grep the temp file for the lerna err token and return exit 1
+ number_of_lerna_errors=$(grep "lerna ERR" /tmp/publish-results | wc -l)
+ if [[ number_of_lerna_errors -gt 0 ]]; then
+ echo "Fail! Lerna error."
+ exit 1;
+ else
+ echo "Success! Lerna publish succeeded."
+ fi
}
# verifies that binaries are uploaded and available before publishing to NPM
@@ -23,22 +30,20 @@ function verifyPkgIsAvailable {
# check binaries
# send HEAD requests to check for binary presence
# curl --fail exits with non-zero code and makes this script fail
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-linux-x64.tgz
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-linux-arm64.tgz
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-macos-x64.tgz
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-win-x64.tgz
+ curl -I --fail https://$PKG_CLI_CLOUDFRONT_URL/$desiredPkgVersion/amplify-pkg-linux-x64.tgz
+ curl -I --fail https://$PKG_CLI_CLOUDFRONT_URL/$desiredPkgVersion/amplify-pkg-linux-arm64.tgz
+ curl -I --fail https://$PKG_CLI_CLOUDFRONT_URL/$desiredPkgVersion/amplify-pkg-macos-x64.tgz
+ curl -I --fail https://$PKG_CLI_CLOUDFRONT_URL/$desiredPkgVersion/amplify-pkg-win-x64.tgz
}
-if [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]]; then
- if [[ "$CIRCLE_BRANCH" =~ ^tagged-release-without-e2e-tests\/.* ]]; then
- # Remove tagged-release-without-e2e-tests/
- export NPM_TAG="${CIRCLE_BRANCH/tagged-release-without-e2e-tests\//}"
- elif [[ "$CIRCLE_BRANCH" =~ ^tagged-release\/.* ]]; then
- # Remove tagged-release/
- export NPM_TAG="${CIRCLE_BRANCH/tagged-release\//}"
- fi
+if [[ "$PROJECT_NAME" == "TaggedReleaseWithoutE2E" ]]; then
if [ -z "$NPM_TAG" ]; then
- echo "Tag name is missing. Name your branch with either tagged-release/ or tagged-release-without-e2e-tests/"
+ echo "Tag name is missing. Make sure CodeBuild workflow was started with NPM_TAG environment variable"
+ exit 1
+ fi
+
+ if [[ "$BRANCH_NAME" == "main" ]] || [[ "$BRANCH_NAME" == "dev" ]] || [[ "$BRANCH_NAME" == "hotfix" ]] || [[ "$BRANCH_NAME" == "release" ]]; then
+ echo "You can't use $BRANCH_NAME for tagged release"
exit 1
fi
@@ -49,7 +54,13 @@ if [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]]; then
lernaPublishExitOnFailure from-git --yes --no-push --dist-tag=$NPM_TAG
# @latest release
-elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
+elif [[ "$PROJECT_NAME" == "Release" ]]; then
+
+ if [[ "$BRANCH_NAME" != "release" ]]; then
+ echo "Release must run from release branch. Branch provided was $BRANCH_NAME."
+ exit 1
+ fi
+
# verify that binary has been uploaded
verifyPkgIsAvailable
@@ -57,7 +68,7 @@ elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
lernaPublishExitOnFailure from-git --yes --no-push
# release candidate or local publish for testing / building binary
-elif [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^release_rc\/.* ]]; then
+elif [[ "$PROJECT_NAME" == "RC" ]]; then
# verify that binary has been uploaded
verifyPkgIsAvailable
@@ -65,6 +76,6 @@ elif [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^r
# publish versions that were just computed
lernaPublishExitOnFailure from-git --yes --no-push --dist-tag rc
else
- echo "branch name" "$CIRCLE_BRANCH" "did not match any branch publish rules."
+ echo "Project name" "$PROJECT_NAME" "did not match any publish rules."
exit 1
fi
diff --git a/.circleci/cb-publish-step-4-push-to-git.sh b/.circleci/cb-publish-step-4-push-to-git.sh
new file mode 100755
index 00000000000..08e4172a1a1
--- /dev/null
+++ b/.circleci/cb-publish-step-4-push-to-git.sh
@@ -0,0 +1,40 @@
+#!/bin/bash -e
+
+git config --global user.name aws-amplify-bot
+git config --global user.email aws@amazon.com
+
+if [[ "$BRANCH_NAME" == "" ]]; then
+ echo "BRANCH_NAME must be defined for push to git step."
+ exit 1
+fi
+
+if [[ "$PROJECT_NAME" == "TaggedReleaseWithoutE2E" ]] || [[ "$PROJECT_NAME" == "RC" ]]; then
+ # push release commit
+ git push origin "$BRANCH_NAME" --no-verify
+
+ # push release tags
+ git tag --points-at HEAD | xargs git push origin --no-verify
+
+# @latest release
+elif [[ "$PROJECT_NAME" == "Release" ]]; then
+ # push release commit
+ git push origin "$BRANCH_NAME" --no-verify
+
+ # push release tags
+ git tag --points-at HEAD | xargs git push origin --no-verify
+
+ # fast forward main to release
+ git fetch origin main
+ git checkout main
+ git merge release --ff-only
+ git push origin main --no-verify
+
+ # fast forward hotfix to release
+ git fetch origin hotfix
+ git checkout hotfix
+ git merge release --ff-only
+ git push origin hotfix --no-verify
+else
+ echo "Project name" "$PROJECT_NAME" "did not match any publish rules."
+ exit 1
+fi
diff --git a/.circleci/codebuild-checkout.sh b/.circleci/codebuild-checkout.sh
new file mode 100755
index 00000000000..f83d32cf265
--- /dev/null
+++ b/.circleci/codebuild-checkout.sh
@@ -0,0 +1,45 @@
+#!/bin/bash -e
+
+# This script checks out a branch & loads git tags.
+
+# Get the hash that CodeBuild used to start workflow and use it later to validate that we didn't change it after transformations below.
+INITIAL_HEAD_HASH=$(git rev-parse HEAD)
+
+git status
+
+echo "PROJECT_NAME=$PROJECT_NAME"
+echo "CODEBUILD_SOURCE_VERSION=$CODEBUILD_SOURCE_VERSION"
+echo "BRANCH_NAME=$BRANCH_NAME"
+echo "CODEBUILD_WEBHOOK_TRIGGER=$CODEBUILD_WEBHOOK_TRIGGER"
+
+# Codebuild doesn't checkout the branch by default
+if [[ "$PROJECT_NAME" == "AmplifyCLI-PR-Testing" ]]; then
+ # If we're in PR workflow create temporary local branch.
+ echo "Creating temporary local branch for PR build"
+ TEMP_BRANCH_NAME=$(cat /proc/sys/kernel/random/uuid)
+ git checkout -b $TEMP_BRANCH_NAME
+elif [[ "$CODEBUILD_WEBHOOK_TRIGGER" == "branch/dev" ]]; then
+ # We're in E2E workflow triggered after pushing to dev.
+ echo "Checking out dev"
+ git checkout dev
+elif [[ "$BRANCH_NAME" == "" ]]; then
+ echo "BRANCH_NAME must be defined for non-PR builds"
+ exit 1
+else
+ echo "Checking out $BRANCH_NAME"
+ git checkout $BRANCH_NAME
+fi
+
+git show --summary
+
+echo "Fetching tags"
+git fetch --all --tags
+
+# A sanity check that we haven't altered commit we're building from. This must be last section in this script
+HEAD_HASH=$(git rev-parse HEAD)
+if [[ "$INITIAL_HEAD_HASH" != "$HEAD_HASH" ]]; then
+ echo "Fail! Detected a drift of commit we attempt to build!"
+ echo "INITIAL_HEAD_HASH=$INITIAL_HEAD_HASH"
+ echo "HEAD_HASH=$HEAD_HASH"
+ exit 1
+fi
diff --git a/.circleci/config.base.yml b/.circleci/config.base.yml
deleted file mode 100644
index 1c334687f6b..00000000000
--- a/.circleci/config.base.yml
+++ /dev/null
@@ -1,1469 +0,0 @@
-version: 2.1
-orbs:
- aws-ecr: circleci/aws-ecr@6.15.3
-machine:
- environment:
- PATH: '${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin'
-
-parameters:
- nightly_console_integration_tests:
- type: boolean
- default: false
- setup:
- type: boolean
- default: true
-
-executors:
- w_medium: &windows-e2e-executor-medium
- machine:
- image: 'windows-server-2022-gui:current'
- resource_class: 'windows.medium'
- shell: bash.exe
- working_directory: ~/repo
- environment:
- AMPLIFY_DIR: C:/home/circleci/repo/out
- AMPLIFY_PATH: C:/home/circleci/repo/out/amplify.exe
-
- w_xlarge: &windows-e2e-executor-xlarge
- machine:
- image: 'windows-server-2022-gui:current'
- resource_class: 'windows.xlarge'
- shell: bash.exe
- working_directory: ~/repo
- environment:
- AMPLIFY_DIR: C:/home/circleci/repo/out
- AMPLIFY_PATH: C:/home/circleci/repo/out/amplify.exe
- l_xlarge: &linux-e2e-executor-xlarge
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: xlarge
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- # If you update this name, make sure to update it in split-e2e-tests.ts as well
- l_large: &linux-e2e-executor-large
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: large
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- # If you update this name, make sure to update it in split-e2e-tests.ts as well
- l_medium: &linux-e2e-executor-medium
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: medium
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- l_small: &linux-e2e-executor-small
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
- working_directory: ~/repo
- resource_class: small
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
-
-defaults: &defaults
- working_directory: ~/repo
- parameters:
- os:
- type: executor
- default: l_medium
- executor: << parameters.os >>
-
-scan_e2e_test_artifacts: &scan_e2e_test_artifacts
- name: Scan And Cleanup E2E Test Artifacts
- no_output_timeout: 90m
- command: |
- if ! yarn ts-node .circleci/scan_artifacts.ts; then
- echo "Cleaning the repository"
- git clean -fdx
- exit 1
- fi
- when: always
-
-install_cli_from_local_registry: &install_cli_from_local_registry
- name: Start verdaccio, install node CLI and amplify-app
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- changeNpmGlobalPath
- npm install -g @aws-amplify/cli
- npm install -g amplify-app
- unsetNpmRegistryUrl
-
-jobs:
- build:
- parameters:
- os:
- type: executor
- default: l_xlarge
- executor: l_xlarge
- steps:
- - checkout
- - run: yarn --immutable
- - run: yarn production-build
- - run:
- name: Build tests
- command: yarn build-tests
- - run:
- # setting versions in build step so that commit and git tags are cached and available for all steps in pipeline
- name: Set versions
- command: ./.circleci/publish-step-1-set-versions.sh
- - save_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo
- - save_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- paths:
- - ~/.cache
- - save_cache:
- key: amplify-cli-ssh-deps-{{ .Branch }}
- paths:
- - ~/.ssh
- build_tests_standalone:
- parameters:
- os:
- type: executor
- default: l_xlarge
- executor: l_xlarge
- steps:
- - checkout
- - run: yarn install --immutable
- - run:
- name: Build tests
- command: yarn build-tests
- build_windows_workspace_for_e2e:
- parameters:
- os:
- type: executor
- default: w_xlarge
- executor: w_xlarge
- steps:
- - when:
- condition:
- equal: [*windows-e2e-executor-xlarge, << parameters.os >>]
- steps:
- - install_node_windows
- - checkout
- - run: cd scripts && yarn && yarn ts-node remove-pkg-fetch-checksum.ts && cd -
- - run: yarn --immutable
- - run: yarn production-build
- - run:
- name: Build tests
- command: yarn build-tests
- - persist_to_workspace:
- root: ~/.
- paths:
- - repo
- - .cache
- - .ssh
- test:
- <<: *linux-e2e-executor-xlarge
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: Run tests
- command: yarn test-ci
- - run:
- name: Collect code coverage
- command: yarn coverage
- environment:
- NODE_OPTIONS: --max-old-space-size=5120
-
- validate_cdk_version:
- <<: *linux-e2e-executor-medium
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: Validate cdk version
- command: |
- yarn ts-node .circleci/validate_cdk_version.ts
-
- lint:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run: yarn lint-check
- - run: yarn lint-check-package-json
- - run: yarn prettier-check
- environment:
- NODE_OPTIONS: --max-old-space-size=5120
-
- verify-api-extract:
- <<: *linux-e2e-executor-xlarge
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: extract api
- command: |
- yarn verify-api-extract
-
- verify-yarn-lock:
- <<: *linux-e2e-executor-medium
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: verify yarn lock
- command: |
- yarn verify-yarn-lock
-
- verify-versions-match:
- <<: *linux-e2e-executor-medium
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run:
- name: verify versions match
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- checkPackageVersionsInLocalNpmRegistry
-
- mock_e2e_tests:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: Run Transformer end-to-end tests with mock server
- command: |
- source .circleci/local_publish_helpers.sh
- cd packages/amplify-util-mock/
- yarn e2e
- no_output_timeout: 90m
- environment:
- JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
- NODE_OPTIONS: --max-old-space-size=4096
- - store_test_results:
- path: ~/repo/packages/amplify-util-mock/
-
- publish_to_local_registry:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: Publish to verdaccio
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- ./.circleci/publish-step-2-verdaccio.sh
- unsetNpmRegistryUrl
- - run:
- name: Generate unified changelog
- command: |
- git reset --soft HEAD~1
- yarn ts-node scripts/unified-changelog.ts
- cat UNIFIED_CHANGELOG.md
- - run:
- name: Save new amplify GitHub tag
- command: node scripts/echo-current-cli-version.js > .amplify-pkg-version
- - save_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/verdaccio-cache/
- - save_cache:
- key: amplify-unified-changelog-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/UNIFIED_CHANGELOG.md
- - save_cache:
- key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/.amplify-pkg-version
-
- upload_pkg_binaries:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-linux-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-macos-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-win-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-arm-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Consolidate binaries cache and upload
- command: |
- source .circleci/local_publish_helpers.sh
- uploadPkgCli
- - save_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/out
-
- build_pkg_binaries_linux:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio and package CLI
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- generatePkgCli linux
- unsetNpmRegistryUrl
- - save_cache:
- key: amplify-pkg-binaries-linux-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/out
- - store_artifacts:
- path: ~/repo/out
-
- build_pkg_binaries_macos:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio and package CLI
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- generatePkgCli macos
- unsetNpmRegistryUrl
- - save_cache:
- key: amplify-pkg-binaries-macos-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/out
- - store_artifacts:
- path: ~/repo/out
-
- build_pkg_binaries_win:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio and package CLI
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- generatePkgCli win
- unsetNpmRegistryUrl
- - save_cache:
- key: amplify-pkg-binaries-win-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/out
- - store_artifacts:
- path: ~/repo/out
-
- build_pkg_binaries_arm:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio and package CLI
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- changeNpmGlobalPath
- generatePkgCli arm
- unsetNpmRegistryUrl
- - save_cache:
- key: amplify-pkg-binaries-arm-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/out
- - store_artifacts:
- path: ~/repo/out
-
- verify_pkg_binaries:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-linux-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-macos-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-win-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-arm-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Verify packaged CLI
- command: |
- source .circleci/local_publish_helpers.sh
- verifyPkgCli
-
- amplify_sudo_install_test:
- <<: *defaults
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio and Install Amplify CLI as sudo
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setSudoNpmRegistryUrlToLocal
- changeSudoNpmGlobalPath
- sudo npm install -g @aws-amplify/cli
- unsetSudoNpmRegistryUrl
- amplify version
-
- amplify_install_test:
- <<: *defaults
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio and Install Amplify CLI
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- changeNpmGlobalPath
- # limit memory for new processes to 1GB
- # this is to make sure that install can work on small VMs
- # i.e. not buffer content in memory while installing binary
- ulimit -Sv 1000000
- npm install -g @aws-amplify/cli
- unsetNpmRegistryUrl
- amplify version
-
- amplify_e2e_tests_pkg:
- parameters:
- os:
- type: executor
- default: l_medium
- executor: << parameters.os >>
- working_directory: ~/repo
- steps:
- - when:
- condition:
- equal: [*windows-e2e-executor-medium, << parameters.os >>]
- steps:
- - install_node_windows
- - attach_workspace:
- at: ~/.
- - run:
- name: Git enable long paths
- command: git config --global core.longpaths true
- - when:
- condition:
- or:
- - equal: [*linux-e2e-executor-large, << parameters.os >>]
- - equal: [*linux-e2e-executor-medium, << parameters.os >>]
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-build-artifact-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - rename_binary_for_windows:
- os: << parameters.os >>
- - install_packaged_cli:
- os: << parameters.os >>
- - run_e2e_tests:
- os: << parameters.os >>
- - scan_e2e_test_artifacts:
- os: << parameters.os >>
- - store_test_results:
- path: ~/repo/packages/amplify-e2e-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
-
- amplify_migration_tests_v8:
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- environment:
- AMPLIFY_PATH: /home/circleci/.npm-global/bin/amplify
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Run tests migrating from CLI v8.2.0
- command: |
- source .circleci/local_publish_helpers.sh
- changeNpmGlobalPath
- cd packages/amplify-migration-tests
- unset IS_AMPLIFY_CI
- echo $IS_AMPLIFY_CI
- retry yarn migration_v8.2.0 --no-cache --maxWorkers=4 --forceExit $TEST_SUITE
- no_output_timeout: 65m
- - run: *scan_e2e_test_artifacts
- - store_test_results:
- path: ~/repo/packages/amplify-migration-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
- working_directory: ~/repo
-
- amplify_migration_tests_v10:
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- environment:
- AMPLIFY_PATH: /home/circleci/.amplify/bin/amplify
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Run tests migrating from CLI v10.5.1
- command: |
- source .circleci/local_publish_helpers.sh
- changeNpmGlobalPath
- cd packages/amplify-migration-tests
- unset IS_AMPLIFY_CI
- echo $IS_AMPLIFY_CI
- retry yarn migration_v10.5.1 --no-cache --maxWorkers=4 --forceExit $TEST_SUITE
- no_output_timeout: 65m
- - run: *scan_e2e_test_artifacts
- - store_test_results:
- path: ~/repo/packages/amplify-migration-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
- working_directory: ~/repo
-
- amplify_migration_tests_non_multi_env_layers:
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- environment:
- AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: Run tests migrating from CLI v4.28.2
- command: |
- source .circleci/local_publish_helpers.sh
- changeNpmGlobalPath
- cd packages/amplify-migration-tests
- retry yarn migration_v4.28.2_nonmultienv_layers --no-cache --maxWorkers=4 --forceExit $TEST_SUITE
- no_output_timeout: 90m
- - run: *scan_e2e_test_artifacts
- - store_test_results:
- path: ~/repo/packages/amplify-migration-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
- working_directory: ~/repo
-
- amplify_migration_tests_multi_env_layers:
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- environment:
- AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Run tests migrating from CLI v4.52.0
- command: |
- source .circleci/local_publish_helpers.sh
- changeNpmGlobalPath
- cd packages/amplify-migration-tests
- retry yarn migration_v4.52.0_multienv_layers --no-cache --maxWorkers=4 --forceExit $TEST_SUITE
- no_output_timeout: 90m
- - run: *scan_e2e_test_artifacts
- - store_test_results:
- path: ~/repo/packages/amplify-migration-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
- working_directory: ~/repo
-
- amplify_general_config_tests:
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- environment:
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Run tests using general profile
- command: |
- source .circleci/local_publish_helpers.sh
- cd packages/amplify-e2e-tests
- retry yarn general-config-e2e --no-cache --maxWorkers=3 --forceExit $TEST_SUITE
- no_output_timeout: 90m
- - run: *scan_e2e_test_artifacts
- - store_test_results:
- path: ~/repo/packages/amplify-e2e-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
- working_directory: ~/repo
-
- amplify_console_integration_tests:
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run: *install_cli_from_local_registry
- - run:
- command: |
- echo "export PATH=~/.npm-global/bin:$PATH" >> $BASH_ENV
- source $BASH_ENV
- source .circleci/local_publish_helpers.sh
- amplify -v
- cd packages/amplify-console-integration-tests
- retry yarn console-integration --no-cache --maxWorkers=4 --forceExit
- name: 'Run Amplify Console integration tests'
- no_output_timeout: 90m
- - run: *scan_e2e_test_artifacts
- - store_test_results:
- path: ~/repo/packages/amplify-console-integration-tests/
- - store_artifacts:
- path: ~/repo/packages/amplify-console-integration-tests/console-integration-reports
- working_directory: ~/repo
-
- integration_test:
- working_directory: /home/circleci/repo
- resource_class: large
- docker:
- - image: cypress/base:14.17.0
- environment:
- TERM: dumb
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run: cd .circleci/ && chmod +x aws.sh
- - run:
- name: Setup Dependencies
- command: |
- apt-get update
- apt-get install -y sudo
- sudo apt-get install -y tcl
- sudo apt-get install -y expect
- sudo apt-get install -y zip
- sudo apt-get install -y lsof
- sudo apt-get install -y python python-pip libpython-dev
- sudo apt-get install -y jq
- pip install awscli
- - run: expect .circleci/aws_configure.exp
- - run:
- name: Configure Amplify CLI
- command: |
- yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev
- echo 'export PATH="$(pwd)/.bin:$PATH"' >> $BASH_ENV
- source $BASH_ENV
- amplify-dev
- - run:
- name: Clone auth test package
- command: |
- cd ..
- git clone $AUTH_CLONE_URL
- cd aws-amplify-cypress-auth
- yarn
- yarn add cypress@6.8.0 --save
- - run: cd .circleci/ && chmod +x auth.sh
- - run: cd .circleci/ && chmod +x amplify_init.sh
- - run: cd .circleci/ && chmod +x amplify_init.exp
- - run: expect .circleci/amplify_init.exp ../aws-amplify-cypress-auth
- - run: expect .circleci/enable_auth.exp
- - run: cd ../aws-amplify-cypress-auth
- - run: yarn --immutable
- - run: cd ../aws-amplify-cypress-auth/src && cat $(find . -type f -name 'aws-exports*')
- - run:
- name: Start Auth test server in background
- command: |
- cd ../aws-amplify-cypress-auth
- pwd
- yarn start
- background: true
- - run: cat $(find ../repo -type f -name 'auth_spec*')
- - run:
- name: Run cypress tests for auth
- command: |
- cd ../aws-amplify-cypress-auth
- cp ../repo/cypress.json .
- cp -R ../repo/cypress .
- yarn cypress run --spec $(find . -type f -name 'auth_spec*')
- - run: sudo kill -9 $(lsof -t -i:3000)
- - run: cd .circleci/ && chmod +x delete_auth.sh
- - run: expect .circleci/delete_auth.exp
- - run:
- name: Clone API test package
- command: |
- cd ..
- git clone $API_CLONE_URL
- cd aws-amplify-cypress-api
- yarn
- - run: cd .circleci/ && chmod +x api.sh
- - run: expect .circleci/amplify_init.exp ../aws-amplify-cypress-api
- - run: expect .circleci/enable_api.exp
- - run: cd ../aws-amplify-cypress-api
- - run: yarn --immutable
- - run: cd ../aws-amplify-cypress-api/src && cat $(find . -type f -name 'aws-exports*')
- - run:
- name: Start API test server in background
- command: |
- cd ../aws-amplify-cypress-api
- pwd
- yarn start
- background: true
- - run:
- name: Run cypress tests for api
- command: |
- cd ../aws-amplify-cypress-api
- yarn add cypress@6.8.0 --save
- cp ../repo/cypress.json .
- cp -R ../repo/cypress .
- yarn cypress run --spec $(find . -type f -name 'api_spec*')
- - run: cd .circleci/ && chmod +x delete_api.sh
- - run: expect .circleci/delete_api.exp
- - run: *scan_e2e_test_artifacts
- - store_artifacts:
- path: ~/aws-amplify-cypress-auth/cypress/videos
- - store_artifacts:
- path: ~/aws-amplify-cypress-auth/cypress/screenshots
- - store_artifacts:
- path: ~/aws-amplify-cypress-api/cypress/videos
- - store_artifacts:
- path: ~/aws-amplify-cypress-api/cypress/screenshots
-
- publish_to_npm:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- keys:
- - amplify-cli-ssh-deps-{{ .Branch }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Authenticate with npm
- command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- - run:
- name: Publish Amplify CLI
- command: |
- bash ./.circleci/publish-step-3-npm.sh
- post_publish_push_to_git:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- keys:
- - amplify-cli-ssh-deps-{{ .Branch }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Push release commit and tags
- command: |
- bash ./.circleci/publish-step-4-push-to-git.sh
- github_prerelease:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-unified-changelog-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Compress binaries
- command: |
- cd out
- mv amplify-pkg-macos-x64 amplify-pkg-macos
- mv amplify-pkg-linux-x64 amplify-pkg-linux
- mv amplify-pkg-win-x64.exe amplify-pkg-win.exe
- tar zcvf amplify-pkg-macos.tgz amplify-pkg-macos
- tar zcvf amplify-pkg-linux.tgz amplify-pkg-linux
- tar zcvf amplify-pkg-win.exe.tgz amplify-pkg-win.exe
- - run:
- name: Publish Amplify CLI GitHub prerelease
- command: |
- commit=$(git rev-parse HEAD)
- version=$(cat .amplify-pkg-version)
- yarn ts-node scripts/github-prerelease.ts $version $commit
-
- github_prerelease_install_sanity_check:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Install packaged Amplify CLI
- command: |
- version=$(cat .amplify-pkg-version)
- curl -sL https://aws-amplify.github.io/amplify-cli/install | version=v$version bash
- echo "export PATH=$PATH:$HOME/.amplify/bin" >> $BASH_ENV
- - run:
- name: Sanity check install
- command: |
- amplify version
- github_release:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Publish Amplify CLI GitHub release
- command: |
- commit=$(git rev-parse HEAD)
- version=$(cat .amplify-pkg-version)
- yarn ts-node scripts/github-release.ts $version $commit
- npm_rollback_access:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- keys:
- - amplify-cli-ssh-deps-{{ .Branch }}
- - restore_cache:
- key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Authenticate with npm
- command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- cleanup_resources:
- <<: *linux-e2e-executor-large
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: 'Run cleanup script'
- command: |
- cd packages/amplify-e2e-tests
- yarn clean-e2e-resources
- no_output_timeout: 90m
- - run: *scan_e2e_test_artifacts
- - store_artifacts:
- path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
- working_directory: ~/repo
-
- trigger_e2e_workflow_cleanup:
- <<: *linux-e2e-executor-medium
- steps:
- - run:
- name: 'Trigger Cleanup for this Workflow'
- command: |
- echo "Triggering cleanup for Workflow $CIRCLE_WORKFLOW_ID"
- curl --request POST \
- --url https://circleci.com/api/v2/project/gh/aws-amplify/amplify-cli/pipeline \
- --header "Circle-Token: $AMPLIFY_CLI_CIRCLECI_TRIGGER_TOKEN" \
- --header "content-type: application/json" \
- --data '{"branch":"'$CIRCLE_BRANCH'","parameters":{"e2e_workflow_cleanup":true,"setup":false,"e2e_workflow_cleanup_workflow_id":"'$CIRCLE_WORKFLOW_ID'"}}'
-
- wait_for_all:
- <<: *linux-e2e-executor-small
- steps:
- - restore_cache:
- key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
- - restore_cache:
- key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: 'Wait for all required jobs to finish'
- command: |
- while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLECI_TOKEN"| jq -r '.items[]|select(.name != "wait_for_all")|.status' | grep -c "running") -gt 0 ]]
- do
- sleep 60
- done
- no_output_timeout: 180m
- - run:
- name: 'Collect Results'
- command: yarn workflow-results
- - run: *scan_e2e_test_artifacts
- - store_artifacts:
- path: ~/repo/artifacts
-
- working_directory: ~/repo
-
-workflows:
- version: 3
- build_test_deploy_v3:
- jobs:
- - build:
- filters:
- branches:
- ignore:
- - beta
- - build_tests_standalone
- - build_windows_workspace_for_e2e:
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- - lint:
- requires:
- - build
- filters:
- branches:
- ignore:
- - beta
- - release
- - /release_rc\/.*/
- - /run-e2e\/.*/
- - verify-api-extract:
- requires:
- - build
- filters:
- branches:
- ignore:
- - beta
- - release
- - /release_rc\/.*/
- - /tagged-release-without-e2e-tests\/.*/
- - verify-yarn-lock:
- requires:
- - build
- - verify-versions-match:
- requires:
- - publish_to_local_registry
- - test:
- requires:
- - build
- filters:
- branches:
- ignore:
- - beta
- - release
- - /release_rc\/.*/
- - /tagged-release-without-e2e-tests\/.*/
- - validate_cdk_version:
- requires:
- - build
- - mock_e2e_tests:
- requires:
- - build
- filters:
- branches:
- ignore:
- - beta
- - release
- - /tagged-release-without-e2e-tests\/.*/
- - integration_test:
- context:
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - build
- - publish_to_local_registry:
- requires:
- - build
- - upload_pkg_binaries:
- filters:
- branches:
- only:
- - dev
- - release
- - /release_rc\/.*/
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /tagged-release-without-e2e-tests\/.*/
- - /run-e2e\/.*/
- context:
- - e2e-auth-credentials
- - e2e-test-context
- - amplify-s3-upload
- requires:
- - build_pkg_binaries_linux
- - build_pkg_binaries_macos
- - build_pkg_binaries_win
- - build_pkg_binaries_arm
- - build_pkg_binaries_linux:
- requires:
- - publish_to_local_registry
- - build_pkg_binaries_macos:
- requires:
- - publish_to_local_registry
- - build_pkg_binaries_win:
- requires:
- - publish_to_local_registry
- - build_pkg_binaries_arm:
- requires:
- - publish_to_local_registry
- - verify_pkg_binaries:
- requires:
- - build_pkg_binaries_linux
- - build_pkg_binaries_macos
- - build_pkg_binaries_win
- - build_pkg_binaries_arm
- - amplify_sudo_install_test:
- context: amplify-ecr-image-pull
- requires:
- - upload_pkg_binaries
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- - amplify_install_test:
- context: amplify-ecr-image-pull
- requires:
- - upload_pkg_binaries
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- - cleanup_resources:
- context:
- - cleanup-resources
- - e2e-test-context
- requires:
- - build
- filters:
- branches:
- only:
- - dev
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- - amplify_e2e_tests_pkg:
- context:
- - cleanup-resources
- - e2e-auth-credentials
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - build_windows_workspace_for_e2e
- - amplify_migration_tests_v10:
- context:
- - e2e-auth-credentials
- - cleanup-resources
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - amplify_migration_tests_v8:
- context:
- - e2e-auth-credentials
- - cleanup-resources
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - amplify_migration_tests_non_multi_env_layers:
- context:
- - e2e-auth-credentials
- - cleanup-resources
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - amplify_migration_tests_multi_env_layers:
- context:
- - e2e-auth-credentials
- - cleanup-resources
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - amplify_general_config_tests:
- context:
- - e2e-auth-credentials
- - cleanup-resources
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - amplify_console_integration_tests:
- context:
- - e2e-auth-credentials
- - cleanup-resources
- - console-e2e-test
- - e2e-test-context
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
- requires:
- - upload_pkg_binaries
- - github_prerelease:
- context: github-publish
- requires:
- - upload_pkg_binaries
- filters:
- branches:
- only:
- - release
- - github_prerelease_install_sanity_check:
- requires:
- - github_prerelease
- filters:
- branches:
- only:
- - release
- - wait_for_all:
- context:
- - cleanup-resources
- - e2e-test-context
- requires:
- - build
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
-
- - trigger_e2e_workflow_cleanup:
- context:
- - cleanup-resources
- - e2e-test-context
- requires:
- - wait_for_all
- filters:
- branches:
- only:
- - dev
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /run-e2e\/.*/
-
- - publish_to_npm:
- context:
- - npm-publish
- requires:
- - test
- - mock_e2e_tests
- - integration_test
- - amplify_e2e_tests_pkg
- - amplify_sudo_install_test
- - amplify_install_test
- - amplify_console_integration_tests
- - amplify_migration_tests_v10
- - amplify_migration_tests_v8
- - amplify_migration_tests_non_multi_env_layers
- - amplify_migration_tests_multi_env_layers
- - github_prerelease_install_sanity_check
- - upload_pkg_binaries
- - verify-versions-match
- filters:
- branches:
- only:
- - release
- - /release_rc\/.*/
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /tagged-release-without-e2e-tests\/.*/
- - npm_rollback_access:
- context:
- - npm-publish
- requires:
- - upload_pkg_binaries
- - verify-versions-match
- filters:
- branches:
- only:
- - release
- - post_publish_push_to_git:
- requires:
- - publish_to_npm
- filters:
- branches:
- only:
- - release
- - /release_rc\/.*/
- - /run-e2e-with-rc\/.*/
- - /tagged-release\/.*/
- - /tagged-release-without-e2e-tests\/.*/
- - github_release:
- context: github-publish
- requires:
- - post_publish_push_to_git
- filters:
- branches:
- only:
- - release
-
-commands:
- install_packaged_cli:
- description: 'Install Amplify Packaged CLI to PATH'
- parameters:
- os:
- type: executor
- default: l_large
- steps:
- - when:
- condition:
- equal: [*windows-e2e-executor-medium, << parameters.os >>]
- steps:
- - run:
- shell: powershell.exe
- name: Rename the Packaged CLI to amplify
- command: |
- # rename the command to amplify
- cd /home/circleci/repo/out
- cp amplify-pkg-win-x64.exe amplify.exe
- - run:
- shell: powershell.exe
- name: Move to CLI Binary to already existing PATH
- command: |
- # This is a Hack to make sure the Amplify CLI is in the PATH
- cp /home/circleci/repo/out/amplify.exe $env:homedrive\$env:homepath\AppData\Local\Microsoft\WindowsApps
- - run:
- name: Confirm Amplify CLI is installed and available in PATH
- command: amplify version
-
- - when:
- condition:
- or:
- - equal: [*linux-e2e-executor-large, << parameters.os >>]
- - equal: [*linux-e2e-executor-medium, << parameters.os >>]
- steps:
- - run:
- name: Symlink Amplify packaged CLI
- command: |
- cd out
- ln -sf amplify-pkg-linux-x64 amplify
- echo "export PATH=$AMPLIFY_DIR:$PATH:/home/circleci/repo/node_modules/.bin/" >> $BASH_ENV
- source $BASH_ENV
- - run:
- name: Confirm Amplify CLI is installed and available in PATH
- command: amplify version
-
- rename_binary_for_windows:
- description: 'Rename binary for windows'
- parameters:
- os:
- type: executor
- default: w_medium
- steps:
- - when:
- condition:
- equal: [*windows-e2e-executor-medium, << parameters.os >>]
- steps:
- - run:
- shell: powershell.exe
- command: cp /home/circleci/repo/out/amplify-pkg-win-x64.exe $env:homedrive\$env:homepath\AppData\Local\Microsoft\WindowsApps\amplify.exe
- run_e2e_tests:
- description: 'Run Amplify E2E tests'
- parameters:
- os:
- type: executor
- default: l_medium
- steps:
- - when:
- condition:
- equal: [*windows-e2e-executor-medium, << parameters.os >>]
- steps:
- - run:
- name: Run E2e Tests
- shell: bash.exe
- command: |
- source .circleci/local_publish_helpers.sh
- source $BASH_ENV
- amplify version
- cd packages/amplify-e2e-tests
- retry runE2eTest
- no_output_timeout: 65m
- - when:
- condition:
- or:
- - equal: [*linux-e2e-executor-large, << parameters.os >>]
- - equal: [*linux-e2e-executor-medium, << parameters.os >>]
- steps:
- - run:
- name: Run E2e Tests
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- changeNpmGlobalPath
- source $BASH_ENV
- amplify version
- cd packages/amplify-e2e-tests
- retry runE2eTest
- no_output_timeout: 65m
- scan_e2e_test_artifacts:
- description: 'Scan And Cleanup E2E Test Artifacts'
- parameters:
- os:
- type: executor
- default: l_large
- steps:
- - run:
- name: Scan E2E artifacts
- no_output_timeout: 2m
- command: |
- if ! yarn ts-node .circleci/scan_artifacts.ts; then
- echo "Cleaning the repository"
- git clean -fdx
- exit 1
- fi
- when: always
- install_node_windows:
- description: Install Node 18 on Windows
- steps:
- - run:
- name: Install Node 18
- command: |
- nvm version
- nvm install 18.15.0
- nvm use 18.15.0
- nvm ls
- - run:
- name: Check Node, install yarn
- command: |
- node --version
- npm --version
- npm install -g yarn
- yarn --version
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index d604dbc8b66..00000000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,268 +0,0 @@
-version: 2.1
-
-# this allows you to use CircleCI's dynamic configuration feature
-setup: true
-
-# the continuation orb is required in order to use dynamic configuration
-orbs:
- continuation: circleci/continuation@0.1.2
-
-parameters:
- nightly_console_integration_tests:
- type: boolean
- default: false
- e2e_resource_cleanup:
- type: boolean
- default: false
- e2e_workflow_cleanup:
- type: boolean
- default: false
- e2e_workflow_cleanup_workflow_id:
- type: string
- default: ''
- setup:
- type: boolean
- default: true
-
-executors:
- l_large: &linux-e2e-executor-large
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: large
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- l_xlarge: &linux-e2e-executor-xlarge
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: xlarge
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
-
-# our defined job, and its steps
-jobs:
- setup:
- executor: 'l_large'
- steps:
- - checkout # checkout code
- - run: # run a command
- name: Generate config
- command: |
- cd scripts
- yarn
- yarn split-e2e-tests
- - continuation/continue:
- configuration_path: .circleci/generated_config.yml # use newly generated config to continue
- build:
- parameters:
- os:
- type: executor
- default: l_xlarge
- executor: << parameters.os >>
- steps:
- - checkout
- - restore_cache:
- key: >-
- amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run: yarn --immutable
- - run: yarn production-build
- - save_cache:
- key: >-
- amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- paths:
- - ~/.cache
- - save_cache:
- key: amplify-cli-ssh-deps-{{ .Branch }}
- paths:
- - ~/.ssh
- - when:
- condition:
- equal:
- - docker:
- - image: >-
- public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: xlarge
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- - << parameters.os >>
- steps:
- - persist_to_workspace:
- root: .
- paths: .
- publish_to_local_registry:
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: large
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- steps:
- - attach_workspace:
- at: ./
- - restore_cache:
- key: >-
- amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - run:
- name: Publish to verdaccio
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- git config user.email not@used.com
- git config user.name "Doesnt Matter"
- yarn publish-to-verdaccio
- unsetNpmRegistryUrl
- - run:
- name: Generate unified changelog
- command: |
- git reset --hard HEAD
- yarn update-versions
- yarn ts-node scripts/unified-changelog.ts
- - run:
- name: Save new amplify GitHub tag
- command: node scripts/echo-current-cli-version.js > .amplify-pkg-version
- - save_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/verdaccio-cache/
- - save_cache:
- key: amplify-unified-changelog-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/UNIFIED_CHANGELOG.md
- - save_cache:
- key: amplfiy-pkg-tag-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/repo/.amplify-pkg-version
- amplify_console_integration_tests:
- working_directory: ~/repo
- parameters:
- os:
- type: executor
- default: l_large
- executor: << parameters.os >>
- steps:
- - attach_workspace:
- at: ./
- - restore_cache:
- key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- - run:
- name: Start verdaccio, install node CLI and amplify-app
- command: |
- source .circleci/local_publish_helpers.sh
- startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
- setNpmRegistryUrlToLocal
- changeNpmGlobalPath
- npm install -g @aws-amplify/cli
- npm install -g amplify-app
- unsetNpmRegistryUrl
- - run:
- command: |
- echo "export PATH=~/.npm-global/bin:$PATH" >> $BASH_ENV
- source $BASH_ENV
- source .circleci/local_publish_helpers.sh
- amplify -v
- cd packages/amplify-console-integration-tests
- retry yarn console-integration --no-cache --maxWorkers=4
- name: Run Amplify Console integration tests
- no_output_timeout: 90m
- - run:
- name: Scan And Cleanup E2E Test Artifacts
- command: |
- if ! yarn ts-node .circleci/scan_artifacts.ts; then
- echo "Cleaning the repository"
- git clean -fdx
- exit 1
- fi
- when: always
- - store_test_results:
- path: packages/amplify-console-integration-tests/
- - store_artifacts:
- path: >-
- ~/repo/packages/amplify-console-integration-tests/console-integration-reports
- cleanup_resources:
- docker:
- - image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:node18
- working_directory: ~/repo
- resource_class: large
- environment:
- AMPLIFY_DIR: /home/circleci/repo/out
- AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
- steps:
- - attach_workspace:
- at: ./
- - restore_cache:
- key: >-
- amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- - when:
- condition:
- equal: [true, << pipeline.parameters.e2e_workflow_cleanup >>]
- steps:
- - run:
- name: Run cleanup script for specific workflow
- command: |
- echo "Cleaning up for Workflow << pipeline.parameters.e2e_workflow_cleanup_workflow_id >>"
- cd packages/amplify-e2e-tests
- yarn clean-e2e-resources workflow << pipeline.parameters.e2e_workflow_cleanup_workflow_id >>
- no_output_timeout: 90m
- - when:
- condition:
- equal: [true, << pipeline.parameters.e2e_resource_cleanup >>]
- steps:
- - run:
- name: Run cleanup script
- command: |
- cd packages/amplify-e2e-tests
- yarn clean-e2e-resources
- no_output_timeout: 90m
- - run:
- name: Scan And Cleanup E2E Test Artifacts
- command: |
- if ! yarn ts-node .circleci/scan_artifacts.ts; then
- echo "Cleaning the repository"
- git clean -fdx
- exit 1
- fi
- when: always
- - store_artifacts:
- path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
-
-# our single workflow, that triggers the setup job defined above
-workflows:
- setup:
- when: << pipeline.parameters.setup >>
- jobs:
- - setup
- nightly_console_integration_tests:
- when: << pipeline.parameters.nightly_console_integration_tests >>
- jobs:
- - build
- - publish_to_local_registry:
- requires:
- - build
- - amplify_console_integration_tests:
- context:
- - console-e2e-test
- - e2e-auth-credentials
- - e2e-test-context
- requires:
- - build
- - publish_to_local_registry
- e2e_resource_cleanup:
- when:
- or:
- - equal: [true, << pipeline.parameters.e2e_resource_cleanup >>]
- - equal: [true, << pipeline.parameters.e2e_workflow_cleanup >>]
- jobs:
- - build
- - cleanup_resources:
- context:
- - cleanup-resources
- - e2e-test-context
- requires:
- - build
diff --git a/.circleci/local_publish_helpers.sh b/.circleci/local_publish_helpers_codebuild.sh
similarity index 74%
rename from .circleci/local_publish_helpers.sh
rename to .circleci/local_publish_helpers_codebuild.sh
index 3017ae6aeda..1ca8b1e68f9 100644
--- a/.circleci/local_publish_helpers.sh
+++ b/.circleci/local_publish_helpers_codebuild.sh
@@ -23,42 +23,37 @@ function startLocalRegistry {
done
}
-function uploadPkgCli {
- aws configure --profile=s3-uploader set aws_access_key_id $S3_ACCESS_KEY
- aws configure --profile=s3-uploader set aws_secret_access_key $S3_SECRET_ACCESS_KEY
- aws configure --profile=s3-uploader set aws_session_token $S3_AWS_SESSION_TOKEN
+function uploadPkgCliCodeBuild {
+ # fail and exit if any command fails
+ set -e
+
cd out/
- export hash=$(git rev-parse HEAD | cut -c 1-12)
export version=$(./amplify-pkg-linux-x64 --version)
- if [[ "$CIRCLE_BRANCH" == "release" ]] || [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^release_rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]]; then
- aws --profile=s3-uploader s3 cp amplify-pkg-win-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-win-x64-$(echo $hash).tgz
- aws --profile=s3-uploader s3 cp amplify-pkg-macos-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-macos-x64-$(echo $hash).tgz
- aws --profile=s3-uploader s3 cp amplify-pkg-linux-arm64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-arm64-$(echo $hash).tgz
- aws --profile=s3-uploader s3 cp amplify-pkg-linux-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-x64-$(echo $hash).tgz
-
- ALREADY_EXISTING_FILES="$(set -o pipefail && aws --profile=s3-uploader s3 ls s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-x64 | ( egrep -v "amplify-pkg-linux-x64-.*" || true ) | wc -l | xargs)"
- INCORRECT_PERMISSIONS=$?
-
- if [ INCORRECT_PERMISSIONS -ne "0" ]; then
- echo "Insufficient permissions to list s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-x64"
- exit 1
- fi
-
- if [ ALREADY_EXISTING_FILES -ne "0" ]; then
- echo "Cannot overwrite existing file at s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-x64.tgz"
- exit 1
- fi
-
- aws --profile=s3-uploader s3 cp amplify-pkg-win-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-win-x64.tgz
- aws --profile=s3-uploader s3 cp amplify-pkg-macos-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-macos-x64.tgz
- aws --profile=s3-uploader s3 cp amplify-pkg-linux-arm64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-arm64.tgz
- aws --profile=s3-uploader s3 cp amplify-pkg-linux-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-x64.tgz
-
- else
- aws --profile=s3-uploader s3 cp amplify-pkg-linux-x64.tgz s3://aws-amplify-cli-do-not-delete/$(echo $version)/amplify-pkg-linux-x64-$(echo $hash).tgz
+ # validate that version is uploaded in right build
+ if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ if [[ "$PROJECT_NAME" != "Release" ]]; then
+ echo "Invalid project name $PROJECT_NAME for $version release."
+ exit 1
+ fi
+ elif [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\. ]]; then
+ if [[ "$PROJECT_NAME" != "RC" ]]; then
+ echo "Invalid project name $PROJECT_NAME for $version RC release."
+ exit 1
+ fi
+ elif [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-$ ]]; then
+ echo "Version $version is missing a tag";
+ exit 1
fi
+ # It's ok to re-upload binaries for the same build to make this step idempotent
+ # Versioning is handled by cb-publish-step-1-set-versions script
+ # Version conflicts are caught at cb-publish-step-2-verdaccio script
+ aws s3 cp amplify-pkg-win-x64.tgz s3://$PKG_CLI_BUCKET_NAME/$(echo $version)/amplify-pkg-win-x64.tgz
+ aws s3 cp amplify-pkg-macos-x64.tgz s3://$PKG_CLI_BUCKET_NAME/$(echo $version)/amplify-pkg-macos-x64.tgz
+ aws s3 cp amplify-pkg-linux-arm64.tgz s3://$PKG_CLI_BUCKET_NAME/$(echo $version)/amplify-pkg-linux-arm64.tgz
+ aws s3 cp amplify-pkg-linux-x64.tgz s3://$PKG_CLI_BUCKET_NAME/$(echo $version)/amplify-pkg-linux-x64.tgz
+
cd ..
}
@@ -144,10 +139,10 @@ function verifyPkgCli {
fi
}
- verifySinglePkg "amplify-pkg-linux-x64" "amplify-pkg-linux-x64.tgz" $((700 * 1024 * 1024))
- verifySinglePkg "amplify-pkg-macos-x64" "amplify-pkg-macos-x64.tgz" $((700 * 1024 * 1024))
- verifySinglePkg "amplify-pkg-win-x64.exe" "amplify-pkg-win-x64.tgz" $((700 * 1024 * 1024))
- verifySinglePkg "amplify-pkg-linux-arm64" "amplify-pkg-linux-arm64.tgz" $((550 * 1024 * 1024))
+ verifySinglePkg "amplify-pkg-linux-x64" "amplify-pkg-linux-x64.tgz" $((900 * 1024 * 1024))
+ verifySinglePkg "amplify-pkg-macos-x64" "amplify-pkg-macos-x64.tgz" $((900 * 1024 * 1024))
+ verifySinglePkg "amplify-pkg-win-x64.exe" "amplify-pkg-win-x64.tgz" $((890 * 1024 * 1024))
+ verifySinglePkg "amplify-pkg-linux-arm64" "amplify-pkg-linux-arm64.tgz" $((750 * 1024 * 1024))
}
function unsetNpmRegistryUrl {
@@ -236,7 +231,8 @@ function retry {
resetAwsAccountCredentials
TEST_SUITE=${TEST_SUITE:-"TestSuiteNotSet"}
- aws cloudwatch put-metric-data --metric-name FlakyE2ETests --namespace amplify-cli-e2e-tests --unit Count --value $n --dimensions testFile=$TEST_SUITE
+ # if a test takes a long time to complete, the token may expire before reaching this call, but we should still allow the test to pass
+ aws cloudwatch put-metric-data --metric-name FlakyE2ETests --namespace amplify-cli-e2e-tests --unit Count --value $n --dimensions testFile=$TEST_SUITE || true
echo "Attempt $n succeeded."
exit 0 # don't fail the step if putting the metric fails
}
@@ -277,17 +273,6 @@ function setAwsAccountCredentials {
useChildAccountCredentials
fi
}
-function runE2eTest {
- FAILED_TEST_REGEX_FILE="./amplify-e2e-reports/amplify-e2e-failed-test.txt"
-
- if [ -f $FAILED_TEST_REGEX_FILE ]; then
- # read the content of failed tests
- failedTests=$(<$FAILED_TEST_REGEX_FILE)
- yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
- else
- yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
- fi
-}
function runE2eTestCb {
_setupCoverage
@@ -296,9 +281,19 @@ function runE2eTestCb {
if [ -f $FAILED_TEST_REGEX_FILE ]; then
# read the content of failed tests
failedTests=$(<$FAILED_TEST_REGEX_FILE)
- NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
+ if [[ ! -z "$DISABLE_COVERAGE" ]]; then
+ echo Running WITHOUT coverage
+ yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
+ else
+ NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
+ fi
else
- NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
+ if [[ ! -z "$DISABLE_COVERAGE" ]]; then
+ echo Running WITHOUT coverage
+ yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
+ else
+ NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
+ fi
fi
}
@@ -328,7 +323,7 @@ function checkPackageVersionsInLocalNpmRegistry {
if [[ $cli_internal_version != $cli_version ]]; then
echo "Versions did not match."
- echo "Manual fix: add a proper conventional commit that touches the amplify-cli-npm package to correct its version bump. For example https://github.com/aws-amplify/amplify-cli/commit/6f14792d1db424aa428ec4836fed7d6dd5cccfd0"
+ echo "Manual fix: add a proper conventional commit that touches the amplify-cli-npm package to correct its version bump. For example https://github.com/aws-amplify/amplify-cli/pull/13759/commits/15dcd96feae925ff26ca51abfb4a0477890af745"
exit 1
else
echo "Versions matched."
diff --git a/.circleci/publish-codebuild.sh b/.circleci/publish-codebuild.sh
deleted file mode 100755
index ac9464cbf6a..00000000000
--- a/.circleci/publish-codebuild.sh
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/bin/bash -e
-export BRANCH_NAME="$(git symbolic-ref HEAD --short 2>/dev/null)"
-if [ "$BRANCH_NAME" = "" ] ; then
- BRANCH_NAME="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')";
-fi
-git checkout $BRANCH_NAME
-echo "fetching tags"
-git fetch --tags https://github.com/aws-amplify/amplify-cli
-
-# lerna has a bug (https://github.com/lerna/lerna/issues/1066) where failed publishes do not set the exit code properly
-# this causes the script to keep running even after failed publishes
-# this function forces failed publishes to exit on failure
-function lernaPublishExitOnFailure {
- # exit on failure
- set -e
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- # registy URL update changes .yarnrc.yml file
- git update-index --assume-unchanged .yarnrc.yml
- fi
-
- # run lerna publish with the args that were passed to this function
- # duplicate stdout to a temp file
- # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
- npx lerna publish "$@" | tee /tmp/publish-results && grep -qvz "lerna ERR!" < /tmp/publish-results
-}
-
-# verifies that binaries are uploaded and available before publishing to NPM
-function verifyPkgIsAvailable {
- # exit on failure
- set -e
-
- # read version of @aws-amplify/cli
- desiredPkgVersion=$(npx lerna list --scope @aws-amplify/cli --json | jq -r '.[0].version')
-
- # check binaries
- # send HEAD requests to check for binary presence
- # curl --fail exits with non-zero code and makes this script fail
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-linux-x64.tgz
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-linux-arm64.tgz
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-macos-x64.tgz
- curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-win-x64.tgz
-}
-
-if [ -z "$GITHUB_EMAIL" ]; then
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- git config --global user.email not@used.com
- else
- echo "GITHUB_EMAIL email is missing"
- exit 1
- fi
-else
- git config --global user.email $GITHUB_EMAIL
-fi
-
-if [ -z "$GITHUB_USER" ]; then
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- git config --global user.name "Doesnt Matter"
- else
- echo "GITHUB_USER email is missing"
- exit 1
- fi
-else
- git config --global user.name $GITHUB_USER
-fi
-
-if [[ "$BRANCH_NAME" =~ ^tagged-release ]]; then
- if [[ "$BRANCH_NAME" =~ ^tagged-release-without-e2e-tests\/.* ]]; then
- # Remove tagged-release-without-e2e-tests/
- export NPM_TAG="${BRANCH_NAME/tagged-release-without-e2e-tests\//}"
- elif [[ "$BRANCH_NAME" =~ ^tagged-release\/.* ]]; then
- # Remove tagged-release/
- export NPM_TAG="${BRANCH_NAME/tagged-release\//}"
- fi
- if [ -z "$NPM_TAG" ]; then
- echo "Tag name is missing. Name your branch with either tagged-release/ or tagged-release-without-e2e-tests/"
- exit 1
- fi
-
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- echo "Publishing to local registry under latest tag"
- lernaPublishExitOnFailure --exact --preid=$NPM_TAG --conventional-commits --conventional-prerelease --no-push --yes --include-merged-tags
- else
- echo "Publishing to NPM under $NPM_TAG tag"
- lernaPublishExitOnFailure --exact --dist-tag=$NPM_TAG --preid=$NPM_TAG --conventional-commits --conventional-prerelease --message "chore(release): Publish tagged release $NPM_TAG [ci skip]" --yes --include-merged-tags
- fi
-
-# @latest release
-elif [[ "$BRANCH_NAME" == "release" ]]; then
- # create release commit and release tags
- npx lerna version --exact --conventional-commits --conventional-graduate --yes --no-push --include-merged-tags --message "chore(release): Publish latest [ci skip]"
-
- if [[ "$LOCAL_PUBLISH_TO_LATEST" != "true" ]]; then
- # verify that binary has been uploaded
- verifyPkgIsAvailable
- fi
-
- # publish versions that were just computed
- lernaPublishExitOnFailure from-git --yes --no-push
-
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- echo "Published packages to verdaccio"
- echo "Exiting without pushing release commit or release tags"
- exit 0
- fi
-
- # push release commit
- git push origin "$BRANCH_NAME"
-
- # push release tags
- git tag --points-at HEAD | xargs git push origin
-
- # fast forward main to release
- git fetch origin main
- git checkout main
- git merge release --ff-only
- git push origin main
-
- # fast forward hotfix to release
- git fetch origin hotfix
- git checkout hotfix
- git merge release --ff-only
- git push origin hotfix
-
-# release candidate or local publish for testing / building binary
-elif [[ "$BRANCH_NAME" =~ ^run-e2e-with-rc\/.* ]] || [[ "$BRANCH_NAME" =~ ^release_rc\/.* ]] || [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
-
- # force @aws-amplify/cli-internal to be versioned in case this pipeline run does not have any commits that modify the CLI packages
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- force_publish_local_args="--force-publish '@aws-amplify/cli-internal'"
- fi
- # create release commit and release tags
- npx lerna version --preid=rc.$(git rev-parse --short HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish rc [ci skip]" $(echo $force_publish_local_args) --no-commit-hooks
-
-
- # if publishing locally to verdaccio
- if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
- # publish to verdaccio with no dist tag (default to latest)
- lernaPublishExitOnFailure from-git --yes --no-push
- echo "Published packages to verdaccio"
- echo "Exiting without pushing release commit or release tags"
- exit 0
- fi
-
- # verify that binary has been uploaded
- verifyPkgIsAvailable
-
- # publish versions that were just computed
- lernaPublishExitOnFailure from-git --yes --no-push --dist-tag rc
-
- # push release commit
- git push origin "$BRANCH_NAME"
-
- # push release tags
- git tag --points-at HEAD | xargs git push origin
-else
- echo "branch name" "$BRANCH_NAME" "did not match any branch publish rules. Skipping publish"
-fi
diff --git a/.circleci/publish-step-1-set-versions.sh b/.circleci/publish-step-1-set-versions.sh
deleted file mode 100755
index de28db6c363..00000000000
--- a/.circleci/publish-step-1-set-versions.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash -e
-
-git config --global user.name aws-amplify-bot
-git config --global user.email aws@amazon.com
-
-if [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]]; then
- if [[ "$CIRCLE_BRANCH" =~ ^tagged-release-without-e2e-tests\/.* ]]; then
- # Remove tagged-release-without-e2e-tests/
- export NPM_TAG="${CIRCLE_BRANCH/tagged-release-without-e2e-tests\//}"
- elif [[ "$CIRCLE_BRANCH" =~ ^tagged-release\/.* ]]; then
- # Remove tagged-release/
- export NPM_TAG="${CIRCLE_BRANCH/tagged-release\//}"
- fi
- if [ -z "$NPM_TAG" ]; then
- echo "Tag name is missing. Name your branch with either tagged-release/ or tagged-release-without-e2e-tests/"
- exit 1
- fi
-
- npx lerna version --exact --preid=$NPM_TAG --conventional-commits --conventional-prerelease --yes --no-push --include-merged-tags --message "chore(release): Publish tagged release $NPM_TAG [ci skip]" --no-commit-hooks --force-publish '@aws-amplify/cli-internal'
-
-# @latest release
-elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
- # create release commit and release tags
- npx lerna version --exact --conventional-commits --conventional-graduate --yes --no-push --include-merged-tags --message "chore(release): Publish latest [ci skip]" --force-publish '@aws-amplify/cli-internal'
-
-# release candidate or local publish for testing / building binary
-else
- # create release commit and release tags
- npx lerna version --preid=rc.$(git rev-parse --short HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish rc [ci skip]" --no-commit-hooks --force-publish '@aws-amplify/cli-internal'
-fi
diff --git a/.circleci/publish-step-4-push-to-git.sh b/.circleci/publish-step-4-push-to-git.sh
deleted file mode 100755
index 6267d9e4a73..00000000000
--- a/.circleci/publish-step-4-push-to-git.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash -e
-
-git config --global user.name aws-amplify-bot
-git config --global user.email aws@amazon.com
-
-if [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]] || [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^release_rc\/.* ]]; then
- # push release commit
- git push origin "$CIRCLE_BRANCH"
-
- # push release tags
- git tag --points-at HEAD | xargs git push origin
-
-# @latest release
-elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
- # push release commit
- git push origin "$CIRCLE_BRANCH"
-
- # push release tags
- git tag --points-at HEAD | xargs git push origin
-
- # fast forward main to release
- git fetch origin main
- git checkout main
- git merge release --ff-only
- git push origin main
-
- # fast forward hotfix to release
- git fetch origin hotfix
- git checkout hotfix
- git merge release --ff-only
- git push origin hotfix
-else
- echo "branch name" "$CIRCLE_BRANCH" "did not match any branch publish rules."
- exit 1
-fi
diff --git a/.eslint-dictionary.json b/.eslint-dictionary.json
index 4d82a32f832..f6324edd864 100644
--- a/.eslint-dictionary.json
+++ b/.eslint-dictionary.json
@@ -6,6 +6,7 @@
"admingroup",
"adminui",
"aggs",
+ "al2023",
"allowlist",
"alphanumerics",
"amazonaws",
@@ -198,6 +199,7 @@
"igrantable",
"indexable",
"indicies",
+ "Infos",
"integ",
"integtest",
"integtestfn",
@@ -217,6 +219,7 @@
"junit",
"jwks",
"keyless",
+ "keyout",
"keyphrase",
"kinesis",
"lang",
@@ -276,7 +279,9 @@
"openid",
"openpgp",
"opensearch",
+ "openssl",
"orgs",
+ "Parti",
"parens",
"pathname",
"pathnames",
@@ -289,6 +294,7 @@
"pipfile",
"pkill",
"pluggable",
+ "pnpm",
"poller",
"polly",
"positionally",
diff --git a/.eslintrc.js b/.eslintrc.js
index a0dbdce9324..dd8c24c2f82 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -102,22 +102,26 @@ module.exports = {
},
{
// edit rules here to modify test linting
- files: ['__tests__/**', '*.test.ts', '**/amplify-e2e-tests/**'],
- plugins: ['jest'],
- extends: ['plugin:jest/recommended'],
- rules: {
- '@typescript-eslint/unbound-method': 'off',
- 'jest/unbound-method': 'error',
- '@typescript-eslint/no-explicit-any': 'off',
- 'spellcheck/spell-checker': 'off',
+ files: ['**/__tests__/**', '**/__test__/**', '*.test.ts', '**/amplify-e2e-*/**', '**/test/**', '**/tests/**', '**/__e2e__/**'],
+ parserOptions: {
+ project: ['tsconfig.tests.json'],
},
- },
- {
- // disable spell checker in tests
- files: ['**/__tests__/**', '**/__test__/**', '*.test.ts', 'packages/amplify-e2e-*/**', '**/test/**', '**/tests/**'],
- plugins: ['jest'],
- extends: ['plugin:jest/recommended'],
rules: {
+ '@typescript-eslint/ban-ts-comment': 'off',
+ '@typescript-eslint/ban-types': 'off',
+ '@typescript-eslint/no-empty-function': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-inferrable-types': 'off',
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/no-unused-vars': 'error',
+ 'consistent-return': 'error',
+ 'import/no-extraneous-dependencies': 'error',
+ 'no-constant-condition': 'off',
+ 'no-restricted-syntax': 'off',
+ 'no-useless-catch': 'error',
+ 'no-useless-escape': 'off',
+ 'no-var': 'error',
+ 'prefer-const': 'error',
'spellcheck/spell-checker': 'off',
},
},
@@ -132,8 +136,6 @@ module.exports = {
// Files / paths / globs that shouldn't be linted at all
// (note that only .js, .jsx, .ts, and .tsx files are linted in the first place)
ignorePatterns: [
- '**/__tests__/**',
- '**.test.**',
'.eslintrc.js',
'scripts/',
'node_modules',
@@ -142,7 +144,6 @@ module.exports = {
'__mocks__',
'coverage',
'packages/**/lib',
- '**/__e2e__/**',
// Forked package
'amplify-velocity-template',
@@ -207,6 +208,8 @@ module.exports = {
'/packages/amplify-category-custom/src/utils/generate-cfn-from-cdk.ts',
'/packages/amplify-environment-parameters/lib',
'/packages/amplify-opensearch-simulator/lib',
+ '/packages/amplify-nodejs-function-runtime-provider/src/__tests__/utils/handlerWithSyntaxError.js',
+ '/packages/amplify-frontend-ios/tests/sample*',
// Ignore CHANGELOG.md files
'/packages/*/CHANGELOG.md',
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 14c024fc20c..d58d4d29030 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,15 +1,24 @@
-# Amplify CLI Team owns the full repo by default.
-
-* @aws-amplify/amplify-cli
+# Require at least one Amplify CLI Admin to approve changes.
+# Non-admin reviewers participate in pull request review quorum by having write access to repository.
+* @aws-amplify/amplify-cli-admins
# Add Data team folks focused on GQL transform/codegen to ownership for packages which will be migrated, in addition to the existing cli team.
+/packages/amplify-graphiql-explorer @aws-amplify/amplify-cli-admins @aws-amplify/amplify-data-buildtime
+/packages/amplify-velocity-template @aws-amplify/amplify-cli-admins @aws-amplify/amplify-data-buildtime
-/packages/amplify-graphiql-explorer @aws-amplify/amplify-cli @aws-amplify/amplify-data-buildtime
-/packages/amplify-velocity-template @aws-amplify/amplify-cli @aws-amplify/amplify-data-buildtime
-
-# Add folks focused on reviewing changes to CI/CD scripts/buildspecs
+# Add Studio Backend team folks focused on GQL transform/codegen to ownership for packages which will be migrated, in addition to the existing cli team.
+/packages/amplify-migration @aws-amplify/amplify-cli-admins @aws-amplify/amplify-studio-backend-admins
+/packages/amplify-gen2-codegen @aws-amplify/amplify-cli-admins @aws-amplify/amplify-studio-backend-admins
+/packages/amplify-gen1-codegen-auth-adapter @aws-amplify/amplify-cli-admins @aws-amplify/amplify-studio-backend-admins
+/packages/amplify-gen1-codegen-data-adapter @aws-amplify/amplify-cli-admins @aws-amplify/amplify-studio-backend-admins
+/packages/amplify-gen1-codegen-function-adapter @aws-amplify/amplify-cli-admins @aws-amplify/amplify-studio-backend-admins
+/packages/amplify-gen1-codegen-storage-adapter @aws-amplify/amplify-cli-admins @aws-amplify/amplify-studio-backend-admins
-/.circleci/ @aws-amplify/amplify-cli-admins
-/scripts/ @aws-amplify/amplify-cli-admins
-/shared-scripts.sh @aws-amplify/amplify-cli-admins
-/codebuild_specs/ @aws-amplify/amplify-cli-admins
+# Templates with IAM resources
+packages/amplify-provider-awscloudformation/resources/rootStackTemplate.json @aws-amplify/amplify-cli-admins
+packages/amplify-provider-awscloudformation/src/root-stack-builder/root-stack-builder.ts @aws-amplify/amplify-cli-admins
+packages/amplify-provider-awscloudformation/resources/update-idp-roles-cfn.json @aws-amplify/amplify-cli-admins
+packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-user-pool-group-stack-builder.ts @aws-amplify/amplify-cli-admins
+packages/amplify-category-storage/resources/triggers/s3/lambda-cloudformation-template.json.ejs @aws-amplify/amplify-cli-admins
+packages/amplify-category-storage/resources/triggers/dynamoDB/lambda-cloudformation-template.json.ejs @aws-amplify/amplify-cli-admins
+packages/amplify-category-predictions/src/provider-utils/awscloudformation/triggers/s3/lambda-cloudformation-template.json.ejs @aws-amplify/amplify-cli-admins
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index e85986214ca..f3b47305f35 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,4 +1,4 @@
-blank_issues_enabled: true
+blank_issues_enabled: false
contact_links:
- name: I want help writing my Amplify application
url: https://discord.com/invite/amplify
diff --git a/.github/actions/install-cli/action.yml b/.github/actions/install-cli/action.yml
new file mode 100644
index 00000000000..05726839617
--- /dev/null
+++ b/.github/actions/install-cli/action.yml
@@ -0,0 +1,29 @@
+name: Install Amplify CLI
+description: Installs Amplify CLI
+inputs:
+ cli-version:
+ description: a version of Amplify CLI
+ required: true
+runs:
+ using: 'composite'
+ steps:
+ - name: Install CLI
+ shell: bash
+ if: runner.os != 'Windows'
+ run: |
+ npm install -g @aws-amplify/cli@${{ inputs.cli-version }}
+ AMPLIFY_PATH=$(which amplify)
+ echo "AMPLIFY_PATH=$AMPLIFY_PATH"
+ echo "AMPLIFY_PATH=$AMPLIFY_PATH" >> $GITHUB_ENV
+
+ - name: Install CLI Windows
+ shell: powershell
+ if: runner.os == 'Windows'
+ run: |
+ npm install -g @aws-amplify/cli@${{ inputs.cli-version }}
+ # "where.exe" is used instead of "where" to disambiguate
+ # "where" is aliased to "Where-Object" in powershell, i.e. not pointing to the tool we want
+ # "amplify.cmd" is searched because "where.exe amplify" returns ambiguous list
+ $AMPLIFY_PATH=(where.exe amplify.cmd)
+ echo "AMPLIFY_PATH=$AMPLIFY_PATH"
+ "AMPLIFY_PATH=$AMPLIFY_PATH" >> $env:GITHUB_ENV
diff --git a/.github/actions/run-smoke-tests/action.yml b/.github/actions/run-smoke-tests/action.yml
new file mode 100644
index 00000000000..86967074f03
--- /dev/null
+++ b/.github/actions/run-smoke-tests/action.yml
@@ -0,0 +1,76 @@
+name: Run Smoke Tests
+description: Executes Smoke Tests
+inputs:
+ role-to-assume:
+ description: an IAM role to use in tests
+ required: true
+ cli-version:
+ description: version of Amplify CLI
+ required: true
+ region:
+ description: an AWS region to run in
+ required: false
+ default: us-west-2
+runs:
+ using: 'composite'
+ steps:
+ - name: Verify Amplify Path
+ shell: bash
+ run: |
+ if [[ -z "$AMPLIFY_PATH" ]]; then
+ echo "AMPLIFY_PATH must be defined"
+ exit 1
+ fi
+ echo "AMPLIFY_PATH=$AMPLIFY_PATH"
+ $AMPLIFY_PATH version
+
+ - name: Yarn build on Windows
+ shell: bash
+ if: runner.os == 'Windows'
+ run: |
+ cd scripts
+ yarn
+
+ - name: Install Dependencies
+ shell: bash
+ run: yarn install --immutable
+
+ - name: Build
+ shell: bash
+ run: yarn build-tests
+
+ - name: Configure AWS Credentials
+ uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # v3.0.1
+ with:
+ role-to-assume: ${{ inputs.role-to-assume }}
+ aws-region: ${{ inputs.region }}
+
+ # For iOS tests
+ - name: Setup Ruby
+ uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
+ if: runner.os == 'macOS'
+ with:
+ ruby-version: '3.2.1'
+
+ # For iOS tests
+ - name: Set Default Xcode Version
+ if: runner.os == 'macOS'
+ shell: bash
+ run: |
+ sudo xcode-select -s "/Applications/Xcode_14.1.app"
+ xcodebuild -version
+
+ - name: Run Smoke Tests
+ shell: bash
+ run: yarn smoketest -- --forceExit --no-cache --maxWorkers=2
+ env:
+ CLI_REGION: ${{ inputs.region }}
+ CI: true
+ CIRCLECI: true
+
+ - name: Upload Report
+ uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0
+ if: always()
+ with:
+ name: test report ${{ runner.os }} ${{ inputs.cli-version }}
+ path: packages/amplify-e2e-tests/amplify-e2e-reports
diff --git a/.github/workflows/build-test-mac.yml b/.github/workflows/build-test-mac.yml
new file mode 100644
index 00000000000..2cfee07efb0
--- /dev/null
+++ b/.github/workflows/build-test-mac.yml
@@ -0,0 +1,32 @@
+name: Build and Test on Mac
+
+on:
+ push:
+ branches: [dev]
+ pull_request:
+
+env:
+ NODE_OPTIONS: --max-old-space-size=8096
+
+jobs:
+ build-and-test:
+ runs-on: macos-latest-xl
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+ with:
+ persist-credentials: false
+
+ - name: Install Python
+ uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
+ with:
+ python-version: '3.11'
+
+ - name: Install Dependencies
+ run: yarn install
+
+ - name: Build
+ run: yarn build
+
+ - name: Test
+ run: yarn test-ci
diff --git a/.github/workflows/closed-issue-message.yml b/.github/workflows/closed-issue-message.yml
index b96fff9a4e7..8cb2db494c8 100644
--- a/.github/workflows/closed-issue-message.yml
+++ b/.github/workflows/closed-issue-message.yml
@@ -11,7 +11,5 @@ jobs:
# These inputs are both required
repo-token: '${{ secrets.GITHUB_TOKEN }}'
message: |
- ### ⚠️COMMENT VISIBILITY WARNING⚠️
- Comments on closed issues are hard for our team to see.
+ This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
- If you wish to keep having a conversation with other community members under this issue feel free to do so.
diff --git a/.github/workflows/codeql-tests.yaml b/.github/workflows/codeql-tests.yaml
index 2ad62442d0c..db013bda13a 100644
--- a/.github/workflows/codeql-tests.yaml
+++ b/.github/workflows/codeql-tests.yaml
@@ -3,6 +3,7 @@ name: 'CodeQL Tests'
on:
push:
+ branches: [dev]
pull_request:
jobs:
diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml
index e722670c467..4fcb4435b0b 100644
--- a/.github/workflows/codeql.yaml
+++ b/.github/workflows/codeql.yaml
@@ -3,6 +3,7 @@ name: 'CodeQL'
on:
push:
+ branches: [dev]
pull_request:
jobs:
diff --git a/.github/workflows/smoke-tests-canaries.yml b/.github/workflows/smoke-tests-canaries.yml
new file mode 100644
index 00000000000..c701bff8bc1
--- /dev/null
+++ b/.github/workflows/smoke-tests-canaries.yml
@@ -0,0 +1,17 @@
+name: Smoke Tests - Canaries
+
+# This is required by aws-actions/configure-aws-credentials
+permissions:
+ id-token: write
+ contents: read
+
+on:
+ schedule:
+ - cron: '0 16 * * *' # Everyday 16:00 UTC
+
+jobs:
+ call-smoke-tests:
+ uses: ./.github/workflows/smoke-tests.yml
+ secrets: inherit
+ with:
+ versions: '["rc", "latest"]'
diff --git a/.github/workflows/smoke-tests-manual.yml b/.github/workflows/smoke-tests-manual.yml
new file mode 100644
index 00000000000..534a7d8b3f6
--- /dev/null
+++ b/.github/workflows/smoke-tests-manual.yml
@@ -0,0 +1,27 @@
+name: Smoke Tests - Manual Run
+
+# This is required by aws-actions/configure-aws-credentials
+permissions:
+ id-token: write
+ contents: read
+
+on:
+ workflow_dispatch:
+ inputs:
+ os:
+ required: false
+ type: string
+ default: '["macos-latest-xl", "ubuntu-latest", "amplify-cli_windows-latest_8-core"]'
+ versions:
+ required: false
+ type: string
+ default: '["rc", "latest"]'
+
+jobs:
+ call-smoke-tests:
+ if: github.event_name == 'workflow_dispatch'
+ uses: ./.github/workflows/smoke-tests.yml
+ secrets: inherit
+ with:
+ os: ${{ github.event.inputs.os }}
+ versions: ${{ github.event.inputs.versions }}
diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml
new file mode 100644
index 00000000000..73235ea41a7
--- /dev/null
+++ b/.github/workflows/smoke-tests.yml
@@ -0,0 +1,60 @@
+name: Smoke Tests
+
+# This is required by aws-actions/configure-aws-credentials
+permissions:
+ id-token: write
+ contents: read
+
+on:
+ workflow_call:
+ inputs:
+ os:
+ required: false
+ type: string
+ default: '["macos-latest-xl", "ubuntu-latest", "amplify-cli_windows-latest_8-core"]'
+ versions:
+ required: false
+ type: string
+ default: '["rc", "latest"]'
+
+env:
+ NODE_OPTIONS: --max-old-space-size=8096
+ IS_AMPLIFY_CLI_SMOKE_TEST_RUN: true
+
+jobs:
+ run-smoke-tests:
+ strategy:
+ fail-fast: false
+ matrix:
+ os: ${{ fromJson(inputs.os) }}
+ cli-version: ${{ fromJson(inputs.versions) }}
+ name: Smoke Tests ${{ matrix.os }} ${{ matrix.cli-version }}
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+ with:
+ persist-credentials: false
+
+ - name: Install Python
+ uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
+ with:
+ python-version: '3.11'
+
+ - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # version 4.0.2
+ if: runner.os == 'Windows'
+ with:
+ # Pin node to version before 18.20.2 due to https://github.com/nodejs/node/issues/52554
+ # Amplify App tries to spawn npm.cmd here https://github.com/aws-amplify/amplify-cli/blob/9571383521e6536ecf6568876609654393b27abb/packages/amplify-app/src/index.js#L88-L93
+ node-version: 18.20.0
+
+ - name: Install Amplify CLI
+ uses: ./.github/actions/install-cli
+ with:
+ cli-version: ${{ matrix.cli-version }}
+
+ - name: Run Smoke Tests
+ uses: ./.github/actions/run-smoke-tests
+ with:
+ role-to-assume: ${{ secrets.SMOKE_TESTS_ROLE_ARN }}
+ cli-version: ${{ matrix.cli-version }}
diff --git a/.gitignore b/.gitignore
index 8427f0d97f6..08c73d3f33c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@
!.yarn/sdks
!.yarn/versions
**/.DS_Store
-.circleci/generated_config.yml
scripts/cci-job.data.json
scripts/cci-test.data.json
scripts/.yarn/*
@@ -22,9 +21,8 @@ node_modules
out
pkg/node_modules
pkg/yarn.lock
-lerna-debug.log
-npm-debug.log
-yarn-error.log
+*.log
+logs
coverage
.nyc_output
.env
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100755
index 00000000000..64e5241314b
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,11 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+# Define color variables
+GREEN='\033[0;32m'
+CYAN='\033[0;36m'
+NC='\033[0m' # No color
+
+echo "${GREEN}Running commit-msg hook${NC}"
+echo "${CYAN}Running npx --no -- commitlint --edit $1${NC}"
+npx --no -- commitlint --edit "$1"
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000000..0b8e574c8fa
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+# Define color variables
+GREEN='\033[0;32m'
+CYAN='\033[0;36m'
+NC='\033[0m' # No color
+
+echo "${GREEN}Running pre-commit hook${NC}"
+echo "${CYAN}Running yarn prettier staged files${NC}"
+git diff --name-only --cached --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' | xargs --no-run-if-empty yarn prettier --write
+echo "${CYAN}Running yarn lint-staged${NC}"
+yarn lint-fix
+echo "${CYAN}Running yarn stage prettified files${NC}"
+git diff --name-only --cached --diff-filter=ACM | xargs git add
+echo "${CYAN}Running yarn lint-fix${NC}"
+yarn lint-fix
+echo "${CYAN}Running ./scripts/package-json-check.sh${NC}"
+./scripts/package-json-check.sh
+echo "${CYAN}Running yarn verify-commit${NC}"
+yarn verify-commit
diff --git a/.husky/pre-push b/.husky/pre-push
new file mode 100755
index 00000000000..9af535e1b0b
--- /dev/null
+++ b/.husky/pre-push
@@ -0,0 +1,11 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+# Define color variables
+GREEN='\033[0;32m'
+CYAN='\033[0;36m'
+NC='\033[0m' # No color
+
+echo "${GREEN}Running pre-push hook${NC}"
+echo "${CYAN}Running yarn build-tests-changed"
+yarn build-tests-changed
diff --git a/.prettierignore b/.prettierignore
index b8849d7c2b7..743cc738d61 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,4 +1,6 @@
.yarn
+.prettierignore
+yarn.lock
packages/*/build
packages/*/lib
coverage
@@ -12,6 +14,12 @@ packages/amplify-cli-core/src/__tests__/testFiles/packageManager-npm/package-loc
packages/amplify-cli-core/src/__tests__/testFiles/testProject-initialize-json-error/amplify/cli.json
packages/amplify-e2e-core/dist/index.html
packages/amplify-e2e-tests/amplify-e2e-reports
+packages/amplify-e2e-tests/resources/example-ios-app
packages/amplify-environment-parameters/src/schemas/BackendParameters.schema.json
packages/amplify-nodejs-function-runtime-provider/src/__tests__/utils/handlerWithSyntaxError.js
packages/amplify-velocity-template/src/parse/velocity.yy
+packages/amplify-frontend-ios/tests/sample**
+
+# Exceptions:
+!packages/amplify-category-hosting/lib
+!packages/amplify-frontend-*/lib
diff --git a/.vscode/settings.json b/.vscode/settings.json
index b73ffcb1952..e98ca2b2966 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -20,6 +20,6 @@
"**/.pnp.*": true
},
"typescript.enablePromptUseWorkspaceTsdk": true,
- "prettier.prettierPath": "../node_modules/prettier",
+ "prettier.prettierPath": "./node_modules/prettier",
"jest.jestCommandLine": "./node_modules/.bin/jest"
}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b4d1ee2ddd1..84e15eae2ee 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -47,8 +47,6 @@ This section should get you running with **Amplify CLI** and get you familiar wi
npm install --global yarn
```
- > If you are using Yarn v2, run `yarn set version classic` to change to Yarn Classic.
-
> Ensure that `.bin` directory is added to your PATH. For example, add `export PATH=":$PATH"` to your shell profile file on Linux or macOS.
2. Ensure you have [Java](https://aws.amazon.com/corretto/) installed and `java` command is available in your system. This is required for DynamoDB emulator.
@@ -78,13 +76,23 @@ This section should get you running with **Amplify CLI** and get you familiar wi
```sh
# Linux / macOS
- yarn setup-dev
+ yarn && yarn setup-dev
# Windows
- yarn setup-dev-win
- ## Must be run in Powershell
+ yarn && yarn setup-dev-win
+ ## Preferably run in Git Bash
```
+ ### Additional Instructions for Windows Users:
+
+ Prior to running the `setup-dev` script:
+
+ 1. Install the Visual C++ Build Environment by installing Visual Studio Community Edition. When selecting options, only 'Desktop Development for C++' needs to be added.
+ 2. Open a terminal window/command prompt and run `npm config edit` and add or modify `msvs_version` setting to be your version of Visual Studio (e.g. `msvs_version=22`)
+ 3. If you run into the build error 'MSB8040: Spectre-mitigated libraries are required for this project' open the Visual Studio installer, press the 'Modify' button for your version of Visual Studio, then navigate to the 'Individual Components' and search for 'Spectre'. Install options that look like "MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)", you should only need the x86-64 version, but can optionally install versions for ARM and ARM64/ARM64EC.
+ 4. Go back to the terminal window/command prompt and navigate to the 'amplify-cli' folder and run `yarn clean cache --all`
+ 5. You should now be ready to run the `setup-dev` script
+
> NOTE: Make sure to always [sync your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) with _dev_ branch of amplify-cli
### Architecture of the codebase
@@ -123,9 +131,10 @@ If the change is a breaking change ([as defined by semantic versioning](https://
1. Within your local fork, create a new branch based on the issue you're addressing - e.g. `git checkout -b category-auth/admin-auth-support`
- Use grouping tokens at the beginning of the branch names. For e.g, if you are working on changes specific to `amplify-category-auth`, then you could start the branch name as `category-auth/...`
- Use slashes to separate parts of branch names
+1. Before your first commit, install [git-secrets plugin](https://github.com/awslabs/git-secrets#installing-git-secrets)
1. Once your work is committed and you're ready to share, run `yarn test`. Manually test your changes in a sample app with different edge cases and also test across different platforms if possible.
1. Run `yarn lint-fix` to find and fix any linting errors
-1. Run `yarn prettify:changes` to fix styling issues
+1. Run `yarn prettier-changes` to fix styling issues
1. Then, push your branch: `git push origin HEAD` (pushes the current branch to origin remote)
1. Open GitHub to create a PR from your newly published branch. Fill out the PR template and submit a PR.
1. Finally, the Amplify CLI team will review your PR. Add reviewers based on the core member who is tracking the issue with you or code owners. _In the meantime, address any automated check that fail (such as linting, unit tests, etc. in CI)_
@@ -172,17 +181,7 @@ Valid commit types are as follows:
### Git Hooks
-You will notice the extra actions carried out when you run the `git commit` or `git push` commands on this monorepo, that's because the following git hooks are configured using [husky](https://github.com/typicode/husky/tree/main) (you can see them in the root [package.json](https://github.com/aws-amplify/amplify-cli/blob/f2ac2b27b6b0dbf0c52edbc696c35b71f539c944/package.json#L61) file):
-
-```json
-"husky": {
- "hooks": {
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
- "pre-push": "yarn verify-api-extract && yarn build-tests-changed && yarn split-e2e-tests",
- "pre-commit": "yarn verify-commit"
- }
-}
-```
+You will notice the extra actions carried out when you run the `git commit` or `git push` commands on this monorepo, that's because the following git hooks are configured using [husky](https://github.com/typicode/husky/tree/main) (you can see them in [.husky](.husky) file):
> NOTE: To ensure those git hooks properly execute, run `yarn` or `npm install` at the root of this monorepo to install the necessary dev dependency packages.
diff --git a/Readme.md b/Readme.md
index 937a652d97c..04cb431843e 100644
--- a/Readme.md
+++ b/Readme.md
@@ -9,9 +9,6 @@
-
-
-
### Reporting Bugs/Feature Requests
@@ -20,7 +17,17 @@
[![Feature Requests](https://img.shields.io/github/issues/aws-amplify/amplify-cli/feature-request?color=ff9001&label=feature%20requests)](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+label%3Afeature-request+is%3Aopen)
[![Closed Issues](https://img.shields.io/github/issues-closed/aws-amplify/amplify-cli?color=%2325CC00&label=issues%20closed)](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+is%3Aclosed+)
-# AWS Amplify CLI
+> [!Important]
+>
+> # Amplify Gen 2 is now generally available
+>
+> If you are starting a new project, we recommend starting with [Amplify Gen 2](https://github.com/aws-amplify/amplify-backend).
+>
+> If you are an existing Gen 1 customer, we recommend that you continue working with your Gen 1 Amplify project. We are actively developing migration tooling to aid in transitioning your project from Gen 1 to Gen 2. We remain committed to supporting both Gen 1 and Gen 2 for the foreseeable future.
+>
+> Customers on Gen 1 will continue to receive support for high-priority bugs and essential security updates.
+
+# AWS Amplify CLI (Gen 1)
The AWS Amplify CLI is a toolchain which includes a robust feature set for simplifying mobile and web application development. The CLI uses AWS CloudFormation and nested stacks to allow you to add or modify configurations locally before you push them for execution in your account.
@@ -42,13 +49,6 @@ $ npm install -g @aws-amplify/cli
$ amplify configure
```
-**_Note_**: If you're having permission issues on your system installing the CLI, please try the following command:
-
-```bash
-$ sudo npm install -g @aws-amplify/cli --unsafe-perm=true
-$ amplify configure
-```
-
## Commands Summary
The Amplify CLI supports the commands shown in the following table.
diff --git a/codebuild_specs/aggregate_e2e_reports.yml b/codebuild_specs/aggregate_e2e_reports.yml
index e0e1e428477..5b47fe24fee 100644
--- a/codebuild_specs/aggregate_e2e_reports.yml
+++ b/codebuild_specs/aggregate_e2e_reports.yml
@@ -7,12 +7,16 @@ phases:
- cd ./scripts
- npm install -g ts-node
- npm install aws-sdk
- - ts-node ./wait-for-all-codebuild.ts $CODEBUILD_RESOLVED_SOURCE_VERSION ../$WAIT_FOR_IDS_FILE_PATH AmplifyCLI-E2E-Testing
+ - ts-node ./wait-for-all-codebuild.ts $CODEBUILD_RESOLVED_SOURCE_VERSION ../$WAIT_FOR_IDS_FILE_PATH $PROJECT_NAME $CODEBUILD_WEBHOOK_TRIGGER
- cd ..
- source ./shared-scripts.sh && _downloadReportsFromS3 $CODEBUILD_SOURCE_VERSION
+ - mkdir artifacts && echo "empty artifact" > artifacts/empty-artifact.txt
reports:
e2e-reports:
files:
- '*.xml'
file-format: 'JUNITXML'
base-directory: '$CODEBUILD_SRC_DIR/aggregate_reports'
+artifacts:
+ files:
+ - 'artifacts/*'
diff --git a/codebuild_specs/migration_tests_v10.yml b/codebuild_specs/amplify_console_integration_tests.yml
similarity index 61%
rename from codebuild_specs/migration_tests_v10.yml
rename to codebuild_specs/amplify_console_integration_tests.yml
index 83501f0e397..4978cf3fe3e 100644
--- a/codebuild_specs/migration_tests_v10.yml
+++ b/codebuild_specs/amplify_console_integration_tests.yml
@@ -1,10 +1,12 @@
version: 0.2
env:
shell: bash
- compute-type: BUILD_GENERAL1_SMALL
variables:
+ E2E_TEST_COVERAGE_DIR: node_v8_coverage
CI: true
CIRCLECI: true
+ IS_AMPLIFY_CI: true
+ CLI_REGION: us-east-1
# mock values to test artifact scanning
ENV_VAR_WITH_SECRETS: 'MOCK_ENV_VAR_FOR_SCANNING_SECRETS'
MOCK_ENV_VAR_FOR_SCANNING_SECRETS: 'abc123xyz'
@@ -24,23 +26,18 @@ env:
phases:
build:
commands:
- # you can provide a codebuild source version to use old cache and skip all other jobs :)
- - export NODE_OPTIONS=--max-old-space-size=8096
- - export AMPLIFY_DIR=$CODEBUILD_SRC_DIR/out
- - export AMPLIFY_PATH=$HOME/.amplify/bin/amplify
- - echo $AMPLIFY_DIR
- - echo $AMPLIFY_PATH
- - source ./shared-scripts.sh && _runMigrationV10Test
+ - source ./shared-scripts.sh && _amplifyConsoleIntegrationTests
post_build:
commands:
- source ./shared-scripts.sh && _scanArtifacts
- - source ./shared-scripts.sh && _uploadReportsToS3 $CODEBUILD_SOURCE_VERSION $CODEBUILD_BATCH_BUILD_IDENTIFIER amplify-migration-tests
+
+artifacts:
+ files:
+ - console-integration-reports/*
+ base-directory: packages/amplify-console-integration-tests/
reports:
e2e-reports:
files:
- '*.xml'
file-format: 'JUNITXML'
- base-directory: '$CODEBUILD_SRC_DIR/packages/amplify-migration-tests/reports/junit'
-artifacts:
- files:
- - $CODEBUILD_SRC_DIR/packages/amplify-migration-tests/amplify-migration-reports/*
+ base-directory: '$CODEBUILD_SRC_DIR/packages/amplify-console-integration-tests/reports/junit'
diff --git a/codebuild_specs/amplify_general_config_tests.yml b/codebuild_specs/amplify_general_config_tests.yml
new file mode 100644
index 00000000000..4b6b4006ae6
--- /dev/null
+++ b/codebuild_specs/amplify_general_config_tests.yml
@@ -0,0 +1,15 @@
+version: 0.2
+env:
+ shell: bash
+ variables:
+ E2E_TEST_COVERAGE_DIR: node_v8_coverage
+ CI: true
+ CIRCLECI: true
+ CLI_REGION: us-east-1
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _amplifyGeneralConfigTests
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/amplify_install_test.yml b/codebuild_specs/amplify_install_test.yml
new file mode 100644
index 00000000000..dcdb663a6c7
--- /dev/null
+++ b/codebuild_specs/amplify_install_test.yml
@@ -0,0 +1,22 @@
+version: 0.2
+env:
+ shell: bash
+ variables:
+ E2E_TEST_COVERAGE_DIR: node_v8_coverage
+ CI: true
+ CIRCLECI: true
+ IS_AMPLIFY_CI: true
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _amplifyInstallTestSetup
+ # limit memory for new processes to 1GB
+ # this is to make sure that install can work on small VMs
+ # i.e. not buffer content in memory while installing binary
+ - ulimit -Sv 1000000
+ - npm install -g @aws-amplify/cli
+ - source .circleci/local_publish_helpers_codebuild.sh && unsetNpmRegistryUrl
+ - amplify version
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/amplify_sudo_install_test.yml b/codebuild_specs/amplify_sudo_install_test.yml
new file mode 100644
index 00000000000..43756b5c2d5
--- /dev/null
+++ b/codebuild_specs/amplify_sudo_install_test.yml
@@ -0,0 +1,18 @@
+version: 0.2
+env:
+ shell: bash
+ variables:
+ E2E_TEST_COVERAGE_DIR: node_v8_coverage
+ CI: true
+ CIRCLECI: true
+ IS_AMPLIFY_CI: true
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _amplifySudoInstallTestSetup
+ - sudo npm install -g @aws-amplify/cli
+ - source .circleci/local_publish_helpers_codebuild.sh && unsetSudoNpmRegistryUrl
+ # - amplify version
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/build_linux.yml b/codebuild_specs/build_linux.yml
index 273b055f828..c178e9912a8 100644
--- a/codebuild_specs/build_linux.yml
+++ b/codebuild_specs/build_linux.yml
@@ -4,6 +4,7 @@ env:
phases:
build:
commands:
+ - ./.circleci/codebuild-checkout.sh
- source ./shared-scripts.sh && _buildLinux
artifacts:
diff --git a/codebuild_specs/build_tests_standalone.yml b/codebuild_specs/build_tests_standalone.yml
new file mode 100644
index 00000000000..6953e269e4e
--- /dev/null
+++ b/codebuild_specs/build_tests_standalone.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - echo "Build Tests Standalone"
+ - source ./shared-scripts.sh && _buildTestsStandalone
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/build_windows.yml b/codebuild_specs/build_windows.yml
index 3ca802dbd32..105cedf9655 100644
--- a/codebuild_specs/build_windows.yml
+++ b/codebuild_specs/build_windows.yml
@@ -6,7 +6,6 @@ phases:
commands:
- cd scripts
- yarn
- - yarn ts-node remove-pkg-fetch-checksum.ts
- cd ..
- yarn --immutable
- yarn production-build
diff --git a/codebuild_specs/cleanup_resources.yml b/codebuild_specs/cleanup_resources.yml
index c9249fc7446..d9d143c3410 100644
--- a/codebuild_specs/cleanup_resources.yml
+++ b/codebuild_specs/cleanup_resources.yml
@@ -4,4 +4,8 @@ env:
phases:
build:
commands:
- - echo cleanup running
+ - npm install -g ts-node
+ - source ./shared-scripts.sh && _cleanUpResources
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/deployment_verification_post_release.yml b/codebuild_specs/deployment_verification_post_release.yml
new file mode 100644
index 00000000000..dddebba497d
--- /dev/null
+++ b/codebuild_specs/deployment_verification_post_release.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _deploymentVerificationPostRelease
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/deployment_verification_rc_or_tagged.yml b/codebuild_specs/deployment_verification_rc_or_tagged.yml
new file mode 100644
index 00000000000..59135009e72
--- /dev/null
+++ b/codebuild_specs/deployment_verification_rc_or_tagged.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _deploymentVerificationRCOrTagged
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml
index 8710be0fc06..a6f2b52c5b6 100644
--- a/codebuild_specs/e2e_workflow.yml
+++ b/codebuild_specs/e2e_workflow.yml
@@ -26,73 +26,88 @@ batch:
image: $WINDOWS_IMAGE_2019
- identifier: test
buildspec: codebuild_specs/test.yml
+ depend-on:
+ - build_linux
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: lint
+ buildspec: codebuild_specs/lint.yml
depend-on:
- build_linux
- - identifier: mock_e2e_tests
- buildspec: codebuild_specs/mock_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: mock_e2e_tests
+ buildspec: codebuild_specs/mock_e2e_tests.yml
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: validate_cdk_version
buildspec: codebuild_specs/validate_cdk_version.yml
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: codebuild_specs/verify_api_extract.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_yarn_lock
buildspec: codebuild_specs/verify_yarn_lock.yml
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: codebuild_specs/publish_to_local_registry.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
- - identifier: build_pkg_binaries_arm
- buildspec: codebuild_specs/build_pkg_binaries_arm.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_linux
- buildspec: codebuild_specs/build_pkg_binaries_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_macos
- buildspec: codebuild_specs/build_pkg_binaries_macos.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_win
- buildspec: codebuild_specs/build_pkg_binaries_win.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
depend-on:
- publish_to_local_registry
- - identifier: upload_pkg_binaries
- buildspec: codebuild_specs/upload_pkg_binaries.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: upb
+ buildspec: codebuild_specs/upload_pkg_binaries.yml
depend-on:
- build_pkg_binaries_arm
- build_pkg_binaries_linux
- build_pkg_binaries_macos
- build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_versions_match
buildspec: codebuild_specs/verify_versions_match.yml
depend-on:
- publish_to_local_registry
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: run_e2e_tests_linux
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
@@ -102,7 +117,7 @@ batch:
TEST_SUITE: src/__tests__/auth_2a.test.ts|src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts
debug-session: true
depend-on:
- - upload_pkg_binaries
+ - upb
- identifier: run_e2e_tests_linux_2
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
@@ -112,7 +127,7 @@ batch:
TEST_SUITE: src/__tests__/auth_2f.test.ts
debug-session: true
depend-on:
- - upload_pkg_binaries
+ - upb
- identifier: run_coverage_linux
buildspec: codebuild_specs/run_coverage_linux.yml
env:
@@ -132,14 +147,31 @@ batch:
TEST_SUITE: src/__tests__/auth_2a.test.ts|src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts|src/__tests__/auth_2f.test.ts
depend-on:
- build_windows
- - upload_pkg_binaries
+ - upb
- identifier: integration_test
buildspec: codebuild_specs/integration_test.yml
+ depend-on:
+ - build_linux
env:
compute-type: BUILD_GENERAL1_LARGE
- debug-session: true
+ - identifier: amplify_sudo_install_test
+ buildspec: codebuild_specs/amplify_sudo_install_test.yml
+ env:
+ compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- - build_linux
+ - upb
+ - identifier: amplify_install_test
+ buildspec: codebuild_specs/amplify_install_test.yml
+ env:
+ compute-type: BUILD_GENERAL1_MEDIUM
+ depend-on:
+ - upb
+ - identifier: amplify_console_integration_tests
+ buildspec: codebuild_specs/amplify_console_integration_tests.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - upb
- identifier: aggregate_e2e_reports
buildspec: codebuild_specs/aggregate_e2e_reports.yml
env:
@@ -148,4 +180,4 @@ batch:
WAIT_FOR_IDS_FILE_PATH: ./codebuild_specs/wait_for_ids_local.json
debug-session: true
depend-on:
- - upload_pkg_binaries
+ - upb
diff --git a/codebuild_specs/e2e_workflow_base.yml b/codebuild_specs/e2e_workflow_base.yml
index e24facb8c51..5d1e46626b1 100644
--- a/codebuild_specs/e2e_workflow_base.yml
+++ b/codebuild_specs/e2e_workflow_base.yml
@@ -6,14 +6,16 @@ env:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
CDK_DEFAULT_REGION: us-east-1
- CLI_REGION: us-east-1
- TEST_SUITE: src/__tests__/auth_2b.test.ts
AMPLIFY_DIR: '$CODEBUILD_SRC_DIR/out'
AMPLIFY_PATH: '$CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64'
batch:
fast-fail: false
build-graph:
+ - identifier: build_tests_standalone
+ buildspec: codebuild_specs/build_tests_standalone.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: build_linux
buildspec: codebuild_specs/build_linux.yml
env:
@@ -26,70 +28,115 @@ batch:
image: $WINDOWS_IMAGE_2019
- identifier: test
buildspec: codebuild_specs/test.yml
+ depend-on:
+ - build_linux
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: lint
+ buildspec: codebuild_specs/lint.yml
depend-on:
- build_linux
- - identifier: mock_e2e_tests
- buildspec: codebuild_specs/mock_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: mock_e2e_tests
+ buildspec: codebuild_specs/mock_e2e_tests.yml
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: validate_cdk_version
buildspec: codebuild_specs/validate_cdk_version.yml
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: codebuild_specs/verify_api_extract.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_yarn_lock
buildspec: codebuild_specs/verify_yarn_lock.yml
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: codebuild_specs/publish_to_local_registry.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
- - identifier: build_pkg_binaries_arm
- buildspec: codebuild_specs/build_pkg_binaries_arm.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_linux
- buildspec: codebuild_specs/build_pkg_binaries_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_macos
- buildspec: codebuild_specs/build_pkg_binaries_macos.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_win
- buildspec: codebuild_specs/build_pkg_binaries_win.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
depend-on:
- publish_to_local_registry
- - identifier: upb
- buildspec: codebuild_specs/upload_pkg_binaries.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: upb
+ buildspec: codebuild_specs/upload_pkg_binaries.yml
depend-on:
- build_pkg_binaries_arm
- build_pkg_binaries_linux
- build_pkg_binaries_macos
- build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_versions_match
buildspec: codebuild_specs/verify_versions_match.yml
depend-on:
- publish_to_local_registry
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: integration_test
+ buildspec: codebuild_specs/integration_test.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: amplify_sudo_install_test
+ buildspec: codebuild_specs/amplify_sudo_install_test.yml
+ depend-on:
+ - upb
+ - identifier: amplify_install_test
+ buildspec: codebuild_specs/amplify_install_test.yml
+ depend-on:
+ - upb
+ - identifier: amplify_console_integration_tests
+ buildspec: codebuild_specs/amplify_console_integration_tests.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - upb
+ - identifier: amplify_general_config_tests
+ buildspec: codebuild_specs/amplify_general_config_tests.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - upb
+ - identifier: cleanup_resources
+ buildspec: codebuild_specs/cleanup_resources.yml
+ depend-on:
+ - aggregate_e2e_reports
diff --git a/codebuild_specs/e2e_workflow_generated.yml b/codebuild_specs/e2e_workflow_generated.yml
index 49aa41278bd..e3d6a0179ec 100644
--- a/codebuild_specs/e2e_workflow_generated.yml
+++ b/codebuild_specs/e2e_workflow_generated.yml
@@ -7,13 +7,15 @@ env:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
CDK_DEFAULT_REGION: us-east-1
- CLI_REGION: us-east-1
- TEST_SUITE: src/__tests__/auth_2b.test.ts
AMPLIFY_DIR: $CODEBUILD_SRC_DIR/out
AMPLIFY_PATH: $CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64
batch:
fast-fail: false
build-graph:
+ - identifier: build_tests_standalone
+ buildspec: codebuild_specs/build_tests_standalone.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: build_linux
buildspec: codebuild_specs/build_linux.yml
env:
@@ -26,791 +28,996 @@ batch:
image: $WINDOWS_IMAGE_2019
- identifier: test
buildspec: codebuild_specs/test.yml
+ depend-on:
+ - build_linux
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: lint
+ buildspec: codebuild_specs/lint.yml
depend-on:
- build_linux
- - identifier: mock_e2e_tests
- buildspec: codebuild_specs/mock_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: mock_e2e_tests
+ buildspec: codebuild_specs/mock_e2e_tests.yml
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: validate_cdk_version
buildspec: codebuild_specs/validate_cdk_version.yml
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: codebuild_specs/verify_api_extract.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_yarn_lock
buildspec: codebuild_specs/verify_yarn_lock.yml
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: codebuild_specs/publish_to_local_registry.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
- - identifier: build_pkg_binaries_arm
- buildspec: codebuild_specs/build_pkg_binaries_arm.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_linux
- buildspec: codebuild_specs/build_pkg_binaries_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_macos
- buildspec: codebuild_specs/build_pkg_binaries_macos.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_win
- buildspec: codebuild_specs/build_pkg_binaries_win.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
depend-on:
- publish_to_local_registry
- - identifier: upb
- buildspec: codebuild_specs/upload_pkg_binaries.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: upb
+ buildspec: codebuild_specs/upload_pkg_binaries.yml
depend-on:
- build_pkg_binaries_arm
- build_pkg_binaries_linux
- build_pkg_binaries_macos
- build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_versions_match
buildspec: codebuild_specs/verify_versions_match.yml
depend-on:
- publish_to_local_registry
- - identifier: l_datastore_modelgen_amplify_app_diagnose_hooks_a
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: integration_test
+ buildspec: codebuild_specs/integration_test.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: amplify_sudo_install_test
+ buildspec: codebuild_specs/amplify_sudo_install_test.yml
+ depend-on:
+ - upb
+ - identifier: amplify_install_test
+ buildspec: codebuild_specs/amplify_install_test.yml
+ depend-on:
+ - upb
+ - identifier: amplify_console_integration_tests
+ buildspec: codebuild_specs/amplify_console_integration_tests.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - upb
+ - identifier: amplify_general_config_tests
+ buildspec: codebuild_specs/amplify_general_config_tests.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - upb
+ - identifier: cleanup_resources
+ buildspec: codebuild_specs/cleanup_resources.yml
+ depend-on:
+ - aggregate_e2e_reports
+ - identifier: l_diagnose_hooks_a_mock_api
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/datastore-modelgen.test.ts|src/__tests__/amplify-app.test.ts|src/__tests__/diagnose.test.ts|src/__tests__/hooks-a.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/diagnose.test.ts|src/__tests__/hooks-a.test.ts|src/__tests__/mock-api.test.ts
depend-on:
- upb
- - identifier: l_mock_api_analytics_kinesis_analytics_pinpoint_flutter_analytics_pinpoint_js
+ - identifier: l_analytics_kinesis_analytics_pinpoint_flutter_analytics_pinpoint_js
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/mock-api.test.ts|src/__tests__/analytics-kinesis.test.ts|src/__tests__/analytics-pinpoint-flutter.test.ts|src/__tests__/analytics-pinpoint-js.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/analytics-kinesis.test.ts|src/__tests__/analytics-pinpoint-flutter.test.ts|src/__tests__/analytics-pinpoint-js.test.ts
depend-on:
- upb
- - identifier: l_auth_2a_auth_2b_auth_2d_auth_2f
+ - identifier: l_auth_2a_auth_2b_auth_2d
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_2a.test.ts|src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts|src/__tests__/auth_2f.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/auth_2a.test.ts|src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts
depend-on:
- upb
- - identifier: l_notifications_lifecycle_uibuilder_notifications_analytics_compatibility_in_app_1_notifications_analytics_compatibility_sms_2
+ - identifier: l_auth_2f_notifications_lifecycle_notifications_analytics_compatibility_in_app_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/notifications-lifecycle.test.ts|src/__tests__/uibuilder.test.ts|src/__tests__/notifications-analytics-compatibility-in-app-1.test.ts|src/__tests__/notifications-analytics-compatibility-sms-2.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/auth_2f.test.ts|src/__tests__/notifications-lifecycle.test.ts|src/__tests__/notifications-analytics-compatibility-in-app-1.test.ts
depend-on:
- upb
- - identifier: l_analytics_2_global_sandbox_c_hooks_b_notifications_analytics_compatibility_sms_1
+ - identifier: l_notifications_analytics_compatibility_sms_2_analytics_2_global_sandbox_c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/analytics-2.test.ts|src/__tests__/global_sandbox-c.test.ts|src/__tests__/hooks-b.test.ts|src/__tests__/notifications-analytics-compatibility-sms-1.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/notifications-analytics-compatibility-sms-2.test.ts|src/__tests__/analytics-2.test.ts|src/__tests__/global_sandbox-c.test.ts
depend-on:
- upb
- - identifier: l_plugin_studio_modelgen_custom_transformers_notifications_in_app_messaging_env_1
+ - identifier: l_hooks_b_notifications_analytics_compatibility_sms_1_plugin
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/plugin.test.ts|src/__tests__/studio-modelgen.test.ts|src/__tests__/graphql-v2/custom-transformers.test.ts|src/__tests__/notifications-in-app-messaging-env-1.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/hooks-b.test.ts|src/__tests__/notifications-analytics-compatibility-sms-1.test.ts|src/__tests__/plugin.test.ts
depend-on:
- upb
- - identifier: l_notifications_sms_pull_pull_auth_10_container_hosting
+ - identifier: l_studio_modelgen_custom_transformers_notifications_in_app_messaging_env_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/notifications-sms-pull.test.ts|src/__tests__/pull.test.ts|src/__tests__/auth_10.test.ts|src/__tests__/container-hosting.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/studio-modelgen.test.ts|src/__tests__/graphql-v2/custom-transformers.test.ts|src/__tests__/notifications-in-app-messaging-env-1.test.ts
depend-on:
- upb
- - identifier: l_init_b_notifications_apns_notifications_fcm_notifications_in_app_messaging_env_2
+ - identifier: l_notifications_sms_pull_pull_auth_10
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/init_b.test.ts|src/__tests__/notifications-apns.test.ts|src/__tests__/notifications-fcm.test.ts|src/__tests__/notifications-in-app-messaging-env-2.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/notifications-sms-pull.test.ts|src/__tests__/pull.test.ts|src/__tests__/auth_10.test.ts
depend-on:
- upb
- - identifier: l_with_babel_config_amplify_configure_env_2_init_d
+ - identifier: l_container_hosting_init_b_notifications_apns
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/with-babel-config.test.ts|src/__tests__/amplify-configure.test.ts|src/__tests__/env-2.test.ts|src/__tests__/init_d.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/container-hosting.test.ts|src/__tests__/init_b.test.ts|src/__tests__/notifications-apns.test.ts
depend-on:
- upb
- - identifier: l_init_f_auth_5d_configure_project_git_clone_attach
+ - identifier: l_notifications_fcm_notifications_in_app_messaging_env_2_with_babel_config
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/init_f.test.ts|src/__tests__/auth_5d.test.ts|src/__tests__/configure-project.test.ts|src/__tests__/git-clone-attach.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/notifications-fcm.test.ts|src/__tests__/notifications-in-app-messaging-env-2.test.ts|src/__tests__/with-babel-config.test.ts
depend-on:
- upb
- - identifier: l_init_c_layer_4_function_2c_function_3b
+ - identifier: l_amplify_configure_env_2_init_d
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/init_c.test.ts|src/__tests__/layer-4.test.ts|src/__tests__/function_2c.test.ts|src/__tests__/function_3b.test.ts
- CLI_REGION: eu-west-2
+ TEST_SUITE: src/__tests__/amplify-configure.test.ts|src/__tests__/env-2.test.ts|src/__tests__/init_d.test.ts
depend-on:
- upb
- - identifier: l_function_4_interactions_schema_model_a_tags
+ - identifier: l_init_f_auth_5d_configure_project
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/function_4.test.ts|src/__tests__/interactions.test.ts|src/__tests__/schema-model-a.test.ts|src/__tests__/tags.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/init_f.test.ts|src/__tests__/auth_5d.test.ts|src/__tests__/configure-project.test.ts
depend-on:
- upb
- - identifier: l_auth_1a_auth_trigger_custom_policies_function_function_6
+ - identifier: l_git_clone_attach_init_c_layer_4
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_1a.test.ts|src/__tests__/auth-trigger.test.ts|src/__tests__/custom_policies_function.test.ts|src/__tests__/function_6.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/git-clone-attach.test.ts|src/__tests__/init_c.test.ts|src/__tests__/layer-4.test.ts
depend-on:
- upb
- - identifier: l_storage_2_export_iam_permissions_boundary_node_function
+ - identifier: l_function_2c_function_3b_function_4
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/storage-2.test.ts|src/__tests__/export.test.ts|src/__tests__/iam-permissions-boundary.test.ts|src/__tests__/migration/node.function.test.ts
+ TEST_SUITE: src/__tests__/function_2c.test.ts|src/__tests__/function_3b.test.ts|src/__tests__/function_4.test.ts
+ depend-on:
+ - upb
+ - identifier: l_interactions_schema_model_a_tags
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/interactions.test.ts|src/__tests__/schema-model-a.test.ts|src/__tests__/tags.test.ts
CLI_REGION: us-west-2
depend-on:
- upb
- - identifier: l_notifications_sms_schema_auth_4b_schema_model_e_schema_versioned
+ - identifier: l_auth_1a_auth_trigger_custom_policies_function
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/notifications-sms.test.ts|src/__tests__/schema-auth-4b.test.ts|src/__tests__/schema-model-e.test.ts|src/__tests__/schema-versioned.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/auth_1a.test.ts|src/__tests__/auth-trigger.test.ts|src/__tests__/custom_policies_function.test.ts
depend-on:
- upb
- - identifier: l_auth_1c_auth_5e_auth_8b_geo_add_b
+ - identifier: l_function_6_storage_2_export
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_1c.test.ts|src/__tests__/auth_5e.test.ts|src/__tests__/auth_8b.test.ts|src/__tests__/geo-add-b.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/function_6.test.ts|src/__tests__/storage-2.test.ts|src/__tests__/export.test.ts
depend-on:
- upb
- - identifier: l_s3_sse_schema_auth_4a_schema_model_b_schema_model_d
+ - identifier: l_iam_permissions_boundary_node_function_notifications_sms
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/s3-sse.test.ts|src/__tests__/schema-auth-4a.test.ts|src/__tests__/schema-model-b.test.ts|src/__tests__/schema-model-d.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/iam-permissions-boundary.test.ts|src/__tests__/migration/node.function.test.ts|src/__tests__/notifications-sms.test.ts
depend-on:
- upb
- - identifier: l_auth_5f_env_4_frontend_config_drift_schema_auth_4d
+ - identifier: l_schema_auth_4b_schema_model_e_schema_versioned
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_5f.test.ts|src/__tests__/env-4.test.ts|src/__tests__/frontend_config_drift.test.ts|src/__tests__/schema-auth-4d.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/schema-auth-4b.test.ts|src/__tests__/schema-model-e.test.ts|src/__tests__/schema-versioned.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_6a_schema_data_access_patterns_schema_model_c_schema_predictions
+ - identifier: l_auth_1c_auth_5e_auth_8b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-6a.test.ts|src/__tests__/schema-data-access-patterns.test.ts|src/__tests__/schema-model-c.test.ts|src/__tests__/schema-predictions.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/auth_1c.test.ts|src/__tests__/auth_5e.test.ts|src/__tests__/auth_8b.test.ts
depend-on:
- upb
- - identifier: l_model_migration_auth_3c_auth_4c_auth_5a
+ - identifier: l_geo_add_b_s3_sse_schema_auth_4a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/transformer-migrations/model-migration.test.ts|src/__tests__/auth_3c.test.ts|src/__tests__/auth_4c.test.ts|src/__tests__/auth_5a.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/geo-add-b.test.ts|src/__tests__/s3-sse.test.ts|src/__tests__/schema-auth-4a.test.ts
depend-on:
- upb
- - identifier: l_auth_5c_env_1_geo_add_a_init_a
+ - identifier: l_schema_model_b_schema_model_d_auth_5f
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_5c.test.ts|src/__tests__/env-1.test.ts|src/__tests__/geo-add-a.test.ts|src/__tests__/init_a.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/schema-model-b.test.ts|src/__tests__/schema-model-d.test.ts|src/__tests__/auth_5f.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_4c_schema_auth_5c_auth_5b_auth_9
+ - identifier: l_env_4_frontend_config_drift_schema_auth_4d
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-4c.test.ts|src/__tests__/schema-auth-5c.test.ts|src/__tests__/auth_5b.test.ts|src/__tests__/auth_9.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/env-4.test.ts|src/__tests__/frontend_config_drift.test.ts|src/__tests__/schema-auth-4d.test.ts
depend-on:
- upb
- - identifier: l_custom_resources_env_5_function_10_function_9c
+ - identifier: l_schema_auth_6a_schema_data_access_patterns_schema_model_c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/custom_resources.test.ts|src/__tests__/env-5.test.ts|src/__tests__/function_10.test.ts|src/__tests__/function_9c.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/schema-auth-6a.test.ts|src/__tests__/schema-data-access-patterns.test.ts|src/__tests__/schema-model-c.test.ts
depend-on:
- upb
- - identifier: l_function_permissions_geo_import_1a_geo_import_2_global_sandbox_b
+ - identifier: l_schema_predictions_model_migration_auth_3c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/function-permissions.test.ts|src/__tests__/geo-import-1a.test.ts|src/__tests__/geo-import-2.test.ts|src/__tests__/global_sandbox-b.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/schema-predictions.test.ts|src/__tests__/transformer-migrations/model-migration.test.ts|src/__tests__/auth_3c.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_5d_schema_auth_6b_schema_auth_8c_auth_3a
+ - identifier: l_auth_4c_auth_5a_auth_5c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-5d.test.ts|src/__tests__/schema-auth-6b.test.ts|src/__tests__/schema-auth-8c.test.ts|src/__tests__/auth_3a.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/auth_4c.test.ts|src/__tests__/auth_5a.test.ts|src/__tests__/auth_5c.test.ts
depend-on:
- upb
- - identifier: l_auth_3b_auth_4a_auth_7a_auth_8c
+ - identifier: l_env_1_geo_add_a_init_a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_3b.test.ts|src/__tests__/auth_4a.test.ts|src/__tests__/auth_7a.test.ts|src/__tests__/auth_8c.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/env-1.test.ts|src/__tests__/geo-add-a.test.ts|src/__tests__/init_a.test.ts
depend-on:
- upb
- - identifier: l_feature_flags_geo_import_1b_global_sandbox_a_init_e
+ - identifier: l_schema_auth_4c_schema_auth_5c_auth_5b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/feature-flags.test.ts|src/__tests__/geo-import-1b.test.ts|src/__tests__/global_sandbox-a.test.ts|src/__tests__/init_e.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/schema-auth-4c.test.ts|src/__tests__/schema-auth-5c.test.ts|src/__tests__/auth_5b.test.ts
depend-on:
- upb
- - identifier: l_notifications_analytics_compatibility_in_app_2_schema_auth_11_c_schema_auth_2b_schema_auth_6c
+ - identifier: l_auth_9_custom_resources_env_5
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/notifications-analytics-compatibility-in-app-2.test.ts|src/__tests__/schema-auth-11-c.test.ts|src/__tests__/schema-auth-2b.test.ts|src/__tests__/schema-auth-6c.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/auth_9.test.ts|src/__tests__/custom_resources.test.ts|src/__tests__/env-5.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_6d_schema_auth_7c_schema_auth_8a_function_migration
+ - identifier: l_function_10_function_9c_function_permissions
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-6d.test.ts|src/__tests__/schema-auth-7c.test.ts|src/__tests__/schema-auth-8a.test.ts|src/__tests__/transformer-migrations/function-migration.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/function_10.test.ts|src/__tests__/function_9c.test.ts|src/__tests__/function-permissions.test.ts
depend-on:
- upb
- - identifier: l_api_10_api_7_export_pull_a_function_9a
+ - identifier: l_geo_import_1a_geo_import_2_global_sandbox_b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/api_10.test.ts|src/__tests__/api_7.test.ts|src/__tests__/export-pull-a.test.ts|src/__tests__/function_9a.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/geo-import-1a.test.ts|src/__tests__/geo-import-2.test.ts|src/__tests__/global_sandbox-b.test.ts
depend-on:
- upb
- - identifier: l_geo_headless_api_key_migration5_schema_auth_1a_schema_auth_5b
+ - identifier: l_schema_auth_5d_schema_auth_6b_schema_auth_8c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/geo-headless.test.ts|src/__tests__/migration/api.key.migration5.test.ts|src/__tests__/schema-auth-1a.test.ts|src/__tests__/schema-auth-5b.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/schema-auth-5d.test.ts|src/__tests__/schema-auth-6b.test.ts|src/__tests__/schema-auth-8c.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_8b_schema_auth_9_a_schema_auth_9_c_storage_3
+ - identifier: l_auth_3a_auth_3b_auth_4a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-8b.test.ts|src/__tests__/schema-auth-9-a.test.ts|src/__tests__/schema-auth-9-c.test.ts|src/__tests__/storage-3.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/auth_3a.test.ts|src/__tests__/auth_3b.test.ts|src/__tests__/auth_4a.test.ts
depend-on:
- upb
- - identifier: l_auth_11_auth_1b_delete_geo_add_c
+ - identifier: l_auth_7a_auth_8c_feature_flags
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_11.test.ts|src/__tests__/auth_1b.test.ts|src/__tests__/delete.test.ts|src/__tests__/geo-add-c.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/auth_7a.test.ts|src/__tests__/auth_8c.test.ts|src/__tests__/feature-flags.test.ts
depend-on:
- upb
- - identifier: l_geo_add_d_geo_import_3_hosting_layer_3
+ - identifier: l_geo_import_1b_global_sandbox_a_init_e
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/geo-add-d.test.ts|src/__tests__/geo-import-3.test.ts|src/__tests__/hosting.test.ts|src/__tests__/layer-3.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/geo-import-1b.test.ts|src/__tests__/global_sandbox-a.test.ts|src/__tests__/init_e.test.ts
depend-on:
- upb
- - identifier: l_api_connection_migration_api_key_migration3_predictions_schema_auth_11_b
+ - identifier: l_notifications_analytics_compatibility_in_app_2_schema_auth_11_c_schema_auth_2b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/migration/api.connection.migration.test.ts|src/__tests__/migration/api.key.migration3.test.ts|src/__tests__/predictions.test.ts|src/__tests__/schema-auth-11-b.test.ts
- CLI_REGION: eu-west-2
+ TEST_SUITE: src/__tests__/notifications-analytics-compatibility-in-app-2.test.ts|src/__tests__/schema-auth-11-c.test.ts|src/__tests__/schema-auth-2b.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_1b_schema_auth_2a_schema_auth_7a_schema_auth_7b
+ - identifier: l_schema_auth_6c_schema_auth_6d_schema_auth_7c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-1b.test.ts|src/__tests__/schema-auth-2a.test.ts|src/__tests__/schema-auth-7a.test.ts|src/__tests__/schema-auth-7b.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/schema-auth-6c.test.ts|src/__tests__/schema-auth-6d.test.ts|src/__tests__/schema-auth-7c.test.ts
depend-on:
- upb
- - identifier: l_schema_auth_9_b_schema_iterative_rollback_1_predictions_migration_api_6a
+ - identifier: l_schema_auth_8a_function_migration_api_10
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-auth-9-b.test.ts|src/__tests__/schema-iterative-rollback-1.test.ts|src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/api_6a.test.ts
- CLI_REGION: ap-southeast-2
+ TEST_SUITE: src/__tests__/schema-auth-8a.test.ts|src/__tests__/transformer-migrations/function-migration.test.ts|src/__tests__/api_10.test.ts
depend-on:
- upb
- - identifier: l_auth_7b_export_pull_b_function_3a_init_special_case
+ - identifier: l_api_7_export_pull_a_function_9a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_7b.test.ts|src/__tests__/export-pull-b.test.ts|src/__tests__/function_3a.test.ts|src/__tests__/init-special-case.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/api_7.test.ts|src/__tests__/export-pull-a.test.ts|src/__tests__/function_9a.test.ts
depend-on:
- upb
- - identifier: l_http_migration_schema_auth_12_schema_auth_3_schema_function_2
+ - identifier: l_geo_headless_api_key_migration5_schema_auth_1a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/schema-auth-12.test.ts|src/__tests__/schema-auth-3.test.ts|src/__tests__/schema-function-2.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/geo-headless.test.ts|src/__tests__/migration/api.key.migration5.test.ts|src/__tests__/schema-auth-1a.test.ts
depend-on:
- upb
- - identifier: l_auth_4b_auth_8a_export_pull_d_schema_auth_5a
+ - identifier: l_schema_auth_5b_schema_auth_8b_schema_auth_9_a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_4b.test.ts|src/__tests__/auth_8a.test.ts|src/__tests__/export-pull-d.test.ts|src/__tests__/schema-auth-5a.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/schema-auth-5b.test.ts|src/__tests__/schema-auth-8b.test.ts|src/__tests__/schema-auth-9-a.test.ts
depend-on:
- upb
- - identifier: l_schema_iterative_rollback_2_schema_iterative_update_3_auth_migration_api_2a
+ - identifier: l_schema_auth_9_c_storage_3_auth_11
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-iterative-rollback-2.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/api_2a.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/schema-auth-9-c.test.ts|src/__tests__/storage-3.test.ts|src/__tests__/auth_11.test.ts
depend-on:
- upb
- - identifier: l_api_2b_api_6c_api_9a_auth_12
+ - identifier: l_auth_1b_delete_geo_add_c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/api_2b.test.ts|src/__tests__/api_6c.test.ts|src/__tests__/api_9a.test.ts|src/__tests__/auth_12.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/auth_1b.test.ts|src/__tests__/delete.test.ts|src/__tests__/geo-add-c.test.ts
depend-on:
- upb
- - identifier: l_auth_2g_build_function_custom_resource_with_storage_dynamodb_simulator
+ - identifier: l_geo_add_d_geo_import_3_hosting
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/auth_2g.test.ts|src/__tests__/build-function.test.ts|src/__tests__/custom-resource-with-storage.test.ts|src/__tests__/dynamodb-simulator/dynamodb-simulator.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/geo-add-d.test.ts|src/__tests__/geo-import-3.test.ts|src/__tests__/hosting.test.ts
depend-on:
- upb
- - identifier: l_export_pull_c_function_12_function_2d_general_config_headless_init
+ - identifier: l_layer_3_api_connection_migration_api_key_migration3
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/export-pull-c.test.ts|src/__tests__/function_12.test.ts|src/__tests__/function_2d.test.ts|src/__tests__/general-config/general-config-headless-init.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/layer-3.test.ts|src/__tests__/migration/api.connection.migration.test.ts|src/__tests__/migration/api.key.migration3.test.ts
depend-on:
- upb
- - identifier: l_help_hooks_c_init_force_push_interactions_1
+ - identifier: l_predictions_schema_auth_11_b_schema_auth_1b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/help.test.ts|src/__tests__/hooks-c.test.ts|src/__tests__/init-force-push.test.ts|src/__tests__/interactions-1.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/predictions.test.ts|src/__tests__/schema-auth-11-b.test.ts|src/__tests__/schema-auth-1b.test.ts
depend-on:
- upb
- - identifier: l_interactions_2_minify_cloudformation_notifications_multi_env_opensearch_simulator
+ - identifier: l_schema_auth_2a_schema_auth_7a_schema_auth_7b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/interactions-2.test.ts|src/__tests__/minify-cloudformation.test.ts|src/__tests__/notifications-multi-env.test.ts|src/__tests__/opensearch-simulator/opensearch-simulator.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/schema-auth-2a.test.ts|src/__tests__/schema-auth-7a.test.ts|src/__tests__/schema-auth-7b.test.ts
depend-on:
- upb
- - identifier: l_parameter_store_1_parameter_store_2_android_analytics_pinpoint_config_android_notifications_pinpoint_config
+ - identifier: l_schema_auth_9_b_schema_iterative_rollback_1_predictions_migration
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/parameter-store-1.test.ts|src/__tests__/parameter-store-2.test.ts|src/__tests__/pinpoint/android-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/android-notifications-pinpoint-config.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/schema-auth-9-b.test.ts|src/__tests__/schema-iterative-rollback-1.test.ts|src/__tests__/transformer-migrations/predictions-migration.test.ts
depend-on:
- upb
- - identifier: l_flutter_analytics_pinpoint_config_flutter_notifications_pinpoint_config_ios_analytics_pinpoint_config_ios_notifications_pinpo
+ - identifier: l_api_6a_auth_7b_export_pull_b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/pinpoint/flutter-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/flutter-notifications-pinpoint-config.test.ts|src/__tests__/pinpoint/ios-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/ios-notifications-pinpoint-config.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/api_6a.test.ts|src/__tests__/auth_7b.test.ts|src/__tests__/export-pull-b.test.ts
depend-on:
- upb
- - identifier: l_javascript_analytics_pinpoint_config_javascript_notifications_pinpoint_config_pull_2_push
+ - identifier: l_function_3a_dotnet_function_3a_go_function_3a_nodejs
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/pinpoint/javascript-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/javascript-notifications-pinpoint-config.test.ts|src/__tests__/pull-2.test.ts|src/__tests__/push.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/function_3a_dotnet.test.ts|src/__tests__/function_3a_go.test.ts|src/__tests__/function_3a_nodejs.test.ts
+ depend-on:
+ - upb
+ - identifier: l_function_3a_python_init_special_case_http_migration
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/function_3a_python.test.ts|src/__tests__/init-special-case.test.ts|src/__tests__/transformer-migrations/http-migration.test.ts
depend-on:
- upb
- - identifier: l_smoketest_S3server_api_8_function_8
+ - identifier: l_schema_auth_12_schema_auth_3_schema_function_2
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/smoketest.test.ts|src/__tests__/storage-simulator/S3server.test.ts|src/__tests__/api_8.test.ts|src/__tests__/function_8.test.ts
- CLI_REGION: ap-southeast-2
+ TEST_SUITE: src/__tests__/schema-auth-12.test.ts|src/__tests__/schema-auth-3.test.ts|src/__tests__/schema-function-2.test.ts
depend-on:
- upb
- - identifier: l_schema_iterative_update_locking_api_lambda_auth_2_layer_2_schema_auth_13
+ - identifier: l_auth_4b_auth_8a_export_pull_d
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/api_lambda_auth_2.test.ts|src/__tests__/layer-2.test.ts|src/__tests__/schema-auth-13.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/auth_4b.test.ts|src/__tests__/auth_8a.test.ts|src/__tests__/export-pull-d.test.ts
depend-on:
- upb
- - identifier: l_function_5_schema_iterative_update_1_auth_6_function_2a
+ - identifier: l_schema_auth_5a_schema_iterative_rollback_2_schema_iterative_update_3
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/function_5.test.ts|src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/auth_6.test.ts|src/__tests__/function_2a.test.ts
- CLI_REGION: ap-southeast-2
+ TEST_SUITE: src/__tests__/schema-auth-5a.test.ts|src/__tests__/schema-iterative-rollback-2.test.ts|src/__tests__/schema-iterative-update-3.test.ts
depend-on:
- upb
- - identifier: l_schema_connection_2_schema_function_1_api_9b_custom_policies_container
+ - identifier: l_auth_migration_amplify_remove_api_2a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-connection-2.test.ts|src/__tests__/schema-function-1.test.ts|src/__tests__/api_9b.test.ts|src/__tests__/custom_policies_container.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/amplify-remove.test.ts|src/__tests__/api_2a.test.ts
depend-on:
- upb
- - identifier: l_function_9b_schema_iterative_update_2_storage_1a_storage_1b
+ - identifier: l_api_2b_api_6c_api_9a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/function_9b.test.ts|src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/storage-1a.test.ts|src/__tests__/storage-1b.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/api_2b.test.ts|src/__tests__/api_6c.test.ts|src/__tests__/api_9a.test.ts
depend-on:
- upb
- - identifier: l_function_11_function_2b_function_7_api_connection_migration2
+ - identifier: l_auth_12_auth_2g_auth_2h
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/function_11.test.ts|src/__tests__/function_2b.test.ts|src/__tests__/function_7.test.ts|src/__tests__/migration/api.connection.migration2.test.ts
- CLI_REGION: ap-northeast-1
+ TEST_SUITE: src/__tests__/auth_12.test.ts|src/__tests__/auth_2g.test.ts|src/__tests__/auth_2h.test.ts
depend-on:
- upb
- - identifier: l_api_4_containers_api_secrets_storage_4_schema_auth_10
+ - identifier: l_auth_5g_admin_api_hosted_ui
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/api_4.test.ts|src/__tests__/containers-api-secrets.test.ts|src/__tests__/storage-4.test.ts|src/__tests__/schema-auth-10.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/auth_5g.test.ts|src/__tests__/auth/admin-api.test.ts|src/__tests__/auth/hosted-ui.test.ts
depend-on:
- upb
- - identifier: l_geo_multi_env_searchable_datastore_resolvers_schema_key
+ - identifier: l_user_groups_s3_access_user_groups_build_function_yarn_modern
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/geo-multi-env.test.ts|src/__tests__/graphql-v2/searchable-datastore.test.ts|src/__tests__/resolvers.test.ts|src/__tests__/schema-key.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/auth/user-groups-s3-access.test.ts|src/__tests__/auth/user-groups.test.ts|src/__tests__/build-function-yarn-modern.test.ts
depend-on:
- upb
- - identifier: l_api_5_apigw_api_lambda_auth_1_api_key_migration2
+ - identifier: l_build_function_custom_resource_with_storage_dynamodb_simulator
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/api_5.test.ts|src/__tests__/apigw.test.ts|src/__tests__/graphql-v2/api_lambda_auth_1.test.ts|src/__tests__/migration/api.key.migration2.test.ts
+ TEST_SUITE: src/__tests__/build-function.test.ts|src/__tests__/custom-resource-with-storage.test.ts|src/__tests__/dynamodb-simulator/dynamodb-simulator.test.ts
CLI_REGION: us-west-2
depend-on:
- upb
- - identifier: l_schema_searchable_api_key_migration1_schema_auth_14_api_3
+ - identifier: l_export_pull_c_function_12_function_13
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/export-pull-c.test.ts|src/__tests__/function_12.test.ts|src/__tests__/function_13.test.ts
+ depend-on:
+ - upb
+ - identifier: l_function_14_function_15_function_2d
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/function_14.test.ts|src/__tests__/function_15.test.ts|src/__tests__/function_2d.test.ts
+ depend-on:
+ - upb
+ - identifier: l_general_config_headless_init_help_hooks_c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-searchable.test.ts|src/__tests__/migration/api.key.migration1.test.ts|src/__tests__/schema-auth-14.test.ts|src/__tests__/api_3.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/general-config/general-config-headless-init.test.ts|src/__tests__/help.test.ts|src/__tests__/hooks-c.test.ts
depend-on:
- upb
- - identifier: l_api_6b_api_1_layer_1_api_key_migration4
+ - identifier: l_init_force_push_interactions_1_interactions_2
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/api_6b.test.ts|src/__tests__/api_1.test.ts|src/__tests__/layer-1.test.ts|src/__tests__/migration/api.key.migration4.test.ts
+ TEST_SUITE: src/__tests__/init-force-push.test.ts|src/__tests__/interactions-1.test.ts|src/__tests__/interactions-2.test.ts
CLI_REGION: us-west-2
depend-on:
- upb
- - identifier: l_schema_iterative_update_4_function_1_storage_5
+ - identifier: l_minify_cloudformation_notifications_multi_env_notifications_sms_update
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/minify-cloudformation.test.ts|src/__tests__/notifications-multi-env.test.ts|src/__tests__/notifications-sms-update.test.ts
+ depend-on:
+ - upb
+ - identifier: l_opensearch_simulator_parameter_store_1_parameter_store_2
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/opensearch-simulator/opensearch-simulator.test.ts|src/__tests__/parameter-store-1.test.ts|src/__tests__/parameter-store-2.test.ts
+ depend-on:
+ - upb
+ - identifier: l_android_analytics_pinpoint_config_android_notifications_pinpoint_config_flutter_analytics_pinpoint_config
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/pinpoint/android-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/android-notifications-pinpoint-config.test.ts|src/__tests__/pinpoint/flutter-analytics-pinpoint-config.test.ts
+ depend-on:
+ - upb
+ - identifier: l_flutter_notifications_pinpoint_config_ios_analytics_pinpoint_config_ios_notifications_pinpoint_config
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/pinpoint/flutter-notifications-pinpoint-config.test.ts|src/__tests__/pinpoint/ios-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/ios-notifications-pinpoint-config.test.ts
+ depend-on:
+ - upb
+ - identifier: l_javascript_analytics_pinpoint_config_javascript_notifications_pinpoint_config_pr_previews_multi_env_1
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/pinpoint/javascript-analytics-pinpoint-config.test.ts|src/__tests__/pinpoint/javascript-notifications-pinpoint-config.test.ts|src/__tests__/pr-previews-multi-env-1.test.ts
+ depend-on:
+ - upb
+ - identifier: l_pull_2_push_smoketest_ios
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/pull-2.test.ts|src/__tests__/push.test.ts|src/__tests__/smoke-tests/smoketest-ios.test.ts
+ depend-on:
+ - upb
+ - identifier: l_smoketest_S3server_api_8
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/smoke-tests/smoketest.test.ts|src/__tests__/storage-simulator/S3server.test.ts|src/__tests__/api_8.test.ts
+ depend-on:
+ - upb
+ - identifier: l_function_8_schema_iterative_update_locking_api_lambda_auth_2
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/function_8.test.ts|src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/api_lambda_auth_2.test.ts
+ depend-on:
+ - upb
+ - identifier: l_layer_2_schema_auth_13_function_5
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/layer-2.test.ts|src/__tests__/schema-auth-13.test.ts|src/__tests__/function_5.test.ts
+ depend-on:
+ - upb
+ - identifier: l_schema_iterative_update_1_auth_6_function_2a
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/auth_6.test.ts|src/__tests__/function_2a.test.ts
+ depend-on:
+ - upb
+ - identifier: l_schema_connection_2_schema_function_1_api_9b
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/schema-connection-2.test.ts|src/__tests__/schema-function-1.test.ts|src/__tests__/api_9b.test.ts
+ depend-on:
+ - upb
+ - identifier: l_custom_policies_container_function_9b_schema_iterative_update_2
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/custom_policies_container.test.ts|src/__tests__/function_9b.test.ts|src/__tests__/schema-iterative-update-2.test.ts
+ depend-on:
+ - upb
+ - identifier: l_storage_1a_storage_1b_function_11
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/storage-1a.test.ts|src/__tests__/storage-1b.test.ts|src/__tests__/function_11.test.ts
+ depend-on:
+ - upb
+ - identifier: l_function_2b_function_7_api_connection_migration2
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/function_2b.test.ts|src/__tests__/function_7.test.ts|src/__tests__/migration/api.connection.migration2.test.ts
+ depend-on:
+ - upb
+ - identifier: l_api_4_containers_api_secrets_storage_4
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/api_4.test.ts|src/__tests__/containers-api-secrets.test.ts|src/__tests__/storage-4.test.ts
+ depend-on:
+ - upb
+ - identifier: l_schema_auth_10_geo_multi_env_searchable_datastore
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/schema-auth-10.test.ts|src/__tests__/geo-multi-env.test.ts|src/__tests__/graphql-v2/searchable-datastore.test.ts
+ depend-on:
+ - upb
+ - identifier: l_resolvers_schema_key_api_5
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/resolvers.test.ts|src/__tests__/schema-key.test.ts|src/__tests__/api_5.test.ts
+ depend-on:
+ - upb
+ - identifier: l_apigw_api_lambda_auth_1_api_key_migration2
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/apigw.test.ts|src/__tests__/graphql-v2/api_lambda_auth_1.test.ts|src/__tests__/migration/api.key.migration2.test.ts
+ depend-on:
+ - upb
+ - identifier: l_schema_searchable_api_key_migration1_schema_auth_14
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/schema-searchable.test.ts|src/__tests__/migration/api.key.migration1.test.ts|src/__tests__/schema-auth-14.test.ts
+ depend-on:
+ - upb
+ - identifier: l_api_3_api_6b_api_1
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/api_3.test.ts|src/__tests__/api_6b.test.ts|src/__tests__/api_1.test.ts
+ depend-on:
+ - upb
+ - identifier: l_layer_1_api_key_migration4_schema_iterative_update_4
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
- TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts|src/__tests__/function_1.test.ts|src/__tests__/storage-5.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/layer-1.test.ts|src/__tests__/migration/api.key.migration4.test.ts|src/__tests__/schema-iterative-update-4.test.ts
+ depend-on:
+ - upb
+ - identifier: l_function_1_storage_5
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ TEST_SUITE: src/__tests__/function_1.test.ts|src/__tests__/storage-5.test.ts
+ depend-on:
+ - upb
+ - identifier: l_datastore_modelgen
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ compute-type: BUILD_GENERAL1_SMALL
+ TEST_SUITE: src/__tests__/datastore-modelgen.test.ts
+ DISABLE_COVERAGE: 1
+ depend-on:
+ - upb
+ - identifier: l_amplify_app
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ compute-type: BUILD_GENERAL1_SMALL
+ TEST_SUITE: src/__tests__/amplify-app.test.ts
+ DISABLE_COVERAGE: 1
depend-on:
- upb
- identifier: l_auth_2c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/auth_2c.test.ts
- CLI_REGION: ap-northeast-1
depend-on:
- upb
- identifier: l_auth_2e
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/auth_2e.test.ts
- CLI_REGION: eu-central-1
+ depend-on:
+ - upb
+ - identifier: l_uibuilder
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ compute-type: BUILD_GENERAL1_SMALL
+ TEST_SUITE: src/__tests__/uibuilder.test.ts
depend-on:
- upb
- identifier: l_geo_remove_3
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-remove-3.test.ts
- CLI_REGION: us-east-1
depend-on:
- upb
- identifier: l_geo_add_f
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-add-f.test.ts
- CLI_REGION: us-east-2
depend-on:
- upb
- identifier: l_geo_add_e
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-add-e.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_import_dynamodb_2c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_dynamodb_2c.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_env_3
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/env-3.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_geo_remove_2
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-remove-2.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_notifications_in_app_messaging
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/notifications-in-app-messaging.test.ts
- CLI_REGION: ap-northeast-1
depend-on:
- upb
- identifier: l_import_auth_2a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_auth_2a.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_import_auth_1a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_auth_1a.test.ts
- CLI_REGION: ap-southeast-1
depend-on:
- upb
- identifier: l_import_auth_2b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_auth_2b.test.ts
- CLI_REGION: ap-southeast-2
depend-on:
- upb
- identifier: l_import_s3_2a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_s3_2a.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_import_s3_2c
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_s3_2c.test.ts
- CLI_REGION: eu-west-2
depend-on:
- upb
- identifier: l_import_auth_1b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_auth_1b.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_schema_auth_11_a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/schema-auth-11-a.test.ts
- CLI_REGION: ap-southeast-2
depend-on:
- upb
- identifier: l_geo_update_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-update-1.test.ts
- CLI_REGION: ap-northeast-1
depend-on:
- upb
- identifier: l_geo_update_2
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-update-2.test.ts
- CLI_REGION: us-east-1
depend-on:
- upb
- identifier: l_import_s3_3
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_s3_3.test.ts
- CLI_REGION: us-west-2
+ depend-on:
+ - upb
+ - identifier: l_js_frontend_config
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ compute-type: BUILD_GENERAL1_SMALL
+ TEST_SUITE: src/__tests__/aws-exports/js-frontend-config.test.ts
depend-on:
- upb
- identifier: l_import_dynamodb_2b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_dynamodb_2b.test.ts
- CLI_REGION: eu-central-1
+ depend-on:
+ - upb
+ - identifier: l_smoketest_amplify_app
+ buildspec: codebuild_specs/run_e2e_tests_linux.yml
+ env:
+ variables:
+ compute-type: BUILD_GENERAL1_SMALL
+ TEST_SUITE: src/__tests__/smoke-tests/smoketest-amplify-app.test.ts
+ DISABLE_COVERAGE: 1
depend-on:
- upb
- identifier: l_hostingPROD
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/hostingPROD.test.ts
- CLI_REGION: us-west-2
depend-on:
- upb
- identifier: l_import_s3_2b
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_s3_2b.test.ts
- CLI_REGION: us-east-2
depend-on:
- upb
- identifier: l_containers_api_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/containers-api-1.test.ts
- CLI_REGION: eu-central-1
depend-on:
- upb
- identifier: l_schema_auth_15
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/schema-auth-15.test.ts
- CLI_REGION: us-east-2
depend-on:
- upb
- identifier: l_schema_connection_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/schema-connection-1.test.ts
- CLI_REGION: us-west-2
depend-on:
- upb
- identifier: l_import_auth_3
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_auth_3.test.ts
- CLI_REGION: ap-southeast-1
depend-on:
- upb
- identifier: l_import_dynamodb_2a
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_dynamodb_2a.test.ts
- CLI_REGION: ap-southeast-1
depend-on:
- upb
- identifier: l_containers_api_2
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/containers-api-2.test.ts
- CLI_REGION: us-east-1
depend-on:
- upb
- identifier: l_import_s3_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_s3_1.test.ts
- CLI_REGION: ap-southeast-2
USE_PARENT_ACCOUNT: 1
depend-on:
- upb
@@ -818,8 +1025,8 @@ batch:
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts
- CLI_REGION: us-east-2
USE_PARENT_ACCOUNT: 1
depend-on:
- upb
@@ -827,986 +1034,1283 @@ batch:
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/geo-remove-1.test.ts
- CLI_REGION: ap-northeast-1
depend-on:
- upb
- identifier: l_import_dynamodb_1
buildspec: codebuild_specs/run_e2e_tests_linux.yml
env:
variables:
+ compute-type: BUILD_GENERAL1_SMALL
TEST_SUITE: src/__tests__/import_dynamodb_1.test.ts
- CLI_REGION: ap-southeast-2
USE_PARENT_ACCOUNT: 1
depend-on:
- upb
- - identifier: w_analytics_kinesis_analytics_pinpoint_flutter_analytics_pinpoint_js_auth_2a
+ - identifier: w_analytics_kinesis_analytics_pinpoint_flutter
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/analytics-kinesis.test.ts|src/__tests__/analytics-pinpoint-flutter.test.ts|src/__tests__/analytics-pinpoint-js.test.ts|src/__tests__/auth_2a.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/analytics-kinesis.test.ts|src/__tests__/analytics-pinpoint-flutter.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_2b_auth_2d_auth_2f_notifications_lifecycle
+ - identifier: w_analytics_pinpoint_js_auth_2a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts|src/__tests__/auth_2f.test.ts|src/__tests__/notifications-lifecycle.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/analytics-pinpoint-js.test.ts|src/__tests__/auth_2a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_notifications_analytics_compatibility_in_app_1_notifications_analytics_compatibility_sms_2_analytics_2_global_sandbox_c
+ - identifier: w_auth_2b_auth_2d
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/notifications-analytics-compatibility-in-app-1.test.ts|src/__tests__/notifications-analytics-compatibility-sms-2.test.ts|src/__tests__/analytics-2.test.ts|src/__tests__/global_sandbox-c.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_hooks_b_notifications_analytics_compatibility_sms_1_plugin_studio_modelgen
+ - identifier: w_auth_2f_notifications_lifecycle
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/hooks-b.test.ts|src/__tests__/notifications-analytics-compatibility-sms-1.test.ts|src/__tests__/plugin.test.ts|src/__tests__/studio-modelgen.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_2f.test.ts|src/__tests__/notifications-lifecycle.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_custom_transformers_notifications_in_app_messaging_env_1_notifications_sms_pull_auth_10
+ - identifier: w_notifications_analytics_compatibility_in_app_1_notifications_analytics_compatibility_sms_2
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/graphql-v2/custom-transformers.test.ts|src/__tests__/notifications-in-app-messaging-env-1.test.ts|src/__tests__/notifications-sms-pull.test.ts|src/__tests__/auth_10.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/notifications-analytics-compatibility-in-app-1.test.ts|src/__tests__/notifications-analytics-compatibility-sms-2.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_container_hosting_init_b_notifications_apns_notifications_fcm
+ - identifier: w_analytics_2_global_sandbox_c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/container-hosting.test.ts|src/__tests__/init_b.test.ts|src/__tests__/notifications-apns.test.ts|src/__tests__/notifications-fcm.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/analytics-2.test.ts|src/__tests__/global_sandbox-c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_notifications_in_app_messaging_env_2_with_babel_config_amplify_configure_init_d
+ - identifier: w_hooks_b_notifications_analytics_compatibility_sms_1
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/notifications-in-app-messaging-env-2.test.ts|src/__tests__/with-babel-config.test.ts|src/__tests__/amplify-configure.test.ts|src/__tests__/init_d.test.ts
- CLI_REGION: us-east-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/hooks-b.test.ts|src/__tests__/notifications-analytics-compatibility-sms-1.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_init_f_auth_5d_configure_project_init_c
+ - identifier: w_plugin_studio_modelgen
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/init_f.test.ts|src/__tests__/auth_5d.test.ts|src/__tests__/configure-project.test.ts|src/__tests__/init_c.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/plugin.test.ts|src/__tests__/studio-modelgen.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_layer_4_function_2c_interactions_schema_model_a
+ - identifier: w_custom_transformers_notifications_in_app_messaging_env_1
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/layer-4.test.ts|src/__tests__/function_2c.test.ts|src/__tests__/interactions.test.ts|src/__tests__/schema-model-a.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/graphql-v2/custom-transformers.test.ts|src/__tests__/notifications-in-app-messaging-env-1.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_tags_auth_1a_auth_trigger_custom_policies_function
+ - identifier: w_notifications_sms_pull_auth_10
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/tags.test.ts|src/__tests__/auth_1a.test.ts|src/__tests__/auth-trigger.test.ts|src/__tests__/custom_policies_function.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/notifications-sms-pull.test.ts|src/__tests__/auth_10.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_storage_2_iam_permissions_boundary_node_function_notifications_sms
+ - identifier: w_container_hosting_init_b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/storage-2.test.ts|src/__tests__/iam-permissions-boundary.test.ts|src/__tests__/migration/node.function.test.ts|src/__tests__/notifications-sms.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/container-hosting.test.ts|src/__tests__/init_b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_4b_schema_model_e_schema_versioned_auth_1c
+ - identifier: w_notifications_apns_notifications_fcm
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-4b.test.ts|src/__tests__/schema-model-e.test.ts|src/__tests__/schema-versioned.test.ts|src/__tests__/auth_1c.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/notifications-apns.test.ts|src/__tests__/notifications-fcm.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_5e_auth_8b_geo_add_b_s3_sse
+ - identifier: w_notifications_in_app_messaging_env_2_with_babel_config
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_5e.test.ts|src/__tests__/auth_8b.test.ts|src/__tests__/geo-add-b.test.ts|src/__tests__/s3-sse.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/notifications-in-app-messaging-env-2.test.ts|src/__tests__/with-babel-config.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_4a_schema_model_b_schema_model_d_auth_5f
+ - identifier: w_amplify_configure_init_d
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-4a.test.ts|src/__tests__/schema-model-b.test.ts|src/__tests__/schema-model-d.test.ts|src/__tests__/auth_5f.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/amplify-configure.test.ts|src/__tests__/init_d.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_env_4_frontend_config_drift_schema_auth_4d_schema_auth_6a
+ - identifier: w_init_f_auth_5d
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/env-4.test.ts|src/__tests__/frontend_config_drift.test.ts|src/__tests__/schema-auth-4d.test.ts|src/__tests__/schema-auth-6a.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/init_f.test.ts|src/__tests__/auth_5d.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_data_access_patterns_schema_model_c_schema_predictions_model_migration
+ - identifier: w_configure_project_init_c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-data-access-patterns.test.ts|src/__tests__/schema-model-c.test.ts|src/__tests__/schema-predictions.test.ts|src/__tests__/transformer-migrations/model-migration.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/configure-project.test.ts|src/__tests__/init_c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_3c_auth_4c_auth_5a_auth_5c
+ - identifier: w_layer_4_function_2c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_3c.test.ts|src/__tests__/auth_4c.test.ts|src/__tests__/auth_5a.test.ts|src/__tests__/auth_5c.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/layer-4.test.ts|src/__tests__/function_2c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_env_1_geo_add_a_init_a_schema_auth_4c
+ - identifier: w_interactions_schema_model_a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/env-1.test.ts|src/__tests__/geo-add-a.test.ts|src/__tests__/init_a.test.ts|src/__tests__/schema-auth-4c.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/interactions.test.ts|src/__tests__/schema-model-a.test.ts
+ CLI_REGION: us-west-2
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_5c_auth_5b_auth_9_custom_resources
+ - identifier: w_tags_auth_1a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-5c.test.ts|src/__tests__/auth_5b.test.ts|src/__tests__/auth_9.test.ts|src/__tests__/custom_resources.test.ts
- CLI_REGION: us-east-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/tags.test.ts|src/__tests__/auth_1a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_env_5_function_10_function_9c_function_permissions
+ - identifier: w_auth_trigger_custom_policies_function
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/env-5.test.ts|src/__tests__/function_10.test.ts|src/__tests__/function_9c.test.ts|src/__tests__/function-permissions.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth-trigger.test.ts|src/__tests__/custom_policies_function.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_geo_import_1a_geo_import_2_global_sandbox_b_schema_auth_5d
+ - identifier: w_storage_2_iam_permissions_boundary
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/geo-import-1a.test.ts|src/__tests__/geo-import-2.test.ts|src/__tests__/global_sandbox-b.test.ts|src/__tests__/schema-auth-5d.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/storage-2.test.ts|src/__tests__/iam-permissions-boundary.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_6b_schema_auth_8c_auth_3a_auth_3b
+ - identifier: w_node_function_notifications_sms
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-6b.test.ts|src/__tests__/schema-auth-8c.test.ts|src/__tests__/auth_3a.test.ts|src/__tests__/auth_3b.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/migration/node.function.test.ts|src/__tests__/notifications-sms.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_4a_auth_7a_auth_8c_feature_flags
+ - identifier: w_schema_auth_4b_schema_model_e
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_4a.test.ts|src/__tests__/auth_7a.test.ts|src/__tests__/auth_8c.test.ts|src/__tests__/feature-flags.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-4b.test.ts|src/__tests__/schema-model-e.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_geo_import_1b_global_sandbox_a_init_e_notifications_analytics_compatibility_in_app_2
+ - identifier: w_schema_versioned_auth_1c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/geo-import-1b.test.ts|src/__tests__/global_sandbox-a.test.ts|src/__tests__/init_e.test.ts|src/__tests__/notifications-analytics-compatibility-in-app-2.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-versioned.test.ts|src/__tests__/auth_1c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_11_c_schema_auth_2b_schema_auth_6c_schema_auth_6d
+ - identifier: w_auth_5e_auth_8b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-11-c.test.ts|src/__tests__/schema-auth-2b.test.ts|src/__tests__/schema-auth-6c.test.ts|src/__tests__/schema-auth-6d.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_5e.test.ts|src/__tests__/auth_8b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_7c_schema_auth_8a_function_migration_api_10
+ - identifier: w_geo_add_b_s3_sse
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-7c.test.ts|src/__tests__/schema-auth-8a.test.ts|src/__tests__/transformer-migrations/function-migration.test.ts|src/__tests__/api_10.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/geo-add-b.test.ts|src/__tests__/s3-sse.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_api_7_export_pull_a_function_9a_geo_headless
+ - identifier: w_schema_auth_4a_schema_model_b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/api_7.test.ts|src/__tests__/export-pull-a.test.ts|src/__tests__/function_9a.test.ts|src/__tests__/geo-headless.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-4a.test.ts|src/__tests__/schema-model-b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_api_key_migration5_schema_auth_1a_schema_auth_5b_schema_auth_8b
+ - identifier: w_schema_model_d_auth_5f
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration/api.key.migration5.test.ts|src/__tests__/schema-auth-1a.test.ts|src/__tests__/schema-auth-5b.test.ts|src/__tests__/schema-auth-8b.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-model-d.test.ts|src/__tests__/auth_5f.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_9_a_schema_auth_9_c_storage_3_auth_11
+ - identifier: w_env_4_frontend_config_drift
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-9-a.test.ts|src/__tests__/schema-auth-9-c.test.ts|src/__tests__/storage-3.test.ts|src/__tests__/auth_11.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/env-4.test.ts|src/__tests__/frontend_config_drift.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_1b_delete_geo_add_c_geo_add_d
+ - identifier: w_schema_auth_4d_schema_auth_6a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_1b.test.ts|src/__tests__/delete.test.ts|src/__tests__/geo-add-c.test.ts|src/__tests__/geo-add-d.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-4d.test.ts|src/__tests__/schema-auth-6a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_geo_import_3_hosting_layer_3_api_connection_migration
+ - identifier: w_schema_data_access_patterns_schema_model_c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/geo-import-3.test.ts|src/__tests__/hosting.test.ts|src/__tests__/layer-3.test.ts|src/__tests__/migration/api.connection.migration.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-data-access-patterns.test.ts|src/__tests__/schema-model-c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_api_key_migration3_predictions_schema_auth_11_b_schema_auth_1b
+ - identifier: w_schema_predictions_model_migration
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration/api.key.migration3.test.ts|src/__tests__/predictions.test.ts|src/__tests__/schema-auth-11-b.test.ts|src/__tests__/schema-auth-1b.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-predictions.test.ts|src/__tests__/transformer-migrations/model-migration.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_2a_schema_auth_7a_schema_auth_7b_schema_auth_9_b
+ - identifier: w_auth_3c_auth_4c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-2a.test.ts|src/__tests__/schema-auth-7a.test.ts|src/__tests__/schema-auth-7b.test.ts|src/__tests__/schema-auth-9-b.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_3c.test.ts|src/__tests__/auth_4c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_predictions_migration_api_6a_auth_7b_export_pull_b
+ - identifier: w_auth_5a_auth_5c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/api_6a.test.ts|src/__tests__/auth_7b.test.ts|src/__tests__/export-pull-b.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_5a.test.ts|src/__tests__/auth_5c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_init_special_case_http_migration_schema_auth_12_schema_auth_3
+ - identifier: w_env_1_geo_add_a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/init-special-case.test.ts|src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/schema-auth-12.test.ts|src/__tests__/schema-auth-3.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/env-1.test.ts|src/__tests__/geo-add-a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_function_2_auth_4b_auth_8a_export_pull_d
+ - identifier: w_init_a_schema_auth_4c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-function-2.test.ts|src/__tests__/auth_4b.test.ts|src/__tests__/auth_8a.test.ts|src/__tests__/export-pull-d.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/init_a.test.ts|src/__tests__/schema-auth-4c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_5a_schema_iterative_update_3_auth_migration_api_2a
+ - identifier: w_schema_auth_5c_auth_5b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-5a.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/api_2a.test.ts
- CLI_REGION: us-east-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-5c.test.ts|src/__tests__/auth_5b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_api_2b_api_6c_api_9a_auth_2g
+ - identifier: w_auth_9_env_5
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/api_2b.test.ts|src/__tests__/api_6c.test.ts|src/__tests__/api_9a.test.ts|src/__tests__/auth_2g.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_9.test.ts|src/__tests__/env-5.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_build_function_custom_resource_with_storage_dynamodb_simulator_export_pull_c
+ - identifier: w_function_10_function_9c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/build-function.test.ts|src/__tests__/custom-resource-with-storage.test.ts|src/__tests__/dynamodb-simulator/dynamodb-simulator.test.ts|src/__tests__/export-pull-c.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/function_10.test.ts|src/__tests__/function_9c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_function_12_function_2d_general_config_headless_init_help
+ - identifier: w_function_permissions_geo_import_1a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/function_12.test.ts|src/__tests__/function_2d.test.ts|src/__tests__/general-config/general-config-headless-init.test.ts|src/__tests__/help.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/function-permissions.test.ts|src/__tests__/geo-import-1a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_hooks_c_init_force_push_interactions_1_interactions_2
+ - identifier: w_geo_import_2_global_sandbox_b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/hooks-c.test.ts|src/__tests__/init-force-push.test.ts|src/__tests__/interactions-1.test.ts|src/__tests__/interactions-2.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/geo-import-2.test.ts|src/__tests__/global_sandbox-b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_minify_cloudformation_notifications_multi_env_parameter_store_1_parameter_store_2
+ - identifier: w_schema_auth_5d_schema_auth_6b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/minify-cloudformation.test.ts|src/__tests__/notifications-multi-env.test.ts|src/__tests__/parameter-store-1.test.ts|src/__tests__/parameter-store-2.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-5d.test.ts|src/__tests__/schema-auth-6b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_pull_2_push_smoketest_api_8
+ - identifier: w_schema_auth_8c_auth_3a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/pull-2.test.ts|src/__tests__/push.test.ts|src/__tests__/smoketest.test.ts|src/__tests__/api_8.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-8c.test.ts|src/__tests__/auth_3a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_iterative_update_locking_api_lambda_auth_2_schema_auth_13_function_5
+ - identifier: w_auth_3b_auth_4a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/api_lambda_auth_2.test.ts|src/__tests__/schema-auth-13.test.ts|src/__tests__/function_5.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_3b.test.ts|src/__tests__/auth_4a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_iterative_update_1_auth_6_function_2a_schema_connection_2
+ - identifier: w_auth_7a_auth_8c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/auth_6.test.ts|src/__tests__/function_2a.test.ts|src/__tests__/schema-connection-2.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_7a.test.ts|src/__tests__/auth_8c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_function_1_api_9b_custom_policies_container_function_9b
+ - identifier: w_feature_flags_geo_import_1b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-function-1.test.ts|src/__tests__/api_9b.test.ts|src/__tests__/custom_policies_container.test.ts|src/__tests__/function_9b.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/feature-flags.test.ts|src/__tests__/geo-import-1b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_iterative_update_2_storage_1a_storage_1b_function_11
+ - identifier: w_global_sandbox_a_init_e
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/storage-1a.test.ts|src/__tests__/storage-1b.test.ts|src/__tests__/function_11.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/global_sandbox-a.test.ts|src/__tests__/init_e.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_function_2b_api_connection_migration2_api_4_containers_api_secrets
+ - identifier: w_notifications_analytics_compatibility_in_app_2_schema_auth_11_c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/function_2b.test.ts|src/__tests__/migration/api.connection.migration2.test.ts|src/__tests__/api_4.test.ts|src/__tests__/containers-api-secrets.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/notifications-analytics-compatibility-in-app-2.test.ts|src/__tests__/schema-auth-11-c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_storage_4_schema_auth_10_geo_multi_env_searchable_datastore
+ - identifier: w_schema_auth_2b_schema_auth_6c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/storage-4.test.ts|src/__tests__/schema-auth-10.test.ts|src/__tests__/geo-multi-env.test.ts|src/__tests__/graphql-v2/searchable-datastore.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-2b.test.ts|src/__tests__/schema-auth-6c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_resolvers_schema_key_api_5_apigw
+ - identifier: w_schema_auth_6d_schema_auth_7c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/resolvers.test.ts|src/__tests__/schema-key.test.ts|src/__tests__/api_5.test.ts|src/__tests__/apigw.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-6d.test.ts|src/__tests__/schema-auth-7c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_api_lambda_auth_1_api_key_migration2_schema_searchable_api_key_migration1
+ - identifier: w_schema_auth_8a_function_migration
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/graphql-v2/api_lambda_auth_1.test.ts|src/__tests__/migration/api.key.migration2.test.ts|src/__tests__/schema-searchable.test.ts|src/__tests__/migration/api.key.migration1.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-8a.test.ts|src/__tests__/transformer-migrations/function-migration.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_14_api_3_api_6b_api_1
+ - identifier: w_api_10_api_7
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-14.test.ts|src/__tests__/api_3.test.ts|src/__tests__/api_6b.test.ts|src/__tests__/api_1.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/api_10.test.ts|src/__tests__/api_7.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_layer_1_api_key_migration4_schema_iterative_update_4_function_1
+ - identifier: w_export_pull_a_function_9a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/layer-1.test.ts|src/__tests__/migration/api.key.migration4.test.ts|src/__tests__/schema-iterative-update-4.test.ts|src/__tests__/function_1.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/export-pull-a.test.ts|src/__tests__/function_9a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_2c
+ - identifier: w_geo_headless_api_key_migration5
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_2c.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/geo-headless.test.ts|src/__tests__/migration/api.key.migration5.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_auth_2e
+ - identifier: w_schema_auth_1a_schema_auth_5b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/auth_2e.test.ts
- CLI_REGION: us-east-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-1a.test.ts|src/__tests__/schema-auth-5b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_env_3
+ - identifier: w_schema_auth_8b_schema_auth_9_a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/env-3.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-8b.test.ts|src/__tests__/schema-auth-9-a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_notifications_in_app_messaging
+ - identifier: w_schema_auth_9_c_storage_3
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/notifications-in-app-messaging.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-9-c.test.ts|src/__tests__/storage-3.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_11_a
+ - identifier: w_auth_11_auth_1b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-11-a.test.ts
- CLI_REGION: us-east-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/auth_11.test.ts|src/__tests__/auth_1b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_import_s3_3
+ - identifier: w_delete_geo_add_c
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/import_s3_3.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/delete.test.ts|src/__tests__/geo-add-c.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_hostingPROD
+ - identifier: w_geo_add_d_geo_import_3
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/hostingPROD.test.ts
- CLI_REGION: ap-southeast-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/geo-add-d.test.ts|src/__tests__/geo-import-3.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_containers_api_1
+ - identifier: w_hosting_layer_3
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/containers-api-1.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/hosting.test.ts|src/__tests__/layer-3.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_auth_15
+ - identifier: w_api_connection_migration_api_key_migration3
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-auth-15.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/migration/api.connection.migration.test.ts|src/__tests__/migration/api.key.migration3.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_schema_connection_1
+ - identifier: w_predictions_schema_auth_11_b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/schema-connection-1.test.ts
- CLI_REGION: ap-northeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/predictions.test.ts|src/__tests__/schema-auth-11-b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_containers_api_2
+ - identifier: w_schema_auth_1b_schema_auth_2a
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/containers-api-2.test.ts
- CLI_REGION: us-west-2
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/schema-auth-1b.test.ts|src/__tests__/schema-auth-2a.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_import_s3_1
+ - identifier: w_schema_auth_7a_schema_auth_7b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/import_s3_1.test.ts
- CLI_REGION: eu-west-2
- USE_PARENT_ACCOUNT: true
+ TEST_SUITE: src/__tests__/schema-auth-7a.test.ts|src/__tests__/schema-auth-7b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_searchable_migration
+ - identifier: w_schema_auth_9_b_predictions_migration
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts
- CLI_REGION: eu-central-1
- USE_PARENT_ACCOUNT: true
+ TEST_SUITE: src/__tests__/schema-auth-9-b.test.ts|src/__tests__/transformer-migrations/predictions-migration.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_geo_remove_1
+ - identifier: w_api_6a_auth_7b
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/geo-remove-1.test.ts
- CLI_REGION: ap-southeast-1
- USE_PARENT_ACCOUNT: false
+ TEST_SUITE: src/__tests__/api_6a.test.ts|src/__tests__/auth_7b.test.ts
depend-on:
- build_windows
- upb
- - identifier: w_import_dynamodb_1
+ - identifier: w_export_pull_b_init_special_case
buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/import_dynamodb_1.test.ts
- CLI_REGION: us-east-2
- USE_PARENT_ACCOUNT: true
+ TEST_SUITE: src/__tests__/export-pull-b.test.ts|src/__tests__/init-special-case.test.ts
depend-on:
- build_windows
- upb
- - identifier: l_notifications_migration_4_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_http_migration_schema_auth_12
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests/notifications-migration/notifications-migration-4.test.ts
- CLI_REGION: eu-west-2
+ TEST_SUITE: src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/schema-auth-12.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_api_key_migration_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_schema_auth_3_schema_function_2
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests/transformer_migration/api.key.migration.test.ts
- CLI_REGION: ap-southeast-2
+ TEST_SUITE: src/__tests__/schema-auth-3.test.ts|src/__tests__/schema-function-2.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_notifications_migration_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_auth_4b_auth_8a
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/auth_4b.test.ts|src/__tests__/auth_8a.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_export_pull_d_schema_auth_5a
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests/notifications-migration/notifications-migration.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/export-pull-d.test.ts|src/__tests__/schema-auth-5a.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_api_key_migration_2_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_schema_iterative_update_3_auth_migration
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests/transformer_migration/api.key.migration-2.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_notifications_migration_2_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_amplify_remove_api_2a
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests/notifications-migration/notifications-migration-2.test.ts
- CLI_REGION: ap-southeast-2
+ TEST_SUITE: src/__tests__/amplify-remove.test.ts|src/__tests__/api_2a.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_function_migration_update_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_api_2b_api_6c
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/update_tests/function_migration_update.test.ts
- CLI_REGION: ap-southeast-2
+ TEST_SUITE: src/__tests__/api_2b.test.ts|src/__tests__/api_6c.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_notifications_migration_3_v8
- buildspec: codebuild_specs/migration_tests_v8.yml
+ - identifier: w_api_9a_auth_2h
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests/notifications-migration/notifications-migration-3.test.ts
- CLI_REGION: eu-central-1
+ TEST_SUITE: src/__tests__/api_9a.test.ts|src/__tests__/auth_2h.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_scaffold_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_auth_5g_admin_api
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/scaffold.test.ts
- CLI_REGION: us-west-2
+ TEST_SUITE: src/__tests__/auth_5g.test.ts|src/__tests__/auth/admin-api.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_api_graphql_v2_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_hosted_ui_user_groups_s3_access
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/api-graphql-v2.migration.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/auth/hosted-ui.test.ts|src/__tests__/auth/user-groups-s3-access.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_api_rest_basic_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_user_groups_build_function_yarn_modern
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/api-rest-basic.migration.test.ts
- CLI_REGION: eu-west-2
+ TEST_SUITE: src/__tests__/auth/user-groups.test.ts|src/__tests__/build-function-yarn-modern.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_api_rest_lambda_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_build_function_dynamodb_simulator
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/api-rest-lambda.migration.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/build-function.test.ts|src/__tests__/dynamodb-simulator/dynamodb-simulator.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_api_rest_serverless_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_export_pull_c_function_12
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/api-rest-serverless.migration.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/export-pull-c.test.ts|src/__tests__/function_12.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_auth_add_all_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_function_13_function_14
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/auth-add-all.migration.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/function_13.test.ts|src/__tests__/function_14.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_auth_override_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_function_2d_general_config_headless_init
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/auth-override.migration.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/function_2d.test.ts|src/__tests__/general-config/general-config-headless-init.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_custom_stack_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_help_init_force_push
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/custom-stack.migration.test.ts
- CLI_REGION: us-east-1
+ TEST_SUITE: src/__tests__/help.test.ts|src/__tests__/init-force-push.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_geo_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_interactions_1_interactions_2
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/geo.migration.test.ts
+ TEST_SUITE: src/__tests__/interactions-1.test.ts|src/__tests__/interactions-2.test.ts
CLI_REGION: us-west-2
depend-on:
+ - build_windows
+ - upb
+ - identifier: w_minify_cloudformation_notifications_multi_env
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/minify-cloudformation.test.ts|src/__tests__/notifications-multi-env.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_notifications_sms_update_parameter_store_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/notifications-sms-update.test.ts|src/__tests__/parameter-store-1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_parameter_store_2_push
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/parameter-store-2.test.ts|src/__tests__/push.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_smoketest_ios_smoketest
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/smoke-tests/smoketest-ios.test.ts|src/__tests__/smoke-tests/smoketest.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_8_schema_iterative_update_locking
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/api_8.test.ts|src/__tests__/schema-iterative-update-locking.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_lambda_auth_2_schema_auth_13
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/graphql-v2/api_lambda_auth_2.test.ts|src/__tests__/schema-auth-13.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_function_5_schema_iterative_update_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/function_5.test.ts|src/__tests__/schema-iterative-update-1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_auth_6_function_2a
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/auth_6.test.ts|src/__tests__/function_2a.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_schema_connection_2_schema_function_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/schema-connection-2.test.ts|src/__tests__/schema-function-1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_9b_custom_policies_container
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/api_9b.test.ts|src/__tests__/custom_policies_container.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_function_9b_schema_iterative_update_2
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/function_9b.test.ts|src/__tests__/schema-iterative-update-2.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_storage_1a_storage_1b
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/storage-1a.test.ts|src/__tests__/storage-1b.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_function_11_function_2b
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/function_11.test.ts|src/__tests__/function_2b.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_connection_migration2_api_4
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/migration/api.connection.migration2.test.ts|src/__tests__/api_4.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_containers_api_secrets_storage_4
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/containers-api-secrets.test.ts|src/__tests__/storage-4.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_schema_auth_10_geo_multi_env
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/schema-auth-10.test.ts|src/__tests__/geo-multi-env.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_searchable_datastore_resolvers
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts|src/__tests__/resolvers.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_schema_key_api_5
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/schema-key.test.ts|src/__tests__/api_5.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_apigw_api_lambda_auth_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/apigw.test.ts|src/__tests__/graphql-v2/api_lambda_auth_1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_key_migration2_schema_searchable
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts|src/__tests__/schema-searchable.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_key_migration1_schema_auth_14
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/migration/api.key.migration1.test.ts|src/__tests__/schema-auth-14.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_3_api_6b
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/api_3.test.ts|src/__tests__/api_6b.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_1_layer_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/api_1.test.ts|src/__tests__/layer-1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_api_key_migration4_schema_iterative_update_4
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/migration/api.key.migration4.test.ts|src/__tests__/schema-iterative-update-4.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_function_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/function_1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_auth_2c
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/auth_2c.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_auth_2e
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/auth_2e.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_env_3
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/env-3.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_notifications_in_app_messaging
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/notifications-in-app-messaging.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_schema_auth_11_a
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/schema-auth-11-a.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_import_s3_3
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/import_s3_3.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_js_frontend_config
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/aws-exports/js-frontend-config.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_hostingPROD
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/hostingPROD.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_containers_api_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/containers-api-1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_schema_auth_15
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/schema-auth-15.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_schema_connection_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/schema-connection-1.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_containers_api_2
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/containers-api-2.test.ts
+ depend-on:
+ - build_windows
+ - upb
+ - identifier: w_import_s3_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
+ env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
+ variables:
+ TEST_SUITE: src/__tests__/import_s3_1.test.ts
+ USE_PARENT_ACCOUNT: 1
+ depend-on:
+ - build_windows
- upb
- - identifier: l_git_clone_migration_tests_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_searchable_migration
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/git-clone-migration-tests.test.ts
- CLI_REGION: ap-southeast-1
+ TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts
+ USE_PARENT_ACCOUNT: 1
depend-on:
+ - build_windows
- upb
- - identifier: l_pinpoint_region_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_geo_remove_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/pinpoint-region.migration.test.ts
- CLI_REGION: us-east-2
+ TEST_SUITE: src/__tests__/geo-remove-1.test.ts
depend-on:
+ - build_windows
- upb
- - identifier: l_storage_migration_v10
- buildspec: codebuild_specs/migration_tests_v10.yml
+ - identifier: w_import_dynamodb_1
+ buildspec: codebuild_specs/run_e2e_tests_windows.yml
env:
+ type: WINDOWS_SERVER_2019_CONTAINER
+ image: $WINDOWS_IMAGE_2019
variables:
- TEST_SUITE: src/__tests__/migration_tests_v10/storage.migration.test.ts
- CLI_REGION: eu-west-2
+ TEST_SUITE: src/__tests__/import_dynamodb_1.test.ts
+ USE_PARENT_ACCOUNT: 1
depend-on:
+ - build_windows
- upb
- identifier: aggregate_e2e_reports
env:
diff --git a/codebuild_specs/install_and_cache_dependencies.yml b/codebuild_specs/install_and_cache_dependencies.yml
new file mode 100644
index 00000000000..f47303d6fbc
--- /dev/null
+++ b/codebuild_specs/install_and_cache_dependencies.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _installAndCacheDependencies
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/integration_test.yml b/codebuild_specs/integration_test.yml
index a10bf68e498..9cb01d8924f 100644
--- a/codebuild_specs/integration_test.yml
+++ b/codebuild_specs/integration_test.yml
@@ -1,10 +1,13 @@
version: 0.2
env:
shell: bash
+ variables:
+ CI: true
+ CIRCLECI: true
+ IS_AMPLIFY_CI: true
phases:
build:
commands:
- - echo "integration testing"
- source ./shared-scripts.sh && _integrationTest
artifacts:
files:
diff --git a/codebuild_specs/lint.yml b/codebuild_specs/lint.yml
index 7363c6c10d0..4dd41678530 100644
--- a/codebuild_specs/lint.yml
+++ b/codebuild_specs/lint.yml
@@ -5,3 +5,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _lint
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/migration_tests_v8.yml b/codebuild_specs/migration_tests_v8.yml
deleted file mode 100644
index 6993dd93ae4..00000000000
--- a/codebuild_specs/migration_tests_v8.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-version: 0.2
-env:
- shell: bash
- compute-type: BUILD_GENERAL1_SMALL
- variables:
- CI: true
- CIRCLECI: true
- # mock values to test artifact scanning
- ENV_VAR_WITH_SECRETS: 'MOCK_ENV_VAR_FOR_SCANNING_SECRETS'
- MOCK_ENV_VAR_FOR_SCANNING_SECRETS: 'abc123xyz'
-
- # mock values for credentials below
- FACEBOOK_APP_ID: 'fbAppId'
- FACEBOOK_APP_SECRET: 'fbAppSecret'
- GOOGLE_APP_ID: 'gglAppID'
- GOOGLE_APP_SECRET: 'gglAppSecret'
- AMAZON_APP_ID: 'amaznAppID'
- AMAZON_APP_SECRET: 'amaznAppID'
- APPLE_APP_ID: 'com.fake.app'
- APPLE_TEAM_ID: '2QLEWNDK6K'
- APPLE_KEY_ID: '2QLZXKYJ8J'
- # mock value, Cognito validates the private key, this is an invalidated key.
- APPLE_PRIVATE_KEY_2: '----BEGIN PRIVATE KEY-----MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgIltgNsTgTfSzUadYiCS0VYtDDMFln/J8i1yJsSIw5g+gCgYIKoZIzj0DAQehRANCAASI8E0L/DhR/mIfTT07v3VwQu6q8I76lgn7kFhT0HvWoLuHKGQFcFkXXCgztgBrprzd419mUChAnKE6y89bWcNw----END PRIVATE KEY----'
-phases:
- build:
- commands:
- # you can provide a codebuild source version to use old cache and skip all other jobs :)
- - export NODE_OPTIONS=--max-old-space-size=8096
- - export AMPLIFY_DIR=$CODEBUILD_SRC_DIR/out
- - export AMPLIFY_PATH=$HOME/.npm-global/bin/amplify
- - echo $AMPLIFY_DIR
- - echo $AMPLIFY_PATH
- - source ./shared-scripts.sh && _runMigrationV8Test
- post_build:
- commands:
- - source ./shared-scripts.sh && _scanArtifacts
- - source ./shared-scripts.sh && _uploadReportsToS3 $CODEBUILD_SOURCE_VERSION $CODEBUILD_BATCH_BUILD_IDENTIFIER amplify-migration-tests
-reports:
- e2e-reports:
- files:
- - '*.xml'
- file-format: 'JUNITXML'
- base-directory: '$CODEBUILD_SRC_DIR/packages/amplify-migration-tests/reports/junit'
-artifacts:
- files:
- - $CODEBUILD_SRC_DIR/packages/amplify-migration-tests/amplify-migration-reports/*
diff --git a/codebuild_specs/mock_e2e_tests.yml b/codebuild_specs/mock_e2e_tests.yml
index 371ec92cd74..8a27fa68370 100644
--- a/codebuild_specs/mock_e2e_tests.yml
+++ b/codebuild_specs/mock_e2e_tests.yml
@@ -8,3 +8,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _mockE2ETests
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml
index 421a8d92d5d..aec50c0a503 100644
--- a/codebuild_specs/pr_workflow.yml
+++ b/codebuild_specs/pr_workflow.yml
@@ -14,67 +14,90 @@ env:
batch:
fast-fail: false
build-graph:
+ - identifier: build_tests_standalone
+ buildspec: codebuild_specs/build_tests_standalone.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: build_linux
buildspec: codebuild_specs/build_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
- identifier: test
buildspec: codebuild_specs/test.yml
+ depend-on:
+ - build_linux
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: lint
+ buildspec: codebuild_specs/lint.yml
depend-on:
- build_linux
- - identifier: mock_e2e_tests
- buildspec: codebuild_specs/mock_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: mock_e2e_tests
+ buildspec: codebuild_specs/mock_e2e_tests.yml
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: validate_cdk_version
buildspec: codebuild_specs/validate_cdk_version.yml
depend-on:
- build_linux
- identifier: verify_api_extract
buildspec: codebuild_specs/verify_api_extract.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_yarn_lock
buildspec: codebuild_specs/verify_yarn_lock.yml
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: codebuild_specs/publish_to_local_registry.yml
- env:
- compute-type: BUILD_GENERAL1_LARGE
depend-on:
- build_linux
- - identifier: build_pkg_binaries_arm
- buildspec: codebuild_specs/build_pkg_binaries_arm.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_linux
- buildspec: codebuild_specs/build_pkg_binaries_linux.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
depend-on:
- publish_to_local_registry
- - identifier: build_pkg_binaries_macos
- buildspec: codebuild_specs/build_pkg_binaries_macos.yml
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
depend-on:
- publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: build_pkg_binaries_win
buildspec: codebuild_specs/build_pkg_binaries_win.yml
+ depend-on:
+ - publish_to_local_registry
env:
compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
depend-on:
- - publish_to_local_registry
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
- identifier: verify_versions_match
buildspec: codebuild_specs/verify_versions_match.yml
depend-on:
- publish_to_local_registry
+ - identifier: verify_e2e_workflow_generated
+ buildspec: codebuild_specs/verify_e2e_workflow_generated.yml
+ depend-on:
+ - build_linux
diff --git a/codebuild_specs/publish_to_npm.yml b/codebuild_specs/publish_to_npm.yml
new file mode 100644
index 00000000000..d2afae54a99
--- /dev/null
+++ b/codebuild_specs/publish_to_npm.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+ git-credential-helper: yes
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _publishToNpm
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/release_workflows/github_prerelease.yml b/codebuild_specs/release_workflows/github_prerelease.yml
new file mode 100644
index 00000000000..a8f14403ccc
--- /dev/null
+++ b/codebuild_specs/release_workflows/github_prerelease.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _githubPrerelease
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/release_workflows/github_prerelease_install_sanity_check.yml b/codebuild_specs/release_workflows/github_prerelease_install_sanity_check.yml
new file mode 100644
index 00000000000..eff54e84f33
--- /dev/null
+++ b/codebuild_specs/release_workflows/github_prerelease_install_sanity_check.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _githubPrereleaseInstallSanityCheck
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/release_workflows/github_release.yml b/codebuild_specs/release_workflows/github_release.yml
new file mode 100644
index 00000000000..2fe2313d8c1
--- /dev/null
+++ b/codebuild_specs/release_workflows/github_release.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _githubRelease
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/release_workflows/github_rollback.yml b/codebuild_specs/release_workflows/github_rollback.yml
new file mode 100644
index 00000000000..54264604f37
--- /dev/null
+++ b/codebuild_specs/release_workflows/github_rollback.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _githubRollback
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/release_workflows/hotfix_workflow.yml b/codebuild_specs/release_workflows/hotfix_workflow.yml
new file mode 100644
index 00000000000..070f1a4eda0
--- /dev/null
+++ b/codebuild_specs/release_workflows/hotfix_workflow.yml
@@ -0,0 +1,92 @@
+version: 0.2
+env:
+ shell: bash
+ compute-type: BUILD_GENERAL1_MEDIUM
+ variables:
+ AWS_DEFAULT_REGION: us-east-1
+ AWS_REGION: us-east-1
+ CDK_DEFAULT_REGION: us-east-1
+ CLI_REGION: us-east-1
+ AMPLIFY_DIR: '$CODEBUILD_SRC_DIR/out'
+ AMPLIFY_PATH: '$CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64'
+
+batch:
+ fast-fail: false
+ build-graph:
+ - identifier: build_tests_standalone
+ buildspec: codebuild_specs/build_tests_standalone.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_linux
+ buildspec: codebuild_specs/build_linux.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: test
+ buildspec: codebuild_specs/test.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: mock_e2e_tests
+ buildspec: codebuild_specs/mock_e2e_tests.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: validate_cdk_version
+ buildspec: codebuild_specs/validate_cdk_version.yml
+ depend-on:
+ - build_linux
+ - identifier: verify_api_extract
+ buildspec: codebuild_specs/verify_api_extract.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_yarn_lock
+ buildspec: codebuild_specs/verify_yarn_lock.yml
+ depend-on:
+ - build_linux
+ - identifier: publish_to_local_registry
+ buildspec: codebuild_specs/publish_to_local_registry.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_versions_match
+ buildspec: codebuild_specs/verify_versions_match.yml
+ depend-on:
+ - publish_to_local_registry
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
diff --git a/codebuild_specs/release_workflows/post_publish_push_to_git.yml b/codebuild_specs/release_workflows/post_publish_push_to_git.yml
new file mode 100644
index 00000000000..80b7da60f18
--- /dev/null
+++ b/codebuild_specs/release_workflows/post_publish_push_to_git.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+ git-credential-helper: yes
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _postPublishPushToGit
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/release_workflows/release_rc_workflow.yml b/codebuild_specs/release_workflows/release_rc_workflow.yml
new file mode 100644
index 00000000000..04e50f4eb9e
--- /dev/null
+++ b/codebuild_specs/release_workflows/release_rc_workflow.yml
@@ -0,0 +1,109 @@
+version: 0.2
+env:
+ shell: bash
+ compute-type: BUILD_GENERAL1_MEDIUM
+ git-credential-helper: yes
+ variables:
+ AWS_DEFAULT_REGION: us-east-1
+ AWS_REGION: us-east-1
+ CDK_DEFAULT_REGION: us-east-1
+ CLI_REGION: us-east-1
+ AMPLIFY_DIR: '$CODEBUILD_SRC_DIR/out'
+ AMPLIFY_PATH: '$CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64'
+
+batch:
+ fast-fail: false
+ build-graph:
+ - identifier: build_linux
+ buildspec: codebuild_specs/build_linux.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: validate_cdk_version
+ buildspec: codebuild_specs/validate_cdk_version.yml
+ depend-on:
+ - build_linux
+ - identifier: verify_yarn_lock
+ buildspec: codebuild_specs/verify_yarn_lock.yml
+ depend-on:
+ - build_linux
+ - identifier: publish_to_local_registry
+ buildspec: codebuild_specs/publish_to_local_registry.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: upb
+ buildspec: codebuild_specs/upload_pkg_binaries.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_versions_match
+ buildspec: codebuild_specs/verify_versions_match.yml
+ depend-on:
+ - publish_to_local_registry
+ - identifier: publish_to_npm
+ buildspec: codebuild_specs/publish_to_npm.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ git-credential-helper: yes
+ debug-session: true
+ depend-on:
+ - upb
+ - publish_to_local_registry
+ - verify_versions_match
+ - validate_cdk_version
+ - verify_yarn_lock
+ - verify_pkg_cli
+ - identifier: deployment_verification_rc_or_tagged
+ buildspec: codebuild_specs/deployment_verification_rc_or_tagged.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ git-credential-helper: yes
+ debug-session: true
+ depend-on:
+ - publish_to_npm
+ - identifier: post_publish_push_to_git
+ buildspec: codebuild_specs/release_workflows/post_publish_push_to_git.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ git-credential-helper: yes
+ debug-session: true
+ depend-on:
+ - publish_to_npm
diff --git a/codebuild_specs/release_workflows/release_workflow.yml b/codebuild_specs/release_workflows/release_workflow.yml
new file mode 100644
index 00000000000..ee5f7a4ff3b
--- /dev/null
+++ b/codebuild_specs/release_workflows/release_workflow.yml
@@ -0,0 +1,126 @@
+version: 0.2
+env:
+ shell: bash
+ compute-type: BUILD_GENERAL1_MEDIUM
+ git-credential-helper: yes
+ variables:
+ AWS_DEFAULT_REGION: us-east-1
+ AWS_REGION: us-east-1
+ CDK_DEFAULT_REGION: us-east-1
+ CLI_REGION: us-east-1
+ AMPLIFY_DIR: '$CODEBUILD_SRC_DIR/out'
+ AMPLIFY_PATH: '$CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64'
+
+batch:
+ fast-fail: false
+ build-graph:
+ - identifier: build_linux
+ buildspec: codebuild_specs/build_linux.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: validate_cdk_version
+ buildspec: codebuild_specs/validate_cdk_version.yml
+ depend-on:
+ - build_linux
+ - identifier: verify_yarn_lock
+ buildspec: codebuild_specs/verify_yarn_lock.yml
+ depend-on:
+ - build_linux
+ - identifier: publish_to_local_registry
+ buildspec: codebuild_specs/publish_to_local_registry.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: upb
+ buildspec: codebuild_specs/upload_pkg_binaries.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_versions_match
+ buildspec: codebuild_specs/verify_versions_match.yml
+ depend-on:
+ - publish_to_local_registry
+ - identifier: github_prerelease
+ buildspec: codebuild_specs/release_workflows/github_prerelease.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ debug-session: true
+ depend-on:
+ - upb
+ - identifier: github_prerelease_install_sanity_check
+ buildspec: codebuild_specs/release_workflows/github_prerelease_install_sanity_check.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ debug-session: true
+ depend-on:
+ - github_prerelease
+ - identifier: publish_to_npm
+ buildspec: codebuild_specs/publish_to_npm.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ debug-session: true
+ depend-on:
+ - upb
+ - verify_versions_match
+ - github_prerelease_install_sanity_check
+ - publish_to_local_registry
+ - validate_cdk_version
+ - verify_yarn_lock
+ - verify_pkg_cli
+ - identifier: post_publish_push_to_git
+ buildspec: codebuild_specs/release_workflows/post_publish_push_to_git.yml
+ depend-on:
+ - publish_to_npm
+ - identifier: github_release
+ buildspec: codebuild_specs/release_workflows/github_release.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ debug-session: true
+ depend-on:
+ - post_publish_push_to_git
+ - identifier: deployment_verification_post_release
+ buildspec: codebuild_specs/deployment_verification_post_release.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ git-credential-helper: yes
+ debug-session: true
+ depend-on:
+ - github_release
diff --git a/codebuild_specs/release_workflows/rollback_workflow.yml b/codebuild_specs/release_workflows/rollback_workflow.yml
new file mode 100644
index 00000000000..4337a76e3f0
--- /dev/null
+++ b/codebuild_specs/release_workflows/rollback_workflow.yml
@@ -0,0 +1,34 @@
+version: 0.2
+env:
+ shell: bash
+ compute-type: BUILD_GENERAL1_MEDIUM
+ git-credential-helper: yes
+ variables:
+ AWS_DEFAULT_REGION: us-east-1
+ AWS_REGION: us-east-1
+ CDK_DEFAULT_REGION: us-east-1
+ CLI_REGION: us-east-1
+
+batch:
+ fast-fail: false
+ build-graph:
+ - identifier: install_dependencies
+ buildspec: codebuild_specs/install_and_cache_dependencies.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: validate_rollback_target_version
+ buildspec: codebuild_specs/validate_rollback_target_version.yml
+ depend-on:
+ - install_dependencies
+ - identifier: github_rollback
+ buildspec: codebuild_specs/release_workflows/github_rollback.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - validate_rollback_target_version
+ - identifier: rollback_npm
+ buildspec: codebuild_specs/rollback_npm.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ depend-on:
+ - validate_rollback_target_version
diff --git a/codebuild_specs/release_workflows/tagged_release_without_e2e_workflow.yml b/codebuild_specs/release_workflows/tagged_release_without_e2e_workflow.yml
new file mode 100644
index 00000000000..18b27f14dc3
--- /dev/null
+++ b/codebuild_specs/release_workflows/tagged_release_without_e2e_workflow.yml
@@ -0,0 +1,107 @@
+version: 0.2
+env:
+ shell: bash
+ compute-type: BUILD_GENERAL1_MEDIUM
+ variables:
+ AWS_DEFAULT_REGION: us-east-1
+ AWS_REGION: us-east-1
+ CDK_DEFAULT_REGION: us-east-1
+ CLI_REGION: us-east-1
+ AMPLIFY_DIR: '$CODEBUILD_SRC_DIR/out'
+ AMPLIFY_PATH: '$CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64'
+
+batch:
+ fast-fail: false
+ build-graph:
+ - identifier: build_linux
+ buildspec: codebuild_specs/build_linux.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: validate_cdk_version
+ buildspec: codebuild_specs/validate_cdk_version.yml
+ depend-on:
+ - build_linux
+ - identifier: verify_yarn_lock
+ buildspec: codebuild_specs/verify_yarn_lock.yml
+ depend-on:
+ - build_linux
+ - identifier: publish_to_local_registry
+ buildspec: codebuild_specs/publish_to_local_registry.yml
+ depend-on:
+ - build_linux
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_arm
+ buildspec: codebuild_specs/build_pkg_binaries_arm.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_linux
+ buildspec: codebuild_specs/build_pkg_binaries_linux.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_macos
+ buildspec: codebuild_specs/build_pkg_binaries_macos.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: build_pkg_binaries_win
+ buildspec: codebuild_specs/build_pkg_binaries_win.yml
+ depend-on:
+ - publish_to_local_registry
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: upb
+ buildspec: codebuild_specs/upload_pkg_binaries.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_pkg_cli
+ buildspec: codebuild_specs/verify_pkg_cli.yml
+ depend-on:
+ - build_pkg_binaries_arm
+ - build_pkg_binaries_linux
+ - build_pkg_binaries_macos
+ - build_pkg_binaries_win
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ - identifier: verify_versions_match
+ buildspec: codebuild_specs/verify_versions_match.yml
+ depend-on:
+ - publish_to_local_registry
+ - identifier: publish_to_npm
+ buildspec: codebuild_specs/publish_to_npm.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ debug-session: true
+ depend-on:
+ - upb
+ - verify_versions_match
+ - publish_to_local_registry
+ - validate_cdk_version
+ - verify_yarn_lock
+ - verify_pkg_cli
+ - identifier: deployment_verification_rc_or_tagged
+ buildspec: codebuild_specs/deployment_verification_rc_or_tagged.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ git-credential-helper: yes
+ debug-session: true
+ depend-on:
+ - publish_to_npm
+ - identifier: post_publish_push_to_git
+ buildspec: codebuild_specs/release_workflows/post_publish_push_to_git.yml
+ env:
+ compute-type: BUILD_GENERAL1_LARGE
+ git-credential-helper: yes
+ debug-session: true
+ depend-on:
+ - publish_to_npm
diff --git a/codebuild_specs/rollback_npm.yml b/codebuild_specs/rollback_npm.yml
new file mode 100644
index 00000000000..fbc574b9275
--- /dev/null
+++ b/codebuild_specs/rollback_npm.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+ git-credential-helper: yes
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _rollbackNpm
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/run_e2e_tests_linux.yml b/codebuild_specs/run_e2e_tests_linux.yml
index ae1d54fac5a..c20e7d02980 100644
--- a/codebuild_specs/run_e2e_tests_linux.yml
+++ b/codebuild_specs/run_e2e_tests_linux.yml
@@ -5,6 +5,7 @@ env:
E2E_TEST_COVERAGE_DIR: node_v8_coverage
CI: true
CIRCLECI: true
+ IS_AMPLIFY_CI: true
# mock values to test artifact scanning
ENV_VAR_WITH_SECRETS: 'MOCK_ENV_VAR_FOR_SCANNING_SECRETS'
MOCK_ENV_VAR_FOR_SCANNING_SECRETS: 'abc123xyz'
@@ -25,7 +26,7 @@ phases:
build:
commands:
# you can provide a codebuild source version to use old cache and skip all other jobs :)
- - export NODE_OPTIONS=--max-old-space-size=8096
+ - export NODE_OPTIONS=--max-old-space-size=4096
- export AMPLIFY_DIR=$CODEBUILD_SRC_DIR/out
- export AMPLIFY_PATH=$CODEBUILD_SRC_DIR/out/amplify-pkg-linux-x64
- echo $AMPLIFY_DIR
diff --git a/codebuild_specs/run_e2e_tests_windows.yml b/codebuild_specs/run_e2e_tests_windows.yml
index 9a00c8594cb..b7fc92e94e8 100644
--- a/codebuild_specs/run_e2e_tests_windows.yml
+++ b/codebuild_specs/run_e2e_tests_windows.yml
@@ -2,10 +2,10 @@ version: 0.2
env:
shell: powershell.exe
variables:
- CLI_REGION: us-east-1
TEST_SUITE: src/__tests__/auth_2a.test.ts|src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts|src/__tests__/auth_2f.test.ts
CI: true
CIRCLECI: true
+ IS_AMPLIFY_CI: true
# mock values to test artifact scanning
ENV_VAR_WITH_SECRETS: 'MOCK_ENV_VAR_FOR_SCANNING_SECRETS'
MOCK_ENV_VAR_FOR_SCANNING_SECRETS: 'abc123xyz'
@@ -25,10 +25,19 @@ env:
phases:
build:
commands:
- - choco install -fy jq
+ - git config --global core.longpaths true
- bash ./codebuild_specs/scripts-windows/load-e2e-cache.sh
- bash ./codebuild_specs/scripts-windows/rename-packaged-cli.sh
- bash ./codebuild_specs/scripts-windows/run-e2e-windows.sh
+ post_build:
+ commands:
+ - bash ./codebuild_specs/upload-reports-windows.sh
+reports:
+ e2e-reports:
+ files:
+ - '*.xml'
+ file-format: 'JUNITXML'
+ base-directory: 'packages/amplify-e2e-tests/reports/junit'
artifacts:
files:
- '$E2E_TEST_COVERAGE_DIR/*'
diff --git a/codebuild_specs/scripts-windows/load-e2e-cache.sh b/codebuild_specs/scripts-windows/load-e2e-cache.sh
index 593619b7691..6d5b2f5c62d 100644
--- a/codebuild_specs/scripts-windows/load-e2e-cache.sh
+++ b/codebuild_specs/scripts-windows/load-e2e-cache.sh
@@ -4,7 +4,6 @@ source ./codebuild_specs/scripts-windows/shared-scripts-windows.sh
# export CODEBUILD_SOURCE_VERSION=e1dce3fd6083503048f8d6eec3c09cf1b5d8a007
loadCache repo-windows $CODEBUILD_SRC_DIR
-loadCache .cache-windows $HOME/AppData/Local/Yarn/Cache/v6
loadCache verdaccio-cache $CODEBUILD_SRC_DIR/../verdaccio-cache
loadCache all-binaries $CODEBUILD_SRC_DIR/out
diff --git a/codebuild_specs/scripts-windows/run-e2e-windows.sh b/codebuild_specs/scripts-windows/run-e2e-windows.sh
index eab1d5b9c00..b04d0b89741 100644
--- a/codebuild_specs/scripts-windows/run-e2e-windows.sh
+++ b/codebuild_specs/scripts-windows/run-e2e-windows.sh
@@ -8,10 +8,14 @@ export MSYS2_ARG_CONV_EXCL="*"
export AMPLIFY_DIR=$CODEBUILD_SRC_DIR\\out
export AMPLIFY_PATH=$CODEBUILD_SRC_DIR\\out\\amplify.exe
+export NODE_OPTIONS=--max-old-space-size=5120
-source .circleci/local_publish_helpers.sh
+source .circleci/local_publish_helpers_codebuild.sh
source ./codebuild_specs/scripts-windows/shared-scripts-windows.sh
+export CLI_REGION=$(yarn ts-node ./scripts/select-region-for-e2e-test.ts)
+echo "Test will run in $CLI_REGION"
+
# source $BASH_ENV
amplify version
diff --git a/codebuild_specs/scripts-windows/shared-scripts-windows.sh b/codebuild_specs/scripts-windows/shared-scripts-windows.sh
index ae0100663bd..664d4efc1cb 100644
--- a/codebuild_specs/scripts-windows/shared-scripts-windows.sh
+++ b/codebuild_specs/scripts-windows/shared-scripts-windows.sh
@@ -98,9 +98,6 @@ function _loadTestAccountCredentials {
function _lsOut {
ls ..
ls ~
- ls $HOME
- ls $HOME/..
- ls $HOME/../..
}
function _build {
echo Windows Build
@@ -110,7 +107,6 @@ function _build {
function _saveBuild {
_lsOut
storeCache $CODEBUILD_SRC_DIR repo-windows
- storeCache $HOME/AppData/Local/Yarn/Cache/v6 .cache-windows
}
function _install_packaged_cli_win {
echo Install Amplify Packaged CLI to PATH
@@ -121,8 +117,8 @@ function _install_packaged_cli_win {
echo Move to CLI Binary to already existing PATH
# This is a Hack to make sure the Amplify CLI is in the PATH
- cp $CODEBUILD_SRC_DIR/out/amplify.exe $HOME/AppData/Local/Microsoft/WindowsApps
- ls $HOME/AppData/Local/Microsoft/WindowsApps
+ cp $CODEBUILD_SRC_DIR/out/amplify.exe C:/Users/ContainerAdministrator/AppData/Local/Microsoft/WindowsApps
+ ls C:/Users/ContainerAdministrator/AppData/Local/Microsoft/WindowsApps
# reset working directory
cd $CODEBUILD_SRC_DIR
diff --git a/codebuild_specs/scripts-windows/wait-windows.sh b/codebuild_specs/scripts-windows/wait-windows.sh
new file mode 100644
index 00000000000..e11087209fa
--- /dev/null
+++ b/codebuild_specs/scripts-windows/wait-windows.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# set exit on error to true
+set -e
+
+export MSYS_NO_PATHCONV=1
+export MSYS2_ARG_CONV_EXCL="*"
+
+export NODE_OPTIONS=--max-old-space-size=4096
+
+source shared-scripts.sh
+_waitForJobs $CODEBUILD_SRC_DIR/codebuild_specs/wait_windows.json requirePrevJobsToSucceed
diff --git a/codebuild_specs/sh-files/aws-configure-credentials.py b/codebuild_specs/sh-files/aws-configure-credentials.py
deleted file mode 100644
index 578d3a5f771..00000000000
--- a/codebuild_specs/sh-files/aws-configure-credentials.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import os
-
-AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
-AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
-AWS_SESSION_TOKEN = os.environ['AWS_SESSION_TOKEN']
-
-credentials_file_contents = f'''[default]
-aws_access_key_id={AWS_ACCESS_KEY_ID}
-aws_secret_access_key={AWS_SECRET_ACCESS_KEY}
-aws_session_token={AWS_SESSION_TOKEN}
-
-'''
-
-config_file_contents = '''[default]
-region=us-west-2
-
-'''
-
-with open('/root/.aws/credentials', 'w') as f:
- f.write(credentials_file_contents)
-
-with open('/root/.aws/config', 'w') as f:
- f.write(config_file_contents)
diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml
index c38b781d65e..080b4b9a39e 100644
--- a/codebuild_specs/test.yml
+++ b/codebuild_specs/test.yml
@@ -7,3 +7,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _testLinux
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/upload-reports-windows.sh b/codebuild_specs/upload-reports-windows.sh
new file mode 100644
index 00000000000..79d71ecf800
--- /dev/null
+++ b/codebuild_specs/upload-reports-windows.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -e
+export MSYS_NO_PATHCONV=1
+export MSYS2_ARG_CONV_EXCL="*"
+source ./shared-scripts.sh
+_uploadReportsToS3 $CODEBUILD_SOURCE_VERSION $CODEBUILD_BATCH_BUILD_IDENTIFIER amplify-e2e-tests
diff --git a/codebuild_specs/validate_cdk_version.yml b/codebuild_specs/validate_cdk_version.yml
index f1bf130dbc6..383ce7c3ab4 100644
--- a/codebuild_specs/validate_cdk_version.yml
+++ b/codebuild_specs/validate_cdk_version.yml
@@ -5,3 +5,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _validateCDKVersion
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/validate_rollback_target_version.yml b/codebuild_specs/validate_rollback_target_version.yml
new file mode 100644
index 00000000000..47f0ecdc45d
--- /dev/null
+++ b/codebuild_specs/validate_rollback_target_version.yml
@@ -0,0 +1,11 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _validateRollbackTargetVersion
+
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/verify_api_extract.yml b/codebuild_specs/verify_api_extract.yml
index ac360de6cfd..a850e12103a 100644
--- a/codebuild_specs/verify_api_extract.yml
+++ b/codebuild_specs/verify_api_extract.yml
@@ -5,3 +5,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _verifyAPIExtract
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/verify_e2e_workflow_generated.yml b/codebuild_specs/verify_e2e_workflow_generated.yml
new file mode 100644
index 00000000000..04059eae6e3
--- /dev/null
+++ b/codebuild_specs/verify_e2e_workflow_generated.yml
@@ -0,0 +1,10 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _verifyGeneratedE2EWorkflow
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/verify_pkg_cli.yml b/codebuild_specs/verify_pkg_cli.yml
new file mode 100644
index 00000000000..43dcd188d81
--- /dev/null
+++ b/codebuild_specs/verify_pkg_cli.yml
@@ -0,0 +1,10 @@
+version: 0.2
+env:
+ shell: bash
+phases:
+ build:
+ commands:
+ - source ./shared-scripts.sh && _verifyPkgCLI
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/verify_versions_match.yml b/codebuild_specs/verify_versions_match.yml
index 7a3474e4d52..209140983c6 100644
--- a/codebuild_specs/verify_versions_match.yml
+++ b/codebuild_specs/verify_versions_match.yml
@@ -5,3 +5,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _verifyVersionsMatch
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/verify_yarn_lock.yml b/codebuild_specs/verify_yarn_lock.yml
index 9fba2102f79..106c538b451 100644
--- a/codebuild_specs/verify_yarn_lock.yml
+++ b/codebuild_specs/verify_yarn_lock.yml
@@ -5,3 +5,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _verifyYarnLock
+artifacts:
+ files:
+ - 'shared-scripts.sh'
diff --git a/codebuild_specs/wait_for_ids.json b/codebuild_specs/wait_for_ids.json
index 19af2983a39..805a1d24d5d 100644
--- a/codebuild_specs/wait_for_ids.json
+++ b/codebuild_specs/wait_for_ids.json
@@ -1,61 +1,67 @@
[
- "l_analytics_2_global_sandbox_c_hooks_b_notifications_analytics_compatibility_sms_1",
- "l_api_10_api_7_export_pull_a_function_9a",
- "l_api_2b_api_6c_api_9a_auth_12",
- "l_api_4_containers_api_secrets_storage_4_schema_auth_10",
- "l_api_5_apigw_api_lambda_auth_1_api_key_migration2",
- "l_api_6b_api_1_layer_1_api_key_migration4",
- "l_api_connection_migration_api_key_migration3_predictions_schema_auth_11_b",
- "l_api_graphql_v2_migration_v10",
- "l_api_key_migration_2_v8",
- "l_api_key_migration_v8",
- "l_api_rest_basic_migration_v10",
- "l_api_rest_lambda_migration_v10",
- "l_api_rest_serverless_migration_v10",
- "l_auth_11_auth_1b_delete_geo_add_c",
- "l_auth_1a_auth_trigger_custom_policies_function_function_6",
- "l_auth_1c_auth_5e_auth_8b_geo_add_b",
- "l_auth_2a_auth_2b_auth_2d_auth_2f",
+ "l_amplify_app",
+ "l_amplify_configure_env_2_init_d",
+ "l_analytics_kinesis_analytics_pinpoint_flutter_analytics_pinpoint_js",
+ "l_android_analytics_pinpoint_config_android_notifications_pinpoint_config_flutter_analytics_pinpoint_config",
+ "l_api_2b_api_6c_api_9a",
+ "l_api_3_api_6b_api_1",
+ "l_api_4_containers_api_secrets_storage_4",
+ "l_api_6a_auth_7b_export_pull_b",
+ "l_api_7_export_pull_a_function_9a",
+ "l_apigw_api_lambda_auth_1_api_key_migration2",
+ "l_auth_12_auth_2g_auth_2h",
+ "l_auth_1a_auth_trigger_custom_policies_function",
+ "l_auth_1b_delete_geo_add_c",
+ "l_auth_1c_auth_5e_auth_8b",
+ "l_auth_2a_auth_2b_auth_2d",
"l_auth_2c",
"l_auth_2e",
- "l_auth_2g_build_function_custom_resource_with_storage_dynamodb_simulator",
- "l_auth_3b_auth_4a_auth_7a_auth_8c",
- "l_auth_4b_auth_8a_export_pull_d_schema_auth_5a",
- "l_auth_5c_env_1_geo_add_a_init_a",
- "l_auth_5f_env_4_frontend_config_drift_schema_auth_4d",
- "l_auth_7b_export_pull_b_function_3a_init_special_case",
- "l_auth_add_all_migration_v10",
- "l_auth_override_migration_v10",
+ "l_auth_2f_notifications_lifecycle_notifications_analytics_compatibility_in_app_1",
+ "l_auth_3a_auth_3b_auth_4a",
+ "l_auth_4b_auth_8a_export_pull_d",
+ "l_auth_4c_auth_5a_auth_5c",
+ "l_auth_5g_admin_api_hosted_ui",
+ "l_auth_7a_auth_8c_feature_flags",
+ "l_auth_9_custom_resources_env_5",
+ "l_auth_migration_amplify_remove_api_2a",
+ "l_build_function_custom_resource_with_storage_dynamodb_simulator",
+ "l_container_hosting_init_b_notifications_apns",
"l_containers_api_1",
"l_containers_api_2",
- "l_custom_resources_env_5_function_10_function_9c",
- "l_custom_stack_migration_v10",
- "l_datastore_modelgen_amplify_app_diagnose_hooks_a",
+ "l_custom_policies_container_function_9b_schema_iterative_update_2",
+ "l_datastore_modelgen",
+ "l_diagnose_hooks_a_mock_api",
+ "l_env_1_geo_add_a_init_a",
"l_env_3",
- "l_export_pull_c_function_12_function_2d_general_config_headless_init",
- "l_feature_flags_geo_import_1b_global_sandbox_a_init_e",
- "l_flutter_analytics_pinpoint_config_flutter_notifications_pinpoint_config_ios_analytics_pinpoint_config_ios_notifications_pinpo",
- "l_function_11_function_2b_function_7_api_connection_migration2",
- "l_function_4_interactions_schema_model_a_tags",
- "l_function_5_schema_iterative_update_1_auth_6_function_2a",
- "l_function_9b_schema_iterative_update_2_storage_1a_storage_1b",
- "l_function_migration_update_v8",
- "l_function_permissions_geo_import_1a_geo_import_2_global_sandbox_b",
- "l_geo_add_d_geo_import_3_hosting_layer_3",
+ "l_env_4_frontend_config_drift_schema_auth_4d",
+ "l_export_pull_c_function_12_function_13",
+ "l_flutter_notifications_pinpoint_config_ios_analytics_pinpoint_config_ios_notifications_pinpoint_config",
+ "l_function_10_function_9c_function_permissions",
+ "l_function_14_function_15_function_2d",
+ "l_function_1_storage_5",
+ "l_function_2b_function_7_api_connection_migration2",
+ "l_function_2c_function_3b_function_4",
+ "l_function_3a_dotnet_function_3a_go_function_3a_nodejs",
+ "l_function_3a_python_init_special_case_http_migration",
+ "l_function_6_storage_2_export",
+ "l_function_8_schema_iterative_update_locking_api_lambda_auth_2",
+ "l_general_config_headless_init_help_hooks_c",
+ "l_geo_add_b_s3_sse_schema_auth_4a",
+ "l_geo_add_d_geo_import_3_hosting",
"l_geo_add_e",
"l_geo_add_f",
- "l_geo_headless_api_key_migration5_schema_auth_1a_schema_auth_5b",
- "l_geo_migration_v10",
- "l_geo_multi_env_searchable_datastore_resolvers_schema_key",
+ "l_geo_headless_api_key_migration5_schema_auth_1a",
+ "l_geo_import_1a_geo_import_2_global_sandbox_b",
+ "l_geo_import_1b_global_sandbox_a_init_e",
"l_geo_remove_1",
"l_geo_remove_2",
"l_geo_remove_3",
"l_geo_update_1",
"l_geo_update_2",
- "l_git_clone_migration_tests_v10",
- "l_help_hooks_c_init_force_push_interactions_1",
+ "l_git_clone_attach_init_c_layer_4",
+ "l_hooks_b_notifications_analytics_compatibility_sms_1_plugin",
"l_hostingPROD",
- "l_http_migration_schema_auth_12_schema_auth_3_schema_function_2",
+ "l_iam_permissions_boundary_node_function_notifications_sms",
"l_import_auth_1a",
"l_import_auth_1b",
"l_import_auth_2a",
@@ -70,113 +76,176 @@
"l_import_s3_2b",
"l_import_s3_2c",
"l_import_s3_3",
- "l_init_b_notifications_apns_notifications_fcm_notifications_in_app_messaging_env_2",
- "l_init_c_layer_4_function_2c_function_3b",
- "l_init_f_auth_5d_configure_project_git_clone_attach",
- "l_interactions_2_minify_cloudformation_notifications_multi_env_opensearch_simulator",
- "l_javascript_analytics_pinpoint_config_javascript_notifications_pinpoint_config_pull_2_push",
- "l_mock_api_analytics_kinesis_analytics_pinpoint_flutter_analytics_pinpoint_js",
- "l_model_migration_auth_3c_auth_4c_auth_5a",
- "l_notifications_analytics_compatibility_in_app_2_schema_auth_11_c_schema_auth_2b_schema_auth_6c",
+ "l_init_f_auth_5d_configure_project",
+ "l_init_force_push_interactions_1_interactions_2",
+ "l_interactions_schema_model_a_tags",
+ "l_javascript_analytics_pinpoint_config_javascript_notifications_pinpoint_config_pr_previews_multi_env_1",
+ "l_js_frontend_config",
+ "l_layer_1_api_key_migration4_schema_iterative_update_4",
+ "l_layer_2_schema_auth_13_function_5",
+ "l_layer_3_api_connection_migration_api_key_migration3",
+ "l_minify_cloudformation_notifications_multi_env_notifications_sms_update",
+ "l_notifications_analytics_compatibility_in_app_2_schema_auth_11_c_schema_auth_2b",
+ "l_notifications_analytics_compatibility_sms_2_analytics_2_global_sandbox_c",
+ "l_notifications_fcm_notifications_in_app_messaging_env_2_with_babel_config",
"l_notifications_in_app_messaging",
- "l_notifications_lifecycle_uibuilder_notifications_analytics_compatibility_in_app_1_notifications_analytics_compatibility_sms_2",
- "l_notifications_migration_2_v8",
- "l_notifications_migration_3_v8",
- "l_notifications_migration_4_v8",
- "l_notifications_migration_v8",
- "l_notifications_sms_pull_pull_auth_10_container_hosting",
- "l_notifications_sms_schema_auth_4b_schema_model_e_schema_versioned",
- "l_parameter_store_1_parameter_store_2_android_analytics_pinpoint_config_android_notifications_pinpoint_config",
- "l_pinpoint_region_migration_v10",
- "l_plugin_studio_modelgen_custom_transformers_notifications_in_app_messaging_env_1",
- "l_s3_sse_schema_auth_4a_schema_model_b_schema_model_d",
- "l_scaffold_v10",
+ "l_notifications_sms_pull_pull_auth_10",
+ "l_opensearch_simulator_parameter_store_1_parameter_store_2",
+ "l_predictions_schema_auth_11_b_schema_auth_1b",
+ "l_pull_2_push_smoketest_ios",
+ "l_resolvers_schema_key_api_5",
+ "l_schema_auth_10_geo_multi_env_searchable_datastore",
"l_schema_auth_11_a",
+ "l_schema_auth_12_schema_auth_3_schema_function_2",
"l_schema_auth_15",
- "l_schema_auth_1b_schema_auth_2a_schema_auth_7a_schema_auth_7b",
- "l_schema_auth_4c_schema_auth_5c_auth_5b_auth_9",
- "l_schema_auth_5d_schema_auth_6b_schema_auth_8c_auth_3a",
- "l_schema_auth_6a_schema_data_access_patterns_schema_model_c_schema_predictions",
- "l_schema_auth_6d_schema_auth_7c_schema_auth_8a_function_migration",
- "l_schema_auth_8b_schema_auth_9_a_schema_auth_9_c_storage_3",
- "l_schema_auth_9_b_schema_iterative_rollback_1_predictions_migration_api_6a",
+ "l_schema_auth_2a_schema_auth_7a_schema_auth_7b",
+ "l_schema_auth_4b_schema_model_e_schema_versioned",
+ "l_schema_auth_4c_schema_auth_5c_auth_5b",
+ "l_schema_auth_5a_schema_iterative_rollback_2_schema_iterative_update_3",
+ "l_schema_auth_5b_schema_auth_8b_schema_auth_9_a",
+ "l_schema_auth_5d_schema_auth_6b_schema_auth_8c",
+ "l_schema_auth_6a_schema_data_access_patterns_schema_model_c",
+ "l_schema_auth_6c_schema_auth_6d_schema_auth_7c",
+ "l_schema_auth_8a_function_migration_api_10",
+ "l_schema_auth_9_b_schema_iterative_rollback_1_predictions_migration",
+ "l_schema_auth_9_c_storage_3_auth_11",
"l_schema_connection_1",
- "l_schema_connection_2_schema_function_1_api_9b_custom_policies_container",
- "l_schema_iterative_rollback_2_schema_iterative_update_3_auth_migration_api_2a",
- "l_schema_iterative_update_4_function_1_storage_5",
- "l_schema_iterative_update_locking_api_lambda_auth_2_layer_2_schema_auth_13",
- "l_schema_searchable_api_key_migration1_schema_auth_14_api_3",
+ "l_schema_connection_2_schema_function_1_api_9b",
+ "l_schema_iterative_update_1_auth_6_function_2a",
+ "l_schema_model_b_schema_model_d_auth_5f",
+ "l_schema_predictions_model_migration_auth_3c",
+ "l_schema_searchable_api_key_migration1_schema_auth_14",
"l_searchable_migration",
- "l_smoketest_S3server_api_8_function_8",
- "l_storage_2_export_iam_permissions_boundary_node_function",
- "l_storage_migration_v10",
- "l_with_babel_config_amplify_configure_env_2_init_d",
- "w_analytics_kinesis_analytics_pinpoint_flutter_analytics_pinpoint_js_auth_2a",
- "w_api_2b_api_6c_api_9a_auth_2g",
- "w_api_7_export_pull_a_function_9a_geo_headless",
- "w_api_key_migration3_predictions_schema_auth_11_b_schema_auth_1b",
- "w_api_key_migration5_schema_auth_1a_schema_auth_5b_schema_auth_8b",
- "w_api_lambda_auth_1_api_key_migration2_schema_searchable_api_key_migration1",
- "w_auth_1b_delete_geo_add_c_geo_add_d",
- "w_auth_2b_auth_2d_auth_2f_notifications_lifecycle",
+ "l_smoketest_S3server_api_8",
+ "l_smoketest_amplify_app",
+ "l_storage_1a_storage_1b_function_11",
+ "l_studio_modelgen_custom_transformers_notifications_in_app_messaging_env_1",
+ "l_uibuilder",
+ "l_user_groups_s3_access_user_groups_build_function_yarn_modern",
+ "w_amplify_configure_init_d",
+ "w_amplify_remove_api_2a",
+ "w_analytics_2_global_sandbox_c",
+ "w_analytics_kinesis_analytics_pinpoint_flutter",
+ "w_analytics_pinpoint_js_auth_2a",
+ "w_api_10_api_7",
+ "w_api_1_layer_1",
+ "w_api_2b_api_6c",
+ "w_api_3_api_6b",
+ "w_api_6a_auth_7b",
+ "w_api_8_schema_iterative_update_locking",
+ "w_api_9a_auth_2h",
+ "w_api_9b_custom_policies_container",
+ "w_api_connection_migration2_api_4",
+ "w_api_connection_migration_api_key_migration3",
+ "w_api_key_migration1_schema_auth_14",
+ "w_api_key_migration2_schema_searchable",
+ "w_api_key_migration4_schema_iterative_update_4",
+ "w_api_lambda_auth_2_schema_auth_13",
+ "w_apigw_api_lambda_auth_1",
+ "w_auth_11_auth_1b",
+ "w_auth_2b_auth_2d",
"w_auth_2c",
"w_auth_2e",
- "w_auth_3c_auth_4c_auth_5a_auth_5c",
- "w_auth_4a_auth_7a_auth_8c_feature_flags",
- "w_auth_5e_auth_8b_geo_add_b_s3_sse",
- "w_build_function_custom_resource_with_storage_dynamodb_simulator_export_pull_c",
- "w_container_hosting_init_b_notifications_apns_notifications_fcm",
+ "w_auth_2f_notifications_lifecycle",
+ "w_auth_3b_auth_4a",
+ "w_auth_3c_auth_4c",
+ "w_auth_4b_auth_8a",
+ "w_auth_5a_auth_5c",
+ "w_auth_5e_auth_8b",
+ "w_auth_5g_admin_api",
+ "w_auth_6_function_2a",
+ "w_auth_7a_auth_8c",
+ "w_auth_9_env_5",
+ "w_auth_trigger_custom_policies_function",
+ "w_build_function_dynamodb_simulator",
+ "w_configure_project_init_c",
+ "w_container_hosting_init_b",
"w_containers_api_1",
"w_containers_api_2",
- "w_custom_transformers_notifications_in_app_messaging_env_1_notifications_sms_pull_auth_10",
- "w_env_1_geo_add_a_init_a_schema_auth_4c",
+ "w_containers_api_secrets_storage_4",
+ "w_custom_transformers_notifications_in_app_messaging_env_1",
+ "w_delete_geo_add_c",
+ "w_env_1_geo_add_a",
"w_env_3",
- "w_env_4_frontend_config_drift_schema_auth_4d_schema_auth_6a",
- "w_env_5_function_10_function_9c_function_permissions",
- "w_function_12_function_2d_general_config_headless_init_help",
- "w_function_2b_api_connection_migration2_api_4_containers_api_secrets",
- "w_geo_import_1a_geo_import_2_global_sandbox_b_schema_auth_5d",
- "w_geo_import_1b_global_sandbox_a_init_e_notifications_analytics_compatibility_in_app_2",
- "w_geo_import_3_hosting_layer_3_api_connection_migration",
+ "w_env_4_frontend_config_drift",
+ "w_export_pull_a_function_9a",
+ "w_export_pull_b_init_special_case",
+ "w_export_pull_c_function_12",
+ "w_export_pull_d_schema_auth_5a",
+ "w_feature_flags_geo_import_1b",
+ "w_function_1",
+ "w_function_10_function_9c",
+ "w_function_11_function_2b",
+ "w_function_13_function_14",
+ "w_function_2d_general_config_headless_init",
+ "w_function_5_schema_iterative_update_1",
+ "w_function_9b_schema_iterative_update_2",
+ "w_function_permissions_geo_import_1a",
+ "w_geo_add_b_s3_sse",
+ "w_geo_add_d_geo_import_3",
+ "w_geo_headless_api_key_migration5",
+ "w_geo_import_2_global_sandbox_b",
"w_geo_remove_1",
- "w_hooks_b_notifications_analytics_compatibility_sms_1_plugin_studio_modelgen",
- "w_hooks_c_init_force_push_interactions_1_interactions_2",
+ "w_global_sandbox_a_init_e",
+ "w_help_init_force_push",
+ "w_hooks_b_notifications_analytics_compatibility_sms_1",
+ "w_hosted_ui_user_groups_s3_access",
"w_hostingPROD",
+ "w_hosting_layer_3",
+ "w_http_migration_schema_auth_12",
"w_import_dynamodb_1",
"w_import_s3_1",
"w_import_s3_3",
- "w_init_f_auth_5d_configure_project_init_c",
- "w_init_special_case_http_migration_schema_auth_12_schema_auth_3",
- "w_layer_1_api_key_migration4_schema_iterative_update_4_function_1",
- "w_layer_4_function_2c_interactions_schema_model_a",
- "w_minify_cloudformation_notifications_multi_env_parameter_store_1_parameter_store_2",
- "w_notifications_analytics_compatibility_in_app_1_notifications_analytics_compatibility_sms_2_analytics_2_global_sandbox_c",
+ "w_init_a_schema_auth_4c",
+ "w_init_f_auth_5d",
+ "w_interactions_1_interactions_2",
+ "w_interactions_schema_model_a",
+ "w_js_frontend_config",
+ "w_layer_4_function_2c",
+ "w_minify_cloudformation_notifications_multi_env",
+ "w_node_function_notifications_sms",
+ "w_notifications_analytics_compatibility_in_app_1_notifications_analytics_compatibility_sms_2",
+ "w_notifications_analytics_compatibility_in_app_2_schema_auth_11_c",
+ "w_notifications_apns_notifications_fcm",
"w_notifications_in_app_messaging",
- "w_notifications_in_app_messaging_env_2_with_babel_config_amplify_configure_init_d",
- "w_predictions_migration_api_6a_auth_7b_export_pull_b",
- "w_pull_2_push_smoketest_api_8",
- "w_resolvers_schema_key_api_5_apigw",
+ "w_notifications_in_app_messaging_env_2_with_babel_config",
+ "w_notifications_sms_pull_auth_10",
+ "w_notifications_sms_update_parameter_store_1",
+ "w_parameter_store_2_push",
+ "w_plugin_studio_modelgen",
+ "w_predictions_schema_auth_11_b",
+ "w_schema_auth_10_geo_multi_env",
"w_schema_auth_11_a",
- "w_schema_auth_11_c_schema_auth_2b_schema_auth_6c_schema_auth_6d",
- "w_schema_auth_14_api_3_api_6b_api_1",
"w_schema_auth_15",
- "w_schema_auth_2a_schema_auth_7a_schema_auth_7b_schema_auth_9_b",
- "w_schema_auth_4a_schema_model_b_schema_model_d_auth_5f",
- "w_schema_auth_4b_schema_model_e_schema_versioned_auth_1c",
- "w_schema_auth_5a_schema_iterative_update_3_auth_migration_api_2a",
- "w_schema_auth_5c_auth_5b_auth_9_custom_resources",
- "w_schema_auth_6b_schema_auth_8c_auth_3a_auth_3b",
- "w_schema_auth_7c_schema_auth_8a_function_migration_api_10",
- "w_schema_auth_9_a_schema_auth_9_c_storage_3_auth_11",
+ "w_schema_auth_1a_schema_auth_5b",
+ "w_schema_auth_1b_schema_auth_2a",
+ "w_schema_auth_2b_schema_auth_6c",
+ "w_schema_auth_3_schema_function_2",
+ "w_schema_auth_4a_schema_model_b",
+ "w_schema_auth_4b_schema_model_e",
+ "w_schema_auth_4d_schema_auth_6a",
+ "w_schema_auth_5c_auth_5b",
+ "w_schema_auth_5d_schema_auth_6b",
+ "w_schema_auth_6d_schema_auth_7c",
+ "w_schema_auth_7a_schema_auth_7b",
+ "w_schema_auth_8a_function_migration",
+ "w_schema_auth_8b_schema_auth_9_a",
+ "w_schema_auth_8c_auth_3a",
+ "w_schema_auth_9_b_predictions_migration",
+ "w_schema_auth_9_c_storage_3",
"w_schema_connection_1",
- "w_schema_data_access_patterns_schema_model_c_schema_predictions_model_migration",
- "w_schema_function_1_api_9b_custom_policies_container_function_9b",
- "w_schema_function_2_auth_4b_auth_8a_export_pull_d",
- "w_schema_iterative_update_1_auth_6_function_2a_schema_connection_2",
- "w_schema_iterative_update_2_storage_1a_storage_1b_function_11",
- "w_schema_iterative_update_locking_api_lambda_auth_2_schema_auth_13_function_5",
+ "w_schema_connection_2_schema_function_1",
+ "w_schema_data_access_patterns_schema_model_c",
+ "w_schema_iterative_update_3_auth_migration",
+ "w_schema_key_api_5",
+ "w_schema_model_d_auth_5f",
+ "w_schema_predictions_model_migration",
+ "w_schema_versioned_auth_1c",
+ "w_searchable_datastore_resolvers",
"w_searchable_migration",
- "w_storage_2_iam_permissions_boundary_node_function_notifications_sms",
- "w_storage_4_schema_auth_10_geo_multi_env_searchable_datastore",
- "w_tags_auth_1a_auth_trigger_custom_policies_function"
+ "w_smoketest_ios_smoketest",
+ "w_storage_1a_storage_1b",
+ "w_storage_2_iam_permissions_boundary",
+ "w_tags_auth_1a",
+ "w_user_groups_build_function_yarn_modern"
]
diff --git a/codebuild_specs/wait_windows.json b/codebuild_specs/wait_windows.json
new file mode 100644
index 00000000000..22d0b0d31ad
--- /dev/null
+++ b/codebuild_specs/wait_windows.json
@@ -0,0 +1 @@
+["upb", "build_windows"]
diff --git a/package.json b/package.json
index 6478fb95478..752c9de3dfd 100644
--- a/package.json
+++ b/package.json
@@ -4,19 +4,17 @@
"description": "amplify-cli",
"scripts": {
"addwords": "node ./scripts/add-to-dict.js",
- "all-cloud-e2e": "CURR_BRANCH=$(git branch | awk '/\\*/{printf \"%s\", $2}') && UPSTREAM_BRANCH=run-e2e/$USER/run-all-tests && git push $(git remote -v | grep aws-amplify/amplify-cli | head -n1 | awk '{print $1;}') $CURR_BRANCH:$UPSTREAM_BRANCH --no-verify --force && echo \"\n\n 🏃 E2E test are running at:\nhttps://app.circleci.com/pipelines/github/aws-amplify/amplify-cli?branch=$UPSTREAM_BRANCH\"",
- "build-and-verify": "yarn clean && yarn build && yarn prettier-check && yarn lint-check && yarn verify-api-extract",
+ "build-and-verify": "yarn clean && yarn && yarn build && yarn prettier-check && yarn lint-check && yarn verify-api-extract",
"build-tests-changed": "lerna run build-tests --since dev",
"build-tests": "lerna run build-tests",
"build": "lerna run build",
"check-version-conflicts:beta": "yarn ts-node ./scripts/check-version.ts beta",
"check-version-conflicts:release": "yarn ts-node ./scripts/check-version.ts",
- "cloud-e2e-cb": "bash -c 'source ./scripts/cloud-e2e.sh && cloudE2E'",
- "cloud-e2e-cb-beta": "bash -c 'source ./scripts/cloud-e2e.sh && cloudE2EBeta'",
- "cloud-e2e-cb-local": "bash -c 'source ./scripts/cloud-e2e.sh && cloudE2ELocal'",
"clean": "lerna run clean && yarn rimraf tsconfig.tsbuildinfo && lerna clean --yes && yarn rimraf node_modules",
- "cloud-e2e-with-rc": "CURR_BRANCH=$(git branch | awk '/\\*/{printf \"%s\", $2}') && UPSTREAM_BRANCH=run-e2e-with-rc/$USER/$CURR_BRANCH && git push $(git remote -v | grep aws-amplify/amplify-cli | head -n1 | awk '{print $1;}') $CURR_BRANCH:$UPSTREAM_BRANCH --no-verify --force-with-lease && echo \"\n\n 🏃 E2E test are running at:\nhttps://app.circleci.com/pipelines/github/aws-amplify/amplify-cli?branch=$UPSTREAM_BRANCH\"",
- "cloud-e2e": "CURR_BRANCH=$(git branch | awk '/\\*/{printf \"%s\", $2}') && UPSTREAM_BRANCH=run-e2e/$USER/$CURR_BRANCH && git push $(git remote -v | grep aws-amplify/amplify-cli | head -n1 | awk '{print $1;}') $CURR_BRANCH:$UPSTREAM_BRANCH --no-verify --force-with-lease && echo \"\n\n 🏃 E2E test are running at:\nhttps://app.circleci.com/pipelines/github/aws-amplify/amplify-cli?branch=$UPSTREAM_BRANCH\"",
+ "cloud-e2e-beta": "bash -c 'source ./scripts/cloud-e2e.sh && cloudE2EBeta'",
+ "cloud-e2e-local": "bash -c 'source ./scripts/cloud-e2e.sh && cloudE2ELocal'",
+ "cloud-e2e": "bash -c 'source ./scripts/cloud-e2e.sh && cloudE2E'",
+ "cloud-pr": "./scripts/cloud-pr.sh",
"commit": "git-cz",
"coverage:collect": "ts-node ./scripts/collect-test-coverage.ts",
"coverage": "codecov || exit 0",
@@ -29,40 +27,47 @@
"link-aa-win": "node ./scripts/link-bin.js packages/amplify-app/bin/amplify-app amplify-app-dev",
"link-dev": "mkdir -p .bin/ && cd packages/amplify-cli && ln -s \"$(pwd)/bin/amplify\" ../../.bin/amplify-dev && cd ../../",
"link-win": "node ./scripts/link-bin.js packages/amplify-cli/bin/amplify amplify-dev",
- "lint-check": "yarn eslint . --ext .js,.jsx,.ts,.tsx --max-warnings=835",
- "lint-fix": "git diff --name-only --cached --diff-filter d | grep -E '\\.(js|jsx|ts|tsx)$' | xargs eslint --fix --quiet",
- "lint-fix-package-json": "yarn lint-check-package-json --fix",
"lint-check-package-json": "yarn eslint --no-eslintrc --config .eslint.package.json.js '**/package.json'",
+ "lint-check": "yarn eslint . --ext .js,.jsx,.ts,.tsx --max-warnings=750",
+ "lint-fix-package-json": "yarn lint-check-package-json --fix",
+ "lint-fix": "git diff --name-only --cached --diff-filter d | grep -E '\\.(js|jsx|ts|tsx)$' | xargs eslint --fix --quiet",
"mergewords": "yarn ts-node ./scripts/handle-dict-conflicts.ts",
"pkg-all-local": "yarn verdaccio-clean && yarn verdaccio-start && yarn verdaccio-connect && yarn publish-to-verdaccio && yarn pkg-all && yarn verdaccio-disconnect",
- "pkg-all": "bash -c 'source .circleci/local_publish_helpers.sh && generatePkgCli'",
+ "pkg-all": "bash -c 'source .circleci/local_publish_helpers_codebuild.sh && generatePkgCli'",
"pkg-clean": "rimraf build out pkg/node_modules pkg/yarn.lock",
- "prettier-check": "yarn prettier --check .",
+ "postinstall": "husky install",
"prettier-changes": "git diff --name-only --diff-filter MRA dev | xargs yarn prettier --write",
+ "prettier-check": "yarn prettier --check .",
"prettier-write": "yarn prettier --write .",
"production-build": "lerna run build --concurrency 3 --stream",
- "promote-rc": "./scripts/promote-rc.sh",
+ "promote-rc-local": "bash -c 'source ./scripts/cloud-release.sh && ReleaseLocal'",
+ "promote-rc-beta": "bash -c 'source ./scripts/cloud-release.sh && ReleaseBeta'",
+ "promote-rc": "bash -c 'source ./scripts/cloud-release.sh && ReleaseProd'",
"publish-to-verdaccio": "lerna publish --yes --no-commit-hooks --no-push --exact --dist-tag=latest --conventional-commits --no-git-tag-version --no-verify-access",
- "release-rc": "./scripts/release-rc.sh",
+ "release-rc-local": "bash -c 'source ./scripts/cloud-release.sh && RCLocal'",
+ "release-rc-beta": "bash -c 'source ./scripts/cloud-release.sh && RCBeta'",
+ "release-rc": "bash -c 'source ./scripts/cloud-release.sh && RCProd'",
+ "rollback": "./scripts/cloud-rollback.sh",
+ "tagged-release-without-e2e-local": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCLocal'",
+ "tagged-release-without-e2e-beta": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCBeta'",
+ "tagged-release-without-e2e-prod": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCProd'",
"rm-aa-dev-link": "rimraf -f \".bin/amplify-app-dev\"",
"rm-dev-link": "rimraf -f \".bin/amplify-dev\"",
"setup-dev-win": "yarn build && yarn link-win && yarn link-aa-win",
"setup-dev": "yarn build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev",
- "smoketest": "lerna run smoketest --output-style=stream-without-prefixes",
- "smoketest@latest": "CLI_VERSION=latest lerna run smoketest --output-style=stream-without-prefixes",
- "smoketest@rc": "CLI_VERSION=rc lerna run smoketest --output-style=stream-without-prefixes",
- "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml",
+ "smoketest": "lerna run smoketest",
+ "split-e2e-tests-codebuild-single": "yarn ts-node ./scripts/generate_single_test_buildspec_codebuild.ts",
"split-e2e-tests-codebuild": "yarn ts-node ./scripts/split-e2e-tests-codebuild.ts",
"test-changed": "lerna run test --since dev",
"test-ci": "lerna run test --concurrency 4 -- --ci -i",
"test": "lerna run test --concurrency 1",
- "update-data-packages": "./scripts/update-data-dependencies.sh && yarn",
+ "update-data-packages": "./scripts/update-data-dependencies.sh && yarn && yarn dedupe",
"update-test-timing-data": "ts-node ./scripts/cci-get-job-metrics.ts && ts-node ./scripts/cci-extract-test-timings-from-job-metrics.ts",
- "update-versions": "lerna version --yes --no-commit-hooks --no-push --exact --conventional-commits --no-git-tag-version",
+ "update-versions": "lerna version --yes --no-commit-hooks --no-push --exact --conventional-commits --no-git-tag-version --force-publish",
"verdaccio-clean": "rimraf ../verdaccio-cache",
- "verdaccio-connect": "bash -c 'source .circleci/local_publish_helpers.sh && setNpmRegistryUrlToLocal'",
- "verdaccio-disconnect": "bash -c 'source .circleci/local_publish_helpers.sh && unsetNpmRegistryUrl'",
- "verdaccio-start": "bash -c 'source .circleci/local_publish_helpers.sh && startLocalRegistry \"$(pwd)/.circleci/verdaccio.yaml\"'",
+ "verdaccio-connect": "bash -c 'source .circleci/local_publish_helpers_codebuild.sh && setNpmRegistryUrlToLocal'",
+ "verdaccio-disconnect": "bash -c 'source .circleci/local_publish_helpers_codebuild.sh && unsetNpmRegistryUrl'",
+ "verdaccio-start": "bash -c 'source .circleci/local_publish_helpers_codebuild.sh && startLocalRegistry \"$(pwd)/.circleci/verdaccio.yaml\"'",
"verdaccio-stop": "kill -9 $(lsof -n -t -iTCP:4873 -sTCP:LISTEN) || true",
"verify-api-extract:clean": "yarn clean && yarn build && yarn verify-api-extract",
"verify-api-extract": "yarn extract-api && ./scripts/verify-extract-api.sh",
@@ -80,19 +85,13 @@
"type": "git",
"url": "https://github.com/aws-amplify/amplify-cli.git"
},
- "husky": {
- "hooks": {
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
- "pre-push": "yarn build-tests-changed && yarn split-e2e-tests",
- "pre-commit": "./scripts/package-json-check.sh && yarn verify-commit"
- }
- },
"author": "Amazon Web Services",
"license": "Apache-2.0",
"dependencies": {
"lerna": "^6.6.1",
"node-gyp": "^9.3.1",
- "strip-ansi": "^6.0.0"
+ "strip-ansi": "^6.0.0",
+ "yargs": "^17.7.2"
},
"workspaces": {
"packages": [
@@ -101,7 +100,7 @@
},
"devDependencies": {
"@babel/cli": "^7.10.5",
- "@babel/core": "^7.10.5",
+ "@babel/core": "^7.23.2",
"@babel/plugin-proposal-numeric-separator": "^7.10.4",
"@babel/plugin-transform-modules-commonjs": "7.10.4",
"@babel/plugin-transform-typescript": "7.10.5",
@@ -115,6 +114,7 @@
"@types/jest": "^29.0.0",
"@types/js-yaml": "^4.0.0",
"@types/node": "^18.16.1",
+ "@types/yargs": "^17",
"@typescript-eslint/eslint-plugin": "^5.34.0",
"@typescript-eslint/parser": "^5.34.0",
"@zkochan/cmd-shim": "^5.1.0",
@@ -136,7 +136,7 @@
"eslint-plugin-spellcheck": "^0.0.17",
"execa": "^5.1.1",
"glob": "^7.2.0",
- "husky": "^3.1.0",
+ "husky": "^8.0.3",
"istanbul-lib-coverage": "^3.2.0",
"istanbul-lib-report": "^3.0.0",
"istanbul-reports": "^3.1.5",
@@ -161,15 +161,24 @@
},
"packageManager": "yarn@3.5.0",
"resolutions": {
- "aws-sdk": "^2.1354.0",
+ "aws-sdk": "^2.1464.0",
"cross-fetch": "^2.2.6",
+ "fast-xml-parser": "^4.4.1",
"glob-parent": "^6.0.2",
"got": "^11.8.5",
"istanbul/async": "^2.6.4",
"jake/async": "^2.6.4",
"json5": "^2.2.3",
+ "mysql2": "^3.9.8",
"nth-check": "^2.0.1",
- "undici": "^5.8.0",
- "pkg-fetch": "https://github.com/aws-amplify/pkg-fetch#ad4a21feb533d338bf951e7ba28cea7256aedeff"
+ "pkg-fetch": "^3.5.2",
+ "undici": "^5.28.3",
+ "tough-cookie": "^4.1.3",
+ "semver": "^7.5.4",
+ "send": "^0.19.0",
+ "word-wrap": "^1.2.4",
+ "follow-redirects": "^1.15.6",
+ "tar": "^6.2.1",
+ "ejs": "^3.1.10"
}
}
diff --git a/packages/amplify-app/CHANGELOG.md b/packages/amplify-app/CHANGELOG.md
index 9332d24e74f..927ff884ddd 100644
--- a/packages/amplify-app/CHANGELOG.md
+++ b/packages/amplify-app/CHANGELOG.md
@@ -3,6 +3,255 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.0.38](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.37...@aws-amplify/amplify-app@5.0.38) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.37](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.36...@aws-amplify/amplify-app@5.0.37) (2025-01-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.36](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.35...@aws-amplify/amplify-app@5.0.36) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.35](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.34...@aws-amplify/amplify-app@5.0.35) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.34](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.33...@aws-amplify/amplify-app@5.0.34) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.33](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.32...@aws-amplify/amplify-app@5.0.33) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.32](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.31...@aws-amplify/amplify-app@5.0.32) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.31](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.30...@aws-amplify/amplify-app@5.0.31) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.30](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.29...@aws-amplify/amplify-app@5.0.30) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.29](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.28...@aws-amplify/amplify-app@5.0.29) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.28](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.27...@aws-amplify/amplify-app@5.0.28) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.26...@aws-amplify/amplify-app@5.0.27) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.25...@aws-amplify/amplify-app@5.0.26) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.23...@aws-amplify/amplify-app@5.0.25) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.0.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.23...@aws-amplify/amplify-app@5.0.24) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.22...@aws-amplify/amplify-app@5.0.23) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.21...@aws-amplify/amplify-app@5.0.22) (2023-10-21)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.20...@aws-amplify/amplify-app@5.0.21) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.19...@aws-amplify/amplify-app@5.0.20) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.18...@aws-amplify/amplify-app@5.0.19) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.17...@aws-amplify/amplify-app@5.0.18) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.16...@aws-amplify/amplify-app@5.0.17) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.15...@aws-amplify/amplify-app@5.0.16) (2023-08-17)
+
+
+### Bug Fixes
+
+* amplify app version regex ([#13050](https://github.com/aws-amplify/amplify-cli/issues/13050)) ([f185a72](https://github.com/aws-amplify/amplify-cli/commit/f185a726bf5c19b16d2e39e377bbf234b517e082))
+
+
+
+
+
+## [5.0.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.14...@aws-amplify/amplify-app@5.0.15) (2023-08-14)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.13...@aws-amplify/amplify-app@5.0.14) (2023-08-09)
+
+
+### Bug Fixes
+
+* Dependabot alerts for semver, tough-cookie ([#12962](https://github.com/aws-amplify/amplify-cli/issues/12962)) ([175a86b](https://github.com/aws-amplify/amplify-cli/commit/175a86b89a54c65bb6e68c0609be503d61e39d63))
+
+
+
+
+
+## [5.0.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.12...@aws-amplify/amplify-app@5.0.13) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.11...@aws-amplify/amplify-app@5.0.12) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.10...@aws-amplify/amplify-app@5.0.11) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.9...@aws-amplify/amplify-app@5.0.10) (2023-07-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
+## [5.0.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.8...@aws-amplify/amplify-app@5.0.9) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-app
+
+
+
+
+
## [5.0.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-app@5.0.6...@aws-amplify/amplify-app@5.0.8) (2023-05-25)
diff --git a/packages/amplify-app/package.json b/packages/amplify-app/package.json
index 3c32107b94d..0aca8d08625 100644
--- a/packages/amplify-app/package.json
+++ b/packages/amplify-app/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-app",
- "version": "5.0.8",
+ "version": "5.0.38",
"description": "Amplify CLI",
"repository": {
"type": "git",
@@ -26,10 +26,10 @@
"@aws-amplify/cli": ">=5.0.0"
},
"dependencies": {
- "@aws-amplify/amplify-frontend-android": "3.5.4",
- "@aws-amplify/amplify-frontend-flutter": "1.4.2",
- "@aws-amplify/amplify-frontend-ios": "3.6.10",
- "@aws-amplify/amplify-frontend-javascript": "3.9.8",
+ "@aws-amplify/amplify-frontend-android": "3.5.8",
+ "@aws-amplify/amplify-frontend-flutter": "1.4.7",
+ "@aws-amplify/amplify-frontend-ios": "3.7.9",
+ "@aws-amplify/amplify-frontend-javascript": "3.10.19",
"chalk": "^4.1.1",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
@@ -38,7 +38,7 @@
"node-emoji": "^1.10.0",
"ora": "^4.0.3",
"rimraf": "^3.0.0",
- "semver": "^7.3.5",
+ "semver": "^7.5.4",
"xcode": "^2.1.0",
"yargs": "^15.1.0"
},
diff --git a/packages/amplify-app/src/index.js b/packages/amplify-app/src/index.js
index ab57afbdd4d..8db7ff296f7 100644
--- a/packages/amplify-app/src/index.js
+++ b/packages/amplify-app/src/index.js
@@ -112,7 +112,7 @@ async function installAmplifyCLI() {
async function amplifyCLIVersionCheck() {
try {
const amplifyCLIVersionRaw = await callAmplify(['-v'], { inheritIO: false });
- const amplifyCLIVersionMatch = amplifyCLIVersionRaw.match(/\d+\.\d+\.\d+(-[a-z]+\.[0-9]+)?/g);
+ const amplifyCLIVersionMatch = amplifyCLIVersionRaw.match(/^\d+\.\d+\.\d+/g);
const amplifyCLIVersion =
Array.isArray(amplifyCLIVersionMatch) && amplifyCLIVersionMatch.length > 0 ? amplifyCLIVersionMatch[0] : undefined;
const minCLIVersion = engines['@aws-amplify/cli'];
diff --git a/packages/amplify-appsync-simulator/API.md b/packages/amplify-appsync-simulator/API.md
index 81674abbb25..5cd560e81e9 100644
--- a/packages/amplify-appsync-simulator/API.md
+++ b/packages/amplify-appsync-simulator/API.md
@@ -89,6 +89,10 @@ export class AmplifyAppSyncSimulator {
// (undocumented)
init(config: AmplifyAppSyncSimulatorConfig): void;
// (undocumented)
+ get isHttps(): boolean;
+ // (undocumented)
+ get localhostUrl(): string;
+ // (undocumented)
get pubsub(): PubSub;
// (undocumented)
reload(config: AmplifyAppSyncSimulatorConfig): void;
@@ -266,6 +270,10 @@ export type AppSyncSimulatorSchemaConfig = AppSyncMockFile;
export type AppSyncSimulatorServerConfig = {
port?: number;
wsPort?: number;
+ httpsConfig?: {
+ sslKeyPath: string;
+ sslCertPath: string;
+ };
};
// @public (undocumented)
diff --git a/packages/amplify-appsync-simulator/CHANGELOG.md b/packages/amplify-appsync-simulator/CHANGELOG.md
index 79abfa5f497..5e36bb0da8c 100644
--- a/packages/amplify-appsync-simulator/CHANGELOG.md
+++ b/packages/amplify-appsync-simulator/CHANGELOG.md
@@ -3,6 +3,275 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.16.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.8...@aws-amplify/amplify-appsync-simulator@2.16.9) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.7...@aws-amplify/amplify-appsync-simulator@2.16.8) (2025-01-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.6...@aws-amplify/amplify-appsync-simulator@2.16.7) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.5...@aws-amplify/amplify-appsync-simulator@2.16.6) (2024-10-05)
+
+
+### Bug Fixes
+
+* remove node-ip dependency ([#13877](https://github.com/aws-amplify/amplify-cli/issues/13877)) ([5e9cd5e](https://github.com/aws-amplify/amplify-cli/commit/5e9cd5ee0ee851f10ecbaef80817a19a7b3e04a1))
+
+
+
+
+
+## [2.16.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.4...@aws-amplify/amplify-appsync-simulator@2.16.5) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.3...@aws-amplify/amplify-appsync-simulator@2.16.4) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.2...@aws-amplify/amplify-appsync-simulator@2.16.3) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.1...@aws-amplify/amplify-appsync-simulator@2.16.2) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.16.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.16.0...@aws-amplify/amplify-appsync-simulator@2.16.1) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+# [2.16.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.10...@aws-amplify/amplify-appsync-simulator@2.16.0) (2024-05-07)
+
+
+### Features
+
+* support https for mock util plugin ([#13700](https://github.com/aws-amplify/amplify-cli/issues/13700)) ([cf418f1](https://github.com/aws-amplify/amplify-cli/commit/cf418f1d9ebc46fff8e12abe7a61d9a5e4ccdfe7))
+
+
+
+
+
+## [2.15.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.9...@aws-amplify/amplify-appsync-simulator@2.15.10) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.8...@aws-amplify/amplify-appsync-simulator@2.15.9) (2024-04-15)
+
+
+### Bug Fixes
+
+* resolve issues with graphiql explorer ([#13691](https://github.com/aws-amplify/amplify-cli/issues/13691)) ([4d0677d](https://github.com/aws-amplify/amplify-cli/commit/4d0677def73fb0d1c2fb77e30ed8b7c0e34cfebd))
+
+
+
+
+
+## [2.15.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.7...@aws-amplify/amplify-appsync-simulator@2.15.8) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.6...@aws-amplify/amplify-appsync-simulator@2.15.7) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.5...@aws-amplify/amplify-appsync-simulator@2.15.6) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.3...@aws-amplify/amplify-appsync-simulator@2.15.5) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.15.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.3...@aws-amplify/amplify-appsync-simulator@2.15.4) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.2...@aws-amplify/amplify-appsync-simulator@2.15.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.1...@aws-amplify/amplify-appsync-simulator@2.15.2) (2023-10-21)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.15.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.15.0...@aws-amplify/amplify-appsync-simulator@2.15.1) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+# [2.15.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.14.3...@aws-amplify/amplify-appsync-simulator@2.15.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [2.14.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.14.2...@aws-amplify/amplify-appsync-simulator@2.14.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.14.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.14.1...@aws-amplify/amplify-appsync-simulator@2.14.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.14.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.14.0...@aws-amplify/amplify-appsync-simulator@2.14.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+# [2.14.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.13.4...@aws-amplify/amplify-appsync-simulator@2.14.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [2.13.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.13.3...@aws-amplify/amplify-appsync-simulator@2.13.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.13.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.13.2...@aws-amplify/amplify-appsync-simulator@2.13.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.13.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.13.1...@aws-amplify/amplify-appsync-simulator@2.13.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+## [2.13.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.13.0...@aws-amplify/amplify-appsync-simulator@2.13.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
+# [2.13.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.12.4...@aws-amplify/amplify-appsync-simulator@2.13.0) (2023-07-20)
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [2.12.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.12.3...@aws-amplify/amplify-appsync-simulator@2.12.4) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator
+
+
+
+
+
## [2.12.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-appsync-simulator@2.12.1...@aws-amplify/amplify-appsync-simulator@2.12.3) (2023-05-25)
diff --git a/packages/amplify-appsync-simulator/package.json b/packages/amplify-appsync-simulator/package.json
index 8c8582e2a5a..a59433b1a21 100644
--- a/packages/amplify-appsync-simulator/package.json
+++ b/packages/amplify-appsync-simulator/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-appsync-simulator",
- "version": "2.12.3",
+ "version": "2.16.9",
"description": "An AppSync Simulator to test AppSync API.",
"repository": {
"type": "git",
@@ -30,21 +30,20 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"@graphql-tools/schema": "^8.3.1",
"@graphql-tools/utils": "^8.5.1",
- "amplify-velocity-template": "1.4.11",
- "aws-sdk": "^2.1354.0",
+ "amplify-velocity-template": "1.4.15",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
"cors": "^2.8.5",
"dataloader": "^2.0.0",
- "express": "^4.17.3",
+ "express": "^4.21.2",
"get-port": "^5.1.1",
"graphql": "^15.5.0",
"graphql-iso-date": "^3.6.1",
"graphql-subscriptions": "^1.1.0",
- "ip": "^1.1.5",
"js-string-escape": "^1.0.1",
"jwt-decode": "^2.2.0",
"libphonenumber-js": "1.9.47",
@@ -59,12 +58,12 @@
"ws": "^8.5.0"
},
"devDependencies": {
- "@aws-amplify/amplify-graphiql-explorer": "2.5.7",
+ "@aws-amplify/amplify-graphiql-explorer": "2.6.0",
"@types/cors": "^2.8.6",
"@types/express": "^4.17.3",
"@types/node": "^12.12.6",
"@types/ws": "^8.2.2",
- "jsonwebtoken": "^9.0.0"
+ "jose": "^5.2.0"
},
"packageExtensions": {
"graphql-iso-date": {
diff --git a/packages/amplify-appsync-simulator/src/__tests__/__helpers__/appsync-client.ts b/packages/amplify-appsync-simulator/src/__tests__/__helpers__/appsync-client.ts
index 8e63d96718a..a4f592629b1 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/__helpers__/appsync-client.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/__helpers__/appsync-client.ts
@@ -5,7 +5,7 @@
import * as http from 'http';
import type { GraphQLError } from 'graphql';
import { AmplifyAppSyncSimulator, AmplifyAppSyncSimulatorAuthenticationType } from '../../';
-import jwt from 'jsonwebtoken';
+import { SignJWT } from 'jose';
/**
* Minimal gql tag just for syntax highlighting and Prettier while writing client GraphQL queries
@@ -54,14 +54,14 @@ export async function appSyncClient reject(err));
},
diff --git a/packages/amplify-appsync-simulator/src/__tests__/index.test.ts b/packages/amplify-appsync-simulator/src/__tests__/index.test.ts
index 5f496ee57e2..b1bb99db2ff 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/index.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/index.test.ts
@@ -4,10 +4,8 @@ import { VelocityTemplate } from '../velocity';
import {
AmplifyAppSyncSimulatorAuthenticationType,
- AppSyncSimulatorDataSourceNoneConfig,
AmplifyAppSyncSimulatorConfig,
AppSyncMockFile,
- AppSyncSimulatorBaseResolverConfig,
RESOLVER_KIND,
AppSyncSimulatorUnitResolverConfig,
} from '../type-definition';
diff --git a/packages/amplify-appsync-simulator/src/__tests__/resolvers/pipeline-resolver.test.ts b/packages/amplify-appsync-simulator/src/__tests__/resolvers/pipeline-resolver.test.ts
index 1eada37d4e2..2a9baf6fc83 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/resolvers/pipeline-resolver.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/resolvers/pipeline-resolver.test.ts
@@ -63,14 +63,14 @@ describe('Pipeline Resolvers', () => {
beforeEach(() => {
fnImpl = {
fn1: {
- resolve: jest.fn().mockImplementation((source, args, stash, prevResult, context, info) => ({
+ resolve: jest.fn().mockImplementation((source, args, stash) => ({
result: 'FN1-RESULT',
args,
stash: { ...stash, exeSeq: [...(stash.exeSeq || []), 'fn1'] },
})),
},
fn2: {
- resolve: jest.fn().mockImplementation((source, args, stash, prevResult, context, info) => ({
+ resolve: jest.fn().mockImplementation((source, args, stash) => ({
args,
result: 'FN2-RESULT',
stash: { ...stash, exeSeq: [...(stash.exeSeq || []), 'fn2'] },
@@ -171,12 +171,12 @@ describe('Pipeline Resolvers', () => {
appsyncErrors: [],
};
const info = {};
- fnImpl.fn1.resolve.mockImplementation((source, args, stash, prevResult, context, info) => ({
+ fnImpl.fn1.resolve.mockImplementation((source, args, stash) => ({
result: 'FN1-RESULT',
args: { ...args, fn1Arg: 'FN1-ARG1' },
stash: { ...stash, exeSeq: [...(stash.exeSeq || []), 'fn1'] },
}));
- fnImpl.fn2.resolve.mockImplementation((source, args, stash, prevResult, context, info) => ({
+ fnImpl.fn2.resolve.mockImplementation((source, args, stash) => ({
result: 'FN2-RESULT',
args: { ...args, fn2Arg: 'FN2-ARG1' },
stash: { ...stash, exeSeq: [...(stash.exeSeq || []), 'fn2'] },
@@ -245,7 +245,7 @@ describe('Pipeline Resolvers', () => {
it('bails out early on terminal error', async () => {
resolver = new AppSyncPipelineResolver(baseConfig, simulatorContext);
fnImpl.fn1 = {
- resolve: jest.fn().mockImplementation((source, args, stash, prevResult, context, info) => {
+ resolve: jest.fn().mockImplementation((source, args, stash, prevResult, context) => {
const err = new Error('fn1-ERROR');
context.appsyncErrors = [...context.appsyncErrors, err];
return {
diff --git a/packages/amplify-appsync-simulator/src/__tests__/scalars/AWSIPAddress.test.ts b/packages/amplify-appsync-simulator/src/__tests__/scalars/AWSIPAddress.test.ts
index 93d70013134..fb77ab4c37b 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/scalars/AWSIPAddress.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/scalars/AWSIPAddress.test.ts
@@ -1,4 +1,3 @@
-import { URL } from 'url';
import { scalars } from '../../schema/appsync-scalars';
describe('AWSIPAddress parse', () => {
it('should parse valid ip address', () => {
diff --git a/packages/amplify-appsync-simulator/src/__tests__/server/subscription/websocket-server/server.test.ts b/packages/amplify-appsync-simulator/src/__tests__/server/subscription/websocket-server/server.test.ts
index 652153c70a3..a6e4d96467f 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/server/subscription/websocket-server/server.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/server/subscription/websocket-server/server.test.ts
@@ -78,8 +78,8 @@ describe('WebsocketSubscriptionServer', () => {
server.start();
});
- afterEach(() => {
- server?.stop();
+ afterEach(async () => {
+ await server?.stop();
httpServer?.close();
});
@@ -103,7 +103,7 @@ describe('WebsocketSubscriptionServer', () => {
it('should accept connection when the protocol is graphql-ws', async () => {
const client = new WS(`ws://localhost:${serverPort}${REALTIME_SUBSCRIPTION_PATH}`, 'graphql-ws');
- const messagePromise = new Promise((resolve, _) => {
+ const messagePromise = new Promise((resolve) => {
client.addEventListener('close', (event) => {
expect(event.wasClean).toBeTruthy();
resolve(undefined);
@@ -133,7 +133,7 @@ describe('WebsocketSubscriptionServer', () => {
it('should fail connection when onConnectionHandler throw and error', async () => {
onConnectHandler.mockRejectedValue('error');
const client = new WS(`ws://localhost:${serverPort}${REALTIME_SUBSCRIPTION_PATH}`, 'graphql-ws');
- const messagePromise = new Promise((resolve, _) => {
+ const messagePromise = new Promise((resolve) => {
client.addEventListener('close', (event) => {
expect(event.code).toEqual(1002);
resolve(undefined);
@@ -164,7 +164,7 @@ describe('WebsocketSubscriptionServer', () => {
type: MESSAGE_TYPES.GQL_CONNECTION_INIT,
payload: {},
};
- const messagePromise = new Promise((resolve, _) => {
+ const messagePromise = new Promise((resolve) => {
client.onmessage = (message: WS.MessageEvent) => {
const data = JSON.parse(message.data as string);
expect(data.type).toEqual(MESSAGE_TYPES.GQL_CONNECTION_ACK);
@@ -183,7 +183,7 @@ describe('WebsocketSubscriptionServer', () => {
type: 'invalid',
payload: {},
};
- const messagePromise = new Promise((resolve, _) => {
+ const messagePromise = new Promise((resolve) => {
client.onmessage = (message: WS.MessageEvent) => {
const data = JSON.parse(message.data as string);
expect(data.type).toEqual(MESSAGE_TYPES.GQL_ERROR);
@@ -390,7 +390,7 @@ describe('WebsocketSubscriptionServer', () => {
const data = {
onMessage: 'hello from iterator',
};
- pubsub.publish('onMessage', data);
+ void pubsub.publish('onMessage', data);
const msg = await waitForMessage(client, MESSAGE_TYPES.GQL_DATA);
expect(msg).toEqual({
type: MESSAGE_TYPES.GQL_DATA,
diff --git a/packages/amplify-appsync-simulator/src/__tests__/server/websocket-subscription.test.ts b/packages/amplify-appsync-simulator/src/__tests__/server/websocket-subscription.test.ts
index b1d31f3c652..4106858cc50 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/server/websocket-subscription.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/server/websocket-subscription.test.ts
@@ -73,10 +73,10 @@ describe('websocket subscription', () => {
expect(startSpy).toHaveBeenCalled();
});
- it('should call websocket servers stop method when stop is called', () => {
+ it('should call websocket servers stop method when stop is called', async () => {
const stopSpy = jest.spyOn(WebsocketSubscriptionServer.prototype, 'stop');
const subs = new AppSyncSimulatorSubscriptionServer(simulatorContext, server, subscriptionPath);
- subs.stop();
+ await subs.stop();
expect(stopSpy).toHaveBeenCalled();
});
@@ -119,7 +119,7 @@ describe('websocket subscription', () => {
describe('onSubscribe', () => {
let subsServer: AppSyncSimulatorSubscriptionServer;
- let asyncIterator = new PubSub().asyncIterator('onMessage');
+ const asyncIterator = new PubSub().asyncIterator('onMessage');
const tokenString = 'token-here';
const jwt = { iss: 'some issuer' };
const doc = parse(/* GraphQL */ `
diff --git a/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/query-and-mutation.test.ts b/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/query-and-mutation.test.ts
index a17051fd4ca..a1b1b173c75 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/query-and-mutation.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/query-and-mutation.test.ts
@@ -156,7 +156,6 @@ describe('runQueryAndMutation', () => {
});
it('should have error object populated when error occurs in the resolver (e.g. Lambda DataSource)', async () => {
- const name = 'John Doe';
const doc = parse(/* GraphQL */ `
query getName {
getName
diff --git a/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/subscription.test.ts b/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/subscription.test.ts
index d362e754909..539d2877e6a 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/subscription.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/subscription.test.ts
@@ -18,8 +18,8 @@ describe('runSubscription', () => {
`);
let schema: GraphQLSchema;
- let subscriptionResolver = jest.fn();
- let subscriptionSubscribe = jest.fn();
+ const subscriptionResolver = jest.fn();
+ const subscriptionSubscribe = jest.fn();
const executionContext: AppSyncGraphQLExecutionContext = {
headers: { 'x-api-key': 'da-fake-key' },
diff --git a/packages/amplify-appsync-simulator/src/__tests__/velocity/util/list-utils.test.ts b/packages/amplify-appsync-simulator/src/__tests__/velocity/util/list-utils.test.ts
index e1d7731b2ee..97bcf45228c 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/velocity/util/list-utils.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/velocity/util/list-utils.test.ts
@@ -7,7 +7,7 @@ import { AmplifyAppSyncSimulatorAuthenticationType } from '../../../type-definit
const stubInfo = {} as unknown;
export const mockInfo = stubInfo as GraphQLResolveInfo;
-var util;
+let util;
beforeEach(() => {
const executionContext: AppSyncGraphQLExecutionContext = {
diff --git a/packages/amplify-appsync-simulator/src/__tests__/velocity/util/math.test.ts b/packages/amplify-appsync-simulator/src/__tests__/velocity/util/math.test.ts
index 00fe68423ea..e2ce2e85ba4 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/velocity/util/math.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/velocity/util/math.test.ts
@@ -5,7 +5,7 @@ import { AmplifyAppSyncSimulatorAuthenticationType } from '../../../type-definit
const stubInfo = {} as unknown;
export const mockInfo = stubInfo as GraphQLResolveInfo;
-var util;
+let util;
beforeEach(() => {
const executionContext: AppSyncGraphQLExecutionContext = {
diff --git a/packages/amplify-appsync-simulator/src/__tests__/velocity/util/str.test.ts b/packages/amplify-appsync-simulator/src/__tests__/velocity/util/str.test.ts
index 622d75c1a3c..e18fc3d4d57 100644
--- a/packages/amplify-appsync-simulator/src/__tests__/velocity/util/str.test.ts
+++ b/packages/amplify-appsync-simulator/src/__tests__/velocity/util/str.test.ts
@@ -5,7 +5,7 @@ import { AppSyncGraphQLExecutionContext } from '../../../utils/graphql-runner';
const stubInfo = {} as unknown;
export const mockInfo = stubInfo as GraphQLResolveInfo;
-var util;
+let util;
beforeEach(() => {
const executionContext: AppSyncGraphQLExecutionContext = {
diff --git a/packages/amplify-appsync-simulator/src/index.ts b/packages/amplify-appsync-simulator/src/index.ts
index 77df9b8061d..4f5ad7aaa1e 100644
--- a/packages/amplify-appsync-simulator/src/index.ts
+++ b/packages/amplify-appsync-simulator/src/index.ts
@@ -181,6 +181,12 @@ export class AmplifyAppSyncSimulator {
get url(): string {
return this._server.url.graphql;
}
+ get localhostUrl(): string {
+ return this._server.localhostUrl.graphql;
+ }
+ get isHttps(): boolean {
+ return this._server.isHttps;
+ }
get config(): AmplifyAppSyncSimulatorConfig {
return this._config;
}
diff --git a/packages/amplify-appsync-simulator/src/server/index.ts b/packages/amplify-appsync-simulator/src/server/index.ts
index ee473a45906..24e493f5898 100644
--- a/packages/amplify-appsync-simulator/src/server/index.ts
+++ b/packages/amplify-appsync-simulator/src/server/index.ts
@@ -2,24 +2,58 @@ import { OperationServer } from './operations';
import { AmplifyAppSyncSimulator } from '..';
import { AppSyncSimulatorServerConfig } from '../type-definition';
import { Server, createServer } from 'http';
+import { createServer as createHttpsServer } from 'https';
+import { readFileSync } from 'fs';
import { fromEvent } from 'promise-toolbox';
-import { address as getLocalIpAddress } from 'ip';
import { AppSyncSimulatorSubscriptionServer } from './websocket-subscription';
import getPort from 'get-port';
import { REALTIME_SUBSCRIPTION_PATH } from './subscription/websocket-server/server';
+import os from 'os';
const BASE_PORT = 8900;
const MAX_PORT = 9999;
+function getLocalIpAddress(): string {
+ const interfaces = os.networkInterfaces();
+ const internalAddresses = Object.keys(interfaces)
+ .map((nic) => {
+ const addresses = interfaces[nic].filter((details) => details.internal);
+ return addresses.length ? addresses[0].address : undefined;
+ })
+ .filter(Boolean);
+ return internalAddresses.length ? internalAddresses[0] : '127.0.0.1';
+}
+
export class AppSyncSimulatorServer {
private _operationServer: OperationServer;
private _httpServer: Server;
private _realTimeSubscriptionServer: AppSyncSimulatorSubscriptionServer;
private _url: string;
+ private _localhostUrl: string;
+ private _isHttps = false;
constructor(private config: AppSyncSimulatorServerConfig, private simulatorContext: AmplifyAppSyncSimulator) {
this._operationServer = new OperationServer(config, simulatorContext);
- this._httpServer = createServer(this._operationServer.app);
+
+ // Check if the https configuration is not provided
+ if (!config.httpsConfig) {
+ this._httpServer = createServer(this._operationServer.app);
+ } else {
+ try {
+ // Read the ssl cert and key
+ const sslOptions = {
+ key: readFileSync(config.httpsConfig.sslKeyPath),
+ cert: readFileSync(config.httpsConfig.sslCertPath),
+ };
+ // Set the isHttps flag to true
+ this._isHttps = true;
+ // Create the https server
+ this._httpServer = createHttpsServer(sslOptions, this._operationServer.app);
+ } catch (e) {
+ throw new Error(`SSL key and certificate path provided are invalid. ${e.message}`);
+ }
+ }
+
this._realTimeSubscriptionServer = new AppSyncSimulatorSubscriptionServer(
simulatorContext,
this._httpServer,
@@ -48,7 +82,9 @@ export class AppSyncSimulatorServer {
this._httpServer.listen(port);
await fromEvent(this._httpServer, 'listening').then(() => {
- this._url = `http://${getLocalIpAddress()}:${port}`;
+ const protocol = this._isHttps ? 'https' : 'http';
+ this._url = `${protocol}://${getLocalIpAddress()}:${port}`;
+ this._localhostUrl = `${protocol}://localhost:${port}`;
});
}
@@ -61,4 +97,12 @@ export class AppSyncSimulatorServer {
graphql: this._url,
};
}
+ get localhostUrl() {
+ return {
+ graphql: this._localhostUrl,
+ };
+ }
+ get isHttps() {
+ return this._isHttps;
+ }
}
diff --git a/packages/amplify-appsync-simulator/src/server/subscription/websocket-server/server.ts b/packages/amplify-appsync-simulator/src/server/subscription/websocket-server/server.ts
index 7ba06d3cb89..90b91ed1f75 100644
--- a/packages/amplify-appsync-simulator/src/server/subscription/websocket-server/server.ts
+++ b/packages/amplify-appsync-simulator/src/server/subscription/websocket-server/server.ts
@@ -5,7 +5,6 @@ import * as WebSocket from 'ws';
import { Server as WebSocketServer, ServerOptions } from 'ws';
import {
GQLMessageConnectionAck,
- GQLMessageConnectionInit,
GQLMessageSubscriptionStart,
GQLMessageSubscriptionStop,
isSubscriptionConnectionInitMessage,
diff --git a/packages/amplify-appsync-simulator/src/type-definition.ts b/packages/amplify-appsync-simulator/src/type-definition.ts
index a98b5f87038..063b633aa47 100644
--- a/packages/amplify-appsync-simulator/src/type-definition.ts
+++ b/packages/amplify-appsync-simulator/src/type-definition.ts
@@ -152,6 +152,10 @@ export type AmplifyAppSyncSimulatorConfig = {
export type AppSyncSimulatorServerConfig = {
port?: number;
wsPort?: number;
+ httpsConfig?: {
+ sslKeyPath: string;
+ sslCertPath: string;
+ };
};
export type AmplifyAppSyncSimulatorRequestContext = {
diff --git a/packages/amplify-category-analytics/CHANGELOG.md b/packages/amplify-category-analytics/CHANGELOG.md
index 34e967cfe88..ea4c42156cf 100644
--- a/packages/amplify-category-analytics/CHANGELOG.md
+++ b/packages/amplify-category-analytics/CHANGELOG.md
@@ -3,6 +3,225 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.0.37](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.36...@aws-amplify/amplify-category-analytics@5.0.37) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.36](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.35...@aws-amplify/amplify-category-analytics@5.0.36) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.35](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.34...@aws-amplify/amplify-category-analytics@5.0.35) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.34](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.33...@aws-amplify/amplify-category-analytics@5.0.34) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.33](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.32...@aws-amplify/amplify-category-analytics@5.0.33) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.32](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.31...@aws-amplify/amplify-category-analytics@5.0.32) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.31](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.30...@aws-amplify/amplify-category-analytics@5.0.31) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.30](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.29...@aws-amplify/amplify-category-analytics@5.0.30) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.29](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.28...@aws-amplify/amplify-category-analytics@5.0.29) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.28](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.27...@aws-amplify/amplify-category-analytics@5.0.28) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.26...@aws-amplify/amplify-category-analytics@5.0.27) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.25...@aws-amplify/amplify-category-analytics@5.0.26) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.23...@aws-amplify/amplify-category-analytics@5.0.25) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.0.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.23...@aws-amplify/amplify-category-analytics@5.0.24) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.22...@aws-amplify/amplify-category-analytics@5.0.23) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.21...@aws-amplify/amplify-category-analytics@5.0.22) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.20...@aws-amplify/amplify-category-analytics@5.0.21) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.19...@aws-amplify/amplify-category-analytics@5.0.20) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.18...@aws-amplify/amplify-category-analytics@5.0.19) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.17...@aws-amplify/amplify-category-analytics@5.0.18) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.16...@aws-amplify/amplify-category-analytics@5.0.17) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.15...@aws-amplify/amplify-category-analytics@5.0.16) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.14...@aws-amplify/amplify-category-analytics@5.0.15) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.13...@aws-amplify/amplify-category-analytics@5.0.14) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.12...@aws-amplify/amplify-category-analytics@5.0.13) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.11...@aws-amplify/amplify-category-analytics@5.0.12) (2023-07-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
+## [5.0.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.10...@aws-amplify/amplify-category-analytics@5.0.11) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
+
+
+
+
+
## [5.0.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-analytics@5.0.8...@aws-amplify/amplify-category-analytics@5.0.10) (2023-05-25)
diff --git a/packages/amplify-category-analytics/package.json b/packages/amplify-category-analytics/package.json
index 8da4777a773..cd6d18d3f42 100644
--- a/packages/amplify-category-analytics/package.json
+++ b/packages/amplify-category-analytics/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-analytics",
- "version": "5.0.10",
+ "version": "5.0.37",
"description": "amplify-cli analytics plugin",
"repository": {
"type": "git",
@@ -25,9 +25,9 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"fs-extra": "^8.1.0",
"uuid": "^8.3.2"
},
diff --git a/packages/amplify-category-auth/API.md b/packages/amplify-category-auth/API.md
index 6c6ba139774..9f832059f3f 100644
--- a/packages/amplify-category-auth/API.md
+++ b/packages/amplify-category-auth/API.md
@@ -126,6 +126,9 @@ export function prePushAuthHook(context: any): Promise;
// @public (undocumented)
export function transformCategoryStack(context: any, resource: any): Promise;
+// @public (undocumented)
+export const updateAppClientWithGeneratedSecret: (context: $TSContext) => Promise;
+
// @public (undocumented)
export const uploadFiles: (context: $TSContext) => Promise;
diff --git a/packages/amplify-category-auth/CHANGELOG.md b/packages/amplify-category-auth/CHANGELOG.md
index e753f51ffe5..64afc477d9b 100644
--- a/packages/amplify-category-auth/CHANGELOG.md
+++ b/packages/amplify-category-auth/CHANGELOG.md
@@ -3,6 +3,270 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.7.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.16...@aws-amplify/amplify-category-auth@3.7.17) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.15...@aws-amplify/amplify-category-auth@3.7.16) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.14...@aws-amplify/amplify-category-auth@3.7.15) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.13...@aws-amplify/amplify-category-auth@3.7.14) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.12...@aws-amplify/amplify-category-auth@3.7.13) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.11...@aws-amplify/amplify-category-auth@3.7.12) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.10...@aws-amplify/amplify-category-auth@3.7.11) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.9...@aws-amplify/amplify-category-auth@3.7.10) (2024-05-07)
+
+
+### Bug Fixes
+
+* **amplify-category-auth:** added pagination for listGroups api action ([#13723](https://github.com/aws-amplify/amplify-cli/issues/13723)) ([0d52c47](https://github.com/aws-amplify/amplify-cli/commit/0d52c478475e25f53d7693f79902b21dc4741942))
+
+
+
+
+
+## [3.7.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.8...@aws-amplify/amplify-category-auth@3.7.9) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.7...@aws-amplify/amplify-category-auth@3.7.8) (2024-04-15)
+
+
+### Bug Fixes
+
+* upgrade Go runtime and fix e2e ([#13671](https://github.com/aws-amplify/amplify-cli/issues/13671)) ([395f717](https://github.com/aws-amplify/amplify-cli/commit/395f717cf52e7beef76f00ee08d37877138b0c30))
+
+
+
+
+
+## [3.7.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.6...@aws-amplify/amplify-category-auth@3.7.7) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.5...@aws-amplify/amplify-category-auth@3.7.6) (2024-03-06)
+
+
+### Bug Fixes
+
+* limit query parameter parsing in auth admin api ([#13512](https://github.com/aws-amplify/amplify-cli/issues/13512)) ([2480681](https://github.com/aws-amplify/amplify-cli/commit/24806814ce2275fe7d70e5484c3c485023b8041a))
+
+
+
+
+
+## [3.7.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.4...@aws-amplify/amplify-category-auth@3.7.5) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.2...@aws-amplify/amplify-category-auth@3.7.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [3.7.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.2...@aws-amplify/amplify-category-auth@3.7.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.1...@aws-amplify/amplify-category-auth@3.7.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.7.0...@aws-amplify/amplify-category-auth@3.7.1) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+# [3.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.6.3...@aws-amplify/amplify-category-auth@3.7.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [3.6.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.6.2...@aws-amplify/amplify-category-auth@3.6.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.6.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.6.1...@aws-amplify/amplify-category-auth@3.6.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.6.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.6.0...@aws-amplify/amplify-category-auth@3.6.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+# [3.6.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.5.0...@aws-amplify/amplify-category-auth@3.6.0) (2023-08-17)
+
+
+### Bug Fixes
+
+* remove error incorrectly swallowed (fixes [#13030](https://github.com/aws-amplify/amplify-cli/issues/13030)) ([#13041](https://github.com/aws-amplify/amplify-cli/issues/13041)) ([2941584](https://github.com/aws-amplify/amplify-cli/commit/294158417ab176db4ece2acf043cc16355e9c737))
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+# [3.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.4.3...@aws-amplify/amplify-category-auth@3.5.0) (2023-08-09)
+
+
+### Bug Fixes
+
+* add permissions boundary for IAM Role created for auth trigger ([#12914](https://github.com/aws-amplify/amplify-cli/issues/12914)) ([47990a9](https://github.com/aws-amplify/amplify-cli/commit/47990a9e8f3703fff84ec17fa3c7e33865f676f4))
+* remove vm2 ([#12989](https://github.com/aws-amplify/amplify-cli/issues/12989)) ([7bc0b56](https://github.com/aws-amplify/amplify-cli/commit/7bc0b5654a585104a537c1a3f9615bd672435b58))
+
+
+### Features
+
+* replace oauth and userpoolclient lambdas with cfn and sdk calls ([#12935](https://github.com/aws-amplify/amplify-cli/issues/12935)) ([b3ab512](https://github.com/aws-amplify/amplify-cli/commit/b3ab5125f2ec405afd1af9d2f77b8683d5914010))
+* replace role mapping lambda in auth category ([#13003](https://github.com/aws-amplify/amplify-cli/issues/13003)) ([4ce0329](https://github.com/aws-amplify/amplify-cli/commit/4ce032932702305b9f9564a77418855ceb0f0fca))
+* run auth lambdas on node 18 ([#13011](https://github.com/aws-amplify/amplify-cli/issues/13011)) ([a9e12ff](https://github.com/aws-amplify/amplify-cli/commit/a9e12ff9552ba024887312a81bf411fb5c7926d0))
+
+
+
+
+
+## [3.4.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.4.2...@aws-amplify/amplify-category-auth@3.4.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.4.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.4.1...@aws-amplify/amplify-category-auth@3.4.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+## [3.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.4.0...@aws-amplify/amplify-category-auth@3.4.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-auth
+
+
+
+
+
+# [3.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.3.0...@aws-amplify/amplify-category-auth@3.4.0) (2023-07-20)
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+# [3.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.2.3...@aws-amplify/amplify-category-auth@3.3.0) (2023-06-13)
+
+
+### Features
+
+* update console auth command url to v2 dashboard ([#12612](https://github.com/aws-amplify/amplify-cli/issues/12612)) ([a9f21e5](https://github.com/aws-amplify/amplify-cli/commit/a9f21e5d684ad29b30b0d341b6601d8bb76c2364))
+
+
+
+
+
## [3.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-auth@3.2.1...@aws-amplify/amplify-category-auth@3.2.3) (2023-05-25)
diff --git a/packages/amplify-category-auth/package.json b/packages/amplify-category-auth/package.json
index e0259d270e6..5c2b4edf125 100644
--- a/packages/amplify-category-auth/package.json
+++ b/packages/amplify-category-auth/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-auth",
- "version": "3.2.3",
+ "version": "3.7.17",
"description": "amplify-cli authentication plugin",
"repository": {
"type": "git",
@@ -28,17 +28,17 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
- "@aws-amplify/amplify-function-plugin-interface": "1.10.2",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "@aws-amplify/amplify-util-import": "2.6.0",
- "@aws-amplify/cli-extensibility-helper": "3.0.8",
- "amplify-headless-interface": "1.17.3",
- "amplify-util-headless-input": "1.9.12",
- "aws-cdk-lib": "~2.68.0",
- "aws-sdk": "^2.1354.0",
- "axios": "^0.26.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
+ "@aws-amplify/amplify-function-plugin-interface": "1.12.1",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "@aws-amplify/amplify-util-import": "2.8.3",
+ "@aws-amplify/cli-extensibility-helper": "3.0.35",
+ "amplify-headless-interface": "1.17.7",
+ "amplify-util-headless-input": "1.9.18",
+ "aws-cdk-lib": "~2.177.0",
+ "aws-sdk": "^2.1464.0",
+ "axios": "^1.6.7",
"chalk": "^4.1.1",
"change-case": "^4.1.1",
"constructs": "^10.0.5",
@@ -49,11 +49,11 @@
"mime-types": "^2.1.26",
"ora": "^4.0.3",
"promise-sequential": "^1.1.1",
- "uuid": "^8.3.2",
- "vm2": "^3.9.19"
+ "uuid": "^8.3.2"
},
"devDependencies": {
- "@aws-sdk/client-cognito-identity-provider": "^3.303.0",
+ "@aws-sdk/client-cognito-identity-provider": "3.624.0",
+ "@aws-sdk/client-iam": "3.624.0",
"@types/mime-types": "^2.1.1",
"cloudform-types": "^4.2.0",
"jest": "^29.5.0",
diff --git a/packages/amplify-category-auth/resources/adminAuth/admin-auth-app.js b/packages/amplify-category-auth/resources/adminAuth/admin-auth-app.js
index 9c3d1ad14d3..d6749854ea7 100644
--- a/packages/amplify-category-auth/resources/adminAuth/admin-auth-app.js
+++ b/packages/amplify-category-auth/resources/adminAuth/admin-auth-app.js
@@ -162,14 +162,8 @@ app.get('/getUser', async (req, res, next) => {
app.get('/listUsers', async (req, res, next) => {
try {
- let response;
- if (req.query.token) {
- response = await listUsers(req.query.limit || 25, req.query.token);
- } else if (req.query.limit) {
- response = await listUsers((Limit = req.query.limit));
- } else {
- response = await listUsers();
- }
+ const limit = req.query.limit ? parseInt(req.query.limit) : 25;
+ const response = await listUsers(limit, req.query.token);
res.status(200).json(response);
} catch (err) {
next(err);
@@ -178,14 +172,8 @@ app.get('/listUsers', async (req, res, next) => {
app.get('/listGroups', async (req, res, next) => {
try {
- let response;
- if (req.query.token) {
- response = await listGroups(req.query.limit || 25, req.query.token);
- } else if (req.query.limit) {
- response = await listGroups((Limit = req.query.limit));
- } else {
- response = await listGroups();
- }
+ const limit = req.query.limit ? parseInt(req.query.limit) : 25;
+ const response = await listGroups(limit, req.query.token);
res.status(200).json(response);
} catch (err) {
next(err);
@@ -200,14 +188,8 @@ app.get('/listGroupsForUser', async (req, res, next) => {
}
try {
- let response;
- if (req.query.token) {
- response = await listGroupsForUser(req.query.username, req.query.limit || 25, req.query.token);
- } else if (req.query.limit) {
- response = await listGroupsForUser(req.query.username, (Limit = req.query.limit));
- } else {
- response = await listGroupsForUser(req.query.username);
- }
+ const limit = req.query.limit ? parseInt(req.query.limit) : 25;
+ const response = await listGroupsForUser(req.query.username, limit, req.query.token);
res.status(200).json(response);
} catch (err) {
next(err);
@@ -222,14 +204,8 @@ app.get('/listUsersInGroup', async (req, res, next) => {
}
try {
- let response;
- if (req.query.token) {
- response = await listUsersInGroup(req.query.groupname, req.query.limit || 25, req.query.token);
- } else if (req.query.limit) {
- response = await listUsersInGroup(req.query.groupname, (Limit = req.query.limit));
- } else {
- response = await listUsersInGroup(req.query.groupname);
- }
+ const limit = req.query.limit ? parseInt(req.query.limit) : 25;
+ const response = await listUsersInGroup(req.query.groupname, limit, req.query.token);
res.status(200).json(response);
} catch (err) {
next(err);
diff --git a/packages/amplify-category-auth/resources/adminAuth/admin-auth-cognitoActions.js b/packages/amplify-category-auth/resources/adminAuth/admin-auth-cognitoActions.js
index 3f9d60902f6..1c900aa32cb 100644
--- a/packages/amplify-category-auth/resources/adminAuth/admin-auth-cognitoActions.js
+++ b/packages/amplify-category-auth/resources/adminAuth/admin-auth-cognitoActions.js
@@ -167,11 +167,11 @@ async function listUsers(Limit, PaginationToken) {
}
}
-async function listGroups(Limit, PaginationToken) {
+async function listGroups(Limit, NextToken) {
const params = {
UserPoolId: userPoolId,
...(Limit && { Limit }),
- ...(PaginationToken && { PaginationToken }),
+ ...(NextToken && { NextToken }),
};
console.log('Attempting to list groups');
@@ -179,10 +179,6 @@ async function listGroups(Limit, PaginationToken) {
try {
const result = await cognitoIdentityProviderClient.send(new ListGroupsCommand(params));
- // Rename to NextToken for consistency with other Cognito APIs
- result.NextToken = result.PaginationToken;
- delete result.PaginationToken;
-
return result;
} catch (err) {
console.log(err);
diff --git a/packages/amplify-category-auth/resources/adminAuth/admin-auth-package.json b/packages/amplify-category-auth/resources/adminAuth/admin-auth-package.json
index a9fa5648d98..8be3bcb669e 100644
--- a/packages/amplify-category-auth/resources/adminAuth/admin-auth-package.json
+++ b/packages/amplify-category-auth/resources/adminAuth/admin-auth-package.json
@@ -10,6 +10,6 @@
"express": "^4.17.1"
},
"devDependencies": {
- "@aws-sdk/client-cognito-identity-provider": "^3.303.0"
+ "@aws-sdk/client-cognito-identity-provider": "3.624.0"
}
}
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/hostedUILambda.js b/packages/amplify-category-auth/resources/auth-custom-resource/hostedUILambda.js
index b2e4b1c7ccf..640662f9f5e 100644
--- a/packages/amplify-category-auth/resources/auth-custom-resource/hostedUILambda.js
+++ b/packages/amplify-category-auth/resources/auth-custom-resource/hostedUILambda.js
@@ -1,81 +1,80 @@
const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
+const {
+ CognitoIdentityProviderClient,
+ CreateUserPoolDomainCommand,
+ DeleteUserPoolDomainCommand,
+ DescribeUserPoolCommand,
+ DescribeUserPoolDomainCommand,
+} = require('@aws-sdk/client-cognito-identity-provider');
+const identity = new CognitoIdentityProviderClient({});
+
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
+ try {
+ await handleEvent(event);
+ response.send(event, context, response.SUCCESS, {});
+ } catch (err) {
+ console.log(err);
+ response.send(event, context, response.FAILED, { err });
+ }
+}
+
+async function handleEvent(event) {
const userPoolId = event.ResourceProperties.userPoolId;
const inputDomainName = event.ResourceProperties.hostedUIDomainName;
- let deleteUserPoolDomain = (domainName) => {
- let params = { Domain: domainName, UserPoolId: userPoolId };
- return identity.deleteUserPoolDomain(params).promise();
+ if (event.RequestType === 'Delete') {
+ await deleteUserPoolDomain(inputDomainName, userPoolId);
+ } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {
+ await createOrUpdateDomain(inputDomainName, userPoolId);
+ }
+}
+
+async function checkDomainAvailability(domainName) {
+ const params = { Domain: domainName };
+ try {
+ const res = await identity.send(new DescribeUserPoolDomainCommand(params));
+ return !(res.DomainDescription && res.DomainDescription.UserPoolId);
+ } catch (err) {
+ return false;
+ }
+}
+
+async function deleteUserPoolDomain(domainName, userPoolId) {
+ const params = { Domain: domainName, UserPoolId: userPoolId };
+ await identity.send(new DeleteUserPoolDomainCommand(params));
+}
+
+async function createUserPoolDomain(domainName, userPoolId) {
+ const params = {
+ Domain: domainName,
+ UserPoolId: userPoolId,
};
- if (event.RequestType == 'Delete') {
- deleteUserPoolDomain(inputDomainName)
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err);
- response.send(event, context, response.FAILED, { err });
- });
+ await identity.send(new CreateUserPoolDomainCommand(params));
+}
+
+async function createOrUpdateDomain(inputDomainName, userPoolId) {
+ const result = await identity.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));
+ if (result.UserPool.Domain === inputDomainName) {
+ // if existing domain is same as input domain do nothing.
+ return;
}
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let checkDomainAvailability = (domainName) => {
- let params = { Domain: domainName };
- return identity
- .describeUserPoolDomain(params)
- .promise()
- .then((res) => {
- if (res.DomainDescription && res.DomainDescription.UserPool) {
- return false;
- }
- return true;
- })
- .catch((err) => {
- return false;
- });
- };
- let createUserPoolDomain = (domainName) => {
- let params = { Domain: domainName, UserPoolId: userPoolId };
- return identity.createUserPoolDomain(params).promise();
- };
- identity
- .describeUserPool({ UserPoolId: userPoolId })
- .promise()
- .then((result) => {
- if (inputDomainName) {
- if (result.UserPool.Domain === inputDomainName) {
- return;
- } else {
- if (!result.UserPool.Domain) {
- return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {
- if (isDomainAvailable) {
- return createUserPoolDomain(inputDomainName);
- } else {
- throw new Error('Domain not available');
- }
- });
- } else {
- return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {
- if (isDomainAvailable) {
- return deleteUserPoolDomain(result.UserPool.Domain).then(() => createUserPoolDomain(inputDomainName));
- } else {
- throw new Error('Domain not available');
- }
- });
- }
- }
- } else {
- if (result.UserPool.Domain) {
- return deleteUserPoolDomain(result.UserPool.Domain);
- }
- }
- })
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err);
- response.send(event, context, response.FAILED, { err });
- });
+ if (inputDomainName) {
+ // create new or replace existing domain.
+ const isDomainAvailable = await checkDomainAvailability(inputDomainName);
+ if (isDomainAvailable) {
+ if (result.UserPool.Domain) {
+ await deleteUserPoolDomain(result.UserPool.Domain, userPoolId);
+ }
+ await createUserPoolDomain(inputDomainName, userPoolId);
+ } else {
+ throw new Error('Domain not available');
+ }
+ } else if (result.UserPool.Domain) {
+ // if input domain is undefined delete existing domain if exists.
+ await deleteUserPoolDomain(result.UserPool.Domain, userPoolId);
}
-};
+}
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/hostedUIProviderLambda.js b/packages/amplify-category-auth/resources/auth-custom-resource/hostedUIProviderLambda.js
index 05a82d86c03..4474998dbe6 100644
--- a/packages/amplify-category-auth/resources/auth-custom-resource/hostedUIProviderLambda.js
+++ b/packages/amplify-category-auth/resources/auth-custom-resource/hostedUIProviderLambda.js
@@ -1,104 +1,110 @@
const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
+const {
+ CognitoIdentityProviderClient,
+ CreateIdentityProviderCommand,
+ DeleteIdentityProviderCommand,
+ ListIdentityProvidersCommand,
+ UpdateIdentityProviderCommand,
+} = require('@aws-sdk/client-cognito-identity-provider');
+const identity = new CognitoIdentityProviderClient({});
+
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
try {
- const userPoolId = event.ResourceProperties.userPoolId;
- let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);
- let hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);
- if (hostedUIProviderCreds.length === 0) {
- response.send(event, context, response.SUCCESS, {});
+ await handleEvent(event);
+ response.send(event, context, response.SUCCESS, {});
+ } catch (err) {
+ console.log(err.stack);
+ response.send(event, context, response.FAILED, { err });
+ }
+}
+
+async function handleEvent(event) {
+ const userPoolId = event.ResourceProperties.userPoolId;
+ const hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);
+ const hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);
+ const hasHostedUIProviderCreds = hostedUIProviderCreds.length && hostedUIProviderCreds.length > 0;
+ if (hasHostedUIProviderCreds && (event.RequestType === 'Update' || event.RequestType === 'Create')) {
+ const listIdentityProvidersResponse = await identity.send(
+ new ListIdentityProvidersCommand({
+ UserPoolId: userPoolId,
+ MaxResults: 60,
+ }),
+ );
+ console.log(listIdentityProvidersResponse);
+ const providerList = listIdentityProvidersResponse.Providers.map((provider) => provider.ProviderName);
+ const providerListInParameters = hostedUIProviderMeta.map((provider) => provider.ProviderName);
+ for (const providerMetadata of hostedUIProviderMeta) {
+ if (providerList.indexOf(providerMetadata.ProviderName) > -1) {
+ await updateIdentityProvider(providerMetadata.ProviderName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ } else {
+ await createIdentityProvider(providerMetadata.ProviderName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ }
}
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
+ for (const provider of providerList) {
+ if (providerListInParameters.indexOf(provider) < 0) {
+ await deleteIdentityProvider(provider, userPoolId);
+ }
}
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let getRequestParams = (providerName) => {
- let providerMetaIndex = hostedUIProviderMeta.findIndex((provider) => provider.ProviderName === providerName);
- let providerMeta = hostedUIProviderMeta[providerMetaIndex];
- let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);
- let providerCreds = hostedUIProviderCreds[providerCredsIndex];
- let requestParams = {
- ProviderName: providerMeta.ProviderName,
- UserPoolId: userPoolId,
- AttributeMapping: providerMeta.AttributeMapping,
- };
- if (providerMeta.ProviderName === 'SignInWithApple') {
- if (providerCreds.client_id && providerCreds.team_id && providerCreds.key_id && providerCreds.private_key) {
- requestParams.ProviderDetails = {
- client_id: providerCreds.client_id,
- team_id: providerCreds.team_id,
- key_id: providerCreds.key_id,
- private_key: providerCreds.private_key,
- authorize_scopes: providerMeta.authorize_scopes,
- };
- } else {
- requestParams = null;
- }
- } else {
- if (providerCreds.client_id && providerCreds.client_secret) {
- requestParams.ProviderDetails = {
- client_id: providerCreds.client_id,
- client_secret: providerCreds.client_secret,
- authorize_scopes: providerMeta.authorize_scopes,
- };
- } else {
- requestParams = null;
- }
- }
- return requestParams;
- };
- let createIdentityProvider = (providerName) => {
- let requestParams = getRequestParams(providerName);
- if (!requestParams) {
- return Promise.resolve();
- }
- requestParams.ProviderType = requestParams.ProviderName;
- return identity.createIdentityProvider(requestParams).promise();
- };
- let updateIdentityProvider = (providerName) => {
- let requestParams = getRequestParams(providerName);
- if (!requestParams) {
- return Promise.resolve();
- }
- return identity.updateIdentityProvider(requestParams).promise();
+ }
+}
+
+function getRequestParams(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId) {
+ const providerMeta = hostedUIProviderMeta.find((provider) => provider.ProviderName === providerName);
+ const providerCreds = hostedUIProviderCreds.find((provider) => provider.ProviderName === providerName);
+ let requestParams = {
+ ProviderName: providerMeta.ProviderName,
+ UserPoolId: userPoolId,
+ AttributeMapping: providerMeta.AttributeMapping,
+ };
+ if (providerMeta.ProviderName === 'SignInWithApple') {
+ if (providerCreds.client_id && providerCreds.team_id && providerCreds.key_id && providerCreds.private_key) {
+ requestParams.ProviderDetails = {
+ client_id: providerCreds.client_id,
+ team_id: providerCreds.team_id,
+ key_id: providerCreds.key_id,
+ private_key: providerCreds.private_key,
+ authorize_scopes: providerMeta.authorize_scopes,
};
- let deleteIdentityProvider = (providerName) => {
- let params = { ProviderName: providerName, UserPoolId: userPoolId };
- return identity.deleteIdentityProvider(params).promise();
+ } else {
+ requestParams = null;
+ }
+ } else {
+ if (providerCreds.client_id && providerCreds.client_secret) {
+ requestParams.ProviderDetails = {
+ client_id: providerCreds.client_id,
+ client_secret: providerCreds.client_secret,
+ authorize_scopes: providerMeta.authorize_scopes,
};
- let providerPromises = [];
- identity
- .listIdentityProviders({ UserPoolId: userPoolId, MaxResults: 60 })
- .promise()
- .then((result) => {
- console.log(result);
- let providerList = result.Providers.map((provider) => provider.ProviderName);
- let providerListInParameters = hostedUIProviderMeta.map((provider) => provider.ProviderName);
- hostedUIProviderMeta.forEach((providerMetadata) => {
- if (providerList.indexOf(providerMetadata.ProviderName) > -1) {
- providerPromises.push(updateIdentityProvider(providerMetadata.ProviderName));
- } else {
- providerPromises.push(createIdentityProvider(providerMetadata.ProviderName));
- }
- });
- providerList.forEach((provider) => {
- if (providerListInParameters.indexOf(provider) < 0) {
- providerPromises.push(deleteIdentityProvider(provider));
- }
- });
- return Promise.all(providerPromises);
- })
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
- });
+ } else {
+ requestParams = null;
}
- } catch (err) {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
}
-};
+ return requestParams;
+}
+
+async function createIdentityProvider(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId) {
+ const requestParams = getRequestParams(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ if (!requestParams) {
+ return;
+ }
+ requestParams.ProviderType = requestParams.ProviderName;
+ await identity.send(new CreateIdentityProviderCommand(requestParams));
+}
+
+async function updateIdentityProvider(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId) {
+ const requestParams = getRequestParams(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ if (!requestParams) {
+ return;
+ }
+ await identity.send(new UpdateIdentityProviderCommand(requestParams));
+}
+
+async function deleteIdentityProvider(providerName, userPoolId) {
+ const params = { ProviderName: providerName, UserPoolId: userPoolId };
+ await identity.send(new DeleteIdentityProviderCommand(params));
+}
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/mfaLambda.js b/packages/amplify-category-auth/resources/auth-custom-resource/mfaLambda.js
index 33efb4472ed..f896a07c639 100644
--- a/packages/amplify-category-auth/resources/auth-custom-resource/mfaLambda.js
+++ b/packages/amplify-category-auth/resources/auth-custom-resource/mfaLambda.js
@@ -1,37 +1,37 @@
const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
- if (event.RequestType == 'Delete') {
+const { CognitoIdentityProviderClient, SetUserPoolMfaConfigCommand } = require('@aws-sdk/client-cognito-identity-provider');
+const identity = new CognitoIdentityProviderClient({});
+
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
+ try {
+ await handleEvent(event);
response.send(event, context, response.SUCCESS, {});
+ } catch (e) {
+ response.send(event, context, response.FAILED, { e });
}
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let totpParams = {};
- try {
- totpParams = {
- UserPoolId: event.ResourceProperties.userPoolId,
- MfaConfiguration: event.ResourceProperties.mfaConfiguration,
- SmsMfaConfiguration: {
- SmsAuthenticationMessage: event.ResourceProperties.smsAuthenticationMessage,
- SmsConfiguration: {
- SnsCallerArn: event.ResourceProperties.smsConfigCaller,
- ExternalId: event.ResourceProperties.smsConfigExternalId,
- },
+}
+
+async function handleEvent(event) {
+ if (event.RequestType === 'Update' || event.RequestType === 'Create') {
+ const totpParams = {
+ UserPoolId: event.ResourceProperties.userPoolId,
+ MfaConfiguration: event.ResourceProperties.mfaConfiguration,
+ SmsMfaConfiguration: {
+ SmsAuthenticationMessage: event.ResourceProperties.smsAuthenticationMessage,
+ SmsConfiguration: {
+ SnsCallerArn: event.ResourceProperties.smsConfigCaller,
+ ExternalId: event.ResourceProperties.smsConfigExternalId,
},
- SoftwareTokenMfaConfiguration: { Enabled: event.ResourceProperties.totpEnabled.toLowerCase() === true ? true : false },
- };
- console.log(totpParams);
- } catch (e) {
- response.send(event, context, response.FAILED, { e });
- }
- identity
- .setUserPoolMfaConfig(totpParams)
- .promise()
- .then((res) => {
- response.send(event, context, response.SUCCESS, { res });
- })
- .catch((err) => {
- response.send(event, context, response.FAILED, { err });
- });
+ },
+ SoftwareTokenMfaConfiguration: { Enabled: event.ResourceProperties.totpEnabled.toLowerCase() === 'true' },
+ };
+ console.log(totpParams);
+
+ await identity.send(new SetUserPoolMfaConfigCommand(totpParams));
}
-};
+}
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/oauthLambda.js b/packages/amplify-category-auth/resources/auth-custom-resource/oauthLambda.js
deleted file mode 100644
index 8d6d48f951d..00000000000
--- a/packages/amplify-category-auth/resources/auth-custom-resource/oauthLambda.js
+++ /dev/null
@@ -1,45 +0,0 @@
-const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
- try {
- const userPoolId = event.ResourceProperties.userPoolId;
- let webClientId = event.ResourceProperties.webClientId;
- let nativeClientId = event.ResourceProperties.nativeClientId;
- let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);
- let oAuthMetadata = JSON.parse(event.ResourceProperties.oAuthMetadata);
- let providerList = hostedUIProviderMeta.map((provider) => provider.ProviderName);
- providerList.push('COGNITO');
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
- }
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let params = {
- UserPoolId: userPoolId,
- AllowedOAuthFlows: oAuthMetadata.AllowedOAuthFlows,
- AllowedOAuthFlowsUserPoolClient: true,
- AllowedOAuthScopes: oAuthMetadata.AllowedOAuthScopes,
- CallbackURLs: oAuthMetadata.CallbackURLs,
- LogoutURLs: oAuthMetadata.LogoutURLs,
- SupportedIdentityProviders: providerList,
- };
- console.log(params);
- let updateUserPoolClientPromises = [];
- params.ClientId = webClientId;
- updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());
- params.ClientId = nativeClientId;
- updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());
- Promise.all(updateUserPoolClientPromises)
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
- });
- }
- } catch (err) {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
- }
-};
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/openIdLambda.js b/packages/amplify-category-auth/resources/auth-custom-resource/openIdLambda.js
index acf8eb2e985..0050dd12169 100644
--- a/packages/amplify-category-auth/resources/auth-custom-resource/openIdLambda.js
+++ b/packages/amplify-category-auth/resources/auth-custom-resource/openIdLambda.js
@@ -1,77 +1,69 @@
const response = require('cfn-response');
-const aws = require('aws-sdk');
-const iam = new aws.IAM();
+const {
+ IAMClient,
+ AddClientIDToOpenIDConnectProviderCommand,
+ CreateOpenIDConnectProviderCommand,
+ GetOpenIDConnectProviderCommand,
+ ListOpenIDConnectProvidersCommand,
+} = require('@aws-sdk/client-iam');
+const iam = new IAMClient({});
+
exports.handler = (event, context) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
+ try {
+ const res = await handleEvent(event);
+ response.send(event, context, response.SUCCESS, res);
+ } catch (e) {
+ response.send(event, context, response.FAILED, { e });
}
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
+}
+
+async function handleEvent(event) {
+ if (event.RequestType === 'Update' || event.RequestType === 'Create') {
const params = {
ClientIDList: event.ResourceProperties.clientIdList.split(','),
ThumbprintList: ['0000000000000000000000000000000000000000'],
Url: event.ResourceProperties.url,
};
- let exists = false;
let existingValue;
- iam
- .listOpenIDConnectProviders({})
- .promise()
- .then((data) => {
- if (data.OpenIDConnectProviderList && data.OpenIDConnectProviderList.length > 0) {
- const vals = data.OpenIDConnectProviderList.map((x) => x.Arn);
- existingValue = vals.find((i) => i.split('/')[1] === params.Url.split('//')[1]);
- if (!existingValue) {
- exists = true;
- }
- }
- if (!existingValue) {
- iam
- .createOpenIDConnectProvider(params)
- .promise()
- .then((data) => {
- response.send(event, context, response.SUCCESS, {
- providerArn: data.OpenIDConnectProviderArn,
- providerIds: params.ClientIDList,
- });
- })
- .catch((err) => {
- response.send(event, context, response.FAILED, { err });
- });
- } else {
- const findParams = {
+ const listOpenIDConnectProvidersResponse = await iam.send(new ListOpenIDConnectProvidersCommand({}));
+ if (
+ listOpenIDConnectProvidersResponse.OpenIDConnectProviderList &&
+ listOpenIDConnectProvidersResponse.OpenIDConnectProviderList.length > 0
+ ) {
+ const vals = listOpenIDConnectProvidersResponse.OpenIDConnectProviderList.map((x) => x.Arn);
+ existingValue = vals.find((i) => i.split('/')[1] === params.Url.split('//')[1]);
+ }
+ if (!existingValue) {
+ const createOpenIDConnectProviderResponse = await iam.send(new CreateOpenIDConnectProviderCommand(params));
+ return {
+ providerArn: createOpenIDConnectProviderResponse.OpenIDConnectProviderArn,
+ providerIds: params.ClientIDList,
+ };
+ } else {
+ const findParams = {
+ OpenIDConnectProviderArn: existingValue,
+ };
+ const getOpenIDConnectProviderResponse = await iam.send(new GetOpenIDConnectProviderCommand(findParams));
+ const audiences = getOpenIDConnectProviderResponse.ClientIDList;
+ for (const clientID of params.ClientIDList) {
+ if (!audiences.includes(clientID)) {
+ const updateParams = {
+ ClientID: clientID,
OpenIDConnectProviderArn: existingValue,
};
- iam
- .getOpenIDConnectProvider(findParams)
- .promise()
- .then((data) => {
- const audiences = data.ClientIDList;
- const updateCalls = [];
- params.ClientIDList.forEach((a) => {
- if (!audiences.includes(a)) {
- const updateParams = {
- ClientID: a,
- OpenIDConnectProviderArn: existingValue,
- };
- const prom = iam.addClientIDToOpenIDConnectProvider(updateParams).promise();
- updateCalls.push(prom);
- }
- });
- Promise.all(updateCalls)
- .then(function (values) {
- response.send(event, context, response.SUCCESS, { providerArn: existingValue, providerIds: params.ClientIDList });
- })
- .catch((err3) => {
- response.send(event, context, response.FAILED, { err3 });
- });
- })
- .catch((err2) => {
- response.send(event, context, response.FAILED, { err2 });
- });
+ await iam.send(new AddClientIDToOpenIDConnectProviderCommand(updateParams));
}
- })
- .catch((err1) => {
- response.send(event, context, response.FAILED, { err1 });
- });
+ }
+ return {
+ providerArn: existingValue,
+ providerIds: params.ClientIDList,
+ };
+ }
}
-};
+ return {};
+}
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/role-map-lambda-function.js b/packages/amplify-category-auth/resources/auth-custom-resource/role-map-lambda-function.js
deleted file mode 100644
index 8c714633780..00000000000
--- a/packages/amplify-category-auth/resources/auth-custom-resource/role-map-lambda-function.js
+++ /dev/null
@@ -1,37 +0,0 @@
-const response = require('cfn-response');
-const AWS = require('aws-sdk');
-exports.handler = (event, context) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, { message: 'Request type delete' });
- }
- if (event.RequestType == 'Create' || event.RequestType == 'Update') {
- let { identityPoolId, appClientID, appClientIDWeb, userPoolId, region } = event.ResourceProperties;
- try {
- const cognitoidentity = new AWS.CognitoIdentity();
- let params = {
- IdentityPoolId: identityPoolId,
- Roles: {
- authenticated: event.ResourceProperties.AuthRoleArn,
- unauthenticated: event.ResourceProperties.UnauthRoleArn,
- },
- RoleMappings: {},
- };
- if (appClientIDWeb) {
- params.RoleMappings[`cognito-idp.${region}.amazonaws.com/${userPoolId}:${appClientIDWeb}`] = {
- Type: 'Token',
- AmbiguousRoleResolution: 'AuthenticatedRole',
- };
- }
- if (appClientID) {
- params.RoleMappings[`cognito-idp.${region}.amazonaws.com/${userPoolId}:${appClientID}`] = {
- Type: 'Token',
- AmbiguousRoleResolution: 'AuthenticatedRole',
- };
- }
- cognitoidentity.setIdentityPoolRoles(params).promise();
- response.send(event, context, response.SUCCESS, { message: 'Successfully updated identity pool.' });
- } catch (err) {
- response.send(event, context, response.FAILED, { message: 'Error updating identity pool' });
- }
- }
-};
diff --git a/packages/amplify-category-auth/resources/auth-custom-resource/userpoolclientLambda.js b/packages/amplify-category-auth/resources/auth-custom-resource/userpoolclientLambda.js
deleted file mode 100644
index f3505d2c319..00000000000
--- a/packages/amplify-category-auth/resources/auth-custom-resource/userpoolclientLambda.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
- }
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- const params = {
- ClientId: event.ResourceProperties.clientId,
- UserPoolId: event.ResourceProperties.userpoolId,
- };
- identity
- .describeUserPoolClient(params)
- .promise()
- .then((res) => {
- response.send(event, context, response.SUCCESS, { appSecret: res.UserPoolClient.ClientSecret });
- })
- .catch((err) => {
- response.send(event, context, response.FAILED, { err });
- });
- }
-};
diff --git a/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs b/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs
deleted file mode 100644
index d0802317b2d..00000000000
--- a/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs
+++ /dev/null
@@ -1,1244 +0,0 @@
-<% var autoVerifiedAttributes = props.autoVerifiedAttributes ? props.autoVerifiedAttributes.concat(props.aliasAttributes ? props.aliasAttributes : []).filter((attr, i, aliasAttributeArray) => ['email', 'phone_number'].includes(attr) && aliasAttributeArray.indexOf(attr) === i) : [] %>
-<% var configureSMS = ((props.autoVerifiedAttributes && props.autoVerifiedAttributes.includes('phone_number')) || (props.mfaConfiguration != 'OFF' && props.mfaTypes && props.mfaTypes.includes('SMS Text Message')) || (props.requiredAttributes && props.requiredAttributes.includes('phone_number'))) %>
-AWSTemplateFormatVersion: 2010-09-09
-
-Parameters:
- env:
- Type: String
- authRoleArn:
- Type: String
- unauthRoleArn:
- Type: String
-
- <% if (props.dependsOn && props.dependsOn.length > 0) { %>
- <% for(var i=0; i < props.dependsOn.length; i++) { %>
- <% for(var j=0; j < props.dependsOn[i].attributes.length; j++) { %>
- <%= props.dependsOn[i].category %><%= props.dependsOn[i].resourceName %><%= props.dependsOn[i].attributes[j] %>:
- Type: String
- Default: <%= props.dependsOn[i].category %><%= props.dependsOn[i].resourceName %><%= props.dependsOn[i].attributes[j] %>
- <% } %>
- <% } %>
- <% } %>
-
- <% for(var i=0; i < Object.keys(props).length; i++) { -%>
- <% if (typeof Object.values(props)[i] === 'string' || (Object.values(props)[i] && Object.values(props)[i].value)) { %>
- <%=Object.keys(props)[i]%>:
- Type: String
- <% } -%>
-
- <% if (typeof Object.values(props)[i] === 'boolean') { %>
- <%=Object.keys(props)[i]%>:
- Type: String
- <% } -%>
- <% if (typeof Object.values(props)[i] === 'number') { %>
- <%=Object.keys(props)[i]%>:
- Type: Number
- <% } -%>
- <% if (Object.keys(props)[i] === 'parentStack') { %>
- <%=Object.keys(props)[i]%>:
- Type: String
- <% } -%>
- <% if (Array.isArray(Object.values(props)[i])) { %>
- <%=Object.keys(props)[i]%>:
- Type: CommaDelimitedList
- <% } -%>
- <% } -%>
- <% if(Object.keys(props).includes('hostedUIProviderMeta') && !Object.keys(props).includes('hostedUIProviderCreds')) { %>
- hostedUIProviderCreds:
- Type: String
- Default: '[]'
- <% } -%>
-
-Conditions:
- ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ]
- <%if (props.authSelections !=='identityPoolOnly' ) { %>
- ShouldOutputAppClientSecrets: !Equals [!Ref userpoolClientGenerateSecret, true ]
- <% } %>
-
-Resources:
- <%if (props.verificationBucketName) { %>
- CustomMessageConfirmationBucket:
- Type: AWS::S3::Bucket
- DeletionPolicy: "Retain"
- Properties:
- BucketName: !If [ShouldNotCreateEnvResources, !Ref verificationBucketName, !Join ['',[!Ref verificationBucketName, '-', !Ref env]]]
- AccessControl: "Private"
- WebsiteConfiguration:
- IndexDocument: "index.html"
- ErrorDocument: "index.html"
- CorsConfiguration:
- CorsRules:
- -
- AllowedHeaders:
- - "Authorization"
- - "Content-Length"
- AllowedMethods:
- - "GET"
- AllowedOrigins:
- - "*"
- MaxAge: 3000
- <% } %>
- <%if (props.authSelections !== 'identityPoolOnly') { %>
- <% if(!props.useEnabledMfas || configureSMS) { %>
- # BEGIN SNS ROLE RESOURCE
- SNSRole:
- # Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process
- Type: AWS::IAM::Role
- Properties:
- RoleName: !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_sns-role`%>', !Join ['',[ 'sns', '<%=`${props.sharedId}`%>', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]]
- AssumeRolePolicyDocument:
- Version: "2012-10-17"
- Statement:
- - Sid: ""
- Effect: "Allow"
- Principal:
- Service: "cognito-idp.amazonaws.com"
- Action:
- - "sts:AssumeRole"
- Condition:
- StringEquals:
- sts:ExternalId: <%=`${props.resourceNameTruncated}_role_external_id`%>
- Policies:
- -
- PolicyName: <%=`${props.resourceNameTruncated}-sns-policy`%>
- PolicyDocument:
- Version: "2012-10-17"
- Statement:
- -
- Effect: "Allow"
- Action:
- - "sns:Publish"
- Resource: "*"
- <% } %>
- # BEGIN USER POOL RESOURCES
- UserPool:
- # Created upon user selection
- # Depends on SNS Role for Arn if MFA is enabled
- Type: AWS::Cognito::UserPool
- UpdateReplacePolicy: Retain
- Properties:
- UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]]
- <%if (props.requiredAttributes && props.requiredAttributes.length > 0) { %>
- <%if (props.usernameCaseSensitive !== undefined) { %>
- UsernameConfiguration:
- CaseSensitive: <%= props.usernameCaseSensitive %>
- <% } %>
- Schema:
- <% for(var i=0; i < props.requiredAttributes.length; i++) { %>
- -
- Name: <%= props.requiredAttributes[i] %>
- Required: true
- Mutable: true
- <% } %>
- <% } %>
- <%if (!props.breakCircularDependency && props.triggers && props.triggers !== '{}' && props.dependsOn) { %>
- LambdaConfig:
- <%if (props.dependsOn.find(i => i.resourceName.includes('CreateAuthChallenge'))) { %>
- CreateAuthChallenge: !Ref function<%=props.resourceName%>CreateAuthChallengeArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('CustomMessage'))) { %>
- CustomMessage: !Ref function<%=props.resourceName%>CustomMessageArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('DefineAuthChallenge'))) { %>
- DefineAuthChallenge: !Ref function<%=props.resourceName%>DefineAuthChallengeArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PostAuthentication'))) { %>
- PostAuthentication: !Ref function<%=props.resourceName%>PostAuthenticationArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PostConfirmation'))) { %>
- PostConfirmation: !Ref function<%=props.resourceName%>PostConfirmationArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PreAuthentication'))) { %>
- PreAuthentication: !Ref function<%=props.resourceName%>PreAuthenticationArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PreSignup'))) { %>
- PreSignUp: !Ref function<%=props.resourceName%>PreSignupArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PreTokenGeneration'))) { %>
- PreTokenGeneration: !Ref function<%=props.resourceName%>PreTokenGenerationArn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('VerifyAuthChallengeResponse'))) { %>
- VerifyAuthChallengeResponse: !Ref function<%=props.resourceName%>VerifyAuthChallengeResponseArn
- <% } %>
- <% } %>
- <%if (autoVerifiedAttributes && autoVerifiedAttributes.length > 0) { %>
- AutoVerifiedAttributes:
- <% for(let x = 0; x < autoVerifiedAttributes.length; x++) { %>
- - <%= autoVerifiedAttributes[x] %>
- <% } %>
- <% } %>
- <%if (autoVerifiedAttributes && autoVerifiedAttributes.includes('email')) { %>
- EmailVerificationMessage: !Ref emailVerificationMessage
- EmailVerificationSubject: !Ref emailVerificationSubject
- <% } %>
- Policies:
- PasswordPolicy:
- MinimumLength: !Ref passwordPolicyMinLength
- RequireLowercase: <%= props.passwordPolicyCharacters.includes('Requires Lowercase') %>
- RequireNumbers: <%= props.passwordPolicyCharacters.includes('Requires Numbers') %>
- RequireSymbols: <%= props.passwordPolicyCharacters.includes('Requires Symbols') %>
- RequireUppercase: <%= props.passwordPolicyCharacters.includes('Requires Uppercase') %>
- <% if (props.usernameAttributes && props.usernameAttributes !== 'username') { %>
- UsernameAttributes: !Ref usernameAttributes
- <% } %>
- <% if (props.aliasAttributes && props.aliasAttributes.length > 0) { %>
- AliasAttributes: !Ref aliasAttributes
- <% } %>
- MfaConfiguration: !Ref mfaConfiguration
- <% if(props.useEnabledMfas && props.mfaConfiguration != 'OFF') {%>
- EnabledMfas:
- <% if(configureSMS) {%>
- - SMS_MFA
- <% } %>
- <% if(props.mfaTypes.includes('TOTP')) {%>
- - SOFTWARE_TOKEN_MFA
- <% } %>
- <% } %>
- <% if(!props.useEnabledMfas || configureSMS) {%>
- SmsVerificationMessage: !Ref smsVerificationMessage
- SmsAuthenticationMessage: !Ref smsAuthenticationMessage
- SmsConfiguration:
- SnsCallerArn: !GetAtt SNSRole.Arn
- ExternalId: <%=`${props.resourceNameTruncated}_role_external_id`%>
- <% } %>
- <%if (configureSMS) { %>
- DependsOn: SNSRole
- <% } %>
- <%if (!props.breakCircularDependency && props.triggers && props.dependsOn) { %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('CreateAuthChallenge'))) { %>
- UserPoolCreateAuthChallengeLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>CreateAuthChallengeName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('CustomMessage'))) { %>
- UserPoolCustomMessageLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>CustomMessageName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('DefineAuthChallenge'))) { %>
- UserPoolDefineAuthChallengeLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>DefineAuthChallengeName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PostAuthentication'))) { %>
- UserPoolPostAuthenticationLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>PostAuthenticationName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PostConfirmation'))) { %>
- UserPoolPostConfirmationLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>PostConfirmationName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PreAuthentication'))) { %>
- UserPoolPreAuthenticationLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>PreAuthenticationName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PreSignup'))) { %>
- UserPoolPreSignupLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>PreSignupName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('PreTokenGeneration'))) { %>
- UserPoolPreTokenGenerationLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>PreTokenGenerationName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- <%if (props.dependsOn.find(i => i.resourceName.includes('VerifyAuthChallengeResponse'))) { %>
- UserPoolVerifyAuthChallengeResponseLambdaInvokePermission:
- Type: "AWS::Lambda::Permission"
- DependsOn: UserPool
- Properties:
- Action: "lambda:invokeFunction"
- Principal: "cognito-idp.amazonaws.com"
- FunctionName: !Ref function<%=props.resourceName%>VerifyAuthChallengeResponseName
- SourceArn: !GetAtt UserPool.Arn
- <% } %>
- # Updating lambda role with permissions to Cognito
- <% if (props.permissions && props.permissions.length > 0) { %>
- <% for(var i=0; i < props.permissions.length; i++) { %>
- <%=`${props.resourceName}${JSON.parse(props.permissions[i]).trigger}${JSON.parse(props.permissions[i]).policyName}:`%>
- Type: AWS::IAM::Policy
- Properties:
- PolicyName: <%=`${props.resourceName}${JSON.parse(props.permissions[i]).trigger}${JSON.parse(props.permissions[i]).policyName}`%>
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: <%= JSON.parse(props.permissions[i]).effect %>
- Action:
- <% for(let x = 0; x < JSON.parse(props.permissions[i]).actions.length; x++) { %>
- - <%=JSON.parse(props.permissions[i]).actions[x]%>
- <% } %>
- <% if(JSON.parse(props.permissions[i]).resource.paramType === 'string') { %>
- Resource: "<%=JSON.parse(props.permissions[i]).resource.keys %>"
- <% } %>
- <% if(JSON.parse(props.permissions[i]).resource.paramType === '!GetAtt') { %>
- Resource: !GetAtt
- <% for(let z = 0; z < JSON.parse(props.permissions[i]).resource.keys.length; z++) { %>
- - <%= JSON.parse(props.permissions[i]).resource.keys[z] %>
- <% } %>
- <% } %>
- <% if(JSON.parse(props.permissions[i]).resource.paramType === '!Ref') { %>
- Resource: !Ref <%=JSON.parse(props.permissions[i]).resource.keys %>
- <% } %>
-
- Roles:
- - !Join ['',["<%=`${props.resourceName}${JSON.parse(props.permissions[i]).trigger}`%>", '-', !Ref env]]
- <% } %>
- <% } %>
- <% } %>
- UserPoolClientWeb:
- # Created provide application access to user pool
- # Depends on UserPool for ID reference
- Type: "AWS::Cognito::UserPoolClient"
- Properties:
- ClientName: <%= props.resourceNameTruncated %>_app_clientWeb
- <%if (props.userpoolClientSetAttributes) { %>
- ReadAttributes: !Ref userpoolClientReadAttributes
- WriteAttributes: !Ref userpoolClientWriteAttributes
- <% } %>
- RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
- UserPoolId: !Ref UserPool
- DependsOn: UserPool
- UserPoolClient:
- # Created provide application access to user pool
- # Depends on UserPool for ID reference
- Type: "AWS::Cognito::UserPoolClient"
- Properties:
- ClientName: <%= props.resourceNameTruncated %>_app_client
- <%if (props.userpoolClientSetAttributes) { %>
- ReadAttributes: !Ref userpoolClientReadAttributes
- WriteAttributes: !Ref userpoolClientWriteAttributes
- <% } %>
- GenerateSecret: !Ref userpoolClientGenerateSecret
- RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
- UserPoolId: !Ref UserPool
- DependsOn: UserPool
- # BEGIN USER POOL LAMBDA RESOURCES
- UserPoolClientRole:
- # Created to execute Lambda which gets userpool app client config values
- Type: 'AWS::IAM::Role'
- Properties:
- RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', '<%=`${props.sharedId}`%>', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]]
- AssumeRolePolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Principal:
- Service:
- - lambda.amazonaws.com
- Action:
- - 'sts:AssumeRole'
- DependsOn: UserPoolClient
- UserPoolClientLambda:
- # Lambda which gets userpool app client config values
- # Depends on UserPool for id
- # Depends on UserPoolClientRole for role ARN
- Type: 'AWS::Lambda::Function'
- Properties:
- Code:
- ZipFile: !Join
- - |+
- - - 'const response = require(''cfn-response'');'
- - 'const aws = require(''aws-sdk'');'
- - 'const identity = new aws.CognitoIdentityServiceProvider();'
- - 'exports.handler = (event, context, callback) => {'
- - ' if (event.RequestType == ''Delete'') { '
- - ' response.send(event, context, response.SUCCESS, {})'
- - ' }'
- - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
- - ' const params = {'
- - ' ClientId: event.ResourceProperties.clientId,'
- - ' UserPoolId: event.ResourceProperties.userpoolId'
- - ' };'
- - ' identity.describeUserPoolClient(params).promise()'
- - ' .then((res) => {'
- - ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});'
- - ' })'
- - ' .catch((err) => {'
- - ' response.send(event, context, response.FAILED, {err});'
- - ' });'
- - ' }'
- - '};'
- Handler: index.handler
- Runtime: nodejs16.x
- Timeout: 300
- Role: !GetAtt
- - UserPoolClientRole
- - Arn
- DependsOn: UserPoolClientRole
- UserPoolClientLambdaPolicy:
- # Sets userpool policy for the role that executes the Userpool Client Lambda
- # Depends on UserPool for Arn
- # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: <%=`${props.resourceNameTruncated}_userpoolclient_lambda_iam_policy`%>
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Action:
- - 'cognito-idp:DescribeUserPoolClient'
- Resource: !GetAtt UserPool.Arn
- DependsOn: UserPoolClientLambda
- UserPoolClientLogPolicy:
- # Sets log policy for the role that executes the Userpool Client Lambda
- # Depends on UserPool for Arn
- # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: <%=`${props.resourceNameTruncated}_userpoolclient_lambda_log_policy`%>
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'logs:CreateLogGroup'
- - 'logs:CreateLogStream'
- - 'logs:PutLogEvents'
- Resource: !Sub
- - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
- - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda}
- DependsOn: UserPoolClientLambdaPolicy
- UserPoolClientInputs:
- # Values passed to Userpool client Lambda
- # Depends on UserPool for Id
- # Depends on UserPoolClient for Id
- # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
- Type: 'Custom::LambdaCallout'
- Properties:
- ServiceToken: !GetAtt UserPoolClientLambda.Arn
- clientId: !Ref UserPoolClient
- userpoolId: !Ref UserPool
- DependsOn: UserPoolClientLogPolicy
- <%if (props.hostedUIDomainName) { %>
- HostedUICustomResource:
- Type: 'AWS::Lambda::Function'
- Properties:
- Code:
- ZipFile: !Join
- - |+
- - - 'const response = require(''cfn-response'');'
- - 'const aws = require(''aws-sdk'');'
- - 'const identity = new aws.CognitoIdentityServiceProvider();'
- - 'exports.handler = (event, context, callback) => {'
- - ' const userPoolId = event.ResourceProperties.userPoolId;'
- - ' const inputDomainName = event.ResourceProperties.hostedUIDomainName;'
- - ' let deleteUserPoolDomain = (domainName) => {'
- - ' let params = { Domain: domainName, UserPoolId: userPoolId };'
- - ' return identity.deleteUserPoolDomain(params).promise();'
- - ' };'
- - ' if (event.RequestType == ''Delete'') {'
- - ' deleteUserPoolDomain(inputDomainName)'
- - ' .then(() => {response.send(event, context, response.SUCCESS, {})})'
- - ' .catch((err) => { console.log(err); response.send(event, context, response.FAILED, {err}) });'
- - ' }'
- - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
- - ' let checkDomainAvailability = (domainName) => {'
- - ' let params = { Domain: domainName };'
- - ' return identity.describeUserPoolDomain(params).promise().then((res) => {'
- - ' if (res.DomainDescription && res.DomainDescription.UserPool) {'
- - ' return false;'
- - ' }'
- - ' return true;'
- - ' }).catch((err) => { return false; });'
- - ' };'
- - ' let createUserPoolDomain = (domainName) => {'
- - ' let params = { Domain: domainName, UserPoolId: userPoolId };'
- - ' return identity.createUserPoolDomain(params).promise();'
- - ' };'
- - ' identity.describeUserPool({UserPoolId: userPoolId }).promise().then((result) => {'
- - ' if (inputDomainName) {'
- - ' if (result.UserPool.Domain === inputDomainName) {'
- - ' return;'
- - ' } else {'
- - ' if (!result.UserPool.Domain) {'
- - ' return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {'
- - ' if (isDomainAvailable) {'
- - ' return createUserPoolDomain(inputDomainName);'
- - ' } else {'
- - ' throw new Error(''Domain not available'');'
- - ' }'
- - ' });'
- - ' } else {'
- - ' return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {'
- - ' if (isDomainAvailable) {'
- - ' return deleteUserPoolDomain(result.UserPool.Domain).then(() => createUserPoolDomain(inputDomainName));'
- - ' } else {'
- - ' throw new Error(''Domain not available'');'
- - ' }'
- - ' });'
- - ' }'
- - ' }'
- - ' } else {'
- - ' if (result.UserPool.Domain) {'
- - ' return deleteUserPoolDomain(result.UserPool.Domain);'
- - ' }'
- - ' }'
- - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
- - ' console.log(err); response.send(event, context, response.FAILED, {err});'
- - ' });'
- - '}}'
-
-
- Handler: index.handler
- Runtime: nodejs16.x
- Timeout: 300
- Role: !GetAtt
- - UserPoolClientRole
- - Arn
- DependsOn: UserPoolClientRole
-
- HostedUICustomResourcePolicy:
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: !Join ['-',[!Ref UserPool, 'hostedUI']]
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Action:
- - 'cognito-idp:CreateUserPoolDomain'
- - 'cognito-idp:DescribeUserPool'
- - 'cognito-idp:DeleteUserPoolDomain'
- Resource: !GetAtt UserPool.Arn
- - Effect: Allow
- Action:
- - 'cognito-idp:DescribeUserPoolDomain'
- Resource: '*'
- DependsOn: HostedUICustomResource
- HostedUICustomResourceLogPolicy:
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: !Join ['-',[!Ref UserPool, 'hostedUILogPolicy']]
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'logs:CreateLogGroup'
- - 'logs:CreateLogStream'
- - 'logs:PutLogEvents'
- Resource: !Sub
- - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
- - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref HostedUICustomResource}
- DependsOn: HostedUICustomResourcePolicy
- HostedUICustomResourceInputs:
- Type: 'Custom::LambdaCallout'
- Properties:
- ServiceToken: !GetAtt HostedUICustomResource.Arn
- userPoolId: !Ref UserPool
- hostedUIDomainName: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]]
- DependsOn: HostedUICustomResourceLogPolicy
- <% } %>
-
- <%if (props.hostedUIProviderMeta) { %>
- HostedUIProvidersCustomResource:
- Type: 'AWS::Lambda::Function'
- Properties:
- Code:
- ZipFile: !Join
- - |+
- - - 'const response = require(''cfn-response'');'
- - 'const aws = require(''aws-sdk'');'
- - 'const identity = new aws.CognitoIdentityServiceProvider();'
- - 'exports.handler = (event, context, callback) => {'
- - 'try{'
- - ' const userPoolId = event.ResourceProperties.userPoolId;'
- - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);'
- - ' let hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);'
- - ' if(hostedUIProviderCreds.length === 0) {'
- - ' response.send(event, context, response.SUCCESS, {});'
- - ' }'
- - ' if (event.RequestType == ''Delete'') {'
- - ' response.send(event, context, response.SUCCESS, {});'
- - ' }'
- - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
- - ' let getRequestParams = (providerName) => {'
- - ' let providerMetaIndex = hostedUIProviderMeta.findIndex((provider) => provider.ProviderName === providerName);'
- - ' let providerMeta = hostedUIProviderMeta[providerMetaIndex];'
- - ' let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);'
- - ' let providerCreds = hostedUIProviderCreds[providerCredsIndex];'
- - ' let requestParams = {'
- - ' ProviderName: providerMeta.ProviderName,'
- - ' UserPoolId: userPoolId,'
- - ' AttributeMapping: providerMeta.AttributeMapping,'
- - ' };'
- - ' if (providerMeta.ProviderName === ''SignInWithApple'') {'
- - ' requestParams.ProviderDetails = {'
- - ' ''client_id'': providerCreds.client_id,'
- - ' ''team_id'': providerCreds.team_id,'
- - ' ''key_id'': providerCreds.key_id,'
- - ' ''private_key'': providerCreds.private_key ? providerCreds.private_key : null,'
- - ' ''authorize_scopes'': providerMeta.authorize_scopes,'
- - ' };'
- - ' } else {'
- - ' requestParams.ProviderDetails = {'
- - ' ''client_id'': providerCreds.client_id,'
- - ' ''client_secret'': providerCreds.client_secret,'
- - ' ''authorize_scopes'': providerMeta.authorize_scopes,'
- - ' };'
- - ' }'
- - ' return requestParams;'
- - ' };'
- - ' let createIdentityProvider = (providerName) => {'
- - ' let requestParams = getRequestParams(providerName);'
- - ' requestParams.ProviderType = requestParams.ProviderName;'
- - ' return identity.createIdentityProvider(requestParams).promise();'
- - ' };'
- - ' let updateIdentityProvider = (providerName) => {'
- - ' let requestParams = getRequestParams(providerName);'
- - ' return identity.updateIdentityProvider(requestParams).promise();'
- - ' };'
- - ' let deleteIdentityProvider = (providerName) => {'
- - ' let params = {ProviderName: providerName, UserPoolId: userPoolId};'
- - ' return identity.deleteIdentityProvider(params).promise();'
- - ' };'
- - ' let providerPromises = [];'
- - ' identity.listIdentityProviders({UserPoolId: userPoolId, MaxResults: 60}).promise()'
- - ' .then((result) => {'
- - ' let providerList = result.Providers.map(provider => provider.ProviderName);'
- - ' let providerListInParameters = hostedUIProviderMeta.map(provider => provider.ProviderName);'
- - ' hostedUIProviderMeta.forEach((providerMetadata) => {'
- - ' if(providerList.indexOf(providerMetadata.ProviderName) > -1) {'
- - ' providerPromises.push(updateIdentityProvider(providerMetadata.ProviderName));'
- - ' } else {'
- - ' providerPromises.push(createIdentityProvider(providerMetadata.ProviderName));'
- - ' }'
- - ' });'
- - ' providerList.forEach((provider) => {'
- - ' if(providerListInParameters.indexOf(provider) < 0) {'
- - ' providerPromises.push(deleteIdentityProvider(provider));'
- - ' }'
- - ' });'
- - ' return Promise.all(providerPromises);'
- - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
- - ' console.log(err.stack); response.send(event, context, response.FAILED, {err})'
- - ' });'
- - ' } '
- - ' } catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};'
- - '} '
-
- Handler: index.handler
- Runtime: nodejs16.x
- Timeout: 300
- Role: !GetAtt
- - UserPoolClientRole
- - Arn
- DependsOn: UserPoolClientRole
-
- HostedUIProvidersCustomResourcePolicy:
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProvider']]
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Action:
- - 'cognito-idp:CreateIdentityProvider'
- - 'cognito-idp:UpdateIdentityProvider'
- - 'cognito-idp:ListIdentityProviders'
- - 'cognito-idp:DeleteIdentityProvider'
- Resource: !GetAtt UserPool.Arn
- DependsOn: HostedUIProvidersCustomResource
-
- HostedUIProvidersCustomResourceLogPolicy:
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProviderLogPolicy']]
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'logs:CreateLogGroup'
- - 'logs:CreateLogStream'
- - 'logs:PutLogEvents'
- Resource: !Sub
- - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
- - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref HostedUIProvidersCustomResource}
- DependsOn: HostedUIProvidersCustomResourcePolicy
-
- HostedUIProvidersCustomResourceInputs:
- Type: 'Custom::LambdaCallout'
- Properties:
- ServiceToken: !GetAtt HostedUIProvidersCustomResource.Arn
- userPoolId: !Ref UserPool
- hostedUIProviderMeta: !Ref hostedUIProviderMeta
- hostedUIProviderCreds: !Ref hostedUIProviderCreds
- DependsOn: HostedUIProvidersCustomResourceLogPolicy
- <% } %>
- <%if (props.oAuthMetadata) { %>
- OAuthCustomResource:
- Type: 'AWS::Lambda::Function'
- Properties:
- Code:
- ZipFile: !Join
- - |+
- - - 'const response = require(''cfn-response'');'
- - 'const aws = require(''aws-sdk'');'
- - 'const identity = new aws.CognitoIdentityServiceProvider();'
- - 'exports.handler = (event, context, callback) => {'
- - 'try{'
- - ' const userPoolId = event.ResourceProperties.userPoolId;'
- - ' let webClientId = event.ResourceProperties.webClientId;'
- - ' let nativeClientId = event.ResourceProperties.nativeClientId;'
- - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);'
- - ' let oAuthMetadata = JSON.parse(event.ResourceProperties.oAuthMetadata);'
- - ' let providerList = hostedUIProviderMeta.map(provider => provider.ProviderName);'
- - ' providerList.push(''COGNITO'');'
- - ' if (event.RequestType == ''Delete'') {'
- - ' response.send(event, context, response.SUCCESS, {});'
- - ' }'
- - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
- - ' let params = {'
- - ' UserPoolId: userPoolId,'
- - ' AllowedOAuthFlows: oAuthMetadata.AllowedOAuthFlows,'
- - ' AllowedOAuthFlowsUserPoolClient: true,'
- - ' AllowedOAuthScopes: oAuthMetadata.AllowedOAuthScopes,'
- - ' CallbackURLs: oAuthMetadata.CallbackURLs,'
- - ' LogoutURLs: oAuthMetadata.LogoutURLs,'
- - ' SupportedIdentityProviders: providerList'
- - ' };'
- - ' let updateUserPoolClientPromises = [];'
- - ' params.ClientId = webClientId;'
- - ' updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());'
- - ' params.ClientId = nativeClientId;'
- - ' updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());'
- - ' Promise.all(updateUserPoolClientPromises)'
- - ' .then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
- - ' console.log(err.stack); response.send(event, context, response.FAILED, {err});'
- - ' });'
- - ' }'
- - '} catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};'
- - '}'
-
- Handler: index.handler
- Runtime: nodejs16.x
- Timeout: 300
- Role: !GetAtt
- - UserPoolClientRole
- - Arn
- DependsOn: HostedUIProvidersCustomResourceInputs
-
- OAuthCustomResourcePolicy:
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: !Join ['-',[!Ref UserPool, 'OAuth']]
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Action:
- - 'cognito-idp:UpdateUserPoolClient'
- Resource: !GetAtt UserPool.Arn
- DependsOn: OAuthCustomResource
-
- OAuthCustomResourceLogPolicy:
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: !Join ['-',[!Ref UserPool, 'OAuthLogPolicy']]
- Roles:
- - !Ref UserPoolClientRole
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'logs:CreateLogGroup'
- - 'logs:CreateLogStream'
- - 'logs:PutLogEvents'
- Resource: !Sub
- - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
- - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref OAuthCustomResource}
- DependsOn: OAuthCustomResourcePolicy
-
- OAuthCustomResourceInputs:
- Type: 'Custom::LambdaCallout'
- Properties:
- ServiceToken: !GetAtt OAuthCustomResource.Arn
- userPoolId: !Ref UserPool
- hostedUIProviderMeta: !Ref hostedUIProviderMeta
- oAuthMetadata: !Ref oAuthMetadata
- webClientId: !Ref 'UserPoolClientWeb'
- nativeClientId: !Ref 'UserPoolClient'
- DependsOn: OAuthCustomResourceLogPolicy
- <% } %>
-
- <%if (!props.useEnabledMfas && props.mfaConfiguration != 'OFF') { %>
- # BEGIN MFA LAMBDA RESOURCES
- MFALambdaRole:
- # Created to execute Lambda which sets MFA config values
- Type: 'AWS::IAM::Role'
- Properties:
- RoleName: !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_totp_lambda_role`%>', !Join ['',['<%=`${props.resourceNameTruncated}_totp_lambda_role`%>', '-', !Ref env]]]
- AssumeRolePolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Principal:
- Service:
- - lambda.amazonaws.com
- Action:
- - 'sts:AssumeRole'
- Policies:
- - PolicyName: <%=`${props.resourceNameTruncated}_totp_pass_role_policy`%>
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'iam:PassRole'
- Resource: !If [ShouldNotCreateEnvResources, '<%= `arn:aws:iam:::role/${props.resourceNameTruncated}_totp_lambda_role`%>', !Join ['',['<%= `arn:aws:iam:::role/${props.resourceNameTruncated}_totp_lambda_role` %>', '-', !Ref env]]]
- - PolicyName: <%=`${props.resourceNameTruncated}_sns_pass_role_policy`%>
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'iam:PassRole'
- Resource: !GetAtt SNSRole.Arn
- DependsOn: SNSRole
- MFALambda:
- # Lambda which sets MFA config values
- # Depends on MFALambdaRole for role ARN
- Type: 'AWS::Lambda::Function'
- Properties:
- Code:
- ZipFile: !Join
- - |+
- - - 'const response = require(''cfn-response'');'
- - 'const aws = require(''aws-sdk'');'
- - 'const identity = new aws.CognitoIdentityServiceProvider();'
- - 'exports.handler = (event, context, callback) => {'
- - ' if (event.RequestType == ''Delete'') { '
- - ' response.send(event, context, response.SUCCESS, {})'
- - ' }'
- - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
- - ' let totpParams = {};'
- - ' try {'
- - ' totpParams = {'
- - ' UserPoolId: event.ResourceProperties.userPoolId,'
- - ' MfaConfiguration: event.ResourceProperties.mfaConfiguration,'
- - ' SmsMfaConfiguration: {'
- - ' SmsAuthenticationMessage: event.ResourceProperties.smsAuthenticationMessage,'
- - ' SmsConfiguration: {'
- - ' SnsCallerArn: event.ResourceProperties.smsConfigCaller,'
- - ' ExternalId: event.ResourceProperties.smsConfigExternalId'
- - ' }'
- - ' },'
- - ' SoftwareTokenMfaConfiguration: {Enabled: event.ResourceProperties.totpEnabled.toLowerCase() === ''true'' ? true : false}'
- - ' };'
- - ' } catch(e) {'
- - ' response.send(event, context, response.FAILED, {e});'
- - ' };'
- - ' identity.setUserPoolMfaConfig(totpParams).promise()'
- - ' .then((res) => {'
- - ' response.send(event, context, response.SUCCESS, {res});'
- - ' })'
- - ' .catch((err) => {'
- - ' response.send(event, context, response.FAILED, {err});'
- - ' });'
- - ' }'
- - '};'
- Handler: index.handler
- Runtime: nodejs16.x
- Timeout: 300
- Role: !GetAtt
- - MFALambdaRole
- - Arn
- DependsOn: MFALambdaRole
- MFALambdaPolicy:
- # Sets policy for the role that executes the MFA Lambda
- # Depends on Userpool for Arn
- # Marked as depending on MFALambda for easier to understand CFN sequencing
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: <%=`${props.resourceNameTruncated}_totp_lambda_iam_policy`%>
- Roles:
- - !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_totp_lambda_role`%>', !Join ['',['<%=`${props.resourceNameTruncated}_totp_lambda_role`%>', '-', !Ref env]]]
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Action:
- - 'cognito-idp:SetUserPoolMfaConfig'
- Resource: !GetAtt UserPool.Arn
- DependsOn: MFALambda
- MFALogPolicy:
- # Sets log policy for the role that executes the MFA Lambda
- # Marked as depending on MFALambdaPolicy for easier to understand CFN sequencing
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: <%=`${props.resourceNameTruncated}_totp_lambda_log_policy`%>
- Roles:
- - !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_totp_lambda_role`%>', !Join ['',['<%=`${props.resourceNameTruncated}_totp_lambda_role`%>', '-', !Ref env]]]
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'logs:CreateLogGroup'
- - 'logs:CreateLogStream'
- - 'logs:PutLogEvents'
- Resource: !Sub
- - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
- - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref MFALambda}
- DependsOn: MFALambdaPolicy
- MFALambdaInputs:
- # Values passed to MFA Lambda
- # Depends on UserPool for Arn
- # Depends on MFALambda for Arn
- # Marked as depending on MFALambdaPolicy for easier to understand CFN sequencing
- Type: 'Custom::LambdaCallout'
- Properties:
- ServiceToken: !GetAtt MFALambda.Arn
- userPoolId: !Ref UserPool
- mfaConfiguration: !Ref mfaConfiguration
- totpEnabled: <%= props.mfaTypes.includes('TOTP') %>
- smsConfigCaller: !GetAtt SNSRole.Arn
- smsAuthenticationMessage: !Ref smsAuthenticationMessage
- smsConfigExternalId: <%=`${props.resourceNameTruncated}_role_external_id`%>
- DependsOn: MFALogPolicy
- <% } %>
- <% } -%>
- <%if (props.authSelections === 'identityPoolAndUserPool' || props.authSelections === 'identityPoolOnly') { %>
- # BEGIN IDENTITY POOL RESOURCES
- <%if (props.audiences && props.audiences.length > 0) { %>
- OpenIdLambdaRole:
- # Created to execute Lambda which sets MFA config values
- # Depends on UserPoolClientInputs to prevent further identity pool resources from being created before userpool is ready
- Type: 'AWS::IAM::Role'
- Properties:
- RoleName: !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_openid_lambda_role`%>', !Join ['',['<%=`${props.resourceNameTruncated}_openid_lambda_role`%>', '-', !Ref env]]]
- AssumeRolePolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Principal:
- Service:
- - lambda.amazonaws.com
- Action:
- - 'sts:AssumeRole'
- Policies:
- - PolicyName: <%=`${props.resourceNameTruncated}_openid_pass_role_policy`%>
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'iam:PassRole'
- Resource: !If [ShouldNotCreateEnvResources, '<%= `arn:aws:iam:::role/${props.resourceNameTruncated}_openid_lambda_role` %>', !Join ['',['<%= `arn:aws:iam:::role/${props.resourceNameTruncated}_openid_lambda_role` %>', '-', !Ref env]]]
- DependsOn: UserPoolClientInputs
- OpenIdLambda:
- # Lambda which sets OpenId Values
- Type: 'AWS::Lambda::Function'
- Properties:
- Code:
- ZipFile: !Join
- - |+
- - - 'const response = require(''cfn-response'');'
- - 'const aws = require(''aws-sdk'');'
- - 'const iam = new aws.IAM();'
- - 'exports.handler = (event, context) => {'
- - ' if (event.RequestType == ''Delete'') { '
- - ' response.send(event, context, response.SUCCESS, {});'
- - ' }'
- - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
- - ' const params = {'
- - ' ClientIDList: event.ResourceProperties.clientIdList.split('',''),'
- - ' ThumbprintList: ["0000000000000000000000000000000000000000"],'
- - ' Url: event.ResourceProperties.url'
- - ' };'
- - ' let exists = false;'
- - ' let existingValue;'
- - ' iam.listOpenIDConnectProviders({}).promise().then((data) => {'
- - ' if (data.OpenIDConnectProviderList && data.OpenIDConnectProviderList.length > 0) {'
- - ' const vals = data.OpenIDConnectProviderList.map(x => x.Arn);'
- - ' existingValue = vals.find(i => i.split(''/'')[1] === params.Url.split(''//'')[1]);'
- - ' if (!existingValue) {'
- - ' exists = true;'
- - ' }'
- - ' }'
- - ' if (!existingValue) {'
- - ' iam.createOpenIDConnectProvider(params).promise().then((data) => {'
- - ' response.send(event, context, response.SUCCESS, {providerArn: data.OpenIDConnectProviderArn, providerIds: params.ClientIDList});'
- - ' })'
- - ' .catch((err) => {'
- - ' response.send(event, context, response.FAILED, {err});'
- - ' });'
- - ' } else {'
- - ' const findParams = {'
- - ' OpenIDConnectProviderArn: existingValue'
- - ' };'
- - ' iam.getOpenIDConnectProvider(findParams).promise().then((data) => {'
- - ' const audiences = data.ClientIDList;'
- - ' const updateCalls = [];'
- - ' params.ClientIDList.forEach((a) => {'
- - ' if (!audiences.includes(a)) {'
- - ' const updateParams = {'
- - ' ClientID: a,'
- - ' OpenIDConnectProviderArn: existingValue'
- - ' };'
- - ' const prom = iam.addClientIDToOpenIDConnectProvider(updateParams).promise();'
- - ' updateCalls.push(prom);'
- - ' }'
- - ' });'
- - ' Promise.all(updateCalls).then(function(values) {'
- - ' response.send(event, context, response.SUCCESS, {providerArn: existingValue, providerIds: params.ClientIDList});'
- - ' })'
- - ' .catch((err3) => {'
- - ' response.send(event, context, response.FAILED, {err3});'
- - ' });'
- - ' })'
- - ' .catch((err2) => {'
- - ' response.send(event, context, response.FAILED, {err2});'
- - ' });'
- - ' }'
- - ' })'
- - ' .catch((err1) => {'
- - ' response.send(event, context, response.FAILED, {err1});'
- - ' });'
- - ' }'
- - '};'
- Handler: index.handler
- Runtime: nodejs16.x
- Timeout: 300
- Role: !GetAtt
- - OpenIdLambdaRole
- - Arn
- DependsOn: OpenIdLambdaRole
- OpenIdLambdaIAMPolicy:
- # Sets policy for the role that executes the OpenId Lambda
- # Depends on OpenIdLambda for Arn
- # Marked as depending on MFALambda for easier to understand CFN sequencing
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: <%=`${props.resourceNameTruncated}_openid_lambda_iam_policy`%>
- Roles:
- - !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_openid_lambda_role`%>', !Join ['',['<%=`${props.resourceNameTruncated}_openid_lambda_role`%>', '-', !Ref env]]]
- PolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Action:
- - 'iam:CreateOpenIDConnectProvider'
- - 'iam:GetOpenIDConnectProvider'
- - 'iam:AddClientIDToOpenIDConnectProvider'
- Resource: !Sub
- - arn:aws:iam::${account}:oidc-provider/accounts.google.com
- - { account: !Ref "AWS::AccountId"}
- - Effect: Allow
- Action:
- - 'iam:ListOpenIDConnectProviders'
- Resource: !Sub
- - arn:aws:iam::${account}:oidc-provider/${selector}
- - { account: !Ref "AWS::AccountId", selector: '*'}
- DependsOn: OpenIdLambda
- OpenIdLogPolicy:
- # Sets log policy for the role that executes the OpenId Lambda
- # Depends on OpenIdLambda for Arn
- # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
- Type: 'AWS::IAM::Policy'
- Properties:
- PolicyName: <%=`${props.resourceNameTruncated}_openid_lambda_log_policy`%>
- Roles:
- - !If [ShouldNotCreateEnvResources, '<%=`${props.resourceNameTruncated}_openid_lambda_role`%>', !Join ['',['<%=`${props.resourceNameTruncated}_openid_lambda_role`%>', '-', !Ref env]]]
- PolicyDocument:
- Version: 2012-10-17
- Statement:
- - Effect: Allow
- Action:
- - 'logs:CreateLogGroup'
- - 'logs:CreateLogStream'
- - 'logs:PutLogEvents'
- Resource: !Sub
- - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
- - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref OpenIdLambda}
- DependsOn: OpenIdLambdaIAMPolicy
- OpenIdLambdaInputs:
- # Values passed to OpenId Lambda
- # Depends on OpenId for Arn
- # Marked as depending on OpenIdLogPolicy for easier to understand CFN sequencing
- Type: 'Custom::LambdaCallout'
- Properties:
- ServiceToken: !GetAtt OpenIdLambda.Arn
- clientIdList: <%= props.audiences.join() %>
- url: 'https://accounts.google.com'
- DependsOn: OpenIdLogPolicy
- <% } %>
-
- IdentityPool:
- # Always created
- Type: AWS::Cognito::IdentityPool
- Properties:
- IdentityPoolName: !If [ShouldNotCreateEnvResources, '<%= props.identityPoolName %>', !Join ['',['<%= props.identityPoolName %>', '__', !Ref env]]]
- <%if (props.authSelections !== 'identityPoolOnly') { %>
- CognitoIdentityProviders:
- - ClientId: !Ref UserPoolClient
- ProviderName: !Sub
- - cognito-idp.${region}.amazonaws.com/${client}
- - { region: !Ref "AWS::Region", client: !Ref UserPool}
- - ClientId: !Ref UserPoolClientWeb
- ProviderName: !Sub
- - cognito-idp.${region}.amazonaws.com/${client}
- - { region: !Ref "AWS::Region", client: !Ref UserPool}
- <% } -%>
- <%if (props.authProviders && Object.keys(props.authProviders).length > 0 && props.authProviders !== '{}' && !(Object.keys(props.authProviders).length === 1 && props.authProviders[0] === 'accounts.google.com' && props.audiences)) { %>
- SupportedLoginProviders:
- <%if (props.authProviders.indexOf('graph.facebook.com') !== -1) { %>
- graph.facebook.com: !Ref facebookAppId
- <% } %>
- <%if (props.authProviders.indexOf('accounts.google.com') !== -1 && !props.audiences) { %>
- accounts.google.com: !Ref googleClientId
- <% } %>
- <%if (props.authProviders.indexOf('www.amazon.com') !== -1) { %>
- www.amazon.com: !Ref amazonAppId
- <% } %>
- <%if (props.authProviders.indexOf('appleid.apple.com') !== -1) { %>
- appleid.apple.com: !Ref appleAppId
- <% } %>
- <% } %>
- AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities
- <%if (props.audiences && props.audiences.length > 0) { %>
- OpenIdConnectProviderARNs:
- - !GetAtt OpenIdLambdaInputs.providerArn
- DependsOn: OpenIdLambdaInputs
- <% } %>
- <%if ((!props.audiences || props.audiences.length === 0) && props.authSelections !== 'identityPoolOnly') { %>
- DependsOn: UserPoolClientInputs
- <% } %>
-
- IdentityPoolRoleMap:
- # Created to map Auth and Unauth roles to the identity pool
- # Depends on Identity Pool for ID ref
- Type: AWS::Cognito::IdentityPoolRoleAttachment
- Properties:
- IdentityPoolId: !Ref IdentityPool
- Roles:
- unauthenticated: !Ref unauthRoleArn
- authenticated: !Ref authRoleArn
- DependsOn: IdentityPool
- <% } %>
-
-Outputs :
- <%if (props.authSelections === 'identityPoolAndUserPool' || props.authSelections == 'identityPoolOnly') { %>
- IdentityPoolId:
- Value: !Ref 'IdentityPool'
- Description: Id for the identity pool
- IdentityPoolName:
- Value: !GetAtt IdentityPool.Name
- <% } %>
- <%if (props.hostedUIDomainName) { %>
- HostedUIDomain:
- Value: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]]
- <% } %>
- <%if (props.oAuthMetadata) { %>
- OAuthMetadata:
- Value: !Ref oAuthMetadata
- <% } %>
- <%if (props.authSelections !== 'identityPoolOnly') { %>
- UserPoolId:
- Value: !Ref 'UserPool'
- Description: Id for the user pool
- UserPoolArn:
- Value: !GetAtt UserPool.Arn
- Description: Arn for the user pool
- UserPoolName:
- Value: !Ref userPoolName
- AppClientIDWeb:
- Value: !Ref 'UserPoolClientWeb'
- Description: The user pool app client id for web
- AppClientID:
- Value: !Ref 'UserPoolClient'
- Description: The user pool app client id
- AppClientSecret:
- Value: !GetAtt UserPoolClientInputs.appSecret
- Condition: ShouldOutputAppClientSecrets
- <%if (!props.useEnabledMfas || configureSMS) { %>
- CreatedSNSRole:
- Value: !GetAtt SNSRole.Arn
- Description: role arn
- <% } %>
- <%if (props.googleClientId) { %>
- GoogleWebClient:
- Value: !Ref googleClientId
- <% } %>
- <%if (props.googleIos) { %>
- GoogleIOSClient:
- Value: !Ref googleIos
- <% } %>
- <%if (props.googleAndroid) { %>
- GoogleAndroidClient:
- Value: !Ref googleAndroid
- <% } %>
- <%if (props.facebookAppId) { %>
- FacebookWebClient:
- Value: !Ref facebookAppId
- <% } %>
- <%if (props.amazonAppId) { %>
- AmazonWebClient:
- Value: !Ref amazonAppId
- <% } %>
- <%if (props.appleAppId) { %>
- AppleWebClient:
- Value: !Ref appleAppId
- <% } %>
- <% } %>
diff --git a/packages/amplify-category-auth/resources/cloudformation-templates/user-pool-group-template.json.ejs b/packages/amplify-category-auth/resources/cloudformation-templates/user-pool-group-template.json.ejs
deleted file mode 100644
index f41916731eb..00000000000
--- a/packages/amplify-category-auth/resources/cloudformation-templates/user-pool-group-template.json.ejs
+++ /dev/null
@@ -1,336 +0,0 @@
-{
- "AWSTemplateFormatVersion": "2010-09-09",
- "Parameters": {
- "auth<%= props.cognitoResourceName %>UserPoolId": {
- "Type": "String",
- "Default": "auth<%= props.cognitoResourceName %>UserPoolId"
- },
- <% if (props.identityPoolName) { %>
- "auth<%= props.cognitoResourceName %>IdentityPoolId": {
- "Type": "String",
- "Default": "auth<%= props.cognitoResourceName %>IdentityPoolId"
- },
- <% } %>
- "auth<%= props.cognitoResourceName %>AppClientID": {
- "Type": "String",
- "Default": "auth<%= props.cognitoResourceName %>AppClientID"
- },
- "auth<%= props.cognitoResourceName %>AppClientIDWeb": {
- "Type": "String",
- "Default": "auth<%= props.cognitoResourceName %>AppClientIDWeb"
- },
- "AuthRoleArn": {
- "Type": "String"
- },
- "UnauthRoleArn": {
- "Type": "String"
- },
- "env": {
- "Type": "String"
- }
- },
- "Conditions": {
- "ShouldNotCreateEnvResources": {
- "Fn::Equals": [
- {
- "Ref": "env"
- },
- "NONE"
- ]
- }
- },
- "Resources": {
- <% for(var i=0; i < props.groups.length; i++) { %>
- "<%= props.groups[i].groupName%>Group": {
- "Type" : "AWS::Cognito::UserPoolGroup",
- "Properties" : {
- "GroupName" : "<%= props.groups[i].groupName %>",
- "Precedence" : <%= props.groups[i].precedence %>,
- <% if (props.identityPoolName) { %>
- "RoleArn" : {
- "Fn::GetAtt": [
- "<%= props.groups[i].groupName %>GroupRole",
- "Arn"
- ]
- },
- <% } %>
- "UserPoolId" : {
- "Ref": "auth<%= props.cognitoResourceName %>UserPoolId"
- }
- }
- },
- <% if (props.identityPoolName) { %>
- "<%= props.groups[i].groupName %>GroupRole": {
- "Type": "AWS::IAM::Role",
- "Properties": {
- "RoleName":{
- "Fn::Join": [
- "",
- [
- {
- "Ref": "auth<%= props.cognitoResourceName %>UserPoolId"
- },
- "-<%= props.groups[i].groupName %>GroupRole"
- ]
- ]
- },
- "AssumeRolePolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "",
- "Effect": "Allow",
- "Principal": {
- "Federated": "cognito-identity.amazonaws.com"
- },
- "Action": "sts:AssumeRoleWithWebIdentity",
- "Condition": {
- "StringEquals": {"cognito-identity.amazonaws.com:aud": {"Ref":"auth<%= props.cognitoResourceName %>IdentityPoolId"}},
- "ForAnyValue:StringLike": {"cognito-identity.amazonaws.com:amr": "authenticated"}
- }
- }
- ]
- }<% if(props.groups[i].customPolicies && props.groups[i].customPolicies.length > 0) { %>,
- "Policies": <%- JSON.stringify(props.groups[i].customPolicies, null, 4) %>
- <% } %>
- }
- },
- <% } %>
- <% } %>
- <% if (props.identityPoolName) { %>
- "LambdaCloudWatchPolicy": {
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "UserGroupLogPolicy"
- },
- "Roles": [
- {
- "Ref": "LambdaExecutionRole"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "logs:CreateLogGroup",
- "logs:CreateLogStream",
- "logs:PutLogEvents"
- ],
- "Resource": {
- "Fn::Sub": [
- "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/${lambdaName}:log-stream:*",
- {
- "lambdaName": {
- "Ref": "RoleMapFunction"
- }
- }
- ]
- }
- }
- ]
- }
- }
- },
- "LambdaExecutionRole": {
- "Type": "AWS::IAM::Role",
- "Properties": {
- "RoleName": {
- "Fn::If": [
- "ShouldNotCreateEnvResources",
- {
- <%= props.resourceName %>
- },
- {
-
- "Fn::Join": [
- "",
- [
-
- "<%= props.cognitoResourceName %>",
- "-ExecutionRole-",
- {
- "Ref": "env"
- }
- ]
- ]
- }
- ]
- },
- "AssumeRolePolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Service": [
- "lambda.amazonaws.com"
- ]
- },
- "Action": [
- "sts:AssumeRole"
- ]
- }
- ]
- },
- "Policies": [
- {
- "PolicyName": "UserGroupExecutionPolicy",
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "cognito-identity:SetIdentityPoolRoles",
- "cognito-identity:ListIdentityPools",
- "cognito-identity:describeIdentityPool"
-
- ],
- "Resource": "*"
- }
- ]
- }
- },
- {
- "PolicyName": "UserGroupPassRolePolicy",
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "iam:PassRole"
- ],
- "Resource": [
- { "Ref": "AuthRoleArn" },
- { "Ref": "UnauthRoleArn" }
- ]
- }
- ]
- }
- }
- ]
- }
- },
- "RoleMapFunction": {
- "Type": "AWS::Lambda::Function",
- "DependsOn": ["LambdaExecutionRole"],
- "Properties": {
- "Code": {
- "ZipFile": {
- "Fn::Join": [
- "\n",
- [
- "const response = require('cfn-response');",
- "const AWS = require('aws-sdk');",
- "exports.handler = (event, context) => {",
- "if (event.RequestType == 'Delete') {",
- " response.send(event, context, response.SUCCESS, {message: 'Request type delete'})",
- "};",
- "if (event.RequestType == 'Create' || event.RequestType == 'Update') {",
- " let { identityPoolId, appClientID, appClientIDWeb, userPoolId, region } = event.ResourceProperties;",
- " try {",
- " const cognitoidentity = new AWS.CognitoIdentity();",
- " let params = {",
- " IdentityPoolId: identityPoolId,",
- " Roles: {",
- " 'authenticated': event.ResourceProperties.AuthRoleArn,",
- " 'unauthenticated': event.ResourceProperties.UnauthRoleArn,",
- " },",
- " RoleMappings: {}",
- " };",
- " if (appClientIDWeb) {",
- " params.RoleMappings[`cognito-idp.${region}.amazonaws.com/${userPoolId}:${appClientIDWeb}`] = {",
- " Type: 'Token',",
- " AmbiguousRoleResolution: 'AuthenticatedRole',",
- " }",
- " }",
- " if (appClientID) {",
- " params.RoleMappings[`cognito-idp.${region}.amazonaws.com/${userPoolId}:${appClientID}`] = {",
- " Type: 'Token',",
- " AmbiguousRoleResolution: 'AuthenticatedRole',",
- " }",
- " }",
- " cognitoidentity.setIdentityPoolRoles(params).promise();",
- " response.send(event, context, response.SUCCESS, {message: 'Successfully updated identity pool.'})",
- " } catch(err) {",
- " response.send(event, context, response.FAILED, {message: 'Error updating identity pool'});",
- " }",
- " };",
- "};"
-
- ]
- ]
- }
- },
- "Handler": "index.handler",
- "Runtime": "nodejs16.x",
- "Timeout": 300,
- "Role": {
- "Fn::GetAtt": [
- "LambdaExecutionRole",
- "Arn"
- ]
- }
- }
- },
- "RoleMapFunctionInput": {
- "Type": "Custom::LambdaCallout",
- "Properties": {
- "ServiceToken": {
- "Fn::GetAtt": [
- "RoleMapFunction",
- "Arn"
- ]
- },
- "AuthRoleArn": {
- "Ref": "AuthRoleArn"
- },
- "UnauthRoleArn": {
- "Ref": "UnauthRoleArn"
- },
- "identityPoolId": {
- "Ref": "auth<%= props.cognitoResourceName %>IdentityPoolId"
- },
- "userPoolId": {
- "Ref": "auth<%= props.cognitoResourceName %>UserPoolId"
- },
- "appClientIDWeb": {
- "Ref": "auth<%= props.cognitoResourceName %>AppClientIDWeb"
- },
- "appClientID": {
- "Ref": "auth<%= props.cognitoResourceName %>AppClientID"
- },
- "region": {
- "Ref": "AWS::Region"
- },
- "env": {
- "Ref": "env"
- }
- },
- "DependsOn": ["RoleMapFunction"]
- }
- <% } %>
- },
- <% if (props.identityPoolName) { %>
- "Outputs": {
- <% for(var i=0; i < props.groups.length; i++) { %>
- "<%= props.groups[i].groupName %>GroupRole": {
- "Value": {
- "Fn::GetAtt": [
- "<%= props.groups[i].groupName %>GroupRole",
- "Arn"
- ]
- }
- <% if(i !== (props.groups.length -1)) { %>
- },
- <%} else { %>
- }
- <% } %>
- <% } %>
- }
- <% } %>
-}
diff --git a/packages/amplify-category-auth/resources/lambda-function.js b/packages/amplify-category-auth/resources/lambda-function.js
index 2dbc6f56023..de3524b383c 100644
--- a/packages/amplify-category-auth/resources/lambda-function.js
+++ b/packages/amplify-category-auth/resources/lambda-function.js
@@ -1,73 +1,73 @@
const response = require('cfn-response');
-const aws = require('aws-sdk');
+const {
+ CognitoIdentityProviderClient,
+ DescribeUserPoolCommand,
+ UpdateUserPoolCommand,
+} = require('@aws-sdk/client-cognito-identity-provider');
-exports.handler = async function (event, context) {
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
const physicalResourceId =
event.RequestType === 'Update' ? event.PhysicalResourceId : `${event.LogicalResourceId}-${event.ResourceProperties.userpoolId}`;
-
try {
- const userPoolId = event.ResourceProperties.userpoolId;
- const { lambdaConfig } = event.ResourceProperties;
- const config = {};
- const cognitoClient = new aws.CognitoIdentityServiceProvider();
- const userPoolConfig = await cognitoClient.describeUserPool({ UserPoolId: userPoolId }).promise();
- const userPoolParams = userPoolConfig.UserPool;
- // update userPool params
+ await handleEvent(event);
+ response.send(event, context, response.SUCCESS, {}, physicalResourceId);
+ } catch (err) {
+ console.log(err.stack);
+ response.send(event, context, response.FAILED, { err }, physicalResourceId);
+ }
+}
- const updateUserPoolConfig = {
- UserPoolId: userPoolParams.Id,
- Policies: userPoolParams.Policies,
- SmsVerificationMessage: userPoolParams.SmsVerificationMessage,
- AccountRecoverySetting: userPoolParams.AccountRecoverySetting,
- AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,
- AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,
- EmailConfiguration: userPoolParams.EmailConfiguration,
- EmailVerificationMessage: userPoolParams.EmailVerificationMessage,
- EmailVerificationSubject: userPoolParams.EmailVerificationSubject,
- VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,
- SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,
- MfaConfiguration: userPoolParams.MfaConfiguration,
- DeviceConfiguration: userPoolParams.DeviceConfiguration,
- SmsConfiguration: userPoolParams.SmsConfiguration,
- UserPoolTags: userPoolParams.UserPoolTags,
- UserPoolAddOns: userPoolParams.UserPoolAddOns,
- };
+async function handleEvent(event) {
+ const userPoolId = event.ResourceProperties.userpoolId;
+ const { lambdaConfig } = event.ResourceProperties;
+ const config = {};
+ const cognitoClient = new CognitoIdentityProviderClient({});
+ const userPoolConfig = await cognitoClient.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));
+ const userPoolParams = userPoolConfig.UserPool;
+ // update userPool params
- // removing undefined keys
- Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);
+ const updateUserPoolConfig = {
+ UserPoolId: userPoolParams.Id,
+ Policies: userPoolParams.Policies,
+ SmsVerificationMessage: userPoolParams.SmsVerificationMessage,
+ AccountRecoverySetting: userPoolParams.AccountRecoverySetting,
+ AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,
+ AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,
+ EmailConfiguration: userPoolParams.EmailConfiguration,
+ EmailVerificationMessage: userPoolParams.EmailVerificationMessage,
+ EmailVerificationSubject: userPoolParams.EmailVerificationSubject,
+ VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,
+ SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,
+ MfaConfiguration: userPoolParams.MfaConfiguration,
+ DeviceConfiguration: userPoolParams.DeviceConfiguration,
+ SmsConfiguration: userPoolParams.SmsConfiguration,
+ UserPoolTags: userPoolParams.UserPoolTags,
+ UserPoolAddOns: userPoolParams.UserPoolAddOns,
+ };
- /* removing UnusedAccountValidityDays as deprecated
+ // removing undefined keys
+ Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);
+
+ /* removing UnusedAccountValidityDays as deprecated
InvalidParameterException: Please use TemporaryPasswordValidityDays in PasswordPolicy instead of UnusedAccountValidityDays
*/
- if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {
- delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;
- }
- lambdaConfig.forEach((lambda) => (config[`${lambda.triggerType}`] = lambda.lambdaFunctionArn));
- if (event.RequestType === 'Delete') {
- try {
- updateUserPoolConfig.LambdaConfig = {};
- console.log(`${event.RequestType}:`, JSON.stringify(updateUserPoolConfig));
- const result = await cognitoClient.updateUserPool(updateUserPoolConfig).promise();
- console.log(`delete response data ${JSON.stringify(result)}`);
- await response.send(event, context, response.SUCCESS, {}, physicalResourceId);
- } catch (err) {
- console.log(err.stack);
- await response.send(event, context, response.FAILED, { err }, physicalResourceId);
- }
- }
- if (event.RequestType === 'Update' || event.RequestType === 'Create') {
- updateUserPoolConfig.LambdaConfig = config;
- try {
- const result = await cognitoClient.updateUserPool(updateUserPoolConfig).promise();
- console.log(`createOrUpdate response data ${JSON.stringify(result)}`);
- await response.send(event, context, response.SUCCESS, {}, physicalResourceId);
- } catch (err) {
- console.log(err.stack);
- await response.send(event, context, response.FAILED, { err }, physicalResourceId);
- }
- }
- } catch (err) {
- console.log(err.stack);
- await response.send(event, context, response.FAILED, { err }, physicalResourceId);
+ if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {
+ delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;
}
-};
+ lambdaConfig.forEach((lambda) => (config[`${lambda.triggerType}`] = lambda.lambdaFunctionArn));
+ if (event.RequestType === 'Delete') {
+ updateUserPoolConfig.LambdaConfig = {};
+ console.log(`${event.RequestType}:`, JSON.stringify(updateUserPoolConfig));
+ const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));
+ console.log(`delete response data ${JSON.stringify(result)}`);
+ } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {
+ updateUserPoolConfig.LambdaConfig = config;
+ const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));
+ console.log(`createOrUpdate response data ${JSON.stringify(result)}`);
+ }
+}
diff --git a/packages/amplify-category-auth/src/__tests__/commands/override.test.ts b/packages/amplify-category-auth/src/__tests__/commands/override.test.ts
index d5eb3ee478a..fc2d0f93204 100644
--- a/packages/amplify-category-auth/src/__tests__/commands/override.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/commands/override.test.ts
@@ -1,6 +1,5 @@
import { run } from '../../commands/auth/override';
import { $TSContext, generateOverrideSkeleton } from '@aws-amplify/amplify-cli-core';
-import { AuthInputState } from '../../provider-utils/awscloudformation/auth-inputs-manager/auth-input-state';
import { checkAuthResourceMigration } from '../../provider-utils/awscloudformation/utils/check-for-auth-migration';
jest.mock('../../provider-utils/awscloudformation/auth-inputs-manager/auth-input-state');
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-inputs-manager/auth-input-state.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-inputs-manager/auth-input-state.test.ts
index 8c7f03eb216..0c238a6ef48 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-inputs-manager/auth-input-state.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-inputs-manager/auth-input-state.test.ts
@@ -120,5 +120,5 @@ test('Auth Input State -> validate cli payload manual payload', async () => {
test('Auth Input State -> validate cli payload manual payload to throw error', async () => {
const resourceName = 'mockResource';
const authState = new AuthInputState(mockContext, resourceName);
- expect(authState.isCLIInputsValid()).rejects.toThrowError();
+ await expect(authState.isCLIInputsValid()).rejects.toThrowError();
});
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap
index af1c3869689..75d5b2751b0 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap
@@ -12,14 +12,6 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
"NONE",
],
},
- "ShouldOutputAppClientSecrets": {
- "Fn::Equals": [
- {
- "Ref": "userpoolClientGenerateSecret",
- },
- true,
- ],
- },
},
"Description": "Amplify Cognito Stack for AWS Amplify CLI",
"Outputs": {
@@ -35,15 +27,6 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
"Ref": "UserPoolClientWeb",
},
},
- "AppClientSecret": {
- "Condition": "ShouldOutputAppClientSecrets",
- "Value": {
- "Fn::GetAtt": [
- "UserPoolClientInputs",
- "appSecret",
- ],
- },
- },
"IdentityPoolId": {
"Description": "Id for the identity pool",
"Value": {
@@ -188,9 +171,6 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
},
"Resources": {
"IdentityPool": {
- "DependsOn": [
- "UserPoolClientInputs",
- ],
"Properties": {
"AllowUnauthenticatedIdentities": {
"Ref": "allowUnauthenticatedIdentities",
@@ -361,149 +341,7 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
},
"Type": "AWS::Cognito::UserPoolClient",
},
- "UserPoolClientInputs": {
- "DeletionPolicy": "Delete",
- "DependsOn": [
- "UserPoolClientLogPolicy",
- ],
- "Properties": {
- "ServiceToken": {
- "Fn::GetAtt": [
- "UserPoolClientLambda",
- "Arn",
- ],
- },
- "clientId": {
- "Ref": "UserPoolClient",
- },
- "userpoolId": {
- "Ref": "UserPool",
- },
- },
- "Type": "Custom::LambdaCallout",
- "UpdateReplacePolicy": "Delete",
- },
- "UserPoolClientLambda": {
- "DependsOn": [
- "UserPoolClientRole",
- ],
- "Properties": {
- "Code": {
- "ZipFile": "const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
- }
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- const params = {
- ClientId: event.ResourceProperties.clientId,
- UserPoolId: event.ResourceProperties.userpoolId,
- };
- identity
- .describeUserPoolClient(params)
- .promise()
- .then((res) => {
- response.send(event, context, response.SUCCESS, { appSecret: res.UserPoolClient.ClientSecret });
- })
- .catch((err) => {
- response.send(event, context, response.FAILED, { err });
- });
- }
-};
-",
- },
- "Handler": "index.handler",
- "Role": {
- "Fn::GetAtt": [
- "UserPoolClientRole",
- "Arn",
- ],
- },
- "Runtime": "nodejs16.x",
- "Timeout": 300,
- },
- "Type": "AWS::Lambda::Function",
- },
- "UserPoolClientLambdaPolicy": {
- "DependsOn": [
- "UserPoolClientLambda",
- ],
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "cognito-idp:DescribeUserPoolClient",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::GetAtt": [
- "UserPool",
- "Arn",
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "authde2c33facd_userpoolclient_lambda_iam_policy",
- "Roles": [
- {
- "Ref": "UserPoolClientRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
- "UserPoolClientLogPolicy": {
- "DependsOn": [
- "UserPoolClientLambdaPolicy",
- ],
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "logs:CreateLogGroup",
- "logs:CreateLogStream",
- "logs:PutLogEvents",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Sub": [
- "arn:aws:logs:\${region}:\${account}:log-group:/aws/lambda/\${lambda}:log-stream:*",
- {
- "account": {
- "Ref": "AWS::AccountId",
- },
- "lambda": {
- "Ref": "UserPoolClientLambda",
- },
- "region": {
- "Ref": "AWS::Region",
- },
- },
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "authde2c33facd_userpoolclient_lambda_log_policy",
- "Roles": [
- {
- "Ref": "UserPoolClientRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
"UserPoolClientRole": {
- "DependsOn": [
- "UserPoolClient",
- ],
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
@@ -587,14 +425,6 @@ exports[`Check Auth Template Generated authstack template in manual flow 1`] = `
"NONE",
],
},
- "ShouldOutputAppClientSecrets": {
- "Fn::Equals": [
- {
- "Ref": "userpoolClientGenerateSecret",
- },
- true,
- ],
- },
},
"Description": "Amplify Cognito Stack for AWS Amplify CLI",
"Outputs": {
@@ -615,15 +445,6 @@ exports[`Check Auth Template Generated authstack template in manual flow 1`] = `
"Ref": "UserPoolClientWeb",
},
},
- "AppClientSecret": {
- "Condition": "ShouldOutputAppClientSecrets",
- "Value": {
- "Fn::GetAtt": [
- "UserPoolClientInputs",
- "appSecret",
- ],
- },
- },
"AppleWebClient": {
"Value": {
"Ref": "appleAppId",
@@ -963,86 +784,85 @@ exports[`Check Auth Template Generated authstack template in manual flow 1`] = `
"Properties": {
"Code": {
"ZipFile": "const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
+const {
+ CognitoIdentityProviderClient,
+ CreateUserPoolDomainCommand,
+ DeleteUserPoolDomainCommand,
+ DescribeUserPoolCommand,
+ DescribeUserPoolDomainCommand,
+} = require('@aws-sdk/client-cognito-identity-provider');
+const identity = new CognitoIdentityProviderClient({});
+
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
+ try {
+ await handleEvent(event);
+ response.send(event, context, response.SUCCESS, {});
+ } catch (err) {
+ console.log(err);
+ response.send(event, context, response.FAILED, { err });
+ }
+}
+
+async function handleEvent(event) {
const userPoolId = event.ResourceProperties.userPoolId;
const inputDomainName = event.ResourceProperties.hostedUIDomainName;
- let deleteUserPoolDomain = (domainName) => {
- let params = { Domain: domainName, UserPoolId: userPoolId };
- return identity.deleteUserPoolDomain(params).promise();
+ if (event.RequestType === 'Delete') {
+ await deleteUserPoolDomain(inputDomainName, userPoolId);
+ } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {
+ await createOrUpdateDomain(inputDomainName, userPoolId);
+ }
+}
+
+async function checkDomainAvailability(domainName) {
+ const params = { Domain: domainName };
+ try {
+ const res = await identity.send(new DescribeUserPoolDomainCommand(params));
+ return !(res.DomainDescription && res.DomainDescription.UserPoolId);
+ } catch (err) {
+ return false;
+ }
+}
+
+async function deleteUserPoolDomain(domainName, userPoolId) {
+ const params = { Domain: domainName, UserPoolId: userPoolId };
+ await identity.send(new DeleteUserPoolDomainCommand(params));
+}
+
+async function createUserPoolDomain(domainName, userPoolId) {
+ const params = {
+ Domain: domainName,
+ UserPoolId: userPoolId,
};
- if (event.RequestType == 'Delete') {
- deleteUserPoolDomain(inputDomainName)
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err);
- response.send(event, context, response.FAILED, { err });
- });
+ await identity.send(new CreateUserPoolDomainCommand(params));
+}
+
+async function createOrUpdateDomain(inputDomainName, userPoolId) {
+ const result = await identity.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));
+ if (result.UserPool.Domain === inputDomainName) {
+ // if existing domain is same as input domain do nothing.
+ return;
}
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let checkDomainAvailability = (domainName) => {
- let params = { Domain: domainName };
- return identity
- .describeUserPoolDomain(params)
- .promise()
- .then((res) => {
- if (res.DomainDescription && res.DomainDescription.UserPool) {
- return false;
- }
- return true;
- })
- .catch((err) => {
- return false;
- });
- };
- let createUserPoolDomain = (domainName) => {
- let params = { Domain: domainName, UserPoolId: userPoolId };
- return identity.createUserPoolDomain(params).promise();
- };
- identity
- .describeUserPool({ UserPoolId: userPoolId })
- .promise()
- .then((result) => {
- if (inputDomainName) {
- if (result.UserPool.Domain === inputDomainName) {
- return;
- } else {
- if (!result.UserPool.Domain) {
- return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {
- if (isDomainAvailable) {
- return createUserPoolDomain(inputDomainName);
- } else {
- throw new Error('Domain not available');
- }
- });
- } else {
- return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {
- if (isDomainAvailable) {
- return deleteUserPoolDomain(result.UserPool.Domain).then(() => createUserPoolDomain(inputDomainName));
- } else {
- throw new Error('Domain not available');
- }
- });
- }
- }
- } else {
- if (result.UserPool.Domain) {
- return deleteUserPoolDomain(result.UserPool.Domain);
- }
- }
- })
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err);
- response.send(event, context, response.FAILED, { err });
- });
+ if (inputDomainName) {
+ // create new or replace existing domain.
+ const isDomainAvailable = await checkDomainAvailability(inputDomainName);
+ if (isDomainAvailable) {
+ if (result.UserPool.Domain) {
+ await deleteUserPoolDomain(result.UserPool.Domain, userPoolId);
+ }
+ await createUserPoolDomain(inputDomainName, userPoolId);
+ } else {
+ throw new Error('Domain not available');
+ }
+ } else if (result.UserPool.Domain) {
+ // if input domain is undefined delete existing domain if exists.
+ await deleteUserPoolDomain(result.UserPool.Domain, userPoolId);
}
-};
+}
",
},
"Handler": "index.handler",
@@ -1052,7 +872,7 @@ exports.handler = (event, context, callback) => {
"Arn",
],
},
- "Runtime": "nodejs16.x",
+ "Runtime": "nodejs18.x",
"Timeout": 300,
},
"Type": "AWS::Lambda::Function",
@@ -1209,109 +1029,115 @@ exports.handler = (event, context, callback) => {
"Properties": {
"Code": {
"ZipFile": "const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
+const {
+ CognitoIdentityProviderClient,
+ CreateIdentityProviderCommand,
+ DeleteIdentityProviderCommand,
+ ListIdentityProvidersCommand,
+ UpdateIdentityProviderCommand,
+} = require('@aws-sdk/client-cognito-identity-provider');
+const identity = new CognitoIdentityProviderClient({});
+
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
try {
- const userPoolId = event.ResourceProperties.userPoolId;
- let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);
- let hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);
- if (hostedUIProviderCreds.length === 0) {
- response.send(event, context, response.SUCCESS, {});
+ await handleEvent(event);
+ response.send(event, context, response.SUCCESS, {});
+ } catch (err) {
+ console.log(err.stack);
+ response.send(event, context, response.FAILED, { err });
+ }
+}
+
+async function handleEvent(event) {
+ const userPoolId = event.ResourceProperties.userPoolId;
+ const hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);
+ const hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);
+ const hasHostedUIProviderCreds = hostedUIProviderCreds.length && hostedUIProviderCreds.length > 0;
+ if (hasHostedUIProviderCreds && (event.RequestType === 'Update' || event.RequestType === 'Create')) {
+ const listIdentityProvidersResponse = await identity.send(
+ new ListIdentityProvidersCommand({
+ UserPoolId: userPoolId,
+ MaxResults: 60,
+ }),
+ );
+ console.log(listIdentityProvidersResponse);
+ const providerList = listIdentityProvidersResponse.Providers.map((provider) => provider.ProviderName);
+ const providerListInParameters = hostedUIProviderMeta.map((provider) => provider.ProviderName);
+ for (const providerMetadata of hostedUIProviderMeta) {
+ if (providerList.indexOf(providerMetadata.ProviderName) > -1) {
+ await updateIdentityProvider(providerMetadata.ProviderName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ } else {
+ await createIdentityProvider(providerMetadata.ProviderName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ }
}
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
+ for (const provider of providerList) {
+ if (providerListInParameters.indexOf(provider) < 0) {
+ await deleteIdentityProvider(provider, userPoolId);
+ }
}
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let getRequestParams = (providerName) => {
- let providerMetaIndex = hostedUIProviderMeta.findIndex((provider) => provider.ProviderName === providerName);
- let providerMeta = hostedUIProviderMeta[providerMetaIndex];
- let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);
- let providerCreds = hostedUIProviderCreds[providerCredsIndex];
- let requestParams = {
- ProviderName: providerMeta.ProviderName,
- UserPoolId: userPoolId,
- AttributeMapping: providerMeta.AttributeMapping,
- };
- if (providerMeta.ProviderName === 'SignInWithApple') {
- if (providerCreds.client_id && providerCreds.team_id && providerCreds.key_id && providerCreds.private_key) {
- requestParams.ProviderDetails = {
- client_id: providerCreds.client_id,
- team_id: providerCreds.team_id,
- key_id: providerCreds.key_id,
- private_key: providerCreds.private_key,
- authorize_scopes: providerMeta.authorize_scopes,
- };
- } else {
- requestParams = null;
- }
- } else {
- if (providerCreds.client_id && providerCreds.client_secret) {
- requestParams.ProviderDetails = {
- client_id: providerCreds.client_id,
- client_secret: providerCreds.client_secret,
- authorize_scopes: providerMeta.authorize_scopes,
- };
- } else {
- requestParams = null;
- }
- }
- return requestParams;
- };
- let createIdentityProvider = (providerName) => {
- let requestParams = getRequestParams(providerName);
- if (!requestParams) {
- return Promise.resolve();
- }
- requestParams.ProviderType = requestParams.ProviderName;
- return identity.createIdentityProvider(requestParams).promise();
- };
- let updateIdentityProvider = (providerName) => {
- let requestParams = getRequestParams(providerName);
- if (!requestParams) {
- return Promise.resolve();
- }
- return identity.updateIdentityProvider(requestParams).promise();
+ }
+}
+
+function getRequestParams(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId) {
+ const providerMeta = hostedUIProviderMeta.find((provider) => provider.ProviderName === providerName);
+ const providerCreds = hostedUIProviderCreds.find((provider) => provider.ProviderName === providerName);
+ let requestParams = {
+ ProviderName: providerMeta.ProviderName,
+ UserPoolId: userPoolId,
+ AttributeMapping: providerMeta.AttributeMapping,
+ };
+ if (providerMeta.ProviderName === 'SignInWithApple') {
+ if (providerCreds.client_id && providerCreds.team_id && providerCreds.key_id && providerCreds.private_key) {
+ requestParams.ProviderDetails = {
+ client_id: providerCreds.client_id,
+ team_id: providerCreds.team_id,
+ key_id: providerCreds.key_id,
+ private_key: providerCreds.private_key,
+ authorize_scopes: providerMeta.authorize_scopes,
};
- let deleteIdentityProvider = (providerName) => {
- let params = { ProviderName: providerName, UserPoolId: userPoolId };
- return identity.deleteIdentityProvider(params).promise();
+ } else {
+ requestParams = null;
+ }
+ } else {
+ if (providerCreds.client_id && providerCreds.client_secret) {
+ requestParams.ProviderDetails = {
+ client_id: providerCreds.client_id,
+ client_secret: providerCreds.client_secret,
+ authorize_scopes: providerMeta.authorize_scopes,
};
- let providerPromises = [];
- identity
- .listIdentityProviders({ UserPoolId: userPoolId, MaxResults: 60 })
- .promise()
- .then((result) => {
- console.log(result);
- let providerList = result.Providers.map((provider) => provider.ProviderName);
- let providerListInParameters = hostedUIProviderMeta.map((provider) => provider.ProviderName);
- hostedUIProviderMeta.forEach((providerMetadata) => {
- if (providerList.indexOf(providerMetadata.ProviderName) > -1) {
- providerPromises.push(updateIdentityProvider(providerMetadata.ProviderName));
- } else {
- providerPromises.push(createIdentityProvider(providerMetadata.ProviderName));
- }
- });
- providerList.forEach((provider) => {
- if (providerListInParameters.indexOf(provider) < 0) {
- providerPromises.push(deleteIdentityProvider(provider));
- }
- });
- return Promise.all(providerPromises);
- })
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
- });
+ } else {
+ requestParams = null;
}
- } catch (err) {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
}
-};
+ return requestParams;
+}
+
+async function createIdentityProvider(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId) {
+ const requestParams = getRequestParams(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ if (!requestParams) {
+ return;
+ }
+ requestParams.ProviderType = requestParams.ProviderName;
+ await identity.send(new CreateIdentityProviderCommand(requestParams));
+}
+
+async function updateIdentityProvider(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId) {
+ const requestParams = getRequestParams(providerName, hostedUIProviderMeta, hostedUIProviderCreds, userPoolId);
+ if (!requestParams) {
+ return;
+ }
+ await identity.send(new UpdateIdentityProviderCommand(requestParams));
+}
+
+async function deleteIdentityProvider(providerName, userPoolId) {
+ const params = { ProviderName: providerName, UserPoolId: userPoolId };
+ await identity.send(new DeleteIdentityProviderCommand(params));
+}
",
},
"Handler": "index.handler",
@@ -1321,7 +1147,7 @@ exports.handler = (event, context, callback) => {
"Arn",
],
},
- "Runtime": "nodejs16.x",
+ "Runtime": "nodejs18.x",
"Timeout": 300,
},
"Type": "AWS::Lambda::Function",
@@ -1456,9 +1282,6 @@ exports.handler = (event, context, callback) => {
"Type": "AWS::IAM::Policy",
},
"IdentityPool": {
- "DependsOn": [
- "UserPoolClientInputs",
- ],
"Properties": {
"AllowUnauthenticatedIdentities": {
"Ref": "allowUnauthenticatedIdentities",
@@ -1538,11 +1361,55 @@ exports.handler = (event, context, callback) => {
"IdentityPoolRoleMap": {
"DependsOn": [
"IdentityPool",
+ "UserPoolClient",
+ "UserPoolClientWeb",
],
"Properties": {
"IdentityPoolId": {
"Ref": "IdentityPool",
},
+ "RoleMappings": {
+ "UserPoolClientRoleMapping": {
+ "AmbiguousRoleResolution": "AuthenticatedRole",
+ "IdentityProvider": {
+ "Fn::Sub": [
+ "cognito-idp.\${region}.amazonaws.com/\${userPool}:\${client}",
+ {
+ "client": {
+ "Ref": "UserPoolClient",
+ },
+ "region": {
+ "Ref": "AWS::Region",
+ },
+ "userPool": {
+ "Ref": "UserPool",
+ },
+ },
+ ],
+ },
+ "Type": "Token",
+ },
+ "UserPoolWebClientRoleMapping": {
+ "AmbiguousRoleResolution": "AuthenticatedRole",
+ "IdentityProvider": {
+ "Fn::Sub": [
+ "cognito-idp.\${region}.amazonaws.com/\${userPool}:\${webClient}",
+ {
+ "region": {
+ "Ref": "AWS::Region",
+ },
+ "userPool": {
+ "Ref": "UserPool",
+ },
+ "webClient": {
+ "Ref": "UserPoolClientWeb",
+ },
+ },
+ ],
+ },
+ "Type": "Token",
+ },
+ },
"Roles": {
"authenticated": {
"Ref": "authRoleArn",
@@ -1554,197 +1421,6 @@ exports.handler = (event, context, callback) => {
},
"Type": "AWS::Cognito::IdentityPoolRoleAttachment",
},
- "OAuthCustomResource": {
- "DependsOn": [
- "HostedUICustomResourceInputs",
- "HostedUIProvidersCustomResourceInputs",
- ],
- "Properties": {
- "Code": {
- "ZipFile": "const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
- try {
- const userPoolId = event.ResourceProperties.userPoolId;
- let webClientId = event.ResourceProperties.webClientId;
- let nativeClientId = event.ResourceProperties.nativeClientId;
- let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);
- let oAuthMetadata = JSON.parse(event.ResourceProperties.oAuthMetadata);
- let providerList = hostedUIProviderMeta.map((provider) => provider.ProviderName);
- providerList.push('COGNITO');
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
- }
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- let params = {
- UserPoolId: userPoolId,
- AllowedOAuthFlows: oAuthMetadata.AllowedOAuthFlows,
- AllowedOAuthFlowsUserPoolClient: true,
- AllowedOAuthScopes: oAuthMetadata.AllowedOAuthScopes,
- CallbackURLs: oAuthMetadata.CallbackURLs,
- LogoutURLs: oAuthMetadata.LogoutURLs,
- SupportedIdentityProviders: providerList,
- };
- console.log(params);
- let updateUserPoolClientPromises = [];
- params.ClientId = webClientId;
- updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());
- params.ClientId = nativeClientId;
- updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());
- Promise.all(updateUserPoolClientPromises)
- .then(() => {
- response.send(event, context, response.SUCCESS, {});
- })
- .catch((err) => {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
- });
- }
- } catch (err) {
- console.log(err.stack);
- response.send(event, context, response.FAILED, { err });
- }
-};
-",
- },
- "Handler": "index.handler",
- "Role": {
- "Fn::GetAtt": [
- "UserPoolClientRole",
- "Arn",
- ],
- },
- "Runtime": "nodejs16.x",
- "Timeout": 300,
- },
- "Type": "AWS::Lambda::Function",
- },
- "OAuthCustomResourceInputs": {
- "DeletionPolicy": "Delete",
- "DependsOn": [
- "OAuthCustomResourceLogPolicy",
- ],
- "Properties": {
- "ServiceToken": {
- "Fn::GetAtt": [
- "OAuthCustomResource",
- "Arn",
- ],
- },
- "hostedUIProviderMeta": {
- "Ref": "hostedUIProviderMeta",
- },
- "nativeClientId": {
- "Ref": "UserPoolClient",
- },
- "oAuthMetadata": {
- "Ref": "oAuthMetadata",
- },
- "userPoolId": {
- "Ref": "UserPool",
- },
- "webClientId": {
- "Ref": "UserPoolClientWeb",
- },
- },
- "Type": "Custom::LambdaCallout",
- "UpdateReplacePolicy": "Delete",
- },
- "OAuthCustomResourceLogPolicy": {
- "DependsOn": [
- "OAuthCustomResourcePolicy",
- ],
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "logs:CreateLogGroup",
- "logs:CreateLogStream",
- "logs:PutLogEvents",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Sub": [
- "arn:aws:logs:\${region}:\${account}:log-group:/aws/lambda/\${lambda}:log-stream:*",
- {
- "account": {
- "Ref": "AWS::AccountId",
- },
- "lambda": {
- "Ref": "OAuthCustomResource",
- },
- "region": {
- "Ref": "AWS::Region",
- },
- },
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": {
- "Fn::Join": [
- "-",
- [
- {
- "Ref": "UserPool",
- },
- "OAuthLogPolicy",
- ],
- ],
- },
- "Roles": [
- {
- "Ref": "UserPoolClientRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
- "OAuthCustomResourcePolicy": {
- "DependsOn": [
- "OAuthCustomResource",
- ],
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "cognito-idp:UpdateUserPoolClient",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::GetAtt": [
- "UserPool",
- "Arn",
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": {
- "Fn::Join": [
- "-",
- [
- {
- "Ref": "UserPool",
- },
- "OAuth",
- ],
- ],
- },
- "Roles": [
- {
- "Ref": "UserPoolClientRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
"SNSRole": {
"Properties": {
"AssumeRolePolicyDocument": {
@@ -1987,19 +1663,44 @@ exports.handler = (event, context, callback) => {
},
"UserPoolClient": {
"DependsOn": [
+ "HostedUIProvidersCustomResourceInputs",
"UserPool",
],
"Properties": {
+ "AllowedOAuthFlows": [
+ "code",
+ ],
+ "AllowedOAuthFlowsUserPoolClient": true,
+ "AllowedOAuthScopes": [
+ "phone",
+ "email",
+ "openid",
+ "profile",
+ "aws.cognito.signin.user.admin",
+ ],
+ "CallbackURLs": [
+ "https://localhost:3000/",
+ ],
"ClientName": "extaut87063394_app_client",
"GenerateSecret": {
"Ref": "userpoolClientGenerateSecret",
},
+ "LogoutURLs": [
+ "https://localhost:3000/",
+ ],
"ReadAttributes": {
"Ref": "userpoolClientReadAttributes",
},
"RefreshTokenValidity": {
"Ref": "userpoolClientRefreshTokenValidity",
},
+ "SupportedIdentityProviders": [
+ "Facebook",
+ "Google",
+ "LoginWithAmazon",
+ "SignInWithApple",
+ "COGNITO",
+ ],
"TokenValidityUnits": {
"RefreshToken": "days",
},
@@ -2012,149 +1713,7 @@ exports.handler = (event, context, callback) => {
},
"Type": "AWS::Cognito::UserPoolClient",
},
- "UserPoolClientInputs": {
- "DeletionPolicy": "Delete",
- "DependsOn": [
- "UserPoolClientLogPolicy",
- ],
- "Properties": {
- "ServiceToken": {
- "Fn::GetAtt": [
- "UserPoolClientLambda",
- "Arn",
- ],
- },
- "clientId": {
- "Ref": "UserPoolClient",
- },
- "userpoolId": {
- "Ref": "UserPool",
- },
- },
- "Type": "Custom::LambdaCallout",
- "UpdateReplacePolicy": "Delete",
- },
- "UserPoolClientLambda": {
- "DependsOn": [
- "UserPoolClientRole",
- ],
- "Properties": {
- "Code": {
- "ZipFile": "const response = require('cfn-response');
-const aws = require('aws-sdk');
-const identity = new aws.CognitoIdentityServiceProvider();
-exports.handler = (event, context, callback) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, {});
- }
- if (event.RequestType == 'Update' || event.RequestType == 'Create') {
- const params = {
- ClientId: event.ResourceProperties.clientId,
- UserPoolId: event.ResourceProperties.userpoolId,
- };
- identity
- .describeUserPoolClient(params)
- .promise()
- .then((res) => {
- response.send(event, context, response.SUCCESS, { appSecret: res.UserPoolClient.ClientSecret });
- })
- .catch((err) => {
- response.send(event, context, response.FAILED, { err });
- });
- }
-};
-",
- },
- "Handler": "index.handler",
- "Role": {
- "Fn::GetAtt": [
- "UserPoolClientRole",
- "Arn",
- ],
- },
- "Runtime": "nodejs16.x",
- "Timeout": 300,
- },
- "Type": "AWS::Lambda::Function",
- },
- "UserPoolClientLambdaPolicy": {
- "DependsOn": [
- "UserPoolClientLambda",
- ],
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "cognito-idp:DescribeUserPoolClient",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::GetAtt": [
- "UserPool",
- "Arn",
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "extaut87063394_userpoolclient_lambda_iam_policy",
- "Roles": [
- {
- "Ref": "UserPoolClientRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
- "UserPoolClientLogPolicy": {
- "DependsOn": [
- "UserPoolClientLambdaPolicy",
- ],
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "logs:CreateLogGroup",
- "logs:CreateLogStream",
- "logs:PutLogEvents",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Sub": [
- "arn:aws:logs:\${region}:\${account}:log-group:/aws/lambda/\${lambda}:log-stream:*",
- {
- "account": {
- "Ref": "AWS::AccountId",
- },
- "lambda": {
- "Ref": "UserPoolClientLambda",
- },
- "region": {
- "Ref": "AWS::Region",
- },
- },
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "extaut87063394_userpoolclient_lambda_log_policy",
- "Roles": [
- {
- "Ref": "UserPoolClientRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
"UserPoolClientRole": {
- "DependsOn": [
- "UserPoolClient",
- ],
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
@@ -2206,16 +1765,41 @@ exports.handler = (event, context, callback) => {
},
"UserPoolClientWeb": {
"DependsOn": [
+ "HostedUIProvidersCustomResourceInputs",
"UserPool",
],
"Properties": {
+ "AllowedOAuthFlows": [
+ "code",
+ ],
+ "AllowedOAuthFlowsUserPoolClient": true,
+ "AllowedOAuthScopes": [
+ "phone",
+ "email",
+ "openid",
+ "profile",
+ "aws.cognito.signin.user.admin",
+ ],
+ "CallbackURLs": [
+ "https://localhost:3000/",
+ ],
"ClientName": "extaut87063394_app_clientWeb",
+ "LogoutURLs": [
+ "https://localhost:3000/",
+ ],
"ReadAttributes": {
"Ref": "userpoolClientReadAttributes",
},
"RefreshTokenValidity": {
"Ref": "userpoolClientRefreshTokenValidity",
},
+ "SupportedIdentityProviders": [
+ "Facebook",
+ "Google",
+ "LoginWithAmazon",
+ "SignInWithApple",
+ "COGNITO",
+ ],
"TokenValidityUnits": {
"RefreshToken": "days",
},
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/user-pool-group-stack-transform.test.ts.snap b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/user-pool-group-stack-transform.test.ts.snap
index f5c4e38ee7d..ad73361a47a 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/user-pool-group-stack-transform.test.ts.snap
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/user-pool-group-stack-transform.test.ts.snap
@@ -52,213 +52,6 @@ exports[`Check UserPool Group Template Generated userpool group stack template d
},
},
"Resources": {
- "LambdaCloudWatchPolicy": {
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "logs:CreateLogGroup",
- "logs:CreateLogStream",
- "logs:PutLogEvents",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Sub": [
- "arn:aws:logs:\${AWS::Region}:\${AWS::AccountId}:log-group:/aws/lambda/\${lambdaName}:log-stream:*",
- {
- "lambdaName": {
- "Ref": "RoleMapFunction",
- },
- },
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "UserGroupLogPolicy",
- "Roles": [
- {
- "Ref": "LambdaExecutionRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
- "LambdaExecutionRole": {
- "Properties": {
- "AssumeRolePolicyDocument": {
- "Statement": [
- {
- "Action": [
- "sts:AssumeRole",
- ],
- "Effect": "Allow",
- "Principal": {
- "Service": [
- "lambda.amazonaws.com",
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "Policies": [
- {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "cognito-identity:SetIdentityPoolRoles",
- "cognito-identity:ListIdentityPools",
- "cognito-identity:describeIdentityPool",
- ],
- "Effect": "Allow",
- "Resource": "*",
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "UserGroupExecutionPolicy",
- },
- {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "iam:PassRole",
- ],
- "Effect": "Allow",
- "Resource": [
- {
- "Ref": "AuthRoleArn",
- },
- {
- "Ref": "UnauthRoleArn",
- },
- ],
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "UserGroupPassRolePolicy",
- },
- ],
- "RoleName": {
- "Fn::If": [
- "ShouldNotCreateEnvResources",
- "mockResource",
- {
- "Fn::Join": [
- "",
- [
- "mockResource-ExecutionRole-",
- {
- "Ref": "env",
- },
- ],
- ],
- },
- ],
- },
- },
- "Type": "AWS::IAM::Role",
- },
- "RoleMapFunction": {
- "Properties": {
- "Code": {
- "ZipFile": "const response = require('cfn-response');
-const AWS = require('aws-sdk');
-exports.handler = (event, context) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, { message: 'Request type delete' });
- }
- if (event.RequestType == 'Create' || event.RequestType == 'Update') {
- let { identityPoolId, appClientID, appClientIDWeb, userPoolId, region } = event.ResourceProperties;
- try {
- const cognitoidentity = new AWS.CognitoIdentity();
- let params = {
- IdentityPoolId: identityPoolId,
- Roles: {
- authenticated: event.ResourceProperties.AuthRoleArn,
- unauthenticated: event.ResourceProperties.UnauthRoleArn,
- },
- RoleMappings: {},
- };
- if (appClientIDWeb) {
- params.RoleMappings[\`cognito-idp.\${region}.amazonaws.com/\${userPoolId}:\${appClientIDWeb}\`] = {
- Type: 'Token',
- AmbiguousRoleResolution: 'AuthenticatedRole',
- };
- }
- if (appClientID) {
- params.RoleMappings[\`cognito-idp.\${region}.amazonaws.com/\${userPoolId}:\${appClientID}\`] = {
- Type: 'Token',
- AmbiguousRoleResolution: 'AuthenticatedRole',
- };
- }
- cognitoidentity.setIdentityPoolRoles(params).promise();
- response.send(event, context, response.SUCCESS, { message: 'Successfully updated identity pool.' });
- } catch (err) {
- response.send(event, context, response.FAILED, { message: 'Error updating identity pool' });
- }
- }
-};
-",
- },
- "Handler": "index.handler",
- "Role": {
- "Fn::GetAtt": [
- "LambdaExecutionRole",
- "Arn",
- ],
- },
- "Runtime": "nodejs16.x",
- "Timeout": 300,
- },
- "Type": "AWS::Lambda::Function",
- },
- "RoleMapFunctionInput": {
- "DeletionPolicy": "Delete",
- "DependsOn": [
- "RoleMapFunction",
- ],
- "Properties": {
- "AuthRoleArn": {
- "Ref": "AuthRoleArn",
- },
- "ServiceToken": {
- "Fn::GetAtt": [
- "RoleMapFunction",
- "Arn",
- ],
- },
- "UnauthRoleArn": {
- "Ref": "UnauthRoleArn",
- },
- "appClientID": {
- "Ref": "authmockResourceAppClientID",
- },
- "appClientIDWeb": {
- "Ref": "authmockResourceAppClientIDWeb",
- },
- "env": {
- "Ref": "env",
- },
- "identityPoolId": {
- "Ref": "authmockResourceIdentityPoolId",
- },
- "region": {
- "Ref": "AWS::Region",
- },
- "userPoolId": {
- "Ref": "authmockResourceUserPoolId",
- },
- },
- "Type": "Custom::LambdaCallout",
- "UpdateReplacePolicy": "Delete",
- },
"adminGroup": {
"Properties": {
"Description": "override success",
@@ -371,213 +164,6 @@ exports[`Check UserPool Group Template Generated userpool group stack template d
},
},
"Resources": {
- "LambdaCloudWatchPolicy": {
- "Properties": {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "logs:CreateLogGroup",
- "logs:CreateLogStream",
- "logs:PutLogEvents",
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Sub": [
- "arn:aws:logs:\${AWS::Region}:\${AWS::AccountId}:log-group:/aws/lambda/\${lambdaName}:log-stream:*",
- {
- "lambdaName": {
- "Ref": "RoleMapFunction",
- },
- },
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "UserGroupLogPolicy",
- "Roles": [
- {
- "Ref": "LambdaExecutionRole",
- },
- ],
- },
- "Type": "AWS::IAM::Policy",
- },
- "LambdaExecutionRole": {
- "Properties": {
- "AssumeRolePolicyDocument": {
- "Statement": [
- {
- "Action": [
- "sts:AssumeRole",
- ],
- "Effect": "Allow",
- "Principal": {
- "Service": [
- "lambda.amazonaws.com",
- ],
- },
- },
- ],
- "Version": "2012-10-17",
- },
- "Policies": [
- {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "cognito-identity:SetIdentityPoolRoles",
- "cognito-identity:ListIdentityPools",
- "cognito-identity:describeIdentityPool",
- ],
- "Effect": "Allow",
- "Resource": "*",
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "UserGroupExecutionPolicy",
- },
- {
- "PolicyDocument": {
- "Statement": [
- {
- "Action": [
- "iam:PassRole",
- ],
- "Effect": "Allow",
- "Resource": [
- {
- "Ref": "AuthRoleArn",
- },
- {
- "Ref": "UnauthRoleArn",
- },
- ],
- },
- ],
- "Version": "2012-10-17",
- },
- "PolicyName": "UserGroupPassRolePolicy",
- },
- ],
- "RoleName": {
- "Fn::If": [
- "ShouldNotCreateEnvResources",
- "mockResource",
- {
- "Fn::Join": [
- "",
- [
- "mockResource-ExecutionRole-",
- {
- "Ref": "env",
- },
- ],
- ],
- },
- ],
- },
- },
- "Type": "AWS::IAM::Role",
- },
- "RoleMapFunction": {
- "Properties": {
- "Code": {
- "ZipFile": "const response = require('cfn-response');
-const AWS = require('aws-sdk');
-exports.handler = (event, context) => {
- if (event.RequestType == 'Delete') {
- response.send(event, context, response.SUCCESS, { message: 'Request type delete' });
- }
- if (event.RequestType == 'Create' || event.RequestType == 'Update') {
- let { identityPoolId, appClientID, appClientIDWeb, userPoolId, region } = event.ResourceProperties;
- try {
- const cognitoidentity = new AWS.CognitoIdentity();
- let params = {
- IdentityPoolId: identityPoolId,
- Roles: {
- authenticated: event.ResourceProperties.AuthRoleArn,
- unauthenticated: event.ResourceProperties.UnauthRoleArn,
- },
- RoleMappings: {},
- };
- if (appClientIDWeb) {
- params.RoleMappings[\`cognito-idp.\${region}.amazonaws.com/\${userPoolId}:\${appClientIDWeb}\`] = {
- Type: 'Token',
- AmbiguousRoleResolution: 'AuthenticatedRole',
- };
- }
- if (appClientID) {
- params.RoleMappings[\`cognito-idp.\${region}.amazonaws.com/\${userPoolId}:\${appClientID}\`] = {
- Type: 'Token',
- AmbiguousRoleResolution: 'AuthenticatedRole',
- };
- }
- cognitoidentity.setIdentityPoolRoles(params).promise();
- response.send(event, context, response.SUCCESS, { message: 'Successfully updated identity pool.' });
- } catch (err) {
- response.send(event, context, response.FAILED, { message: 'Error updating identity pool' });
- }
- }
-};
-",
- },
- "Handler": "index.handler",
- "Role": {
- "Fn::GetAtt": [
- "LambdaExecutionRole",
- "Arn",
- ],
- },
- "Runtime": "nodejs16.x",
- "Timeout": 300,
- },
- "Type": "AWS::Lambda::Function",
- },
- "RoleMapFunctionInput": {
- "DeletionPolicy": "Delete",
- "DependsOn": [
- "RoleMapFunction",
- ],
- "Properties": {
- "AuthRoleArn": {
- "Ref": "AuthRoleArn",
- },
- "ServiceToken": {
- "Fn::GetAtt": [
- "RoleMapFunction",
- "Arn",
- ],
- },
- "UnauthRoleArn": {
- "Ref": "UnauthRoleArn",
- },
- "appClientID": {
- "Ref": "authmockResourceAppClientID",
- },
- "appClientIDWeb": {
- "Ref": "authmockResourceAppClientIDWeb",
- },
- "env": {
- "Ref": "env",
- },
- "identityPoolId": {
- "Ref": "authmockResourceIdentityPoolId",
- },
- "region": {
- "Ref": "AWS::Region",
- },
- "userPoolId": {
- "Ref": "authmockResourceUserPoolId",
- },
- },
- "Type": "Custom::LambdaCallout",
- "UpdateReplacePolicy": "Delete",
- },
"adminMockGroup": {
"Properties": {
"Description": "override success",
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.test.ts
index 87d042f8fd8..16d335d64f8 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.test.ts
@@ -1,5 +1,4 @@
import * as cdk from 'aws-cdk-lib';
-import * as iam from 'aws-cdk-lib/aws-iam';
import { AmplifyAuthCognitoStack } from '../../../../provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder';
import { AuthStackSynthesizer } from '../../../../provider-utils/awscloudformation/auth-stack-builder/stack-synthesizer';
import {
@@ -71,46 +70,24 @@ describe('generateCognitoStackResources', () => {
authProviders: [],
};
- it('adds correct custom oauth lambda dependencies', () => {
- const testApp = new cdk.App();
- const cognitoStack = new AmplifyAuthCognitoStack(testApp, 'testCognitoStack', { synthesizer: new AuthStackSynthesizer() });
- cognitoStack.userPoolClientRole = new iam.CfnRole(cognitoStack, 'testRole', {
- assumeRolePolicyDocument: 'test policy document',
- });
- cognitoStack.createHostedUICustomResource();
- cognitoStack.createHostedUIProviderCustomResource();
- cognitoStack.createOAuthCustomResource();
- expect(cognitoStack.oAuthCustomResource).toBeDefined();
- expect(
- cognitoStack
- .oAuthCustomResource!.node!.dependencies!.map((dep: any) => dep.logicalId)
- .map((logicalIdToken) => /testCognitoStack\.([^.]+)\.Default/.exec(logicalIdToken)![1]),
- ).toMatchInlineSnapshot(`
-[
- "HostedUICustomResourceInputs",
- "HostedUIProvidersCustomResourceInputs",
-]
-`);
- });
-
- it('adds correct preSignUp lambda config and permissions', () => {
+ it('adds correct preSignUp lambda config and permissions', async () => {
const testApp = new cdk.App();
const cognitoStack = new AmplifyAuthCognitoStack(testApp, 'CognitoPreSignUpTriggerTest', { synthesizer: new AuthStackSynthesizer() });
- cognitoStack.generateCognitoStackResources(props);
+ await cognitoStack.generateCognitoStackResources(props);
expect(cognitoStack.userPool?.lambdaConfig).toHaveProperty('preSignUp');
expect(cognitoStack.lambdaConfigPermissions).toHaveProperty('UserPoolPreSignupLambdaInvokePermission');
});
- it('disables updateAttributeSetting when autoVerified attributes not present', () => {
+ it('disables updateAttributeSetting when autoVerified attributes not present', async () => {
const testApp = new cdk.App();
const cognitoStack = new AmplifyAuthCognitoStack(testApp, 'CognitoPreSignUpTriggerTest', { synthesizer: new AuthStackSynthesizer() });
const updatedProps = { ...props };
delete updatedProps.autoVerifiedAttributes;
- cognitoStack.generateCognitoStackResources(updatedProps);
+ await cognitoStack.generateCognitoStackResources(updatedProps);
expect(cognitoStack.userPool?.userAttributeUpdateSettings).toBeUndefined();
});
- it('correctly adds updateAttributeSetting when autoVerifiedAttributes attributes is TOTP', () => {
+ it('correctly adds updateAttributeSetting when autoVerifiedAttributes attributes is TOTP', async () => {
const testApp = new cdk.App();
// eslint-disable-next-line spellcheck/spell-checker
const cognitoStack = new AmplifyAuthCognitoStack(testApp, 'CognitoUpdateAttributesettingTest', {
@@ -120,7 +97,7 @@ describe('generateCognitoStackResources', () => {
...props,
userAutoVerifiedAttributeUpdateSettings: [AttributeType.PHONE_NUMBER],
};
- cognitoStack.generateCognitoStackResources(updatedProps);
+ await cognitoStack.generateCognitoStackResources(updatedProps);
expect(cognitoStack.userPool?.userAttributeUpdateSettings).toMatchInlineSnapshot(`
{
"attributesRequireVerificationBeforeUpdate": [
@@ -130,7 +107,7 @@ describe('generateCognitoStackResources', () => {
`);
});
- it('correctly adds updateAttributeSetting when autoVerifiedAttributes attributes is email', () => {
+ it('correctly adds updateAttributeSetting when autoVerifiedAttributes attributes is email', async () => {
const testApp = new cdk.App();
// eslint-disable-next-line spellcheck/spell-checker
const cognitoStack = new AmplifyAuthCognitoStack(testApp, 'CognitoUpdateAttributesettingTesting1', {
@@ -140,7 +117,7 @@ describe('generateCognitoStackResources', () => {
...props,
userAutoVerifiedAttributeUpdateSettings: [AttributeType.EMAIL],
};
- cognitoStack.generateCognitoStackResources(updatedProps);
+ await cognitoStack.generateCognitoStackResources(updatedProps);
expect(cognitoStack.userPool?.userAttributeUpdateSettings).toMatchInlineSnapshot(`
{
"attributesRequireVerificationBeforeUpdate": [
@@ -153,4 +130,27 @@ describe('generateCognitoStackResources', () => {
expect(cognitoStack.userPoolClient!.tokenValidityUnits).toHaveProperty('refreshToken');
expect(cognitoStack.lambdaConfigPermissions).toHaveProperty('UserPoolPreSignupLambdaInvokePermission');
});
+
+ it('correctly adds oauth properties on userpool client when oauthMetaData is defined', async () => {
+ const testApp = new cdk.App();
+ // eslint-disable-next-line spellcheck/spell-checker
+ const cognitoStack = new AmplifyAuthCognitoStack(testApp, 'CognitoUpdateAttributesettingTesting1', {
+ synthesizer: new AuthStackSynthesizer(),
+ });
+ const updatedProps: CognitoStackOptions = {
+ ...props,
+ oAuthMetadata:
+ '{"AllowedOAuthFlows":["code"],"AllowedOAuthScopes":["phone","email","openid","profile","aws.cognito.signin.user.admin"],"CallbackURLs":["https://localhost:3000/"]}',
+ };
+ await cognitoStack.generateCognitoStackResources(updatedProps);
+ expect(cognitoStack.userPoolClientWeb).toHaveProperty('allowedOAuthFlows');
+ expect(cognitoStack.userPoolClientWeb).toHaveProperty('allowedOAuthScopes');
+ expect(cognitoStack.userPoolClientWeb).toHaveProperty('callbackUrLs');
+ expect(cognitoStack.userPoolClientWeb).toHaveProperty('logoutUrLs');
+
+ expect(cognitoStack.userPoolClient).toHaveProperty('allowedOAuthFlows');
+ expect(cognitoStack.userPoolClient).toHaveProperty('allowedOAuthScopes');
+ expect(cognitoStack.userPoolClient).toHaveProperty('callbackUrLs');
+ expect(cognitoStack.userPoolClient).toHaveProperty('logoutUrLs');
+ });
});
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.test.ts
index 3024fca9a95..f9f409e2b83 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.test.ts
@@ -273,4 +273,60 @@ describe('Check Auth Template', () => {
);
expect(process.exit).toBeCalledTimes(1);
});
+
+ it('should include oauth settings in cfn when enabled oauth', async () => {
+ getCLIInputPayload_mock.mockReset();
+ getCLIInputPayload_mock.mockReturnValue({
+ cognitoConfig: {
+ ...inputPayload1.cognitoConfig,
+ oAuthMetadata:
+ '{"AllowedOAuthFlows":["code"],"AllowedOAuthScopes":["phone","email","openid","profile","aws.cognito.signin.user.admin"],"CallbackURLs":["https://localhost:3000/"]}',
+ },
+ });
+
+ const resourceName = 'mockResource';
+ const authTransform = new AmplifyAuthTransform(resourceName);
+ const mock_template = await authTransform.transform(context_stub_typed);
+ expect(mock_template.Resources?.UserPoolClient.Properties.AllowedOAuthFlows).toMatchInlineSnapshot(`
+ [
+ "code",
+ ]
+ `);
+ expect(mock_template.Resources?.UserPoolClient.Properties.AllowedOAuthScopes).toMatchInlineSnapshot(`
+ [
+ "phone",
+ "email",
+ "openid",
+ "profile",
+ "aws.cognito.signin.user.admin",
+ ]
+ `);
+ expect(mock_template.Resources?.UserPoolClient.Properties.CallbackURLs).toMatchInlineSnapshot(`
+ [
+ "https://localhost:3000/",
+ ]
+ `);
+ expect(mock_template.Resources?.UserPoolClient.Properties.LogoutURLs).toMatchInlineSnapshot(`undefined`);
+
+ expect(mock_template.Resources?.UserPoolClientWeb.Properties.AllowedOAuthFlows).toMatchInlineSnapshot(`
+ [
+ "code",
+ ]
+ `);
+ expect(mock_template.Resources?.UserPoolClientWeb.Properties.AllowedOAuthScopes).toMatchInlineSnapshot(`
+ [
+ "phone",
+ "email",
+ "openid",
+ "profile",
+ "aws.cognito.signin.user.admin",
+ ]
+ `);
+ expect(mock_template.Resources?.UserPoolClientWeb.Properties.CallbackURLs).toMatchInlineSnapshot(`
+ [
+ "https://localhost:3000/",
+ ]
+ `);
+ expect(mock_template.Resources?.UserPoolClientWeb.Properties.LogoutURLs).toMatchInlineSnapshot(`undefined`);
+ });
});
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/index.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/index.test.ts
index 8138ad126ab..9913becafa5 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/index.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/index.test.ts
@@ -29,7 +29,7 @@ const pluginInstance = {
const getOAuthObjectFromCognitoMock = getOAuthObjectFromCognito as jest.MockedFunction;
// mock context
-let mockContext = {
+const mockContext = {
amplify: {
getProjectConfig: jest.fn().mockReturnValue({
projectName: 'authHeadless',
@@ -67,7 +67,7 @@ let mockContext = {
describe('import checks', () => {
test('throws amplify error when auth headless params are missing during pull', async () => {
- expect(() => updateConfigOnEnvInit(mockContext, 'auth', 'Cognito')).rejects.toThrowErrorMatchingInlineSnapshot(
+ await expect(() => updateConfigOnEnvInit(mockContext, 'auth', 'Cognito')).rejects.toThrowErrorMatchingInlineSnapshot(
`"auth headless is missing the following inputParameters facebookAppIdUserPool, facebookAppSecretUserPool, loginwithamazonAppIdUserPool, loginwithamazonAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool"`,
);
});
@@ -77,7 +77,7 @@ describe('update config when amplify pull headless command', () => {
test('throws amplify error when auth headless params are missing during pull', async () => {
mockContext.input.command = 'pull';
getOAuthObjectFromCognitoMock.mockResolvedValue(undefined);
- expect(() => updateConfigOnEnvInit(mockContext, 'auth', 'Cognito')).rejects.toThrowErrorMatchingInlineSnapshot(
+ await expect(() => updateConfigOnEnvInit(mockContext, 'auth', 'Cognito')).rejects.toThrowErrorMatchingInlineSnapshot(
`"auth headless is missing the following inputParameters facebookAppIdUserPool, facebookAppSecretUserPool, loginwithamazonAppIdUserPool, loginwithamazonAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool"`,
);
});
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/__snapshots__/generate-auth-trigger-template.test.ts.snap b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/__snapshots__/generate-auth-trigger-template.test.ts.snap
index f6af9816029..9927083f0ae 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/__snapshots__/generate-auth-trigger-template.test.ts.snap
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/__snapshots__/generate-auth-trigger-template.test.ts.snap
@@ -115,78 +115,78 @@ exports[`generateNestedAuthTriggerTemplate adds "authTriggerFn" as a dependency
"Properties": {
"Code": {
"ZipFile": "const response = require('cfn-response');
-const aws = require('aws-sdk');
+const {
+ CognitoIdentityProviderClient,
+ DescribeUserPoolCommand,
+ UpdateUserPoolCommand,
+} = require('@aws-sdk/client-cognito-identity-provider');
-exports.handler = async function (event, context) {
+exports.handler = (event, context) => {
+ // Don't return promise, response.send() marks context as done internally
+ void tryHandleEvent(event, context);
+};
+
+async function tryHandleEvent(event, context) {
const physicalResourceId =
event.RequestType === 'Update' ? event.PhysicalResourceId : \`\${event.LogicalResourceId}-\${event.ResourceProperties.userpoolId}\`;
-
try {
- const userPoolId = event.ResourceProperties.userpoolId;
- const { lambdaConfig } = event.ResourceProperties;
- const config = {};
- const cognitoClient = new aws.CognitoIdentityServiceProvider();
- const userPoolConfig = await cognitoClient.describeUserPool({ UserPoolId: userPoolId }).promise();
- const userPoolParams = userPoolConfig.UserPool;
- // update userPool params
+ await handleEvent(event);
+ response.send(event, context, response.SUCCESS, {}, physicalResourceId);
+ } catch (err) {
+ console.log(err.stack);
+ response.send(event, context, response.FAILED, { err }, physicalResourceId);
+ }
+}
- const updateUserPoolConfig = {
- UserPoolId: userPoolParams.Id,
- Policies: userPoolParams.Policies,
- SmsVerificationMessage: userPoolParams.SmsVerificationMessage,
- AccountRecoverySetting: userPoolParams.AccountRecoverySetting,
- AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,
- AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,
- EmailConfiguration: userPoolParams.EmailConfiguration,
- EmailVerificationMessage: userPoolParams.EmailVerificationMessage,
- EmailVerificationSubject: userPoolParams.EmailVerificationSubject,
- VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,
- SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,
- MfaConfiguration: userPoolParams.MfaConfiguration,
- DeviceConfiguration: userPoolParams.DeviceConfiguration,
- SmsConfiguration: userPoolParams.SmsConfiguration,
- UserPoolTags: userPoolParams.UserPoolTags,
- UserPoolAddOns: userPoolParams.UserPoolAddOns,
- };
+async function handleEvent(event) {
+ const userPoolId = event.ResourceProperties.userpoolId;
+ const { lambdaConfig } = event.ResourceProperties;
+ const config = {};
+ const cognitoClient = new CognitoIdentityProviderClient({});
+ const userPoolConfig = await cognitoClient.send(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));
+ const userPoolParams = userPoolConfig.UserPool;
+ // update userPool params
- // removing undefined keys
- Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);
+ const updateUserPoolConfig = {
+ UserPoolId: userPoolParams.Id,
+ Policies: userPoolParams.Policies,
+ SmsVerificationMessage: userPoolParams.SmsVerificationMessage,
+ AccountRecoverySetting: userPoolParams.AccountRecoverySetting,
+ AdminCreateUserConfig: userPoolParams.AdminCreateUserConfig,
+ AutoVerifiedAttributes: userPoolParams.AutoVerifiedAttributes,
+ EmailConfiguration: userPoolParams.EmailConfiguration,
+ EmailVerificationMessage: userPoolParams.EmailVerificationMessage,
+ EmailVerificationSubject: userPoolParams.EmailVerificationSubject,
+ VerificationMessageTemplate: userPoolParams.VerificationMessageTemplate,
+ SmsAuthenticationMessage: userPoolParams.SmsAuthenticationMessage,
+ MfaConfiguration: userPoolParams.MfaConfiguration,
+ DeviceConfiguration: userPoolParams.DeviceConfiguration,
+ SmsConfiguration: userPoolParams.SmsConfiguration,
+ UserPoolTags: userPoolParams.UserPoolTags,
+ UserPoolAddOns: userPoolParams.UserPoolAddOns,
+ };
- /* removing UnusedAccountValidityDays as deprecated
+ // removing undefined keys
+ Object.keys(updateUserPoolConfig).forEach((key) => updateUserPoolConfig[key] === undefined && delete updateUserPoolConfig[key]);
+
+ /* removing UnusedAccountValidityDays as deprecated
InvalidParameterException: Please use TemporaryPasswordValidityDays in PasswordPolicy instead of UnusedAccountValidityDays
*/
- if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {
- delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;
- }
- lambdaConfig.forEach((lambda) => (config[\`\${lambda.triggerType}\`] = lambda.lambdaFunctionArn));
- if (event.RequestType === 'Delete') {
- try {
- updateUserPoolConfig.LambdaConfig = {};
- console.log(\`\${event.RequestType}:\`, JSON.stringify(updateUserPoolConfig));
- const result = await cognitoClient.updateUserPool(updateUserPoolConfig).promise();
- console.log(\`delete response data \${JSON.stringify(result)}\`);
- await response.send(event, context, response.SUCCESS, {}, physicalResourceId);
- } catch (err) {
- console.log(err.stack);
- await response.send(event, context, response.FAILED, { err }, physicalResourceId);
- }
- }
- if (event.RequestType === 'Update' || event.RequestType === 'Create') {
- updateUserPoolConfig.LambdaConfig = config;
- try {
- const result = await cognitoClient.updateUserPool(updateUserPoolConfig).promise();
- console.log(\`createOrUpdate response data \${JSON.stringify(result)}\`);
- await response.send(event, context, response.SUCCESS, {}, physicalResourceId);
- } catch (err) {
- console.log(err.stack);
- await response.send(event, context, response.FAILED, { err }, physicalResourceId);
- }
- }
- } catch (err) {
- console.log(err.stack);
- await response.send(event, context, response.FAILED, { err }, physicalResourceId);
+ if (updateUserPoolConfig.AdminCreateUserConfig && updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays) {
+ delete updateUserPoolConfig.AdminCreateUserConfig.UnusedAccountValidityDays;
}
-};
+ lambdaConfig.forEach((lambda) => (config[\`\${lambda.triggerType}\`] = lambda.lambdaFunctionArn));
+ if (event.RequestType === 'Delete') {
+ updateUserPoolConfig.LambdaConfig = {};
+ console.log(\`\${event.RequestType}:\`, JSON.stringify(updateUserPoolConfig));
+ const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));
+ console.log(\`delete response data \${JSON.stringify(result)}\`);
+ } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {
+ updateUserPoolConfig.LambdaConfig = config;
+ const result = await cognitoClient.send(new UpdateUserPoolCommand(updateUserPoolConfig));
+ console.log(\`createOrUpdate response data \${JSON.stringify(result)}\`);
+ }
+}
",
},
"Handler": "index.handler",
@@ -196,7 +196,7 @@ exports.handler = async function (event, context) {
"Arn",
],
},
- "Runtime": "nodejs16.x",
+ "Runtime": "nodejs18.x",
},
"Type": "AWS::Lambda::Function",
},
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/auth-defaults-appliers.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/auth-defaults-appliers.test.ts
index 23f79608c13..9cdb37f50d7 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/auth-defaults-appliers.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/auth-defaults-appliers.test.ts
@@ -23,10 +23,8 @@ jest.mock('@aws-amplify/amplify-cli-core', () => {
return {
...(jest.requireActual('@aws-amplify/amplify-cli-core') as {}),
FeatureFlags: {
- getBoolean: jest.fn().mockImplementation((name, defaultValue) => {
- if (name === 'auth.enableCaseInsensitivity') {
- return true;
- }
+ getBoolean: jest.fn().mockImplementation((name) => {
+ return name === 'auth.enableCaseInsensitivity';
}),
getNumber: jest.fn(),
getObject: jest.fn(),
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/check-for-auth-migration.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/check-for-auth-migration.test.ts
index 71a9d7426ce..9735a47fb25 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/check-for-auth-migration.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/check-for-auth-migration.test.ts
@@ -1,6 +1,6 @@
import { migrateResourceToSupportOverride } from '../../../../provider-utils/awscloudformation/utils/migrate-override-resource';
import { generateAuthStackTemplate } from '../../../../provider-utils/awscloudformation/utils/generate-auth-stack-template';
-import { $TSContext, generateOverrideSkeleton } from '@aws-amplify/amplify-cli-core';
+import { $TSContext } from '@aws-amplify/amplify-cli-core';
import { AuthInputState } from '../../../../provider-utils/awscloudformation/auth-inputs-manager/auth-input-state';
import { checkAuthResourceMigration } from '../../../../provider-utils/awscloudformation/utils/check-for-auth-migration';
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-auth-trigger-template.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-auth-trigger-template.test.ts
index 1f7b4cf98c0..850164cd7b1 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-auth-trigger-template.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-auth-trigger-template.test.ts
@@ -1,10 +1,11 @@
+import { getPermissionsBoundaryArn } from '@aws-amplify/amplify-cli-core';
import {
AuthTriggerConnection,
AuthTriggerPermissions,
TriggerType,
} from '../../../../provider-utils/awscloudformation/service-walkthrough-types/cognito-user-input-types';
import { createCustomResourceForAuthTrigger } from '../../../../provider-utils/awscloudformation/utils/generate-auth-trigger-template';
-
+jest.mock('@aws-amplify/amplify-cli-core');
jest.mock('uuid');
describe('generate Auth Trigger Template', () => {
it('successfully generate IAM policies when permissions are defined', async () => {
@@ -78,6 +79,44 @@ describe('generate Auth Trigger Template', () => {
"Type": "AWS::IAM::Policy",
}
`);
+ // No permissions boundary set if not available
+ expect(cfn.Resources.authTriggerFnServiceRole08093B67.Properties.PermissionsBoundary).toBeUndefined();
+ });
+
+ it('adds permissions boundary to new role if available', async () => {
+ // Setup for a successfully generating custom resource.
+ const mockAuthTriggerConnections: AuthTriggerConnection[] = [
+ {
+ lambdaFunctionName: 'randomFn',
+ triggerType: TriggerType.PostConfirmation,
+ lambdaFunctionArn: 'randomArn',
+ },
+ ];
+ const mockAuthTriggerPermissions: AuthTriggerPermissions[] = [
+ {
+ policyName: 'AddToGroupCognito',
+ trigger: 'PostConfirmation',
+ effect: 'Allow',
+ actions: ['cognito-idp:AdminAddUserToGroup', 'cognito-idp:GetGroup', 'cognito-idp:CreateGroup'],
+ resource: {
+ paramType: '!GetAtt',
+ keys: ['UserPool', 'Arn'],
+ },
+ },
+ ];
+
+ // ensure permissions boundary is set
+ const getPermissionsBoundaryArn_mock = getPermissionsBoundaryArn as jest.MockedFunction;
+ getPermissionsBoundaryArn_mock.mockReturnValue('testPermissionsBoundaryArn');
+
+ // execute the test
+ const cfn = await createCustomResourceForAuthTrigger(mockAuthTriggerConnections, false, mockAuthTriggerPermissions);
+
+ //validate
+ expect(cfn.Resources.authTriggerFnServiceRole08093B67.Properties.PermissionsBoundary).toStrictEqual('testPermissionsBoundaryArn');
+
+ // Restore for other folks
+ getPermissionsBoundaryArn_mock.mockRestore();
});
it('does not generate iam policies for Auth trigger when permissions are empty', async () => {
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-cognito-app-client-secret.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-cognito-app-client-secret.test.ts
new file mode 100644
index 00000000000..04e26beac5c
--- /dev/null
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/generate-cognito-app-client-secret.test.ts
@@ -0,0 +1,108 @@
+import { $TSContext, stateManager, pathManager } from '@aws-amplify/amplify-cli-core';
+import { updateAppClientWithGeneratedSecret } from '../../../../provider-utils/awscloudformation/utils/generate-cognito-app-client-secret';
+import { projectHasAuth } from '../../../../provider-utils/awscloudformation/utils/project-has-auth';
+import { getAuthResourceName } from '../../../../utils/getAuthResourceName';
+import { getAppClientSecret } from '../../../../provider-utils/awscloudformation/utils/get-app-client-secret-sdk';
+
+jest.mock('@aws-amplify/amplify-cli-core');
+jest.mock('../../../../provider-utils/awscloudformation/utils/project-has-auth');
+jest.mock('../../../../utils/getAuthResourceName');
+jest.mock('../../../../provider-utils/awscloudformation/utils/get-app-client-secret-sdk');
+
+const stateManagerMock = stateManager as jest.Mocked;
+const pathManagerMock = pathManager as jest.Mocked;
+const projectHasAuthMock = projectHasAuth as jest.MockedFunction;
+const getAuthResourceNameMock = getAuthResourceName as jest.MockedFunction;
+const getAppClientSecretMock = getAppClientSecret as jest.MockedFunction;
+
+pathManagerMock.getBackendDirPath.mockReturnValue('mockBackendPath');
+projectHasAuthMock.mockReturnValue(true);
+getAuthResourceNameMock.mockResolvedValue('mockResource');
+const contextStub = {
+ amplify: {
+ getImportedAuthProperties: jest.fn().mockResolvedValue({ imported: false }),
+ updateamplifyMetaAfterResourceUpdate: jest.fn(),
+ },
+};
+describe('test auth trigger stack Parameters', () => {
+ it('test case 1 - appClientSecret doesnt get updated when sdk returns undefined ', async () => {
+ jest.clearAllMocks();
+ stateManagerMock.getMeta.mockReturnValue({
+ auth: {
+ mockResource: {
+ output: {
+ AppClientID: 'mockClientId',
+ UserPoolId: 'mockUserpoolId',
+ },
+ },
+ },
+ });
+ getAppClientSecretMock.mockResolvedValue(undefined);
+ await updateAppClientWithGeneratedSecret(contextStub as unknown as $TSContext);
+ expect(contextStub.amplify.updateamplifyMetaAfterResourceUpdate.mock.calls).toMatchInlineSnapshot(`[]`);
+ });
+
+ it('test case 2 - appClientSecret updates successfully ', async () => {
+ jest.clearAllMocks();
+ stateManagerMock.getMeta.mockReturnValue({
+ auth: {
+ mockResource: {
+ output: {
+ AppClientID: 'mockClientId',
+ UserPoolId: 'mockUserpoolId',
+ AmazonWebClient: 'mockAmazonWebClient',
+ FacebookWebClient: 'mockFacebookWebClient',
+ GoogleWebClient: 'mockGoogleWebClient',
+ AppleWebClient: 'mockAppleWebClient',
+ HostedUIDomain: 'mockHostedUIDomain',
+ OAuthMetadata: 'mockOAuthMetadata',
+ },
+ },
+ },
+ });
+ getAppClientSecretMock.mockResolvedValue('mockAppClientSecret');
+ await updateAppClientWithGeneratedSecret(contextStub as unknown as $TSContext);
+ expect(contextStub.amplify.updateamplifyMetaAfterResourceUpdate.mock.calls).toMatchInlineSnapshot(`
+ [
+ [
+ "auth",
+ "mockResource",
+ "output",
+ {
+ "AmazonWebClient": "mockAmazonWebClient",
+ "AppClientID": "mockClientId",
+ "AppClientSecret": "mockAppClientSecret",
+ "AppleWebClient": "mockAppleWebClient",
+ "FacebookWebClient": "mockFacebookWebClient",
+ "GoogleWebClient": "mockGoogleWebClient",
+ "HostedUIDomain": "mockHostedUIDomain",
+ "OAuthMetadata": "mockOAuthMetadata",
+ "UserPoolId": "mockUserpoolId",
+ },
+ ],
+ ]
+ `);
+ });
+
+ it('test case 3 - throws error when getAppClientSecret call fails ', async () => {
+ jest.clearAllMocks();
+ stateManagerMock.getMeta.mockReturnValue({
+ auth: {
+ mockResource: {
+ output: {
+ AppClientID: 'mockClientId',
+ UserPoolId: 'mockUserpoolId',
+ },
+ },
+ },
+ });
+ getAppClientSecretMock.mockRejectedValue('error fetching app client secret');
+ try {
+ await updateAppClientWithGeneratedSecret(contextStub as unknown as $TSContext);
+ } catch (err) {
+ console.log(err);
+ expect(err).toMatchInlineSnapshot(`"error fetching app client secret"`);
+ expect(contextStub.amplify.updateamplifyMetaAfterResourceUpdate.mock.calls).toMatchInlineSnapshot(`[]`);
+ }
+ });
+});
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/migrate-override-resource.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/migrate-override-resource.test.ts
index 21edda163db..f883f14bc0a 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/migrate-override-resource.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/migrate-override-resource.test.ts
@@ -83,7 +83,7 @@ jest.mock('@aws-amplify/amplify-cli-core', () => ({
}));
test('migrate resource', async () => {
const resourceName = 'mockResource';
- migrateResourceToSupportOverride(resourceName);
+ await migrateResourceToSupportOverride(resourceName);
const expectedPath = path.join('mockProjectPath', 'cli-inputs.json');
const expectedPayload = {
version: '1',
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/synthesize-resources.test.ts b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/synthesize-resources.test.ts
index 89a70486b6c..e58ef9f44fc 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/synthesize-resources.test.ts
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/synthesize-resources.test.ts
@@ -2,7 +2,6 @@ import { $TSAny, $TSContext, AmplifyCategories, JSONUtilities, pathManager } fro
import { UserPoolGroupMetadata } from '../../../../provider-utils/awscloudformation/auth-stack-builder';
import { updateUserPoolGroups } from '../../../../provider-utils/awscloudformation/utils/synthesize-resources';
import { createAdminAuthFunction } from '../../../../provider-utils/awscloudformation/utils/synthesize-resources';
-import * as path from 'path';
jest.mock('@aws-amplify/amplify-cli-core');
jest.mock('fs-extra');
diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/trigger-flow-auth-helper.test.js b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/trigger-flow-auth-helper.test.js
index 677a2a80c0d..451af93b026 100644
--- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/trigger-flow-auth-helper.test.js
+++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/utils/trigger-flow-auth-helper.test.js
@@ -1,9 +1,7 @@
jest.mock('@aws-amplify/amplify-cli-core', () => {
return {
FeatureFlags: {
- getBoolean: jest.fn().mockImplementation((name, defaultValue) => {
- return true;
- }),
+ getBoolean: jest.fn().mockReturnValue(true),
},
};
});
diff --git a/packages/amplify-category-auth/src/commands/auth/remove.ts b/packages/amplify-category-auth/src/commands/auth/remove.ts
index 1eb1db48ff3..a438cafacab 100644
--- a/packages/amplify-category-auth/src/commands/auth/remove.ts
+++ b/packages/amplify-category-auth/src/commands/auth/remove.ts
@@ -27,20 +27,13 @@ export const run = async (context: $TSContext): Promise => {
(resourceKey) => meta.auth[resourceKey].service === AmplifySupportedService.COGNITO,
);
- try {
- const resource = await amplify.removeResource(context, category, resourceName);
- if (resource?.service === AmplifySupportedService.COGNITOUSERPOOLGROUPS) {
- // update cli input here
- const cliState = new AuthInputState(context, authResourceName[0]);
- const cliInputPayload = cliState.getCLIInputPayload();
- cliInputPayload.cognitoConfig.userPoolGroupList = [];
- await cliState.saveCLIInputPayload(cliInputPayload);
- }
- } catch (err) {
- printer.info(err.stack);
- printer.error('There was an error removing the auth resource');
- void context.usageData.emitError(err);
- process.exitCode = 1;
+ const resource = await amplify.removeResource(context, category, resourceName);
+ if (resource?.service === AmplifySupportedService.COGNITOUSERPOOLGROUPS) {
+ // update cli input here
+ const cliState = new AuthInputState(context, authResourceName[0]);
+ const cliInputPayload = cliState.getCLIInputPayload();
+ cliInputPayload.cognitoConfig.userPoolGroupList = [];
+ await cliState.saveCLIInputPayload(cliInputPayload);
}
};
diff --git a/packages/amplify-category-auth/src/index.js b/packages/amplify-category-auth/src/index.js
index 0fbe5952d12..16b9e96920d 100644
--- a/packages/amplify-category-auth/src/index.js
+++ b/packages/amplify-category-auth/src/index.js
@@ -40,6 +40,7 @@ const { privateKeys } = require('./provider-utils/awscloudformation/constants');
const { checkAuthResourceMigration } = require('./provider-utils/awscloudformation/utils/check-for-auth-migration');
const { run: authRunPush } = require('./commands/auth/push');
const { getAuthTriggerStackCfnParameters } = require('./provider-utils/awscloudformation/utils/get-auth-trigger-stack-cfn-parameters');
+const { updateAppClientWithGeneratedSecret } = require('./provider-utils/awscloudformation/utils/generate-cognito-app-client-secret');
const { prePushHandler } = require('./events/prePushHandler');
// this function is being kept for temporary compatability.
@@ -575,6 +576,7 @@ module.exports = {
transformCategoryStack,
authPluginAPIPush: authPushYes,
getAuthTriggerStackCfnParameters,
+ updateAppClientWithGeneratedSecret,
};
// force major version bump for cdk v2
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts
index 1d2b800d717..a0a8d4ed8fe 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts
@@ -8,16 +8,10 @@ import { $TSAny, JSONUtilities } from '@aws-amplify/amplify-cli-core';
import * as fs from 'fs-extra';
import _ from 'lodash';
import { Construct } from 'constructs';
-import {
- hostedUILambdaFilePath,
- hostedUIProviderLambdaFilePath,
- mfaLambdaFilePath,
- oauthLambdaFilePath,
- openIdLambdaFilePath,
- userPoolClientLambdaFilePath,
-} from '../constants';
+import { hostedUILambdaFilePath, hostedUIProviderLambdaFilePath, mfaLambdaFilePath, openIdLambdaFilePath } from '../constants';
import { CognitoStackOptions } from '../service-walkthrough-types/cognito-user-input-types';
import { configureSmsOption } from '../utils/configure-sms';
+import { OAuthMetaData } from './types';
const CFN_TEMPLATE_FORMAT_VERSION = '2010-09-09';
const ROOT_CFN_DESCRIPTION = 'Amplify Cognito Stack for AWS Amplify CLI';
@@ -68,12 +62,8 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
identityPoolRoleMap: cognito.CfnIdentityPoolRoleAttachment | undefined;
lambdaConfigPermissions?: Record;
lambdaTriggerPermissions?: Record;
- // custom resources userPoolClient
- userPoolClientLambda?: lambda.CfnFunction;
+ // provides base role for deleting custom resource lambdas that are no longer needed after the migration
userPoolClientRole?: iam.CfnRole;
- userPoolClientLambdaPolicy?: iam.CfnPolicy;
- userPoolClientLogPolicy?: iam.CfnPolicy;
- userPoolClientInputs?: cdk.CustomResource;
// custom resources HostedUI
hostedUICustomResource?: lambda.CfnFunction;
hostedUICustomResourcePolicy?: iam.CfnPolicy;
@@ -84,11 +74,6 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
hostedUIProvidersCustomResourcePolicy?: iam.CfnPolicy;
hostedUIProvidersCustomResourceLogPolicy?: iam.CfnPolicy;
hostedUIProvidersCustomResourceInputs?: cdk.CustomResource;
- // custom resource OAUTH Provider
- oAuthCustomResource?: lambda.CfnFunction;
- oAuthCustomResourcePolicy?: iam.CfnPolicy;
- oAuthCustomResourceLogPolicy?: iam.CfnPolicy;
- oAuthCustomResourceInputs?: cdk.CustomResource;
// custom resource MFA
mfaLambda?: lambda.CfnFunction;
mfaLogPolicy?: iam.CfnPolicy;
@@ -323,7 +308,7 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
}
if (!props.breakCircularDependency && props.triggers && props.dependsOn) {
- props.dependsOn!.forEach((trigger) => {
+ props.dependsOn?.forEach((trigger) => {
if (trigger.resourceName.includes('CreateAuthChallenge')) {
this.userPool!.lambdaConfig = {
createAuthChallenge: cdk.Fn.ref(`function${props.resourceName}${'CreateAuthChallenge'}Arn`),
@@ -409,7 +394,7 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
if (configureSMS) {
this.userPool.enabledMfas = ['SMS_MFA'];
}
- if (!_.isEmpty(props.mfaTypes) && props.mfaTypes!.includes('TOTP')) {
+ if (!_.isEmpty(props.mfaTypes) && props.mfaTypes?.includes('TOTP')) {
this.userPool.enabledMfas = [...(this.userPool.enabledMfas || []), 'SOFTWARE_TOKEN_MFA'];
}
}
@@ -481,16 +466,19 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
this.userPoolClient.generateSecret = cdk.Fn.ref('userpoolClientGenerateSecret') as unknown as boolean;
this.userPoolClient.addDependency(this.userPool);
- this.createUserPoolClientCustomResource(props);
+ this.createBaseLambdaRole(props);
+
+ if (props.oAuthMetadata) {
+ this.updateUserPoolClientWithOAuthSettings(props);
+ }
+
if (props.hostedUIDomainName) {
this.createHostedUICustomResource();
}
if (props.hostedUIProviderMeta) {
this.createHostedUIProviderCustomResource();
}
- if (props.oAuthMetadata) {
- this.createOAuthCustomResource();
- }
+
if (!props.useEnabledMfas && props.mfaConfiguration !== 'OFF') {
this.createMFACustomResource(props);
}
@@ -549,22 +537,64 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
this.identityPool.openIdConnectProviderArns = [cdk.Fn.getAtt('OpenIdLambdaInputs', 'providerArn').toString()];
this.identityPool.node.addDependency(this.openIdLambdaInputs!.node!.defaultChild!);
}
-
- if ((!props.audiences || props.audiences.length === 0) && props.authSelections !== 'identityPoolOnly') {
- this.identityPool.node.addDependency(this.userPoolClientInputs!.node!.defaultChild!);
- }
/**
* # Created to map Auth and Unauth roles to the identity pool
# Depends on Identity Pool for ID ref
*/
- this.identityPoolRoleMap = new cognito.CfnIdentityPoolRoleAttachment(this, 'IdentityPoolRoleMap', {
+
+ let identityPoolRoleMapParams = {
identityPoolId: cdk.Fn.ref('IdentityPool'),
roles: {
unauthenticated: cdk.Fn.ref('unauthRoleArn'),
authenticated: cdk.Fn.ref('authRoleArn'),
},
- });
+ };
+
+ const addRoleMappingAttachments = props.userPoolGroups || (props.userPoolGroupList || []).length > 0;
+
+ if (addRoleMappingAttachments) {
+ const roleMappings = {
+ roleMappings: {
+ UserPoolClientRoleMapping: {
+ identityProvider: cdk.Fn.sub('cognito-idp.${region}.amazonaws.com/${userPool}:${client}', {
+ region: cdk.Fn.ref('AWS::Region'),
+ userPool: cdk.Fn.ref('UserPool'),
+ client: cdk.Fn.ref('UserPoolClient'),
+ }),
+ ambiguousRoleResolution: 'AuthenticatedRole',
+ type: 'Token',
+ },
+ UserPoolWebClientRoleMapping: {
+ identityProvider: cdk.Fn.sub('cognito-idp.${region}.amazonaws.com/${userPool}:${webClient}', {
+ region: cdk.Fn.ref('AWS::Region'),
+ userPool: cdk.Fn.ref('UserPool'),
+ webClient: cdk.Fn.ref('UserPoolClientWeb'),
+ }),
+ ambiguousRoleResolution: 'AuthenticatedRole',
+ type: 'Token',
+ },
+ },
+ };
+
+ identityPoolRoleMapParams = {
+ ...identityPoolRoleMapParams,
+ ...roleMappings,
+ };
+ }
+
+ this.identityPoolRoleMap = new cognito.CfnIdentityPoolRoleAttachment(this, 'IdentityPoolRoleMap', identityPoolRoleMapParams);
+
this.identityPoolRoleMap.addDependency(this.identityPool);
+
+ if (addRoleMappingAttachments) {
+ if (this.userPoolClient) {
+ this.identityPoolRoleMap.addDependency(this.userPoolClient);
+ }
+
+ if (this.userPoolClientWeb) {
+ this.identityPoolRoleMap.addDependency(this.userPoolClientWeb);
+ }
+ }
}
};
@@ -574,9 +604,9 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
public renderCloudFormationTemplate = (): string => JSONUtilities.stringify(this._toCloudFormation())!;
/**
- * creates userpool client custom resource
+ * creates base policy for lambdas
*/
- createUserPoolClientCustomResource(props: CognitoStackOptions): void {
+ createBaseLambdaRole(props: CognitoStackOptions): void {
// iam role
this.userPoolClientRole = new iam.CfnRole(this, 'UserPoolClientRole', {
roleName: cdk.Fn.conditionIf(
@@ -603,78 +633,38 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
],
},
});
- this.userPoolClientRole.addDependency(this.userPoolClient!);
-
- // lambda function
- this.userPoolClientLambda = new lambda.CfnFunction(this, 'UserPoolClientLambda', {
- code: {
- zipFile: fs.readFileSync(userPoolClientLambdaFilePath, 'utf-8'),
- },
- handler: 'index.handler',
- role: cdk.Fn.getAtt('UserPoolClientRole', 'Arn').toString(),
- runtime: 'nodejs16.x',
- timeout: 300,
- });
- this.userPoolClientLambda.addDependency(this.userPoolClientRole);
-
- // userPool client lambda policy
- /**
- * # Sets userpool policy for the role that executes the Userpool Client Lambda
- # Depends on UserPool for Arn
- # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
- */
- this.userPoolClientLambdaPolicy = new iam.CfnPolicy(this, 'UserPoolClientLambdaPolicy', {
- // eslint-disable-next-line spellcheck/spell-checker
- policyName: `${props.resourceNameTruncated}_userpoolclient_lambda_iam_policy`,
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: ['cognito-idp:DescribeUserPoolClient'],
- Resource: cdk.Fn.getAtt('UserPool', 'Arn'),
- },
- ],
- },
- roles: [cdk.Fn.ref('UserPoolClientRole')],
- });
- this.userPoolClientLambdaPolicy.addDependency(this.userPoolClientLambda);
-
- // userPool Client Log policy
-
- this.userPoolClientLogPolicy = new iam.CfnPolicy(this, 'UserPoolClientLogPolicy', {
- // eslint-disable-next-line spellcheck/spell-checker
- policyName: `${props.resourceNameTruncated}_userpoolclient_lambda_log_policy`,
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'],
- Resource: cdk.Fn.sub('arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*', {
- region: cdk.Fn.ref('AWS::Region'),
- account: cdk.Fn.ref('AWS::AccountId'),
- lambda: cdk.Fn.ref('UserPoolClientLambda'),
- }),
- },
- ],
- },
- roles: [cdk.Fn.ref('UserPoolClientRole')],
- });
- this.userPoolClientLogPolicy.addDependency(this.userPoolClientLambdaPolicy);
-
- // userPoolClient Custom Resource
- this.userPoolClientInputs = new cdk.CustomResource(this, 'UserPoolClientInputs', {
- serviceToken: this.userPoolClientLambda.attrArn,
- resourceType: 'Custom::LambdaCallout',
- properties: {
- clientId: cdk.Fn.ref('UserPoolClient'),
- userpoolId: cdk.Fn.ref('UserPool'),
- },
- });
- this.userPoolClientInputs.node.addDependency(this.userPoolClientLogPolicy);
}
+ /**
+ * updates cognito userpool client with OAuth settings
+ */
+ updateUserPoolClientWithOAuthSettings = (props: CognitoStackOptions): void => {
+ const oAuthMetaData = JSONUtilities.parse(props.oAuthMetadata);
+ let hostedUIProviderMeta;
+ let supportedIdentityProviders: string[] = [];
+ if (!_.isEmpty(props.hostedUIProviderMeta)) {
+ hostedUIProviderMeta = JSONUtilities.parse>(props.hostedUIProviderMeta);
+ supportedIdentityProviders = hostedUIProviderMeta.map((provider: { ProviderName: string }) => provider.ProviderName);
+ }
+ supportedIdentityProviders.push('COGNITO');
+ if (this.userPoolClient) {
+ this.userPoolClient.allowedOAuthFlowsUserPoolClient = true;
+ this.userPoolClient.allowedOAuthScopes = oAuthMetaData?.AllowedOAuthScopes;
+ this.userPoolClient.allowedOAuthFlows = oAuthMetaData?.AllowedOAuthFlows;
+ this.userPoolClient.callbackUrLs = oAuthMetaData?.CallbackURLs;
+ this.userPoolClient.logoutUrLs = oAuthMetaData?.LogoutURLs;
+ this.userPoolClient.supportedIdentityProviders = supportedIdentityProviders;
+ }
+ if (this.userPoolClientWeb) {
+ this.userPoolClientWeb.allowedOAuthFlowsUserPoolClient = true;
+ this.userPoolClientWeb.allowedOAuthScopes = oAuthMetaData?.AllowedOAuthScopes;
+ this.userPoolClientWeb.allowedOAuthFlows = oAuthMetaData?.AllowedOAuthFlows;
+ this.userPoolClientWeb.callbackUrLs = oAuthMetaData?.CallbackURLs;
+ this.userPoolClientWeb.logoutUrLs = oAuthMetaData?.LogoutURLs;
+ this.userPoolClientWeb.supportedIdentityProviders = supportedIdentityProviders;
+ }
+ };
+
/**
* Creates custom lambda to update userPool client on Cognito
*/
@@ -686,10 +676,13 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
},
handler: 'index.handler',
role: cdk.Fn.getAtt('UserPoolClientRole', 'Arn').toString(),
- runtime: 'nodejs16.x',
+ runtime: 'nodejs18.x',
timeout: 300,
});
- this.hostedUICustomResource.addDependency(this.userPoolClientRole!);
+
+ if (this.userPoolClientRole) {
+ this.hostedUICustomResource.addDependency(this.userPoolClientRole);
+ }
// userPool client lambda policy
/**
@@ -767,10 +760,13 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
},
handler: 'index.handler',
role: cdk.Fn.getAtt('UserPoolClientRole', 'Arn').toString(),
- runtime: 'nodejs16.x',
+ runtime: 'nodejs18.x',
timeout: 300,
});
- this.hostedUIProvidersCustomResource.addDependency(this.userPoolClientRole!);
+
+ if (this.userPoolClientRole) {
+ this.hostedUIProvidersCustomResource.addDependency(this.userPoolClientRole);
+ }
// userPool client lambda policy
/**
@@ -837,83 +833,9 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
},
});
this.hostedUIProvidersCustomResourceInputs.node.addDependency(this.hostedUIProvidersCustomResourceLogPolicy);
- }
-
- /**
- * creates OAuth customResource for Cognito
- */
- createOAuthCustomResource(): void {
- // lambda function
- this.oAuthCustomResource = new lambda.CfnFunction(this, 'OAuthCustomResource', {
- code: {
- zipFile: fs.readFileSync(oauthLambdaFilePath, 'utf-8'),
- },
- handler: 'index.handler',
- role: cdk.Fn.getAtt('UserPoolClientRole', 'Arn').toString(),
- runtime: 'nodejs16.x',
- timeout: 300,
- });
-
- this.oAuthCustomResource.node.addDependency(this.hostedUICustomResourceInputs!.node!.defaultChild!);
- this.oAuthCustomResource.node.addDependency(this.hostedUIProvidersCustomResourceInputs!.node!.defaultChild!);
-
- // userPool client lambda policy
- /**
- * # Sets userpool policy for the role that executes the Userpool Client Lambda
- # Depends on UserPool for Arn
- # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
- */
- this.oAuthCustomResourcePolicy = new iam.CfnPolicy(this, 'OAuthCustomResourcePolicy', {
- policyName: cdk.Fn.join('-', [cdk.Fn.ref('UserPool'), 'OAuth']),
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: ['cognito-idp:UpdateUserPoolClient'],
- Resource: cdk.Fn.getAtt('UserPool', 'Arn'),
- },
- ],
- },
- roles: [cdk.Fn.ref('UserPoolClientRole')],
- });
- this.oAuthCustomResourcePolicy.addDependency(this.oAuthCustomResource);
-
- // Oauth Log policy
-
- this.oAuthCustomResourceLogPolicy = new iam.CfnPolicy(this, 'OAuthCustomResourceLogPolicy', {
- policyName: cdk.Fn.join('-', [cdk.Fn.ref('UserPool'), 'OAuthLogPolicy']),
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'],
- Resource: cdk.Fn.sub('arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*', {
- region: cdk.Fn.ref('AWS::Region'),
- account: cdk.Fn.ref('AWS::AccountId'),
- lambda: cdk.Fn.ref('OAuthCustomResource'),
- }),
- },
- ],
- },
- roles: [cdk.Fn.ref('UserPoolClientRole')],
- });
- this.oAuthCustomResourceLogPolicy.addDependency(this.oAuthCustomResourcePolicy);
-
- // oAuth Custom Resource
- this.oAuthCustomResourceInputs = new cdk.CustomResource(this, 'OAuthCustomResourceInputs', {
- serviceToken: this.oAuthCustomResource.attrArn,
- resourceType: 'Custom::LambdaCallout',
- properties: {
- hostedUIProviderMeta: cdk.Fn.ref('hostedUIProviderMeta'),
- oAuthMetadata: cdk.Fn.ref('oAuthMetadata'),
- webClientId: cdk.Fn.ref('UserPoolClientWeb'),
- nativeClientId: cdk.Fn.ref('UserPoolClient'),
- userPoolId: cdk.Fn.ref('UserPool'),
- },
- });
- this.oAuthCustomResourceInputs.node.addDependency(this.oAuthCustomResourceLogPolicy);
+ // this can be removed when hostedUI Custom resource is removed
+ this.userPoolClient?.node.addDependency(this.hostedUIProvidersCustomResourceInputs);
+ this.userPoolClientWeb?.node.addDependency(this.hostedUIProvidersCustomResourceInputs);
}
/**
@@ -984,7 +906,7 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
},
handler: 'index.handler',
role: cdk.Fn.getAtt('MFALambdaRole', 'Arn').toString(),
- runtime: 'nodejs16.x',
+ runtime: 'nodejs18.x',
timeout: 300,
});
this.mfaLambda.addDependency(this.mfaLambdaRole);
@@ -1114,8 +1036,6 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
},
],
});
- // TODO
- this.openIdLambdaRole!.node.addDependency(this.userPoolClientInputs!.node!.defaultChild!);
// lambda function
/**
* Lambda which sets MFA config values
@@ -1127,7 +1047,7 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
},
handler: 'index.handler',
role: cdk.Fn.getAtt('OpenIdLambdaRole', 'Arn').toString(),
- runtime: 'nodejs16.x',
+ runtime: 'nodejs18.x',
timeout: 300,
});
this.openIdLambda.addDependency(this.openIdLambdaRole);
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.ts
index 05de42e931c..99c3a45ffd7 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-stack-transform.ts
@@ -4,23 +4,21 @@ import {
AmplifyCategories,
AmplifyCategoryTransform,
AmplifyError,
- AmplifyStackTemplate,
AmplifySupportedService,
buildOverrideDir,
CFNTemplateFormat,
FeatureFlags,
JSONUtilities,
pathManager,
+ runOverride,
stateManager,
Template,
writeCFNTemplate,
} from '@aws-amplify/amplify-cli-core';
-import { formatter } from '@aws-amplify/amplify-prompts';
import * as cdk from 'aws-cdk-lib';
import * as fs from 'fs-extra';
import _ from 'lodash';
import * as path from 'path';
-import * as vm from 'vm2';
import { AuthInputState } from '../auth-inputs-manager/auth-input-state';
import { CognitoCLIInputs } from '../service-walkthrough-types/awsCognito-user-input-types';
import { AuthTriggerConnection, AuthTriggerPermissions, CognitoStackOptions } from '../service-walkthrough-types/cognito-user-input-types';
@@ -95,7 +93,7 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
this.addCfnParameters(props);
// add CFN condition
- this.addCfnConditions(props);
+ this.addCfnConditions();
// generate Resources
await this._authTemplateObj.generateCognitoStackResources(props);
@@ -109,26 +107,9 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
const overrideDir = path.join(backendDir, this._category, this.resourceName);
const isBuild = await buildOverrideDir(backendDir, overrideDir);
if (isBuild) {
- const overrideCode: string = await fs.readFile(path.join(overrideDir, 'build', 'override.js'), 'utf-8').catch(() => {
- formatter.list(['No override File Found', `To override ${this.resourceName} run amplify override auth`]);
- return '';
- });
-
- const sandboxNode = new vm.NodeVM({
- console: 'inherit',
- timeout: 5000,
- sandbox: {},
- require: {
- context: 'sandbox',
- builtin: ['path'],
- external: true,
- },
- });
const projectInfo = getProjectInfo();
try {
- await sandboxNode
- .run(overrideCode, path.join(overrideDir, 'build', 'override.js'))
- .override(this._authTemplateObj as AmplifyAuthCognitoStack & AmplifyStackTemplate, projectInfo);
+ await runOverride(overrideDir, this._authTemplateObj, projectInfo);
} catch (err) {
throw new AmplifyError(
'InvalidOverrideError',
@@ -399,14 +380,6 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
'AppClientID',
);
- this._authTemplateObj.addCfnOutput(
- {
- value: cdk.Fn.getAtt('UserPoolClientInputs', 'appSecret').toString(),
- condition: this._authTemplateObj.getCfnCondition('ShouldOutputAppClientSecrets'),
- },
- 'AppClientSecret',
- );
-
if (!props.useEnabledMfas || configureSMS) {
this._authTemplateObj.addCfnOutput(
{
@@ -569,21 +542,12 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
/**
* adds cfn conditions
*/
- private addCfnConditions = (props: CognitoStackOptions): void => {
+ private addCfnConditions = (): void => {
this._authTemplateObj.addCfnCondition(
{
expression: cdk.Fn.conditionEquals(cdk.Fn.ref('env'), 'NONE'),
},
'ShouldNotCreateEnvResources',
);
-
- if (props.authSelections !== 'identityPoolOnly') {
- this._authTemplateObj.addCfnCondition(
- {
- expression: cdk.Fn.conditionEquals(cdk.Fn.ref('userpoolClientGenerateSecret'), true),
- },
- 'ShouldOutputAppClientSecrets',
- );
- }
};
}
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-user-pool-group-stack-builder.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-user-pool-group-stack-builder.ts
index bcffc8c5778..c160d01791e 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-user-pool-group-stack-builder.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-user-pool-group-stack-builder.ts
@@ -1,15 +1,11 @@
/* eslint-disable max-classes-per-file */
import * as cdk from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';
-import * as lambda from 'aws-cdk-lib/aws-lambda';
import { CfnUserPoolGroup } from 'aws-cdk-lib/aws-cognito';
import { AmplifyUserPoolGroupStackTemplate } from '@aws-amplify/cli-extensibility-helper';
import { JSONUtilities } from '@aws-amplify/amplify-cli-core';
-import * as fs from 'fs-extra';
import { Construct } from 'constructs';
// eslint-disable-next-line import/no-cycle
-import { roleMapLambdaFilePath } from '../constants';
-// eslint-disable-next-line import/no-cycle
import { AmplifyUserPoolGroupStackOptions } from './user-pool-group-stack-transform';
const CFN_TEMPLATE_FORMAT_VERSION = '2010-09-09';
@@ -31,9 +27,6 @@ export class AmplifyUserPoolGroupStack extends cdk.Stack implements AmplifyUserP
private _cfnConditionMap: Map = new Map();
userPoolGroup: Record;
userPoolGroupRole: Record;
- roleMapCustomResource?: cdk.CustomResource;
- roleMapLambdaFunction?: lambda.CfnFunction;
- lambdaExecutionRole?: iam.CfnRole;
constructor(scope: Construct, id: string, props: AmplifyAuthCognitoStackProps) {
super(scope, id, props);
@@ -192,117 +185,6 @@ export class AmplifyUserPoolGroupStack extends cdk.Stack implements AmplifyUserP
}
}
});
-
- if (props.identityPoolName) {
- this.lambdaExecutionRole = new iam.CfnRole(this, 'LambdaExecutionRole', {
- roleName: cdk.Fn.conditionIf(
- 'ShouldNotCreateEnvResources',
- props.cognitoResourceName,
- cdk.Fn.join('', [`${props.cognitoResourceName}-ExecutionRole-`, cdk.Fn.ref('env')]).toString(),
- ).toString(),
- assumeRolePolicyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Principal: {
- Service: ['lambda.amazonaws.com'],
- },
- Action: ['sts:AssumeRole'],
- },
- ],
- },
- policies: [
- {
- policyName: 'UserGroupExecutionPolicy',
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: [
- 'cognito-identity:SetIdentityPoolRoles',
- 'cognito-identity:ListIdentityPools',
- 'cognito-identity:describeIdentityPool',
- ],
- Resource: '*',
- },
- ],
- },
- },
- {
- policyName: 'UserGroupPassRolePolicy',
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: ['iam:PassRole'],
- Resource: [
- {
- Ref: 'AuthRoleArn',
- },
- {
- Ref: 'UnauthRoleArn',
- },
- ],
- },
- ],
- },
- },
- ],
- });
- // lambda function for RoleMap Custom Resource
- this.roleMapLambdaFunction = new lambda.CfnFunction(this, 'RoleMapFunction', {
- code: {
- zipFile: fs.readFileSync(roleMapLambdaFilePath, 'utf-8'),
- },
- handler: 'index.handler',
- runtime: 'nodejs16.x',
- timeout: 300,
- role: cdk.Fn.getAtt('LambdaExecutionRole', 'Arn').toString(),
- });
-
- // eslint-disable-next-line no-new
- new iam.CfnPolicy(this, 'LambdaCloudWatchPolicy', {
- policyName: 'UserGroupLogPolicy',
- roles: [this.lambdaExecutionRole.ref],
- policyDocument: {
- Version: '2012-10-17',
- Statement: [
- {
- Effect: 'Allow',
- Action: ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'],
- Resource: {
- 'Fn::Sub': [
- 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/${lambdaName}:log-stream:*',
- {
- lambdaName: this.roleMapLambdaFunction.ref,
- },
- ],
- },
- },
- ],
- },
- });
-
- // adding custom trigger roleMap function
- this.roleMapCustomResource = new cdk.CustomResource(this, 'RoleMapFunctionInput', {
- serviceToken: this.roleMapLambdaFunction.attrArn,
- resourceType: 'Custom::LambdaCallout',
- properties: {
- AuthRoleArn: cdk.Fn.ref('AuthRoleArn'),
- UnauthRoleArn: cdk.Fn.ref('UnauthRoleArn'),
- identityPoolId: cdk.Fn.ref(getCfnParamsLogicalId(props.cognitoResourceName, 'IdentityPoolId')),
- userPoolId: cdk.Fn.ref(getCfnParamsLogicalId(props.cognitoResourceName, 'UserPoolId')),
- appClientIDWeb: cdk.Fn.ref(getCfnParamsLogicalId(props.cognitoResourceName, 'AppClientIDWeb')),
- appClientID: cdk.Fn.ref(getCfnParamsLogicalId(props.cognitoResourceName, 'AppClientID')),
- region: cdk.Fn.ref('AWS::Region'),
- env: cdk.Fn.ref('env'),
- },
- });
- this.roleMapCustomResource.node.addDependency(this.roleMapLambdaFunction);
- }
};
}
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/types.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/types.ts
new file mode 100644
index 00000000000..fb9bc3e3936
--- /dev/null
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/types.ts
@@ -0,0 +1,8 @@
+export type OAuthMetaData = {
+ AllowedOAuthFlows?: Array;
+ AllowedOAuthFlowsUserPoolClient?: boolean;
+ AllowedOAuthScopes?: Array;
+ CallbackURLs?: Array;
+ LogoutURLs?: Array;
+ SupportedIdentityProviders?: Array;
+};
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/user-pool-group-stack-transform.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/user-pool-group-stack-transform.ts
index 4f6e900d92b..21b93a91fc6 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/user-pool-group-stack-transform.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/user-pool-group-stack-transform.ts
@@ -4,20 +4,17 @@ import {
AmplifyCategories,
AmplifyCategoryTransform,
AmplifyError,
- AmplifyStackTemplate,
AmplifySupportedService,
buildOverrideDir,
CFNTemplateFormat,
JSONUtilities,
pathManager,
+ runOverride,
Template,
writeCFNTemplate,
} from '@aws-amplify/amplify-cli-core';
-import { formatter } from '@aws-amplify/amplify-prompts';
import * as cdk from 'aws-cdk-lib';
-import * as fs from 'fs-extra';
import * as path from 'path';
-import * as vm from 'vm2';
import { AuthInputState } from '../auth-inputs-manager/auth-input-state';
import { CognitoCLIInputs } from '../service-walkthrough-types/awsCognito-user-input-types';
import { AmplifyUserPoolGroupStack, AmplifyUserPoolGroupStackOutputs } from './index';
@@ -186,20 +183,9 @@ export class AmplifyUserPoolGroupTransform extends AmplifyCategoryTransform {
const overrideDir = path.join(backendDir, this._category, this._resourceName);
const isBuild = await buildOverrideDir(backendDir, overrideDir);
if (isBuild) {
- const overrideCode: string = await fs.readFile(path.join(overrideDir, 'build', 'override.js'), 'utf-8').catch(() => {
- formatter.list(['No override File Found', `To override ${this._resourceName} run amplify override auth`]);
- return '';
- });
- const sandboxNode = new vm.NodeVM({
- console: 'inherit',
- timeout: 5000,
- sandbox: {},
- });
const projectInfo = getProjectInfo();
try {
- await sandboxNode
- .run(overrideCode)
- .override(this._userPoolGroupTemplateObj as AmplifyUserPoolGroupStack & AmplifyStackTemplate, projectInfo);
+ await runOverride(overrideDir, this._userPoolGroupTemplateObj, projectInfo);
} catch (err: $TSAny) {
throw new AmplifyError(
'InvalidOverrideError',
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/constants.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/constants.ts
index 1ac201843fc..d52f95baf39 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/constants.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/constants.ts
@@ -10,13 +10,10 @@ export const adminAuthAssetRoot = path.join(resourcesRoot, 'adminAuth');
export const authTriggerAssetFilePath = path.join(resourcesRoot, 'lambda-function.js');
export const cfnTemplateRoot = path.join(resourcesRoot, 'cloudformation-templates');
export const triggerRoot = path.normalize(path.join(__dirname, '../../../provider-utils/awscloudformation/triggers'));
-export const userPoolClientLambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'userpoolclientLambda.js');
export const hostedUILambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'hostedUILambda.js');
export const hostedUIProviderLambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'hostedUIProviderLambda.js');
-export const oauthLambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'oauthLambda.js');
export const mfaLambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'mfaLambda.js');
export const openIdLambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'openIdLambda.js');
-export const roleMapLambdaFilePath = path.join(resourcesRoot, 'auth-custom-resource', 'role-map-lambda-function.js');
export const ENV_SPECIFIC_PARAMS = [
'facebookAppId',
'facebookAppIdUserPool',
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/handlers/resource-handlers.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/handlers/resource-handlers.ts
index 6a23adf42a4..557ad8bb200 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/handlers/resource-handlers.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/handlers/resource-handlers.ts
@@ -99,9 +99,9 @@ export const getUpdateAuthHandler = (context: AuthContext) => async (request: Se
)(request);
const resources = stateManager.getMeta();
if (resources.auth.userPoolGroups) {
- await updateUserPoolGroups(context, requestWithDefaults.resourceName!, requestWithDefaults.userPoolGroupList);
+ await updateUserPoolGroups(context, requestWithDefaults.resourceName, requestWithDefaults.userPoolGroupList);
} else {
- await createUserPoolGroups(context, requestWithDefaults.resourceName!, requestWithDefaults.userPoolGroupList);
+ await createUserPoolGroups(context, requestWithDefaults.resourceName, requestWithDefaults.userPoolGroupList);
}
if (
(!requestWithDefaults.updateFlow && !requestWithDefaults.thirdPartyAuth) ||
@@ -165,7 +165,7 @@ export const getUpdateAuthHandler = (context: AuthContext) => async (request: Se
// saving cli-inputs except secrets
await cliState.saveCLIInputPayload(cognitoCLIInputs);
// remove this when api and functions transform are done
- if (request.updateFlow !== 'updateUserPoolGroups' && request.updateFlow !== 'updateAdminQueries') {
+ if (request.updateFlow !== 'updateAdminQueries') {
await generateAuthStackTemplate(context, cognitoCLIInputs.cognitoConfig.resourceName);
}
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts
index 25d272f7e57..e5808e479dc 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts
@@ -1130,7 +1130,7 @@ export const importedAuthEnvInit = async (
answers.appClientWeb = questionParameters.webClients!.find((c) => c.ClientId! === currentEnvSpecificParameters.webClientId);
if (!answers.appClientWeb) {
- printer.error(importMessages.AppClientNotFound('Web', currentEnvSpecificParameters.webClientId));
+ printer.error(importMessages.AppClientNotFound('Web'));
return {
succeeded: false,
@@ -1140,7 +1140,7 @@ export const importedAuthEnvInit = async (
answers.appClientNative = questionParameters.nativeClients!.find((c) => c.ClientId! === currentEnvSpecificParameters.nativeClientId);
if (!answers.appClientNative) {
- printer.error(importMessages.AppClientNotFound('Native', currentEnvSpecificParameters.nativeClientId));
+ printer.error(importMessages.AppClientNotFound('Native'));
return {
succeeded: false,
@@ -1292,7 +1292,7 @@ export const headlessImport = async (
if (!answers.appClientWeb) {
throw new AmplifyError('AuthImportError', {
- message: importMessages.AppClientNotFound('Web', resolvedEnvParams.webClientId),
+ message: importMessages.AppClientNotFound('Web'),
});
}
@@ -1300,7 +1300,7 @@ export const headlessImport = async (
if (!answers.appClientNative) {
throw new AmplifyError('AuthImportError', {
- message: importMessages.AppClientNotFound('Native', resolvedEnvParams.nativeClientId),
+ message: importMessages.AppClientNotFound('Native'),
});
}
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/messages.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/messages.ts
index b4baf0cec6c..d400e6a9166 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/messages.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/messages.ts
@@ -20,7 +20,7 @@ export const importMessages = {
`The previously configured Cognito User Pool: '${userPoolName}' (${userPoolId}) cannot be found.`,
IdentityPoolNotFound: (identityPoolName: string, identityPoolId: string) =>
`The previously configured Identity Pool: '${identityPoolName}' (${identityPoolId}) cannot be found.`,
- AppClientNotFound: (type: 'Web' | 'Native', clientId: string) => `The previously configured ${type} app client cannot be found.`,
+ AppClientNotFound: (type: 'Web' | 'Native') => `The previously configured ${type} app client cannot be found.`,
NoAtLeastOneAppClient: (type: 'Web' | 'Native') =>
`The selected Cognito User Pool does not have at least 1 ${type} app client configured. ${type} app clients are app clients ${
type === 'Web' ? 'without' : 'with'
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/types.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/types.ts
index 0507d348709..e1acaaa2baa 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/types.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/import/types.ts
@@ -155,7 +155,7 @@ export interface ProviderUtils {
privateParams: $TSObject,
envSpecificParams: string[],
): void;
- loadResourceParameters(context: $TSContext, category: string, resourceName: string): Record;
+ loadResourceParameters(context: $TSContext, category: string, resourceName: string): Record;
}
export type ImportAuthHeadlessParameters = {
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/awsCognito-user-input-types.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/awsCognito-user-input-types.ts
index 3db5cfe5314..d0f0273f740 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/awsCognito-user-input-types.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/awsCognito-user-input-types.ts
@@ -1,3 +1,5 @@
+import { $TSAny } from '@aws-amplify/amplify-cli-core';
+
export interface CognitoCLIInputs {
version?: string;
cognitoConfig: CognitoConfiguration;
@@ -41,13 +43,13 @@ export interface ServiceQuestionsBaseResult {
export interface OAuthResult {
hostedUI?: boolean;
hostedUIDomainName?: string;
- hostedUIProviderMeta?: any;
- hostedUIProviderCreds?: any;
+ hostedUIProviderMeta?: $TSAny;
+ hostedUIProviderCreds?: $TSAny;
AllowedOAuthFlows?: 'code' | 'implicit';
AllowedOAuthScopes?: string[];
newCallbackURLs?: string[];
newLogoutURLs?: string[];
- oAuthMetadata?: any;
+ oAuthMetadata?: $TSAny;
}
export interface SocialProviderResult {
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/cognito-user-input-types.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/cognito-user-input-types.ts
index 8ef95b454a8..5bb0ef080cf 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/cognito-user-input-types.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/service-walkthrough-types/cognito-user-input-types.ts
@@ -1,6 +1,6 @@
// Some convenience types for the existing service walkthrough logic
-import { $TSObject } from '@aws-amplify/amplify-cli-core';
+import { $TSObject, $TSAny } from '@aws-amplify/amplify-cli-core';
import { FunctionDependency } from '@aws-amplify/amplify-function-plugin-interface';
import { CognitoConfiguration } from './awsCognito-user-input-types';
@@ -67,13 +67,13 @@ export interface ServiceQuestionsBaseResult {
export interface OAuthResult {
hostedUI?: boolean;
hostedUIDomainName?: string;
- hostedUIProviderMeta?: any;
- hostedUIProviderCreds?: any;
+ hostedUIProviderMeta?: $TSAny;
+ hostedUIProviderCreds?: $TSAny;
AllowedOAuthFlows?: 'code' | 'implicit';
AllowedOAuthScopes?: string[];
newCallbackURLs?: string[];
newLogoutURLs?: string[];
- oAuthMetadata?: any;
+ oAuthMetadata?: $TSAny;
}
export interface SocialProviderResult {
@@ -141,7 +141,7 @@ export type UsernameAttributes = AttributeType.EMAIL | AttributeType.PHONE_NUMBE
export type AliasAttributes = AttributeType.EMAIL | AttributeType.PHONE_NUMBER | AttributeType.PREFERRED_USERNAME;
export interface Triggers {
- triggers?: any; // TODO create a type for this
+ triggers?: $TSAny; // TODO create a type for this
}
export enum TriggerType {
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-auth-trigger-template.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-auth-trigger-template.ts
index 36326257999..24c5f856909 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-auth-trigger-template.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-auth-trigger-template.ts
@@ -1,6 +1,6 @@
import * as path from 'path';
import * as fs from 'fs-extra';
-import { $TSAny, AmplifyFault, JSONUtilities, pathManager } from '@aws-amplify/amplify-cli-core';
+import { $TSAny, AmplifyFault, JSONUtilities, pathManager, getPermissionsBoundaryArn } from '@aws-amplify/amplify-cli-core';
import * as iam from 'aws-cdk-lib/aws-iam';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as cdk from 'aws-cdk-lib';
@@ -152,7 +152,7 @@ const createCustomResource = (
): void => {
const triggerCode = fs.readFileSync(authTriggerAssetFilePath, 'utf-8');
const authTriggerFn = new lambda.Function(stack, 'authTriggerFn', {
- runtime: lambda.Runtime.NODEJS_16_X,
+ runtime: lambda.Runtime.NODEJS_18_X,
code: lambda.Code.fromInline(triggerCode),
handler: 'index.handler',
});
@@ -166,6 +166,11 @@ const createCustomResource = (
}),
);
+ const policyArn = getPermissionsBoundaryArn();
+ if (policyArn) {
+ iam.PermissionsBoundary.of(authTriggerFn).apply(iam.ManagedPolicy.fromManagedPolicyArn(stack, 'PermissionsBoundary', policyArn));
+ }
+
// reason to add iam::PassRole
// AccessDeniedException: User: is not authorized to perform: iam:PassRole
// on resource: if (authTriggerFn.role) {
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-cognito-app-client-secret.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-cognito-app-client-secret.ts
new file mode 100644
index 00000000000..946816f9dc3
--- /dev/null
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/generate-cognito-app-client-secret.ts
@@ -0,0 +1,30 @@
+import { $TSContext, AmplifyCategories, stateManager } from '@aws-amplify/amplify-cli-core';
+import { getAuthResourceName } from '../../../utils/getAuthResourceName';
+import { MetaOutput } from '../import/types';
+import { getAppClientSecret } from './get-app-client-secret-sdk';
+import { projectHasAuth } from './project-has-auth';
+
+/**
+ *
+ * updates app client secret if user pool exists and userpoolClientGenerateSecret is set to true
+ */
+export const updateAppClientWithGeneratedSecret = async (context: $TSContext): Promise => {
+ if (projectHasAuth()) {
+ // check if its imported auth
+ const { imported } = context.amplify.getImportedAuthProperties(context);
+ if (!imported) {
+ const authResourceName = await getAuthResourceName(context);
+ const authMetaOutput: MetaOutput = stateManager.getMeta()?.auth[authResourceName]?.output;
+ const clientId = authMetaOutput.AppClientID;
+ const userpoolId = authMetaOutput.UserPoolId;
+ // no else case required as userpool client is default created with userPool when created through amplify
+ if (clientId && userpoolId) {
+ const appClientSecret = await getAppClientSecret(context, userpoolId, clientId);
+ if (appClientSecret) {
+ authMetaOutput.AppClientSecret = appClientSecret;
+ await context.amplify.updateamplifyMetaAfterResourceUpdate(AmplifyCategories.AUTH, authResourceName, 'output', authMetaOutput);
+ }
+ }
+ }
+ }
+};
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/get-app-client-secret-sdk.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/get-app-client-secret-sdk.ts
new file mode 100644
index 00000000000..cbaedcbd002
--- /dev/null
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/get-app-client-secret-sdk.ts
@@ -0,0 +1,33 @@
+import { $TSContext, AmplifyFault } from '@aws-amplify/amplify-cli-core';
+import { CognitoIdentityServiceProvider } from 'aws-sdk';
+
+export const getAppClientSecret = async (context: $TSContext, userpoolId: string, clientId: string): Promise => {
+ try {
+ const identity = await getCognitoIdentityProviderClient(context);
+ const params = {
+ ClientId: clientId,
+ UserPoolId: userpoolId,
+ };
+ const result = await identity.describeUserPoolClient(params).promise();
+ return result.UserPoolClient?.ClientSecret;
+ } catch (error) {
+ throw new AmplifyFault(
+ 'ServiceCallFault',
+ {
+ message: error.message,
+ },
+ error,
+ );
+ }
+};
+
+const getCognitoIdentityProviderClient = async (context: $TSContext): Promise => {
+ const { client } = await context.amplify.invokePluginMethod<{ client: CognitoIdentityServiceProvider }>(
+ context,
+ 'awscloudformation',
+ undefined,
+ 'getConfiguredCognitoIdentityProviderClient',
+ [context],
+ );
+ return client;
+};
diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/print-auth-exists-warning.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/print-auth-exists-warning.ts
index 12a8280573d..5946ef6c2a6 100644
--- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/print-auth-exists-warning.ts
+++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/print-auth-exists-warning.ts
@@ -18,5 +18,5 @@ export const printAuthExistsWarning = (context: $TSContext): void => {
};
const checkAuthIsImported = (authResources: [string, $TSObject][]): boolean => {
- return authResources.filter(([_, resource]) => resource?.serviceType === 'imported').length > 0;
+ return authResources.filter(([, resource]) => resource?.serviceType === 'imported').length > 0;
};
diff --git a/packages/amplify-category-custom/CHANGELOG.md b/packages/amplify-category-custom/CHANGELOG.md
index e86722d95cd..202abd203c7 100644
--- a/packages/amplify-category-custom/CHANGELOG.md
+++ b/packages/amplify-category-custom/CHANGELOG.md
@@ -3,6 +3,231 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.1.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.24...@aws-amplify/amplify-category-custom@3.1.25) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.23...@aws-amplify/amplify-category-custom@3.1.24) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.22...@aws-amplify/amplify-category-custom@3.1.23) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.21...@aws-amplify/amplify-category-custom@3.1.22) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.20...@aws-amplify/amplify-category-custom@3.1.21) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.19...@aws-amplify/amplify-category-custom@3.1.20) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.18...@aws-amplify/amplify-category-custom@3.1.19) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.17...@aws-amplify/amplify-category-custom@3.1.18) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.16...@aws-amplify/amplify-category-custom@3.1.17) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.15...@aws-amplify/amplify-category-custom@3.1.16) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.14...@aws-amplify/amplify-category-custom@3.1.15) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.13...@aws-amplify/amplify-category-custom@3.1.14) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.11...@aws-amplify/amplify-category-custom@3.1.13) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [3.1.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.11...@aws-amplify/amplify-category-custom@3.1.12) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.10...@aws-amplify/amplify-category-custom@3.1.11) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.9...@aws-amplify/amplify-category-custom@3.1.10) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.8...@aws-amplify/amplify-category-custom@3.1.9) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.7...@aws-amplify/amplify-category-custom@3.1.8) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.6...@aws-amplify/amplify-category-custom@3.1.7) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.5...@aws-amplify/amplify-category-custom@3.1.6) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.4...@aws-amplify/amplify-category-custom@3.1.5) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.3...@aws-amplify/amplify-category-custom@3.1.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.2...@aws-amplify/amplify-category-custom@3.1.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.1...@aws-amplify/amplify-category-custom@3.1.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
+## [3.1.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.1.0...@aws-amplify/amplify-category-custom@3.1.1) (2023-07-24)
+
+
+### Bug Fixes
+
+* skip hooks if flag detected ([a58e13c](https://github.com/aws-amplify/amplify-cli/commit/a58e13c55fb7dfd9e4f4a945e96d429cbecd2f9a))
+
+
+
+
+
+# [3.1.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.0.9...@aws-amplify/amplify-category-custom@3.1.0) (2023-07-20)
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+
+
+
+
+
+## [3.0.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.0.8...@aws-amplify/amplify-category-custom@3.0.9) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-custom
+
+
+
+
+
## [3.0.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-custom@3.0.6...@aws-amplify/amplify-category-custom@3.0.8) (2023-05-25)
diff --git a/packages/amplify-category-custom/package.json b/packages/amplify-category-custom/package.json
index d75c62c40f9..61b85a7a8e7 100644
--- a/packages/amplify-category-custom/package.json
+++ b/packages/amplify-category-custom/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-custom",
- "version": "3.0.8",
+ "version": "3.1.25",
"description": "amplify-cli custom resources plugin",
"repository": {
"type": "git",
@@ -26,9 +26,9 @@
"access": "public"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "aws-cdk-lib": "~2.68.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "aws-cdk-lib": "~2.177.0",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
@@ -37,6 +37,7 @@
},
"devDependencies": {
"@types/lodash": "^4.14.149",
+ "jest": "^29.5.0",
"rimraf": "^3.0.2"
},
"jest": {
diff --git a/packages/amplify-category-custom/resources/package.json b/packages/amplify-category-custom/resources/package.json
index 541adcfde46..2d578af0eb6 100644
--- a/packages/amplify-category-custom/resources/package.json
+++ b/packages/amplify-category-custom/resources/package.json
@@ -9,7 +9,7 @@
},
"dependencies": {
"@aws-amplify/cli-extensibility-helper": "^3.0.0",
- "aws-cdk-lib": "~2.68.0",
+ "aws-cdk-lib": "~2.177.0",
"constructs": "^10.0.5"
},
"devDependencies": {
diff --git a/packages/amplify-category-custom/resources/sample.npmrc b/packages/amplify-category-custom/resources/sample.npmrc
new file mode 100644
index 00000000000..9b233e42bf4
--- /dev/null
+++ b/packages/amplify-category-custom/resources/sample.npmrc
@@ -0,0 +1 @@
+resolution-mode=highest
diff --git a/packages/amplify-category-custom/src/__tests__/commands/update.test.ts b/packages/amplify-category-custom/src/__tests__/commands/update.test.ts
index 23c2eb96c30..b32d61b8e83 100644
--- a/packages/amplify-category-custom/src/__tests__/commands/update.test.ts
+++ b/packages/amplify-category-custom/src/__tests__/commands/update.test.ts
@@ -8,7 +8,7 @@ jest.mock('../../walkthroughs/cloudformation-walkthrough');
jest.mock('@aws-amplify/amplify-cli-core');
jest.mock('@aws-amplify/amplify-prompts');
-let mockAmplifyMeta = {
+const mockAmplifyMeta = {
custom: {
mockcdkresourcename: {
service: CDK_SERVICE_NAME,
diff --git a/packages/amplify-category-custom/src/__tests__/utils/build-custom-resources.test.ts b/packages/amplify-category-custom/src/__tests__/utils/build-custom-resources.test.ts
index 7396dfa476a..0eb9e5d2cfe 100644
--- a/packages/amplify-category-custom/src/__tests__/utils/build-custom-resources.test.ts
+++ b/packages/amplify-category-custom/src/__tests__/utils/build-custom-resources.test.ts
@@ -43,6 +43,7 @@ jest.mock('@aws-amplify/amplify-cli-core', () => ({
readJson: jest.fn(),
stringify: jest.fn(),
},
+ skipHooks: jest.fn().mockReturnValue(false),
}));
describe('build custom resources scenarios', () => {
diff --git a/packages/amplify-category-custom/src/__tests__/utils/dependency-management-utils.test.ts b/packages/amplify-category-custom/src/__tests__/utils/dependency-management-utils.test.ts
index 6a5e0a3ed60..fd15322b234 100644
--- a/packages/amplify-category-custom/src/__tests__/utils/dependency-management-utils.test.ts
+++ b/packages/amplify-category-custom/src/__tests__/utils/dependency-management-utils.test.ts
@@ -26,29 +26,8 @@ pathManager.getBackendDirPath = jest.fn().mockReturnValue('mockTargetDir');
pathManager.getResourceDirectoryPath = jest.fn().mockReturnValue('mockResourceDir');
describe('getResourceCfnOutputAttributes() scenarios', () => {
- let mockContext: $TSContext;
-
beforeEach(() => {
jest.clearAllMocks();
- mockContext = {
- amplify: {
- openEditor: jest.fn(),
- updateamplifyMetaAfterResourceAdd: jest.fn(),
- copyBatch: jest.fn(),
- getResourceStatus: jest.fn().mockResolvedValue({
- allResources: [
- {
- resourceName: 'mockresource1',
- service: 'customCDK',
- },
- {
- resourceName: 'mockresource2',
- service: 'customCDK',
- },
- ],
- }),
- },
- } as unknown as $TSContext;
});
it('get resource attr for resources with build folder with one cfn file', async () => {
@@ -109,29 +88,8 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
});
describe('getAllResources() scenarios', () => {
- let mockContext: $TSContext;
-
beforeEach(() => {
jest.clearAllMocks();
- mockContext = {
- amplify: {
- openEditor: jest.fn(),
- updateamplifyMetaAfterResourceAdd: jest.fn(),
- copyBatch: jest.fn(),
- getResourceStatus: jest.fn().mockResolvedValue({
- allResources: [
- {
- resourceName: 'mockresource1',
- service: 'customCDK',
- },
- {
- resourceName: 'mockresource2',
- service: 'customCDK',
- },
- ],
- }),
- },
- } as unknown as $TSContext;
});
it('get all resource types', async () => {
@@ -161,29 +119,8 @@ describe('getAllResources() scenarios', () => {
});
describe('addCDKResourceDependency() scenarios', () => {
- let mockContext: $TSContext;
-
beforeEach(() => {
jest.clearAllMocks();
- mockContext = {
- amplify: {
- openEditor: jest.fn(),
- updateamplifyMetaAfterResourceAdd: jest.fn(),
- copyBatch: jest.fn(),
- getResourceStatus: jest.fn().mockResolvedValue({
- allResources: [
- {
- resourceName: 'mockresource1',
- service: 'customCDK',
- },
- {
- resourceName: 'mockresource2',
- service: 'customCDK',
- },
- ],
- }),
- },
- } as unknown as $TSContext;
});
it('get depenencies for a custom CDK stack', async () => {
diff --git a/packages/amplify-category-custom/src/__tests__/walkthroughts/cdk-walkthrough.test.ts b/packages/amplify-category-custom/src/__tests__/walkthroughts/cdk-walkthrough.test.ts
index 5eb071b95bb..f07fdcf82b5 100644
--- a/packages/amplify-category-custom/src/__tests__/walkthroughts/cdk-walkthrough.test.ts
+++ b/packages/amplify-category-custom/src/__tests__/walkthroughts/cdk-walkthrough.test.ts
@@ -22,7 +22,7 @@ pathManager.getBackendDirPath = jest.fn().mockReturnValue('mockTargetDir');
(JSONUtilities.writeJson = jest.fn()), (JSONUtilities.readJson = jest.fn());
const buildCustomResources_mock = buildCustomResources as jest.MockedFunction;
-let customResourceNameQuestion_mock = customResourceNameQuestion as jest.MockedFunction;
+const customResourceNameQuestion_mock = customResourceNameQuestion as jest.MockedFunction;
customResourceNameQuestion_mock.mockResolvedValue('customresoourcename');
describe('addCDKWalkthrough scenarios', () => {
@@ -46,6 +46,6 @@ describe('addCDKWalkthrough scenarios', () => {
expect(buildCustomResources_mock).toHaveBeenCalledWith(mockContext, 'customresoourcename');
expect(mockContext.amplify.openEditor).toHaveBeenCalledTimes(1);
expect(mockContext.amplify.updateamplifyMetaAfterResourceAdd).toHaveBeenCalledTimes(1);
- expect(fs.writeFileSync).toHaveBeenCalledTimes(1);
+ expect(fs.writeFileSync).toHaveBeenCalledTimes(2);
});
});
diff --git a/packages/amplify-category-custom/src/__tests__/walkthroughts/cloudformation-walkthrough.test.ts b/packages/amplify-category-custom/src/__tests__/walkthroughts/cloudformation-walkthrough.test.ts
index 97d9fe9f098..db47d62f655 100644
--- a/packages/amplify-category-custom/src/__tests__/walkthroughts/cloudformation-walkthrough.test.ts
+++ b/packages/amplify-category-custom/src/__tests__/walkthroughts/cloudformation-walkthrough.test.ts
@@ -19,7 +19,7 @@ jest.mock('fs-extra', () => ({
pathManager.getBackendDirPath = jest.fn().mockReturnValue('mockTargetDir');
-let customResourceNameQuestion_mock = customResourceNameQuestion as jest.MockedFunction;
+const customResourceNameQuestion_mock = customResourceNameQuestion as jest.MockedFunction;
customResourceNameQuestion_mock.mockResolvedValue('customresoourcename');
describe('addCFNWalkthrough scenarios', () => {
diff --git a/packages/amplify-category-custom/src/utils/build-custom-resources.ts b/packages/amplify-category-custom/src/utils/build-custom-resources.ts
index edea003d43a..007ced69b6d 100644
--- a/packages/amplify-category-custom/src/utils/build-custom-resources.ts
+++ b/packages/amplify-category-custom/src/utils/build-custom-resources.ts
@@ -15,6 +15,7 @@ import * as path from 'path';
import { categoryName, TYPES_DIR_NAME, AMPLIFY_RESOURCES_TYPE_DEF_FILENAME } from './constants';
import { getAllResources } from './dependency-management-utils';
import { generateCloudFormationFromCDK } from './generate-cfn-from-cdk';
+import { skipHooks } from '@aws-amplify/amplify-cli-core';
type ResourceMeta = ResourceTuple & {
service: string;
@@ -69,14 +70,18 @@ export const generateDependentResourcesType = async (): Promise => {
const buildResource = async (resource: ResourceMeta): Promise => {
const targetDir = path.resolve(path.join(pathManager.getBackendDirPath(), categoryName, resource.resourceName));
-
+ if (skipHooks()) {
+ throw new AmplifyError('DeploymentError', {
+ message: 'A flag to disable custom resources has been detected, please deploy from a different environment.',
+ }); // should rollback
+ }
// generate dynamic types for Amplify resources
await generateDependentResourcesType();
const packageManager = await getPackageManager(targetDir);
if (packageManager === null) {
- throw new Error('No package manager found. Please install npm or yarn to compile overrides for this project.');
+ throw new Error('No package manager found. Please install npm, yarn, or pnpm to compile overrides for this project.');
}
try {
diff --git a/packages/amplify-category-custom/src/walkthroughs/cdk-walkthrough.ts b/packages/amplify-category-custom/src/walkthroughs/cdk-walkthrough.ts
index 2481718e6f0..fa3fef1f3de 100644
--- a/packages/amplify-category-custom/src/walkthroughs/cdk-walkthrough.ts
+++ b/packages/amplify-category-custom/src/walkthroughs/cdk-walkthrough.ts
@@ -57,4 +57,7 @@ async function generateSkeletonDir(resourceName: string) {
const cdkFilepath = path.join(targetDir, 'cdk-stack.ts');
fs.writeFileSync(cdkFilepath, fs.readFileSync(path.join(srcResourceDirPath, 'cdk-stack.ts.sample')));
+
+ const npmRcPath = path.join(targetDir, '.npmrc');
+ fs.writeFileSync(npmRcPath, fs.readFileSync(path.join(srcResourceDirPath, 'sample.npmrc')));
}
diff --git a/packages/amplify-category-function/CHANGELOG.md b/packages/amplify-category-function/CHANGELOG.md
index fb43e4376ae..fc3b395238e 100644
--- a/packages/amplify-category-function/CHANGELOG.md
+++ b/packages/amplify-category-function/CHANGELOG.md
@@ -3,6 +3,251 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.7.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.10...@aws-amplify/amplify-category-function@5.7.11) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.9...@aws-amplify/amplify-category-function@5.7.10) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.8...@aws-amplify/amplify-category-function@5.7.9) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.7...@aws-amplify/amplify-category-function@5.7.8) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.6...@aws-amplify/amplify-category-function@5.7.7) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.5...@aws-amplify/amplify-category-function@5.7.6) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.4...@aws-amplify/amplify-category-function@5.7.5) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.3...@aws-amplify/amplify-category-function@5.7.4) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.2...@aws-amplify/amplify-category-function@5.7.3) (2024-04-15)
+
+
+### Bug Fixes
+
+* upgrade Go runtime and fix e2e ([#13671](https://github.com/aws-amplify/amplify-cli/issues/13671)) ([395f717](https://github.com/aws-amplify/amplify-cli/commit/395f717cf52e7beef76f00ee08d37877138b0c30))
+
+
+
+
+
+## [5.7.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.1...@aws-amplify/amplify-category-function@5.7.2) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.7.0...@aws-amplify/amplify-category-function@5.7.1) (2024-03-06)
+
+
+### Reverts
+
+* Revert "chore: bump data package versions (#13486)" (#13487) ([3280d40](https://github.com/aws-amplify/amplify-cli/commit/3280d40a5ab50c675b0e2b8050ad35a69c83cdc2)), closes [#13486](https://github.com/aws-amplify/amplify-cli/issues/13486) [#13487](https://github.com/aws-amplify/amplify-cli/issues/13487)
+
+
+
+
+
+# [5.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.6.4...@aws-amplify/amplify-category-function@5.7.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [5.6.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.6.2...@aws-amplify/amplify-category-function@5.6.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.6.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.6.2...@aws-amplify/amplify-category-function@5.6.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.6.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.6.1...@aws-amplify/amplify-category-function@5.6.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.6.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.6.0...@aws-amplify/amplify-category-function@5.6.1) (2023-10-12)
+
+
+### Bug Fixes
+
+* add retained secrets to syncSecretDeltas ([#13300](https://github.com/aws-amplify/amplify-cli/issues/13300)) ([f3c9c05](https://github.com/aws-amplify/amplify-cli/commit/f3c9c05617b55560ac78f824cf71d4001cb5c58b))
+
+
+
+
+
+# [5.6.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.5.3...@aws-amplify/amplify-category-function@5.6.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [5.5.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.5.2...@aws-amplify/amplify-category-function@5.5.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.5.1...@aws-amplify/amplify-category-function@5.5.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.5.0...@aws-amplify/amplify-category-function@5.5.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+# [5.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.4.4...@aws-amplify/amplify-category-function@5.5.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [5.4.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.4.3...@aws-amplify/amplify-category-function@5.4.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.4.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.4.2...@aws-amplify/amplify-category-function@5.4.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.4.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.4.1...@aws-amplify/amplify-category-function@5.4.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+## [5.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.4.0...@aws-amplify/amplify-category-function@5.4.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-function
+
+
+
+
+
+# [5.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.3.4...@aws-amplify/amplify-category-function@5.4.0) (2023-07-20)
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [5.3.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.3.3...@aws-amplify/amplify-category-function@5.3.4) (2023-06-13)
+
+
+### Bug Fixes
+
+* functions e2e tests on windows ([#12745](https://github.com/aws-amplify/amplify-cli/issues/12745)) ([0de4529](https://github.com/aws-amplify/amplify-cli/commit/0de45299fbaafb090893f96c1884cdcff321f511))
+* throw message when adding lambda function with same name ([#12623](https://github.com/aws-amplify/amplify-cli/issues/12623)) ([0819db4](https://github.com/aws-amplify/amplify-cli/commit/0819db49c0f3b1057c0e5ca94d674f2dc1cc3d77))
+
+
+
+
+
## [5.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-function@5.3.1...@aws-amplify/amplify-category-function@5.3.3) (2023-05-25)
diff --git a/packages/amplify-category-function/package.json b/packages/amplify-category-function/package.json
index 9f93f4487f5..3214c4a7f79 100644
--- a/packages/amplify-category-function/package.json
+++ b/packages/amplify-category-function/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-function",
- "version": "5.3.3",
+ "version": "5.7.11",
"description": "amplify-cli function plugin",
"repository": {
"type": "git",
@@ -26,19 +26,19 @@
"access": "public"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
- "@aws-amplify/amplify-function-plugin-interface": "1.10.2",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
+ "@aws-amplify/amplify-function-plugin-interface": "1.12.1",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"archiver": "^5.3.0",
- "aws-sdk": "^2.1354.0",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
"cloudform-types": "^4.2.0",
"enquirer": "^2.3.6",
"folder-hash": "^4.0.2",
"fs-extra": "^8.1.0",
"globby": "^11.0.3",
- "graphql-transformer-core": "^8.1.2",
+ "graphql-transformer-core": "^8.2.13",
"inquirer": "^7.3.3",
"inquirer-datepicker": "^2.0.0",
"jstreemap": "^1.28.2",
@@ -47,7 +47,8 @@
"uuid": "^8.3.2"
},
"devDependencies": {
- "@types/folder-hash": "^4.0.1"
+ "@types/folder-hash": "^4.0.1",
+ "jest": "^29.5.0"
},
"jest": {
"collectCoverage": true,
diff --git a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts
index 2a410148006..79bac54b66d 100644
--- a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts
+++ b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts
@@ -33,7 +33,7 @@ const buildFunction_mock = buildFunction as jest.MockedFunction {
beforeEach(() => jest.clearAllMocks());
- it('opens the correct service console', () => {
+ it('opens the correct service console', async () => {
const contextStub = {
amplify: {
getProjectMeta: () => ({
@@ -45,14 +45,14 @@ describe('awscloudformation function provider', () => {
}),
},
} as $TSContext;
- openConsole(contextStub, ServiceName.LambdaFunction);
+ await openConsole(contextStub, ServiceName.LambdaFunction);
const openMock = open as any;
expect(openMock.mock.calls.length).toBe(1);
expect(openMock.mock.calls[0][0]).toMatchSnapshot();
openMock.mockClear();
- openConsole(contextStub, ServiceName.LambdaLayer);
+ await openConsole(contextStub, ServiceName.LambdaLayer);
expect(openMock.mock.calls.length).toBe(1);
expect(openMock.mock.calls[0][0]).toMatchSnapshot();
});
diff --git a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/addLayerToFunctionWalkthrough.test.ts b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/addLayerToFunctionWalkthrough.test.ts
index c22e5279f9e..5f175aa1fde 100644
--- a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/addLayerToFunctionWalkthrough.test.ts
+++ b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/addLayerToFunctionWalkthrough.test.ts
@@ -172,7 +172,7 @@ describe('add layer to function walkthrough', () => {
});
it('asks to reorder the selected layers', async () => {
- const result = await addLayersToFunctionWalkthrough(getContextStubWith(confirmPromptTrue_mock), runtimeStub);
+ await addLayersToFunctionWalkthrough(getContextStubWith(confirmPromptTrue_mock), runtimeStub);
expect(askLayerOrderQuestion_mock.mock.calls.length).toBe(1);
});
diff --git a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/lambda-layer-cloud-formation-template.test.ts b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/lambda-layer-cloud-formation-template.test.ts
index 9bb18950d94..9b3e8c573b7 100644
--- a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/lambda-layer-cloud-formation-template.test.ts
+++ b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/lambda-layer-cloud-formation-template.test.ts
@@ -114,7 +114,7 @@ describe('test layer CFN generation functions', () => {
});
it('should generate the expected CFN for an existing LL version and new version with complex permissions', () => {
- let permissions: LayerPermission[] = [
+ const permissions: LayerPermission[] = [
{ type: PermissionEnum.Private },
{ type: PermissionEnum.AwsAccounts, accounts: ['123456789012', '098765432112'] },
{ type: PermissionEnum.AwsOrg, orgs: ['o-123456789012', 'o-098765432112'] },
@@ -129,7 +129,7 @@ describe('test layer CFN generation functions', () => {
it('should generate the expected CFN for an existing LL version and new version with public permission', () => {
// Public should override other permissions
- let permissions: LayerPermission[] = [
+ const permissions: LayerPermission[] = [
{ type: PermissionEnum.Private },
{ type: PermissionEnum.AwsAccounts, accounts: ['123456789012', '098765432112'] },
{ type: PermissionEnum.AwsOrg, orgs: ['o-123456789012', 'o-098765432112'] },
diff --git a/packages/amplify-category-function/src/commands/function/build.ts b/packages/amplify-category-function/src/commands/function/build.ts
index f516408904a..9abb6a1b617 100644
--- a/packages/amplify-category-function/src/commands/function/build.ts
+++ b/packages/amplify-category-function/src/commands/function/build.ts
@@ -28,15 +28,11 @@ export const run = async (context: $TSContext) => {
await packageResource(context, resource);
}
} catch (err) {
- context.print.info(err.stack);
- context.print.error('There was an error building the function resources');
- const amplifyError = new AmplifyError(
+ throw new AmplifyError(
'PackagingLambdaFunctionError',
{ message: `There was an error building the function resources ${err.message}` },
err,
);
- void context.usageData.emitError(amplifyError);
- process.exitCode = 1;
}
};
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/index.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/index.ts
index dc8649ce7d9..eee2565855c 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/index.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/index.ts
@@ -16,6 +16,7 @@ import {
FunctionTriggerParameters,
LambdaLayer,
} from '@aws-amplify/amplify-function-plugin-interface';
+import { printer } from '@aws-amplify/amplify-prompts';
import * as fs from 'fs-extra';
import _ from 'lodash';
import * as path from 'path';
@@ -127,19 +128,18 @@ export async function addFunctionResource(
if (completeParams.skipNextSteps) {
return completeParams.resourceName;
}
- const { print } = context;
const customPoliciesPath = pathManager.getCustomPoliciesPath(category, completeParams.resourceName);
- print.success(`Successfully added resource ${completeParams.resourceName} locally.`);
- print.info('');
- print.success('Next steps:');
- print.info(`Check out sample function code generated in /amplify/backend/function/${completeParams.resourceName}/src`);
- print.info('"amplify function build" builds all of your functions currently in the project');
- print.info('"amplify mock function " runs your function locally');
- print.info(`To access AWS resources outside of this Amplify app, edit the ${customPoliciesPath}`);
- print.info('"amplify push" builds all of your local backend resources and provisions them in the cloud');
- print.info(
+ printer.success(`Successfully added resource ${completeParams.resourceName} locally.`);
+ printer.info('');
+ printer.success('Next steps:');
+ printer.info(`Check out sample function code generated in /amplify/backend/function/${completeParams.resourceName}/src`);
+ printer.info('"amplify function build" builds all of your functions currently in the project');
+ printer.info('"amplify mock function " runs your function locally');
+ printer.info(`To access AWS resources outside of this Amplify app, edit the ${customPoliciesPath}`);
+ printer.info('"amplify push" builds all of your local backend resources and provisions them in the cloud');
+ printer.info(
'"amplify publish" builds all of your local backend and front-end resources (if you added hosting category) and provisions them in the cloud',
);
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/functionSecretsStateManager.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/functionSecretsStateManager.ts
index eedab135367..6f3f2db2860 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/functionSecretsStateManager.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/functionSecretsStateManager.ts
@@ -100,7 +100,11 @@ export class FunctionSecretsStateManager {
return;
}
const cloudSecretNames = await this.getCloudFunctionSecretNames(functionName);
- const addedSecrets = localSecretNames.filter((name) => !cloudSecretNames.includes(name));
+ const retainedSecrets: string[] = [];
+ const addedSecrets: string[] = [];
+
+ localSecretNames.forEach((name) => (cloudSecretNames.includes(name) ? retainedSecrets.push(name) : addedSecrets.push(name)));
+
if (!addedSecrets.length) {
return;
}
@@ -118,8 +122,12 @@ export class FunctionSecretsStateManager {
link: 'https://docs.amplify.aws/cli/reference/ssm-parameter-store/#manually-creating-parameters',
});
}
+
+ const current = secretNamesToSecretDeltas(retainedSecrets);
const delta = await prePushMissingSecretsWalkthrough(functionName, addedSecrets);
- await this.syncSecretDeltas(delta, functionName);
+ const secretDeltas = { ...current, ...delta };
+
+ await this.syncSecretDeltas(secretDeltas, functionName);
};
/**
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/secretDeltaUtilities.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/secretDeltaUtilities.ts
index 1334c538a95..54479ad37c5 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/secretDeltaUtilities.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/secretDeltaUtilities.ts
@@ -15,7 +15,7 @@ export const hasExistingSecrets = (secretDeltas: SecretDeltas) =>
*/
export const getExistingSecrets = (secretDeltas: SecretDeltas) =>
Object.entries(secretDeltas)
- .filter(([_, delta]) => existingSecretDeltaPredicate(delta))
+ .filter(([, delta]) => existingSecretDeltaPredicate(delta))
.reduce((acc, [secretName, secretDelta]) => ({ ...acc, [secretName]: secretDelta }), {} as SecretDeltas);
/**
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/lambda-walkthrough.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/lambda-walkthrough.ts
index 680ea13accc..3e589dfb8b6 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/lambda-walkthrough.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/lambda-walkthrough.ts
@@ -38,6 +38,8 @@ import { autoGeneratedParameters } from './autogeneratedParameters';
import { askExecRolePermissionsQuestions } from './execPermissionsWalkthrough';
import { generalQuestionsWalkthrough, settingsUpdateSelection } from './generalQuestionsWalkthrough';
import { scheduleWalkthrough } from './scheduleWalkthrough';
+import { printer } from '@aws-amplify/amplify-prompts';
+import { packageManagerWalkthrough } from './packageManagerWalkthrough';
/**
* Starting point for CLI walkthrough that generates a lambda function
@@ -72,10 +74,10 @@ export const createWalkthrough = async (
}
// list out the advanced settings before asking whether to configure them
- context.print.info('');
- context.print.success('Available advanced settings:');
+ printer.blankLine();
+ printer.success('Available advanced settings:');
advancedSettingsList.forEach((setting) => context.print.info('- '.concat(setting)));
- context.print.info('');
+ printer.blankLine();
// ask whether to configure advanced settings
if (await context.amplify.confirmPrompt('Do you want to configure advanced settings?', false)) {
@@ -110,6 +112,9 @@ export const createWalkthrough = async (
Object.keys(getStoredEnvironmentVariables(templateParameters.functionName)),
),
);
+
+ // ask scheduling Lambda questions and merge in results
+ templateParameters = merge(templateParameters, await packageManagerWalkthrough(templateParameters.runtime.value));
}
return templateParameters;
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/packageManagerWalkthrough.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/packageManagerWalkthrough.ts
new file mode 100644
index 00000000000..148bf27a288
--- /dev/null
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/service-walkthroughs/packageManagerWalkthrough.ts
@@ -0,0 +1,36 @@
+import { getPackageManagerByType, packageManagers, PackageManagerType } from '@aws-amplify/amplify-cli-core';
+import { BuildType, FunctionParameters } from '@aws-amplify/amplify-function-plugin-interface';
+import { minLength, prompter } from '@aws-amplify/amplify-prompts';
+
+export const packageManagerWalkthrough = async (runtime: string): Promise> => {
+ if (runtime === 'nodejs') {
+ const packageManagerOptions = Object.values(packageManagers).map((pm) => ({
+ name: pm.displayValue,
+ value: pm.packageManager as string,
+ }));
+
+ const packageManager = (await prompter.pick(
+ 'Choose the package manager that you want to use:',
+ packageManagerOptions,
+ )) as PackageManagerType;
+
+ return {
+ scripts: {
+ build: await getBuildCommand(packageManager),
+ },
+ };
+ }
+
+ return {};
+};
+
+const getBuildCommand = async (packageManager: PackageManagerType): Promise => {
+ if (packageManager === 'custom') {
+ return prompter.input('Enter command or script path to build your function:', {
+ validate: minLength(1),
+ });
+ } else {
+ const packageManagerInstance = getPackageManagerByType(packageManager);
+ return [packageManagerInstance.executable].concat(packageManagerInstance.getInstallArgs(BuildType.PROD)).join(' ');
+ }
+};
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/buildFunction.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/buildFunction.ts
index 701ff6f6230..f7b091b3efd 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/buildFunction.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/buildFunction.ts
@@ -1,5 +1,6 @@
import { $TSContext, pathManager, AmplifyError } from '@aws-amplify/amplify-cli-core';
import { BuildRequest, BuildType, FunctionRuntimeLifecycleManager } from '@aws-amplify/amplify-function-plugin-interface';
+import { printer } from '@aws-amplify/amplify-prompts';
import { categoryName } from '../../../constants';
export const buildFunction = async (
@@ -15,31 +16,26 @@ export const buildFunction = async (
const depCheck = await runtimePlugin.checkDependencies(breadcrumbs.functionRuntime);
if (!depCheck.hasRequiredDependencies) {
- context.print.error(depCheck.errorMessage || `You are missing dependencies required to package ${resourceName}`);
+ printer.error(depCheck.errorMessage || `You are missing dependencies required to package ${resourceName}`);
throw new AmplifyError('PackagingLambdaFunctionError', { message: `Missing required dependencies to package ${resourceName}` });
}
const prevBuildTime = lastBuildTimestamp ? new Date(lastBuildTimestamp) : undefined;
// build the function
- let rebuilt = false;
- if (breadcrumbs.scripts && breadcrumbs.scripts.build) {
- // TODO
- throw new AmplifyError('NotImplementedError', { message: 'Executing custom build scripts is not yet implemented' });
- } else {
- const buildRequest: BuildRequest = {
- buildType,
- srcRoot: pathManager.getResourceDirectoryPath(undefined, categoryName, resourceName),
- runtime: breadcrumbs.functionRuntime,
- legacyBuildHookParams: {
- projectRoot: pathManager.findProjectRoot(),
- resourceName,
- },
- lastBuildTimeStamp: prevBuildTime,
- lastBuildType,
- };
- rebuilt = (await runtimePlugin.build(buildRequest)).rebuilt;
- }
+ const buildRequest: BuildRequest = {
+ buildType,
+ srcRoot: pathManager.getResourceDirectoryPath(undefined, categoryName, resourceName),
+ runtime: breadcrumbs.functionRuntime,
+ legacyBuildHookParams: {
+ projectRoot: pathManager.findProjectRoot(),
+ resourceName,
+ },
+ lastBuildTimeStamp: prevBuildTime,
+ lastBuildType,
+ scripts: breadcrumbs.scripts,
+ };
+ const rebuilt = (await runtimePlugin.build(buildRequest)).rebuilt;
if (rebuilt) {
context.amplify.updateamplifyMetaAfterBuild({ category: categoryName, resourceName }, buildType.toString());
return new Date().toISOString();
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/functionPluginLoader.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/functionPluginLoader.ts
index 835994b5f85..6aac0f6f5f1 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/functionPluginLoader.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/functionPluginLoader.ts
@@ -1,19 +1,21 @@
-import inquirer from 'inquirer';
+import { $TSAny, $TSContext } from '@aws-amplify/amplify-cli-core';
import {
FunctionParameters,
- FunctionTemplateCondition,
FunctionRuntimeCondition,
+ FunctionRuntimeLifecycleManager,
FunctionRuntimeParameters,
+ FunctionTemplateCondition,
FunctionTemplateParameters,
- FunctionRuntimeLifecycleManager,
RuntimeContributionRequest,
TemplateContributionRequest,
} from '@aws-amplify/amplify-function-plugin-interface';
-import { ServiceName } from './constants';
+import { printer } from '@aws-amplify/amplify-prompts';
+import inquirer from 'inquirer';
import _ from 'lodash';
-import { LayerParameters } from './layerParams';
-import { $TSAny, $TSContext } from '@aws-amplify/amplify-cli-core';
import { categoryName } from '../../../constants';
+import { ServiceName } from './constants';
+import { LayerParameters } from './layerParams';
+
/*
* This file contains the logic for loading, selecting and executing function plugins (currently runtime and template plugins)
*/
@@ -86,9 +88,7 @@ export async function runtimeWalkthrough(
const plugin = await loadPluginFromFactory(selection.pluginPath, 'functionRuntimeContributorFactory', context);
const depCheck = await (plugin as FunctionRuntimeLifecycleManager).checkDependencies(selection.value);
if (!depCheck.hasRequiredDependencies) {
- context.print.warning(
- depCheck.errorMessage || 'Some dependencies required for building and packaging this runtime are not installed',
- );
+ printer.warn(depCheck.errorMessage || 'Some dependencies required for building and packaging this runtime are not installed');
}
plugins.push(plugin);
}
@@ -113,6 +113,7 @@ async function _functionRuntimeWalkthroughHelper(
runtimes.push({
...contribution,
runtimePluginId: selections[i].pluginId,
+ scripts: selections[i].scripts,
});
}
return runtimes;
@@ -129,8 +130,8 @@ async function getSelectionsFromContributors(
// get providers from context
const templateProviders = context.pluginPlatform.plugins[selectionOptions.pluginType];
if (!templateProviders) {
- context.print.error(selectionOptions.notFoundMessage);
- context.print.error(notFoundSuffix);
+ printer.error(selectionOptions.notFoundMessage);
+ printer.error(notFoundSuffix);
throw new Error('No plugins found for function configuration');
}
@@ -154,8 +155,8 @@ async function getSelectionsFromContributors(
// sanity checks
let selection;
if (selections.length === 0) {
- context.print.error(selectionOptions.notFoundMessage);
- context.print.error(notFoundSuffix);
+ printer.error(selectionOptions.notFoundMessage);
+ printer.error(notFoundSuffix);
throw new Error('Plugins found but no selections supplied for function configuration');
} else if (selections.length === 1) {
// quick hack to print custom messages for single selection options
@@ -165,7 +166,7 @@ async function getSelectionsFromContributors(
} else if (selectionOptions.listOptionsField === 'runtimes') {
singleOptionMsg = `Only one runtime detected: ${selections[0].name}. Learn more about additional runtimes at https://docs.amplify.aws/cli/function`;
}
- context.print.info(singleOptionMsg);
+ printer.info(singleOptionMsg);
selection = selections[0].value;
} else if (isDefaultDefined(selectionOptions)) {
selection = selectionOptions.defaultSelection;
@@ -187,7 +188,7 @@ async function getSelectionsFromContributors(
selection = [selection];
}
- return selection.map((s) => {
+ return selection.map((s: string) => {
return {
value: s,
pluginPath: selectionMap.get(s).path,
@@ -244,6 +245,9 @@ interface PluginSelection {
pluginPath: string;
value: string;
pluginId: string;
+ scripts?: {
+ build: string;
+ };
}
interface ListOption {
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts
index f79b33602fa..5b1eab1d2f4 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts
@@ -243,7 +243,7 @@ export function getLayerName(context: $TSContext, layerName: string): string {
export function getLambdaFunctionsDependentOnLayerFromMeta(layerName: string, meta: $TSMeta) {
return Object.entries(meta[categoryName]).filter(
- ([_, lambdaFunction]: [string, $TSObject]) =>
+ ([, lambdaFunction]: [string, $TSObject]) =>
lambdaFunction.service === ServiceName.LambdaFunction &&
lambdaFunction?.dependsOn?.filter((dependency) => dependency.resourceName === layerName).length > 0,
);
diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/storeResources.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/storeResources.ts
index 05c3ddb069a..40ae6f01121 100644
--- a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/storeResources.ts
+++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/storeResources.ts
@@ -375,6 +375,7 @@ const createBreadcrumbs = (params: FunctionParameters | FunctionTriggerParameter
functionRuntime: 'nodejs',
useLegacyBuild: true,
defaultEditorFile: 'src/index.js',
+ scripts: params.scripts,
};
}
return {
@@ -382,6 +383,7 @@ const createBreadcrumbs = (params: FunctionParameters | FunctionTriggerParameter
functionRuntime: params.runtime.value,
useLegacyBuild: params.runtime.value === 'nodejs', // so we can update node builds in the future
defaultEditorFile: params.functionTemplate.defaultEditorFile,
+ scripts: params.scripts,
};
};
diff --git a/packages/amplify-category-geo/CHANGELOG.md b/packages/amplify-category-geo/CHANGELOG.md
index 483f0f41c6f..e773c181b52 100644
--- a/packages/amplify-category-geo/CHANGELOG.md
+++ b/packages/amplify-category-geo/CHANGELOG.md
@@ -3,6 +3,242 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.5.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.16...@aws-amplify/amplify-category-geo@3.5.17) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.15...@aws-amplify/amplify-category-geo@3.5.16) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.14...@aws-amplify/amplify-category-geo@3.5.15) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.13...@aws-amplify/amplify-category-geo@3.5.14) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.12...@aws-amplify/amplify-category-geo@3.5.13) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.11...@aws-amplify/amplify-category-geo@3.5.12) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.10...@aws-amplify/amplify-category-geo@3.5.11) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.9...@aws-amplify/amplify-category-geo@3.5.10) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.8...@aws-amplify/amplify-category-geo@3.5.9) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.7...@aws-amplify/amplify-category-geo@3.5.8) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.6...@aws-amplify/amplify-category-geo@3.5.7) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.5...@aws-amplify/amplify-category-geo@3.5.6) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.4...@aws-amplify/amplify-category-geo@3.5.5) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.2...@aws-amplify/amplify-category-geo@3.5.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [3.5.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.2...@aws-amplify/amplify-category-geo@3.5.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.1...@aws-amplify/amplify-category-geo@3.5.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.5.0...@aws-amplify/amplify-category-geo@3.5.1) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+# [3.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.4.3...@aws-amplify/amplify-category-geo@3.5.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [3.4.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.4.2...@aws-amplify/amplify-category-geo@3.4.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.4.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.4.1...@aws-amplify/amplify-category-geo@3.4.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.4.0...@aws-amplify/amplify-category-geo@3.4.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+# [3.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.3.4...@aws-amplify/amplify-category-geo@3.4.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [3.3.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.3.3...@aws-amplify/amplify-category-geo@3.3.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.3.2...@aws-amplify/amplify-category-geo@3.3.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.3.1...@aws-amplify/amplify-category-geo@3.3.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+## [3.3.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.3.0...@aws-amplify/amplify-category-geo@3.3.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
+# [3.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.2.4...@aws-amplify/amplify-category-geo@3.3.0) (2023-07-20)
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [3.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.2.3...@aws-amplify/amplify-category-geo@3.2.4) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-geo
+
+
+
+
+
## [3.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-geo@3.2.1...@aws-amplify/amplify-category-geo@3.2.3) (2023-05-25)
diff --git a/packages/amplify-category-geo/package.json b/packages/amplify-category-geo/package.json
index e207e8f23fb..b3790bab939 100644
--- a/packages/amplify-category-geo/package.json
+++ b/packages/amplify-category-geo/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-geo",
- "version": "3.2.3",
+ "version": "3.5.17",
"description": "Amplify CLI plugin to manage the Geo resources for the project",
"repository": {
"type": "git",
@@ -26,20 +26,20 @@
"access": "public"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"ajv": "^6.12.6",
- "amplify-headless-interface": "1.17.3",
- "amplify-util-headless-input": "1.9.12",
- "aws-cdk-lib": "~2.68.0",
- "aws-sdk": "^2.1354.0",
+ "amplify-headless-interface": "1.17.7",
+ "amplify-util-headless-input": "1.9.18",
+ "aws-cdk-lib": "~2.177.0",
+ "aws-sdk": "^2.1464.0",
"constructs": "^10.0.5",
"fs-extra": "^8.1.0",
"lodash": "^4.17.21",
"uuid": "^8.3.2"
},
"devDependencies": {
- "@aws-sdk/client-location": "^3.303.0"
+ "@aws-sdk/client-location": "3.624.0"
},
"jest": {
"collectCoverage": true,
diff --git a/packages/amplify-category-geo/src/__tests__/commands/geo/remove.test.ts b/packages/amplify-category-geo/src/__tests__/commands/geo/remove.test.ts
index 48a9eea8fa3..4db72f226a6 100644
--- a/packages/amplify-category-geo/src/__tests__/commands/geo/remove.test.ts
+++ b/packages/amplify-category-geo/src/__tests__/commands/geo/remove.test.ts
@@ -5,7 +5,7 @@ import { run } from '../../../commands/geo/remove';
const mockRemoveResource = removeResource as jest.MockedFunction;
const mockResource = 'resource12345';
-mockRemoveResource.mockImplementation((context: $TSContext, service: string): Promise => {
+mockRemoveResource.mockImplementation((): Promise => {
return new Promise((resolve) => {
resolve(mockResource);
});
diff --git a/packages/amplify-category-geo/src/__tests__/index.test.ts b/packages/amplify-category-geo/src/__tests__/index.test.ts
index b4c984805b7..d597d9d9981 100644
--- a/packages/amplify-category-geo/src/__tests__/index.test.ts
+++ b/packages/amplify-category-geo/src/__tests__/index.test.ts
@@ -4,7 +4,6 @@ import { getPermissionPolicies } from '../index';
jest.mock('@aws-amplify/amplify-cli-core');
describe('only grant permission policies as requested', () => {
- const provider = 'awscloudformation';
let mockContext: $TSContext;
// construct mock amplify meta
const mockAmplifyMeta: $TSObject = {
diff --git a/packages/amplify-category-geo/src/__tests__/service-utils/resourceUtils.test.ts b/packages/amplify-category-geo/src/__tests__/service-utils/resourceUtils.test.ts
index 0d3097e730a..47c77f94f54 100644
--- a/packages/amplify-category-geo/src/__tests__/service-utils/resourceUtils.test.ts
+++ b/packages/amplify-category-geo/src/__tests__/service-utils/resourceUtils.test.ts
@@ -185,17 +185,17 @@ describe('Test reading the resource meta information', () => {
it('fails reading the meta information for non-existing resource', async () => {
const nonExistingMap = 'map12345';
const errorMessage = (resourceName: string): string => `Error reading Meta Parameters for ${resourceName}`;
- expect(async () => await readResourceMetaParameters(ServiceName.Map, nonExistingMap)).rejects.toThrowError(
+ await expect(async () => await readResourceMetaParameters(ServiceName.Map, nonExistingMap)).rejects.toThrowError(
errorMessage(nonExistingMap),
);
const nonExistingPlaceIndex = 'placeIndex12345';
- expect(async () => await readResourceMetaParameters(ServiceName.PlaceIndex, nonExistingPlaceIndex)).rejects.toThrowError(
+ await expect(async () => await readResourceMetaParameters(ServiceName.PlaceIndex, nonExistingPlaceIndex)).rejects.toThrowError(
errorMessage(nonExistingPlaceIndex),
);
const nonExistingGeofenceCollection = 'geofenceCollection12345';
- expect(
+ await expect(
async () => await readResourceMetaParameters(ServiceName.GeofenceCollection, nonExistingGeofenceCollection),
).rejects.toThrowError(errorMessage(nonExistingGeofenceCollection));
});
diff --git a/packages/amplify-category-hosting/CHANGELOG.md b/packages/amplify-category-hosting/CHANGELOG.md
index 81545422110..30d1a0bb8b1 100644
--- a/packages/amplify-category-hosting/CHANGELOG.md
+++ b/packages/amplify-category-hosting/CHANGELOG.md
@@ -3,6 +3,228 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.5.38](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.37...@aws-amplify/amplify-category-hosting@3.5.38) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.37](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.36...@aws-amplify/amplify-category-hosting@3.5.37) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.36](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.35...@aws-amplify/amplify-category-hosting@3.5.36) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.35](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.34...@aws-amplify/amplify-category-hosting@3.5.35) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.34](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.33...@aws-amplify/amplify-category-hosting@3.5.34) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.33](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.32...@aws-amplify/amplify-category-hosting@3.5.33) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.32](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.31...@aws-amplify/amplify-category-hosting@3.5.32) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.31](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.30...@aws-amplify/amplify-category-hosting@3.5.31) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.30](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.29...@aws-amplify/amplify-category-hosting@3.5.30) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.29](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.28...@aws-amplify/amplify-category-hosting@3.5.29) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.28](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.27...@aws-amplify/amplify-category-hosting@3.5.28) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.26...@aws-amplify/amplify-category-hosting@3.5.27) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.24...@aws-amplify/amplify-category-hosting@3.5.26) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [3.5.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.24...@aws-amplify/amplify-category-hosting@3.5.25) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.23...@aws-amplify/amplify-category-hosting@3.5.24) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.22...@aws-amplify/amplify-category-hosting@3.5.23) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.21...@aws-amplify/amplify-category-hosting@3.5.22) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.20...@aws-amplify/amplify-category-hosting@3.5.21) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.19...@aws-amplify/amplify-category-hosting@3.5.20) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.18...@aws-amplify/amplify-category-hosting@3.5.19) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.17...@aws-amplify/amplify-category-hosting@3.5.18) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.16...@aws-amplify/amplify-category-hosting@3.5.17) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.15...@aws-amplify/amplify-category-hosting@3.5.16) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.14...@aws-amplify/amplify-category-hosting@3.5.15) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.13...@aws-amplify/amplify-category-hosting@3.5.14) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
+## [3.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.12...@aws-amplify/amplify-category-hosting@3.5.13) (2023-07-20)
+
+
+### Bug Fixes
+
+* s3 upload index.html at last ([#12852](https://github.com/aws-amplify/amplify-cli/issues/12852)) ([99aff47](https://github.com/aws-amplify/amplify-cli/commit/99aff47cc1623f845c63914233148fa30e0ddfdf))
+
+
+
+
+
+## [3.5.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.11...@aws-amplify/amplify-category-hosting@3.5.12) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-hosting
+
+
+
+
+
## [3.5.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-hosting@3.5.9...@aws-amplify/amplify-category-hosting@3.5.11) (2023-05-25)
diff --git a/packages/amplify-category-hosting/__tests__/index.test.js b/packages/amplify-category-hosting/__tests__/index.test.js
index 681580cd339..5b174384cc5 100644
--- a/packages/amplify-category-hosting/__tests__/index.test.js
+++ b/packages/amplify-category-hosting/__tests__/index.test.js
@@ -32,8 +32,8 @@ describe('index', () => {
const ANOTHERSERVICE = 'AnotherHostingService';
const mockAvailableServices = [];
- let mockDisabledServices = [];
- let mockEnabledServices = [];
+ const mockDisabledServices = [];
+ const mockEnabledServices = [];
const mockAnswers = {
selectedServices: [],
diff --git a/packages/amplify-category-hosting/__tests__/lib/S3AndCloudFront/helpers/file-uploader.test.js b/packages/amplify-category-hosting/__tests__/lib/S3AndCloudFront/helpers/file-uploader.test.js
index d60d89cbb4e..90bb849cecd 100644
--- a/packages/amplify-category-hosting/__tests__/lib/S3AndCloudFront/helpers/file-uploader.test.js
+++ b/packages/amplify-category-hosting/__tests__/lib/S3AndCloudFront/helpers/file-uploader.test.js
@@ -2,15 +2,19 @@ jest.mock('mime-types');
jest.mock('../../../../lib/S3AndCloudFront/helpers/file-scanner', () => {
return {
scan: jest.fn(() => {
- return ['filePath1', 'filePath2'];
+ return ['assets/index-4e7fb3f6.js', 'index.html', 'assets/mapbox-gl-d152561b.js', 'assets/index-d41dc7ea.css', 'vite.svg'];
}),
};
});
+jest.mock('../../../../lib/S3AndCloudFront/helpers/upload-file', () => {
+ return { uploadFile: jest.fn() };
+});
const fs = require('fs-extra');
const mime = require('mime-types');
const fileScanner = require('../../../../lib/S3AndCloudFront/helpers/file-scanner');
+const { uploadFile } = require('../../../../lib/S3AndCloudFront/helpers/upload-file');
const mockTemplate = require('../../../../__mocks__/mockTemplate');
const mockParameters = require('../../../../__mocks__/mockParameters');
@@ -89,10 +93,21 @@ describe('cloudfront-manager', () => {
});
});
- beforeEach(() => {});
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
- test('run', async () => {
+ test('file scanner should be called', async () => {
await fileUploader.run(mockContext, 'mockDistributionFolder');
expect(fileScanner.scan).toBeCalled();
});
+
+ test('uploadFileCalls should have the index.html at the end', async () => {
+ await fileUploader.run(mockContext, 'mockDistributionFolder');
+ expect(uploadFile).toHaveBeenCalled();
+ const uploadFileCalls = uploadFile.mock.calls;
+
+ expect(uploadFileCalls.length).toBe(5);
+ expect(uploadFileCalls[4][3]).toBe('index.html');
+ });
});
diff --git a/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/configure-CloudFront.js b/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/configure-CloudFront.js
index abd028d99ff..b56c42a678a 100644
--- a/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/configure-CloudFront.js
+++ b/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/configure-CloudFront.js
@@ -37,8 +37,7 @@ async function configure(context) {
delete context.exeInfo.template.Resources.BucketPolicy;
delete context.exeInfo.template.Resources.S3Bucket.Properties.AccessControl;
}
- }
-
+ }
if (context.exeInfo.template.Resources.CloudFrontDistribution) {
const { DistributionConfig } = context.exeInfo.template.Resources.CloudFrontDistribution.Properties;
diff --git a/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js b/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js
index 5c00fd01f34..92c71c39cc3 100644
--- a/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js
+++ b/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/file-uploader.js
@@ -1,10 +1,8 @@
-const fs = require('fs-extra');
-const path = require('path');
const Ora = require('ora');
-const mime = require('mime-types');
const sequential = require('promise-sequential');
const fileScanner = require('./file-scanner');
const constants = require('../../constants');
+const { uploadFile } = require('./upload-file');
const serviceName = 'S3AndCloudFront';
const providerName = 'awscloudformation';
@@ -13,15 +11,14 @@ async function run(context, distributionDirPath) {
const { WebsiteConfiguration } = context.exeInfo.template.Resources.S3Bucket.Properties;
const fileList = fileScanner.scan(context, distributionDirPath, WebsiteConfiguration);
- const uploadFileTasks = [];
const s3Client = await getS3Client(context, 'update');
const hostingBucketName = getHostingBucketName(context);
const hasCloudFront = !!context?.exeInfo?.template?.Resources?.CloudFrontDistribution;
- fileList.forEach(filePath => {
- uploadFileTasks.push(() => uploadFile(s3Client, hostingBucketName, distributionDirPath, filePath, hasCloudFront));
- });
+ const uploadFileTasks = sortUploadFiles(fileList).map(
+ (filePath) => () => uploadFile(s3Client, hostingBucketName, distributionDirPath, filePath, hasCloudFront),
+ );
const spinner = new Ora('Uploading files.');
try {
@@ -34,6 +31,13 @@ async function run(context, distributionDirPath) {
}
}
+function sortUploadFiles(fileList) {
+ const filesToUploadLast = 'index.html';
+ const sortFiles = (fileA, fileB) => (fileA.includes(filesToUploadLast) ? 1 : fileB.includes(filesToUploadLast) ? -1 : 0);
+
+ return fileList.sort(sortFiles);
+}
+
async function getS3Client(context, action) {
const providerPlugins = context.amplify.getProviderPlugins(context);
const provider = require(providerPlugins[providerName]);
@@ -46,29 +50,6 @@ function getHostingBucketName(context) {
return amplifyMeta[constants.CategoryName][serviceName].output.HostingBucketName;
}
-async function uploadFile(s3Client, hostingBucketName, distributionDirPath, filePath, hasCloudFront) {
- let relativeFilePath = path.relative(distributionDirPath, filePath);
- // make Windows-style relative paths compatible to S3
- relativeFilePath = relativeFilePath.replace(/\\/g, '/');
-
- const fileStream = fs.createReadStream(filePath);
- const contentType = mime.lookup(relativeFilePath);
- const uploadParams = {
- Bucket: hostingBucketName,
- Key: relativeFilePath,
- Body: fileStream,
- ContentType: contentType || 'text/plain',
- };
-
- if (!hasCloudFront) {
- uploadParams.ACL = 'public-read';
- }
-
- const data = await s3Client.upload(uploadParams).promise();
-
- return data;
-}
-
module.exports = {
run,
};
diff --git a/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/upload-file.js b/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/upload-file.js
new file mode 100644
index 00000000000..65054fbe768
--- /dev/null
+++ b/packages/amplify-category-hosting/lib/S3AndCloudFront/helpers/upload-file.js
@@ -0,0 +1,29 @@
+const fs = require('fs-extra');
+const path = require('path');
+const mime = require('mime-types');
+
+async function uploadFile(s3Client, hostingBucketName, distributionDirPath, filePath, hasCloudFront) {
+ let relativeFilePath = path.relative(distributionDirPath, filePath);
+ // make Windows-style relative paths compatible to S3
+ relativeFilePath = relativeFilePath.replace(/\\/g, '/');
+ const fileStream = fs.createReadStream(filePath);
+ const contentType = mime.lookup(relativeFilePath);
+ const uploadParams = {
+ Bucket: hostingBucketName,
+ Key: relativeFilePath,
+ Body: fileStream,
+ ContentType: contentType || 'text/plain',
+ };
+
+ if (!hasCloudFront) {
+ uploadParams.ACL = 'public-read';
+ }
+
+ const data = await s3Client.upload(uploadParams).promise();
+
+ return data;
+}
+
+module.exports = {
+ uploadFile,
+};
diff --git a/packages/amplify-category-hosting/package.json b/packages/amplify-category-hosting/package.json
index 879ecd96839..04d7cee2a60 100644
--- a/packages/amplify-category-hosting/package.json
+++ b/packages/amplify-category-hosting/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-hosting",
- "version": "3.5.11",
+ "version": "3.5.38",
"description": "amplify-cli hosting plugin",
"repository": {
"type": "git",
@@ -21,8 +21,8 @@
"test": "jest --logHeapUsage --coverage"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"chalk": "^4.1.1",
"fs-extra": "^8.1.0",
"mime-types": "^2.1.26",
diff --git a/packages/amplify-category-interactions/CHANGELOG.md b/packages/amplify-category-interactions/CHANGELOG.md
index ea4c8a84431..b6eed3c23b0 100644
--- a/packages/amplify-category-interactions/CHANGELOG.md
+++ b/packages/amplify-category-interactions/CHANGELOG.md
@@ -3,6 +3,225 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.1.30](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.29...@aws-amplify/amplify-category-interactions@5.1.30) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.29](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.28...@aws-amplify/amplify-category-interactions@5.1.29) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.28](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.27...@aws-amplify/amplify-category-interactions@5.1.28) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.26...@aws-amplify/amplify-category-interactions@5.1.27) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.25...@aws-amplify/amplify-category-interactions@5.1.26) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.24...@aws-amplify/amplify-category-interactions@5.1.25) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.23...@aws-amplify/amplify-category-interactions@5.1.24) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.22...@aws-amplify/amplify-category-interactions@5.1.23) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.21...@aws-amplify/amplify-category-interactions@5.1.22) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.20...@aws-amplify/amplify-category-interactions@5.1.21) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.19...@aws-amplify/amplify-category-interactions@5.1.20) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.18...@aws-amplify/amplify-category-interactions@5.1.19) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.16...@aws-amplify/amplify-category-interactions@5.1.18) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.1.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.16...@aws-amplify/amplify-category-interactions@5.1.17) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.15...@aws-amplify/amplify-category-interactions@5.1.16) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.14...@aws-amplify/amplify-category-interactions@5.1.15) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.13...@aws-amplify/amplify-category-interactions@5.1.14) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.12...@aws-amplify/amplify-category-interactions@5.1.13) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.11...@aws-amplify/amplify-category-interactions@5.1.12) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.10...@aws-amplify/amplify-category-interactions@5.1.11) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.9...@aws-amplify/amplify-category-interactions@5.1.10) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.8...@aws-amplify/amplify-category-interactions@5.1.9) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.7...@aws-amplify/amplify-category-interactions@5.1.8) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.6...@aws-amplify/amplify-category-interactions@5.1.7) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.5...@aws-amplify/amplify-category-interactions@5.1.6) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.4...@aws-amplify/amplify-category-interactions@5.1.5) (2023-07-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
+## [5.1.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.3...@aws-amplify/amplify-category-interactions@5.1.4) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-interactions
+
+
+
+
+
## [5.1.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-interactions@5.1.1...@aws-amplify/amplify-category-interactions@5.1.3) (2023-05-25)
diff --git a/packages/amplify-category-interactions/package.json b/packages/amplify-category-interactions/package.json
index a06411a6e03..f688de59062 100644
--- a/packages/amplify-category-interactions/package.json
+++ b/packages/amplify-category-interactions/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-interactions",
- "version": "5.1.3",
+ "version": "5.1.30",
"description": "amplify-cli interactions plugin",
"repository": {
"type": "git",
@@ -25,8 +25,8 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"fs-extra": "^8.1.0",
"fuzzy": "^0.1.3",
"uuid": "^8.3.2"
diff --git a/packages/amplify-category-notifications/CHANGELOG.md b/packages/amplify-category-notifications/CHANGELOG.md
index 74bd45f1bc9..8e486987a10 100644
--- a/packages/amplify-category-notifications/CHANGELOG.md
+++ b/packages/amplify-category-notifications/CHANGELOG.md
@@ -3,6 +3,306 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.26.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.26...@aws-amplify/amplify-category-notifications@2.26.27) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.25...@aws-amplify/amplify-category-notifications@2.26.26) (2025-01-16)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.24...@aws-amplify/amplify-category-notifications@2.26.25) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.23...@aws-amplify/amplify-category-notifications@2.26.24) (2024-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.22...@aws-amplify/amplify-category-notifications@2.26.23) (2024-08-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.21...@aws-amplify/amplify-category-notifications@2.26.22) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.20...@aws-amplify/amplify-category-notifications@2.26.21) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.19...@aws-amplify/amplify-category-notifications@2.26.20) (2024-06-20)
+
+
+### Bug Fixes
+
+* migrate FCM channel authentication from ApiKey to ServiceToken based ([#13826](https://github.com/aws-amplify/amplify-cli/issues/13826)) ([252093f](https://github.com/aws-amplify/amplify-cli/commit/252093fc781547db3543928d1c3667dad16160ea))
+
+
+
+
+
+## [2.26.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.18...@aws-amplify/amplify-category-notifications@2.26.19) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.17...@aws-amplify/amplify-category-notifications@2.26.18) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.16...@aws-amplify/amplify-category-notifications@2.26.17) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.15...@aws-amplify/amplify-category-notifications@2.26.16) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.14...@aws-amplify/amplify-category-notifications@2.26.15) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.13...@aws-amplify/amplify-category-notifications@2.26.14) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.12...@aws-amplify/amplify-category-notifications@2.26.13) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.11...@aws-amplify/amplify-category-notifications@2.26.12) (2024-01-10)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.10...@aws-amplify/amplify-category-notifications@2.26.11) (2023-12-16)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.9...@aws-amplify/amplify-category-notifications@2.26.10) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.7...@aws-amplify/amplify-category-notifications@2.26.9) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.26.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.7...@aws-amplify/amplify-category-notifications@2.26.8) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.6...@aws-amplify/amplify-category-notifications@2.26.7) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.5...@aws-amplify/amplify-category-notifications@2.26.6) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.4...@aws-amplify/amplify-category-notifications@2.26.5) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.3...@aws-amplify/amplify-category-notifications@2.26.4) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.2...@aws-amplify/amplify-category-notifications@2.26.3) (2023-09-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.1...@aws-amplify/amplify-category-notifications@2.26.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.26.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.26.0...@aws-amplify/amplify-category-notifications@2.26.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+# [2.26.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.25.4...@aws-amplify/amplify-category-notifications@2.26.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [2.25.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.25.3...@aws-amplify/amplify-category-notifications@2.25.4) (2023-08-09)
+
+
+### Bug Fixes
+
+* upgrade proxy-agent to ^6.3.0 to remove vm2 deps ([#13012](https://github.com/aws-amplify/amplify-cli/issues/13012)) ([989ec35](https://github.com/aws-amplify/amplify-cli/commit/989ec35be4dfd2bea19ea82bbe317f212729950f))
+
+
+
+
+
+## [2.25.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.25.2...@aws-amplify/amplify-category-notifications@2.25.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.25.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.25.1...@aws-amplify/amplify-category-notifications@2.25.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.25.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.25.0...@aws-amplify/amplify-category-notifications@2.25.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+# [2.25.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.24.12...@aws-amplify/amplify-category-notifications@2.25.0) (2023-07-20)
+
+
+### Bug Fixes
+
+* update notification channel name lookup ([#12763](https://github.com/aws-amplify/amplify-cli/issues/12763)) ([92ca721](https://github.com/aws-amplify/amplify-cli/commit/92ca721134d59b68e85d4f92f4814d6717a3be3a))
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [2.24.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.24.11...@aws-amplify/amplify-category-notifications@2.24.12) (2023-06-16)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
+## [2.24.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.24.10...@aws-amplify/amplify-category-notifications@2.24.11) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-notifications
+
+
+
+
+
## [2.24.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-notifications@2.24.8...@aws-amplify/amplify-category-notifications@2.24.10) (2023-05-25)
diff --git a/packages/amplify-category-notifications/package.json b/packages/amplify-category-notifications/package.json
index f52bf91c563..4e428b7691a 100644
--- a/packages/amplify-category-notifications/package.json
+++ b/packages/amplify-category-notifications/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-notifications",
- "version": "2.24.10",
+ "version": "2.26.27",
"description": "amplify-cli notifications plugin",
"repository": {
"type": "git",
@@ -26,17 +26,17 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "@aws-amplify/amplify-provider-awscloudformation": "8.2.3",
- "aws-sdk": "^2.1354.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "@aws-amplify/amplify-provider-awscloudformation": "8.11.3",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
"fs-extra": "^8.1.0",
"lodash": "^4.17.21",
"ora": "^4.0.3",
"promise-sequential": "^1.1.1",
- "proxy-agent": "^5.0.0"
+ "proxy-agent": "^6.3.0"
},
"jest": {
"testEnvironmentOptions": {
diff --git a/packages/amplify-category-notifications/src/__tests__/channel-apns.test.ts b/packages/amplify-category-notifications/src/__tests__/channel-apns.test.ts
index 2a6409b6d01..c992e7d7ce0 100644
--- a/packages/amplify-category-notifications/src/__tests__/channel-apns.test.ts
+++ b/packages/amplify-category-notifications/src/__tests__/channel-apns.test.ts
@@ -153,7 +153,6 @@ describe('channel-APNS', () => {
expect(enableData).toEqual(mockAPNSChannelResponseData(true, ChannelAction.ENABLE, mockPinpointResponseData.APNSChannelResponse));
});
- // eslint-disable-next-line jest/no-focused-tests
test('enable unsuccessful', async () => {
prompterMock.pick.mockResolvedValueOnce('Certificate');
diff --git a/packages/amplify-category-notifications/src/__tests__/channel-fcm.test.ts b/packages/amplify-category-notifications/src/__tests__/channel-fcm.test.ts
index a43a7bec331..f5b0a457d7a 100644
--- a/packages/amplify-category-notifications/src/__tests__/channel-fcm.test.ts
+++ b/packages/amplify-category-notifications/src/__tests__/channel-fcm.test.ts
@@ -17,7 +17,12 @@ jest.mock('@aws-amplify/amplify-cli-core', () => {
};
});
-const apiKey = 'ApiKey-abc123';
+const serviceJSONFilePath = '/my/service/account/jsonFile.json';
+const serviceAccountJson = '{ "valid": { "service": "accountJson"}}';
+jest.mock('fs-extra', () => ({
+ readFile: () => Promise.resolve(serviceAccountJson),
+ existsSync: () => true,
+}));
jest.mock('@aws-amplify/amplify-prompts');
const prompterMock = prompter as jest.Mocked;
@@ -97,7 +102,7 @@ describe('channel-FCM', () => {
test('configure', async () => {
mockChannelEnabledOutput.Enabled = true;
prompterMock.yesOrNo.mockResolvedValueOnce(true);
- prompterMock.input.mockResolvedValueOnce(apiKey);
+ prompterMock.input.mockResolvedValueOnce(serviceJSONFilePath);
const mockContextObj = mockContext(mockChannelEnabledOutput, mockPinpointClient);
await channelFCM.configure(mockContextObj).then(() => {
@@ -118,20 +123,14 @@ describe('channel-FCM', () => {
});
test('enable', async () => {
- prompterMock.input.mockResolvedValueOnce(apiKey);
+ prompterMock.input.mockResolvedValueOnce(serviceJSONFilePath);
const mockContextObj = mockContext(mockChannelEnabledOutput, mockPinpointClient);
const data = await channelFCM.enable(mockContextObj, 'successMessage');
- expect(mockPinpointClient.updateGcmChannel).toBeCalled();
- expect(data).toEqual(mockPinpointResponseData(true, ChannelAction.ENABLE));
- });
-
- test('enable with newline', async () => {
- prompterMock.input.mockResolvedValueOnce(`${apiKey}\n`);
- const data = await channelFCM.enable(mockContext(mockChannelEnabledOutput, mockPinpointClient), 'successMessage');
expect(mockPinpointClient.updateGcmChannel).toBeCalledWith({
ApplicationId: undefined,
GCMChannelRequest: {
- ApiKey: apiKey,
+ ServiceJson: serviceAccountJson,
+ DefaultAuthenticationMethod: 'TOKEN',
Enabled: true,
},
});
@@ -139,7 +138,7 @@ describe('channel-FCM', () => {
});
test('enable unsuccessful', async () => {
- prompterMock.input.mockResolvedValueOnce(apiKey);
+ prompterMock.input.mockResolvedValueOnce(serviceJSONFilePath);
const context = mockContextReject(mockServiceOutput, mockPinpointClientReject);
const errCert: AmplifyFault = await getError(async () => channelFCM.enable(context as unknown as $TSContext, 'successMessage'));
diff --git a/packages/amplify-category-notifications/src/channel-fcm.ts b/packages/amplify-category-notifications/src/channel-fcm.ts
index 46e5ec4718e..bffcec7bba5 100644
--- a/packages/amplify-category-notifications/src/channel-fcm.ts
+++ b/packages/amplify-category-notifications/src/channel-fcm.ts
@@ -3,6 +3,8 @@ import { printer, prompter } from '@aws-amplify/amplify-prompts';
import ora from 'ora';
import { ChannelAction, ChannelConfigDeploymentType, IChannelAPIResponse } from './channel-types';
import { buildPinpointChannelResponseSuccess } from './pinpoint-helper';
+import { validateFilePath } from './validate-filepath';
+import fs from 'fs-extra';
const channelName = 'FCM';
const spinner = ora('');
@@ -42,12 +44,11 @@ export const enable = async (context: $TSContext, successMessage: string | undef
if (context.exeInfo.pinpointInputParams?.[channelName]) {
answers = validateInputParams(context.exeInfo.pinpointInputParams[channelName]);
} else {
- let channelOutput: $TSAny = {};
- if (context.exeInfo.serviceMeta.output[channelName]) {
- channelOutput = context.exeInfo.serviceMeta.output[channelName];
- }
answers = {
- ApiKey: await prompter.input('Server Key', { initial: channelOutput.ApiKey, transform: (input) => input.trim() }),
+ ServiceJson: await fs.readFile(
+ await prompter.input('The service account file path (.json): ', { validate: validateFilePath }),
+ 'utf8',
+ ),
};
}
@@ -55,6 +56,7 @@ export const enable = async (context: $TSContext, successMessage: string | undef
ApplicationId: context.exeInfo.serviceMeta.output.Id,
GCMChannelRequest: {
...answers,
+ DefaultAuthenticationMethod: 'TOKEN',
Enabled: true,
},
};
@@ -78,10 +80,10 @@ export const enable = async (context: $TSContext, successMessage: string | undef
};
const validateInputParams = (channelInput: $TSAny): $TSAny => {
- if (!channelInput.ApiKey) {
+ if (!channelInput.ServiceJson) {
throw new AmplifyError('UserInputError', {
- message: 'Server Key is missing for the FCM channel',
- resolution: 'Server Key for the FCM channel',
+ message: 'ServiceJson is missing for the FCM channel',
+ resolution: 'Provide the JSON from your Firebase service account json file',
});
}
return channelInput;
@@ -97,18 +99,18 @@ export const disable = async (context: $TSContext): Promise<$TSAny> => {
if (context.exeInfo.pinpointInputParams?.[channelName]) {
answers = validateInputParams(context.exeInfo.pinpointInputParams[channelName]);
} else {
- let channelOutput: $TSAny = {};
- if (context.exeInfo.serviceMeta.output[channelName]) {
- channelOutput = context.exeInfo.serviceMeta.output[channelName];
- }
answers = {
- ApiKey: await prompter.input('Server Key', { initial: channelOutput.ApiKey, transform: (input) => input.trim() }),
+ ServiceJson: await fs.readFile(
+ await prompter.input('The service account file path (.json): ', { validate: validateFilePath }),
+ 'utf8',
+ ),
};
}
const params = {
ApplicationId: context.exeInfo.serviceMeta.output.Id,
GCMChannelRequest: {
...answers,
+ DefaultAuthenticationMethod: 'TOKEN',
Enabled: false,
},
};
diff --git a/packages/amplify-category-notifications/src/channel-in-app-msg.ts b/packages/amplify-category-notifications/src/channel-in-app-msg.ts
index a56ce303fcc..ab1f57f676a 100644
--- a/packages/amplify-category-notifications/src/channel-in-app-msg.ts
+++ b/packages/amplify-category-notifications/src/channel-in-app-msg.ts
@@ -23,12 +23,7 @@ import {
} from './plugin-client-api-analytics';
import { IChannelAPIResponse, ChannelAction, ChannelConfigDeploymentType } from './channel-types';
-import {
- buildPinpointChannelResponseSuccess,
- getPinpointAppStatusFromMeta,
- IPinpointAppStatus,
- IPinpointDeploymentStatus,
-} from './pinpoint-helper';
+import { buildPinpointChannelResponseSuccess, getPinpointAppStatusFromMeta, IPinpointDeploymentStatus } from './pinpoint-helper';
import { ChannelType, getChannelViewName, isChannelEnabledNotificationsBackendConfig } from './notifications-backend-cfg-channel-api';
import { getNotificationsAppMeta } from './notifications-amplify-meta-api';
import { getNotificationsAppConfig } from './notifications-backend-cfg-api';
diff --git a/packages/amplify-category-notifications/src/commands/notifications/configure.ts b/packages/amplify-category-notifications/src/commands/notifications/configure.ts
index 07bbc9faff2..a196ae41a5e 100644
--- a/packages/amplify-category-notifications/src/commands/notifications/configure.ts
+++ b/packages/amplify-category-notifications/src/commands/notifications/configure.ts
@@ -26,14 +26,14 @@ export const alias = 'update';
*/
export const run = async (context: $TSContext): Promise<$TSContext> => {
const availableChannelViewNames = getAvailableChannelViewNames();
- const channelName = context.parameters.first;
- let channelViewName = channelName ? getChannelViewName(channelName) : undefined;
+ let channelViewName = context.parameters.first ? getChannelViewName(context.parameters.first) : undefined;
if (!channelViewName || !availableChannelViewNames.includes(channelViewName)) {
channelViewName = await prompter.pick('Choose the notification channel to configure', availableChannelViewNames);
}
- if (channelViewName && typeof channelName === 'string') {
- const selectedChannel = getChannelNameFromView(channelViewName);
+
+ if (channelViewName) {
+ const channelName = getChannelNameFromView(channelViewName);
let pinpointAppStatus = await pinpointHelper.ensurePinpointApp(context, undefined);
// In-line deployment now requires an amplify-push to create the Pinpoint resource
if (pinpointHelper.isPinpointDeploymentRequired(channelName, pinpointAppStatus)) {
@@ -55,8 +55,8 @@ export const run = async (context: $TSContext): Promise<$TSContext> => {
);
}
}
- if (isPinpointAppDeployed(pinpointAppStatus.status) || isChannelDeploymentDeferred(selectedChannel)) {
- const channelAPIResponse: IChannelAPIResponse | undefined = await notificationManager.configureChannel(context, selectedChannel);
+ if (isPinpointAppDeployed(pinpointAppStatus.status) || isChannelDeploymentDeferred(channelName)) {
+ const channelAPIResponse: IChannelAPIResponse | undefined = await notificationManager.configureChannel(context, channelName);
await writeData(context, channelAPIResponse);
}
} else {
diff --git a/packages/amplify-category-notifications/src/pinpoint-helper.ts b/packages/amplify-category-notifications/src/pinpoint-helper.ts
index 22fed7eaee4..18f8d90c70d 100644
--- a/packages/amplify-category-notifications/src/pinpoint-helper.ts
+++ b/packages/amplify-category-notifications/src/pinpoint-helper.ts
@@ -33,7 +33,7 @@ import {
resolveRegion,
loadConfigurationForEnv,
} from '@aws-amplify/amplify-provider-awscloudformation';
-import proxyAgent from 'proxy-agent';
+import { ProxyAgent } from 'proxy-agent';
const spinner = ora('');
const defaultPinpointRegion = 'us-east-1';
@@ -544,10 +544,11 @@ export const getPinpointClient = async (
customUserAgent: formUserAgentParam(context, userAgentAction),
};
+ // HTTP_PROXY & HTTPS_PROXY env vars are read automatically by ProxyAgent, but we check to see if they are set before using the proxy
if (httpProxy) {
aws.config.update({
httpOptions: {
- agent: proxyAgent(httpProxy),
+ agent: new ProxyAgent(),
},
});
}
diff --git a/packages/amplify-category-predictions/CHANGELOG.md b/packages/amplify-category-predictions/CHANGELOG.md
index 9562285705d..6b79678d8f0 100644
--- a/packages/amplify-category-predictions/CHANGELOG.md
+++ b/packages/amplify-category-predictions/CHANGELOG.md
@@ -3,6 +3,242 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.5.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.16...@aws-amplify/amplify-category-predictions@5.5.17) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.15...@aws-amplify/amplify-category-predictions@5.5.16) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.14...@aws-amplify/amplify-category-predictions@5.5.15) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.13...@aws-amplify/amplify-category-predictions@5.5.14) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.12...@aws-amplify/amplify-category-predictions@5.5.13) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.11...@aws-amplify/amplify-category-predictions@5.5.12) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.10...@aws-amplify/amplify-category-predictions@5.5.11) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.9...@aws-amplify/amplify-category-predictions@5.5.10) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.8...@aws-amplify/amplify-category-predictions@5.5.9) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.7...@aws-amplify/amplify-category-predictions@5.5.8) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.6...@aws-amplify/amplify-category-predictions@5.5.7) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.5...@aws-amplify/amplify-category-predictions@5.5.6) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.4...@aws-amplify/amplify-category-predictions@5.5.5) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.2...@aws-amplify/amplify-category-predictions@5.5.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.5.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.2...@aws-amplify/amplify-category-predictions@5.5.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.1...@aws-amplify/amplify-category-predictions@5.5.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.5.0...@aws-amplify/amplify-category-predictions@5.5.1) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+# [5.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.4.3...@aws-amplify/amplify-category-predictions@5.5.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [5.4.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.4.2...@aws-amplify/amplify-category-predictions@5.4.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.4.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.4.1...@aws-amplify/amplify-category-predictions@5.4.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.4.0...@aws-amplify/amplify-category-predictions@5.4.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+# [5.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.3.4...@aws-amplify/amplify-category-predictions@5.4.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [5.3.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.3.3...@aws-amplify/amplify-category-predictions@5.3.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.3.2...@aws-amplify/amplify-category-predictions@5.3.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.3.1...@aws-amplify/amplify-category-predictions@5.3.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+## [5.3.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.3.0...@aws-amplify/amplify-category-predictions@5.3.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
+# [5.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.2.4...@aws-amplify/amplify-category-predictions@5.3.0) (2023-07-20)
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [5.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.2.3...@aws-amplify/amplify-category-predictions@5.2.4) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-predictions
+
+
+
+
+
## [5.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-predictions@5.2.1...@aws-amplify/amplify-category-predictions@5.2.3) (2023-05-25)
diff --git a/packages/amplify-category-predictions/package.json b/packages/amplify-category-predictions/package.json
index 17da9a7571b..9b7c49d56b4 100644
--- a/packages/amplify-category-predictions/package.json
+++ b/packages/amplify-category-predictions/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-predictions",
- "version": "5.2.3",
+ "version": "5.5.17",
"description": "amplify-cli predictions plugin",
"repository": {
"type": "git",
@@ -25,15 +25,15 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "aws-sdk": "^2.1354.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
"fs-extra": "^8.1.0",
"uuid": "^8.3.2"
},
"devDependencies": {
- "@aws-sdk/client-rekognition": "^3.303.0"
+ "@aws-sdk/client-rekognition": "3.624.0"
},
"berry": {
"plugins": [
diff --git a/packages/amplify-category-storage/CHANGELOG.md b/packages/amplify-category-storage/CHANGELOG.md
index 73b75f0ba8d..47cf5f390ef 100644
--- a/packages/amplify-category-storage/CHANGELOG.md
+++ b/packages/amplify-category-storage/CHANGELOG.md
@@ -3,6 +3,241 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.5.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.15...@aws-amplify/amplify-category-storage@5.5.16) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.14...@aws-amplify/amplify-category-storage@5.5.15) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.13...@aws-amplify/amplify-category-storage@5.5.14) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.12...@aws-amplify/amplify-category-storage@5.5.13) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.11...@aws-amplify/amplify-category-storage@5.5.12) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.10...@aws-amplify/amplify-category-storage@5.5.11) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.9...@aws-amplify/amplify-category-storage@5.5.10) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.8...@aws-amplify/amplify-category-storage@5.5.9) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.7...@aws-amplify/amplify-category-storage@5.5.8) (2024-04-15)
+
+
+### Bug Fixes
+
+* upgrade Go runtime and fix e2e ([#13671](https://github.com/aws-amplify/amplify-cli/issues/13671)) ([395f717](https://github.com/aws-amplify/amplify-cli/commit/395f717cf52e7beef76f00ee08d37877138b0c30))
+
+
+
+
+
+## [5.5.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.6...@aws-amplify/amplify-category-storage@5.5.7) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.5...@aws-amplify/amplify-category-storage@5.5.6) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.4...@aws-amplify/amplify-category-storage@5.5.5) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.2...@aws-amplify/amplify-category-storage@5.5.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.5.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.2...@aws-amplify/amplify-category-storage@5.5.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.1...@aws-amplify/amplify-category-storage@5.5.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.5.0...@aws-amplify/amplify-category-storage@5.5.1) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+# [5.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.4.3...@aws-amplify/amplify-category-storage@5.5.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [5.4.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.4.2...@aws-amplify/amplify-category-storage@5.4.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.4.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.4.1...@aws-amplify/amplify-category-storage@5.4.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.4.0...@aws-amplify/amplify-category-storage@5.4.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+# [5.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.3.4...@aws-amplify/amplify-category-storage@5.4.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [5.3.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.3.3...@aws-amplify/amplify-category-storage@5.3.4) (2023-08-09)
+
+
+### Bug Fixes
+
+* remove vm2 ([#12989](https://github.com/aws-amplify/amplify-cli/issues/12989)) ([7bc0b56](https://github.com/aws-amplify/amplify-cli/commit/7bc0b5654a585104a537c1a3f9615bd672435b58))
+
+
+
+
+
+## [5.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.3.2...@aws-amplify/amplify-category-storage@5.3.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.3.1...@aws-amplify/amplify-category-storage@5.3.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+## [5.3.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.3.0...@aws-amplify/amplify-category-storage@5.3.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
+# [5.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.2.4...@aws-amplify/amplify-category-storage@5.3.0) (2023-07-20)
+
+
+### Features
+
+* **amplify-category-storage:** add CRUD PartiQL permissions for DynamoDB ([#11002](https://github.com/aws-amplify/amplify-cli/issues/11002)) ([19ed508](https://github.com/aws-amplify/amplify-cli/commit/19ed5083fe24264070490c52ac9e182d98571bdb))
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [5.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.2.3...@aws-amplify/amplify-category-storage@5.2.4) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-category-storage
+
+
+
+
+
## [5.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-category-storage@5.2.1...@aws-amplify/amplify-category-storage@5.2.3) (2023-05-25)
diff --git a/packages/amplify-category-storage/package.json b/packages/amplify-category-storage/package.json
index 8296b2efeb1..84af387eba6 100644
--- a/packages/amplify-category-storage/package.json
+++ b/packages/amplify-category-storage/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-storage",
- "version": "5.2.3",
+ "version": "5.5.16",
"description": "amplify-cli storage plugin",
"repository": {
"type": "git",
@@ -27,23 +27,22 @@
"access": "public"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "@aws-amplify/amplify-util-import": "2.6.0",
- "@aws-amplify/cli-extensibility-helper": "3.0.8",
- "amplify-headless-interface": "1.17.3",
- "amplify-util-headless-input": "1.9.12",
- "aws-cdk-lib": "~2.68.0",
- "aws-sdk": "^2.1354.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "@aws-amplify/amplify-util-import": "2.8.3",
+ "@aws-amplify/cli-extensibility-helper": "3.0.35",
+ "amplify-headless-interface": "1.17.7",
+ "amplify-util-headless-input": "1.9.18",
+ "aws-cdk-lib": "~2.177.0",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
"constructs": "^10.0.5",
"enquirer": "^2.3.6",
"fs-extra": "^8.1.0",
"lodash": "^4.17.21",
"promise-sequential": "^1.1.1",
- "uuid": "^8.3.2",
- "vm2": "^3.9.19"
+ "uuid": "^8.3.2"
},
"devDependencies": {
"cloudform-types": "^4.2.0",
diff --git a/packages/amplify-category-storage/resources/cloudformation-templates/dynamoDb-cloudformation-template.json.ejs b/packages/amplify-category-storage/resources/cloudformation-templates/dynamoDb-cloudformation-template.json.ejs
deleted file mode 100644
index 4a91cd85e34..00000000000
--- a/packages/amplify-category-storage/resources/cloudformation-templates/dynamoDb-cloudformation-template.json.ejs
+++ /dev/null
@@ -1,163 +0,0 @@
-{
- "AWSTemplateFormatVersion": "2010-09-09",
- "Description": "DynamoDB resource stack creation using Amplify CLI",
- "Parameters": {
- "partitionKeyName": {
- "Type": "String"
- },
- "partitionKeyType": {
- "Type": "String"
- },
- "env": {
- "Type": "String"
- },
- <%if (props.KeySchema.length > 1) { %>
- "sortKeyName": {
- "Type": "String"
- },
- "sortKeyType": {
- "Type": "String"
- },
- <% } %>
- "tableName": {
- "Type": "String"
- }
- },
- "Conditions": {
- "ShouldNotCreateEnvResources": {
- "Fn::Equals": [
- {
- "Ref": "env"
- },
- "NONE"
- ]
- }
- },
- "Resources": {
- "DynamoDBTable": {
- "Type": "AWS::DynamoDB::Table",
- "Properties": {
- "AttributeDefinitions": [
- <% for(var i=0; i < props.AttributeDefinitions.length; i++) { %>
- {
- "AttributeName": "<%= props.AttributeDefinitions[i].AttributeName %>",
- "AttributeType": "<%= props.AttributeDefinitions[i].AttributeType %>"
- } <%if (i != props.AttributeDefinitions.length - 1) { %> , <% } %>
- <% } %>
- ],
- "KeySchema": [
- <% for(var i=0; i < props.KeySchema.length; i++) { %>
- {
- "AttributeName": "<%= props.KeySchema[i].AttributeName %>",
- "KeyType": "<%= props.KeySchema[i].KeyType %>"
- } <%if (i != props.KeySchema.length - 1) { %> , <% } %>
- <% } %>
- ],
- "ProvisionedThroughput": {
- "ReadCapacityUnits": "5",
- "WriteCapacityUnits": "5"
- },
- "StreamSpecification": {
- "StreamViewType": "NEW_IMAGE"
- },
- "TableName": {
- "Fn::If": [
- "ShouldNotCreateEnvResources",
- {
- "Ref": "tableName"
- },
- {
-
- "Fn::Join": [
- "",
- [
- {
- "Ref": "tableName"
- },
- "-",
- {
- "Ref": "env"
- }
- ]
- ]
- }
- ]
- }
- <%if (props.GlobalSecondaryIndexes) { %>
- ,"GlobalSecondaryIndexes": [
- <% for(var i=0; i < props.GlobalSecondaryIndexes.length; i++) { %>
- {
- "IndexName": "<%= props.GlobalSecondaryIndexes[i].IndexName %>",
- "KeySchema": [
- <% for(var j=0; j < props.GlobalSecondaryIndexes[i].KeySchema.length; j++) { %>
- {
- "AttributeName": "<%= props.GlobalSecondaryIndexes[i].KeySchema[j].AttributeName %>",
- "KeyType": "<%= props.GlobalSecondaryIndexes[i].KeySchema[j].KeyType %>"
- } <%if (j != props.GlobalSecondaryIndexes[i].KeySchema.length - 1) { %> , <% } %>
- <% } %>
- ],
- "Projection": {
- "ProjectionType": "ALL"
- },
- "ProvisionedThroughput": {
- "ReadCapacityUnits": "5",
- "WriteCapacityUnits": "5"
- }
- } <%if (i != props.GlobalSecondaryIndexes.length - 1) { %> , <% } %>
- <% } %>
- ]
- <% } %>
- }
- }
- },
- "Outputs": {
- "Name": {
- "Value": {
- "Ref": "DynamoDBTable"
- }
- },
- "Arn": {
- "Value": {
- "Fn::GetAtt": [
- "DynamoDBTable",
- "Arn"
- ]
- }
- },
- "StreamArn": {
- "Value": {
- "Fn::GetAtt": [
- "DynamoDBTable",
- "StreamArn"
- ]
- }
- },
- "PartitionKeyName": {
- "Value": {
- "Ref": "partitionKeyName"
- }
- },
- "PartitionKeyType": {
- "Value": {
- "Ref": "partitionKeyType"
- }
- },
- <%if (props.KeySchema.length > 1) { %>
- "SortKeyName": {
- "Value": {
- "Ref": "sortKeyName"
- }
- },
- "SortKeyType": {
- "Value": {
- "Ref": "sortKeyType"
- }
- },
- <% } %>
- "Region": {
- "Value": {
- "Ref": "AWS::Region"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/packages/amplify-category-storage/resources/cloudformation-templates/s3-cloudformation-template.json.ejs b/packages/amplify-category-storage/resources/cloudformation-templates/s3-cloudformation-template.json.ejs
deleted file mode 100644
index 5873d8893d2..00000000000
--- a/packages/amplify-category-storage/resources/cloudformation-templates/s3-cloudformation-template.json.ejs
+++ /dev/null
@@ -1,850 +0,0 @@
-{
- "AWSTemplateFormatVersion": "2010-09-09",
- "Description": "S3 resource stack creation using Amplify CLI",
- "Parameters": {
- "bucketName": {
- "Type": "String"
- },
- "authPolicyName": {
- "Type": "String"
- },
- "unauthPolicyName": {
- "Type": "String"
- },
- "authRoleName": {
- "Type": "String"
- },
- "unauthRoleName": {
- "Type": "String"
- },
- "s3PublicPolicy": {
- "Type": "String",
- "Default" : "NONE"
- },
- "s3PrivatePolicy": {
- "Type": "String",
- "Default" : "NONE"
- },
- "s3ProtectedPolicy": {
- "Type": "String",
- "Default" : "NONE"
- },
- "s3UploadsPolicy": {
- "Type": "String",
- "Default" : "NONE"
- },
- "s3ReadPolicy": {
- "Type": "String",
- "Default" : "NONE"
- },
- "s3PermissionsAuthenticatedPublic": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "s3PermissionsAuthenticatedProtected": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "s3PermissionsAuthenticatedPrivate": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "s3PermissionsAuthenticatedUploads": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "s3PermissionsGuestPublic": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "s3PermissionsGuestUploads": {
- "Type": "String",
- "Default" : "DISALLOW" },
- "AuthenticatedAllowList": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "GuestAllowList": {
- "Type": "String",
- "Default" : "DISALLOW"
- },
- "selectedGuestPermissions": {
- "Type": "CommaDelimitedList",
- "Default" : "NONE"
- },
- "selectedAuthenticatedPermissions": {
- "Type": "CommaDelimitedList",
- "Default" : "NONE"
- },
- "env": {
- "Type": "String"
- },
- "triggerFunction": {
- "Type": "String"
- }<%if (props.dependsOn && props.dependsOn.length > 0) { %>,<% } %>
- <% if (props.dependsOn) { %>
- <% for(var i=0; i < props.dependsOn.length; i++) { %>
- <% for(var j=0; j < props.dependsOn[i].attributes.length; j++) { %>
- "<%= props.dependsOn[i].category %><%= props.dependsOn[i].resourceName %><%= props.dependsOn[i].attributes[j] %>": {
- "Type": "String",
- "Default": "<%= props.dependsOn[i].category %><%= props.dependsOn[i].resourceName %><%= props.dependsOn[i].attributes[j] %>"
- }<%if (i !== props.dependsOn.length - 1 || j !== props.dependsOn[i].attributes.length - 1) { %>,<% } %>
- <% } %>
- <% } %>
- <% } %>
-
- },
- "Conditions": {
- "ShouldNotCreateEnvResources": {
- "Fn::Equals": [
- {
- "Ref": "env"
- },
- "NONE"
- ]
- },
- "CreateAuthPublic": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "s3PermissionsAuthenticatedPublic"},
- "DISALLOW"
- ]
- }]
- },
- "CreateAuthProtected": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "s3PermissionsAuthenticatedProtected"},
- "DISALLOW"
- ]
- }]
- },
- "CreateAuthPrivate": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "s3PermissionsAuthenticatedPrivate"},
- "DISALLOW"
- ]
- }]
- },
- "CreateAuthUploads": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "s3PermissionsAuthenticatedUploads"},
- "DISALLOW"
- ]
- }]
- },
- "CreateGuestPublic": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "s3PermissionsGuestPublic"},
- "DISALLOW"
- ]
- }]
- },
- "CreateGuestUploads": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "s3PermissionsGuestUploads"},
- "DISALLOW"
- ]
- }]
- },
- "AuthReadAndList": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "AuthenticatedAllowList"},
- "DISALLOW"
- ]
- }]
- },
- "GuestReadAndList": {
- "Fn::Not" : [{
- "Fn::Equals" : [
- {"Ref" : "GuestAllowList"},
- "DISALLOW"
- ]
- }]
- }
- },
- "Resources": {
- "S3Bucket": {
- "Type": "AWS::S3::Bucket",
- <% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
- "DependsOn": [
- "TriggerPermissions"
- ],
- <% } %>
- "DeletionPolicy" : "Retain",
- "Properties": {
- "BucketName": {
- "Fn::If": [
- "ShouldNotCreateEnvResources",
- {
- "Ref": "bucketName"
- },
- {
- "Fn::Join": [
- "",
- [
- {
- "Ref": "bucketName"
- },
- {
- "Fn::Select": [
- 3,
- {
- "Fn::Split": [
- "-",
- {
- "Ref": "AWS::StackName"
- }
- ]
- }
- ]
- },
- "-",
- {
- "Ref": "env"
- }
- ]
- ]
- }
- ]
- },
- <% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
- "NotificationConfiguration": {
- "LambdaConfigurations": [
- {
- "Event": "s3:ObjectCreated:*",
- "Function": {
- "Ref": "function<%= props.triggerFunction %>Arn"
- }
- },
- {
- "Event": "s3:ObjectRemoved:*",
- "Function": {
- "Ref": "function<%= props.triggerFunction %>Arn"
- }
- }
- ]
- },
- <% } %>
- "CorsConfiguration": {
- "CorsRules": [
- {
- "AllowedHeaders": [
- "*"
- ],
- "AllowedMethods": [
- "GET",
- "HEAD",
- "PUT",
- "POST",
- "DELETE"
- ],
- "AllowedOrigins": [
- "*"
- ],
- "ExposedHeaders": [
- "x-amz-server-side-encryption",
- "x-amz-request-id",
- "x-amz-id-2",
- "ETag"
- ],
- "Id": "S3CORSRuleId1",
- "MaxAge": "3000"
- }
- ]
- }
- }
- },
- <% if (props.groupList) { %>
- <% for(var i=0; i < props.groupList.length; i++) { %>
- "<%= props.groupList[i] %>GroupPolicy": {
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": "<%= props.groupList[i] %>-group-s3-policy",
- "Roles": [
- {
- "Fn::Join": [
- "",
- [
- {
- "Ref": "auth<%= props.authResourceName%>UserPoolId"
- },
- "-<%= props.groupList[i] %>GroupRole"
- ]
- ]
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": <%- JSON.stringify(props.groupPolicyMap[props.groupList[i]]) %>,
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/*"
- ]
- ]
- }
- ]
- }
- <% if (props.groupPolicyMap[props.groupList[i]].includes('s3:ListBucket')) { %>
- ,{
- "Effect": "Allow",
- "Action": ["s3:ListBucket"],
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- }
- ]
- ]
- }
- ]
- }
- <% } %>
- ]
- }
- }
- },
- <% } %>
- <% } %>
- <% if (props.triggerFunction && props.triggerFunction != "NONE") { %>
- "TriggerPermissions": {
- "Type": "AWS::Lambda::Permission",
- "Properties": {
- "Action": "lambda:InvokeFunction",
- "FunctionName": {
- "Ref": "function<%= props.triggerFunction %>Name"
- },
- "Principal": "s3.amazonaws.com",
- "SourceAccount": {
- "Ref": "AWS::AccountId"
- },
- "SourceArn": {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Fn::If": [
- "ShouldNotCreateEnvResources",
- {
- "Ref": "bucketName"
- },
- {
- "Fn::Join": [
- "",
- [
- {
- "Ref": "bucketName"
- },
- {
- "Fn::Select": [
- 3,
- {
- "Fn::Split": [
- "-",
- {
- "Ref": "AWS::StackName"
- }
- ]
- }
- ]
- },
- "-",
- {
- "Ref": "env"
- }
- ]
- ]
- }
- ]
- }
- ]
- ]
- }
- }
- },
- "S3TriggerBucketPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": "amplify-lambda-execution-policy-storage",
- "Roles": [
- {
- "Ref": "function<%= props.triggerFunction %>LambdaExecutionRole"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "s3:PutObject",
- "s3:GetObject",
- "s3:ListBucket",
- "s3:DeleteObject"
- ],
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- <% } %>
- "S3AuthPublicPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "CreateAuthPublic",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3PublicPolicy"
- },
- "Roles": [
- {
- "Ref": "authRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": {
- "Fn::Split" : [ "," , {
- "Ref": "s3PermissionsAuthenticatedPublic"
- } ]
- },
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/public/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- "S3AuthProtectedPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "CreateAuthProtected",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3ProtectedPolicy"
- },
- "Roles": [
- {
- "Ref": "authRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": {
- "Fn::Split" : [ "," , {
- "Ref": "s3PermissionsAuthenticatedProtected"
- } ]
- },
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/protected/${cognito-identity.amazonaws.com:sub}/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- "S3AuthPrivatePolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "CreateAuthPrivate",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3PrivatePolicy"
- },
- "Roles": [
- {
- "Ref": "authRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": {
- "Fn::Split" : [ "," , {
- "Ref": "s3PermissionsAuthenticatedPrivate"
- } ]
- },
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/private/${cognito-identity.amazonaws.com:sub}/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- "S3AuthUploadPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "CreateAuthUploads",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3UploadsPolicy"
- },
- "Roles": [
- {
- "Ref": "authRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": {
- "Fn::Split" : [ "," , {
- "Ref": "s3PermissionsAuthenticatedUploads"
- } ]
- },
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/uploads/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- "S3AuthReadPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "AuthReadAndList",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3ReadPolicy"
- },
- "Roles": [
- {
- "Ref": "authRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "s3:GetObject"
- ],
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/protected/*"
- ]
- ]
- }
- ]
- },
- {
- "Effect": "Allow",
- "Action": [
- "s3:ListBucket"
- ],
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- }
- ]
- ]
- }
- ],
- "Condition": {
- "StringLike": {
- "s3:prefix": [
- "public/",
- "public/*",
- "protected/",
- "protected/*",
- "private/${cognito-identity.amazonaws.com:sub}/",
- "private/${cognito-identity.amazonaws.com:sub}/*"
- ]
- }
- }
- }
- ]
- }
- }
- },
- "S3GuestPublicPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "CreateGuestPublic",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3PublicPolicy"
- },
- "Roles": [
- {
- "Ref": "unauthRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": {
- "Fn::Split" : [ "," , {
- "Ref": "s3PermissionsGuestPublic"
- } ]
- },
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/public/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- "S3GuestUploadPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "CreateGuestUploads",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3UploadsPolicy"
- },
- "Roles": [
- {
- "Ref": "unauthRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": {
- "Fn::Split" : [ "," , {
- "Ref": "s3PermissionsGuestUploads"
- } ]
- },
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/uploads/*"
- ]
- ]
- }
- ]
- }
- ]
- }
- }
- },
- "S3GuestReadPolicy": {
- "DependsOn": [
- "S3Bucket"
- ],
- "Condition": "GuestReadAndList",
- "Type": "AWS::IAM::Policy",
- "Properties": {
- "PolicyName": {
- "Ref": "s3ReadPolicy"
- },
- "Roles": [
- {
- "Ref": "unauthRoleName"
- }
- ],
- "PolicyDocument": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "s3:GetObject"
- ],
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- },
- "/protected/*"
- ]
- ]
- }
- ]
- },
- {
- "Effect": "Allow",
- "Action": [
- "s3:ListBucket"
- ],
- "Resource": [
- {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "S3Bucket"
- }
- ]
- ]
- }
- ],
- "Condition": {
- "StringLike": {
- "s3:prefix": [
- "public/",
- "public/*",
- "protected/",
- "protected/*"
- ]
- }
- }
- }
- ]
- }
- }
- }
- },
- "Outputs": {
- "BucketName": {
- "Value": {
- "Ref": "S3Bucket"
- },
- "Description": "Bucket name for the S3 bucket"
- },
- "Region": {
- "Value": {
- "Ref": "AWS::Region"
- }
- }
- }
-}
diff --git a/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-builder.test.ts b/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-builder.test.ts
index 01b39725384..8e0a10a0405 100644
--- a/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-builder.test.ts
+++ b/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-builder.test.ts
@@ -116,7 +116,6 @@ describe('Test S3 transform generates correct CFN template', () => {
});
});
-// eslint-disable-next-line jest/no-export
export class S3MockDataBuilder {
static mockBucketName = 'mock-stack-builder-bucket-name-99'; // s3 bucket naming rules allows alphanumeric and hyphens
static mockResourceName = 'mockResourceName';
@@ -166,7 +165,7 @@ export class S3MockDataBuilder {
};
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
- constructor(__startCliInputState: S3UserInputs | undefined) {
+ constructor() {
/* noop */
}
diff --git a/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.test.ts b/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.test.ts
index 86a0883e988..ef5524d116d 100644
--- a/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.test.ts
+++ b/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.test.ts
@@ -7,6 +7,7 @@ import {
DynamoDBCLIInputs,
FieldType,
} from '../../../../provider-utils/awscloudformation/service-walkthrough-types/dynamoDB-user-input-types';
+import { getIAMPolicies } from '../../../../provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough';
jest.mock('@aws-amplify/amplify-cli-core');
jest.mock('@aws-amplify/amplify-prompts');
@@ -140,7 +141,7 @@ describe('update ddb walkthrough tests', () => {
});
it('updateWalkthrough() test to add gsi', async () => {
- let mockAmplifyMeta = {
+ const mockAmplifyMeta = {
storage: {
mockresourcename: {
service: 'DynamoDB',
@@ -243,3 +244,29 @@ describe('update ddb walkthrough tests', () => {
expect(DynamoDBInputState.prototype.saveCliInputPayload).toHaveBeenCalledWith(expectedCLIInputsJSON);
});
});
+
+describe('PartiQL Policies', () => {
+ it('create', async () => {
+ const { policy } = getIAMPolicies('Dummy', ['create']);
+ const actions = policy.Action as string[];
+ expect(actions.includes('dynamodb:PartiQLInsert')).toBe(true);
+ });
+
+ it('update', async () => {
+ const { policy } = getIAMPolicies('Dummy', ['update']);
+ const actions = policy.Action as string[];
+ expect(actions.includes('dynamodb:PartiQLUpdate')).toBe(true);
+ });
+
+ it('read', async () => {
+ const { policy } = getIAMPolicies('Dummy', ['read']);
+ const actions = policy.Action as string[];
+ expect(actions.includes('dynamodb:PartiQLSelect')).toBe(true);
+ });
+
+ it('delete', async () => {
+ const { policy } = getIAMPolicies('Dummy', ['delete']);
+ const actions = policy.Action as string[];
+ expect(actions.includes('dynamodb:PartiQLDelete')).toBe(true);
+ });
+});
diff --git a/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.test.ts b/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.test.ts
index d89c1e37c86..9e00ce04a80 100644
--- a/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.test.ts
+++ b/packages/amplify-category-storage/src/__tests__/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.test.ts
@@ -51,8 +51,8 @@ describe('add s3 walkthrough tests', () => {
getResourceStatus: async () => {
return { allResources: S3MockDataBuilder.getMockGetAllResourcesNoExistingLambdas() };
},
- copyBatch: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
- updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
+ copyBatch: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
+ updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
pathManager: {
getBackendDirPath: jest.fn().mockReturnValue('mockTargetDir'),
},
@@ -70,7 +70,7 @@ describe('add s3 walkthrough tests', () => {
});
jest.spyOn(AmplifyS3ResourceStackTransform.prototype, 'transform').mockImplementation(() => Promise.resolve());
jest.spyOn(s3AuthAPI, 'migrateAuthDependencyResource').mockReturnValue(
- new Promise((resolve, _reject) => {
+ new Promise((resolve) => {
process.nextTick(() => resolve(true));
}),
);
@@ -94,7 +94,7 @@ describe('add s3 walkthrough tests', () => {
stateManager.getMeta = jest.fn().mockReturnValue(S3MockDataBuilder.mockAmplifyMeta);
- let options = {};
+ const options = {};
const returnedResourcename = await addWalkthrough(mockContext, S3MockDataBuilder.mockFilePath, mockContext, options);
expect(returnedResourcename).toEqual(S3MockDataBuilder.mockResourceName);
@@ -126,7 +126,7 @@ describe('add s3 walkthrough tests', () => {
stateManager.getMeta = jest.fn().mockReturnValue(S3MockDataBuilder.mockAmplifyMeta);
- let options = {};
+ const options = {};
const returnedResourcename = await addWalkthrough(mockContext, S3MockDataBuilder.mockFilePath, mockContext, options);
expect(returnedResourcename).toEqual(S3MockDataBuilder.mockResourceName);
@@ -160,7 +160,7 @@ describe('add s3 walkthrough tests', () => {
stateManager.getMeta = jest.fn().mockReturnValue(S3MockDataBuilder.mockAmplifyMeta);
- let options = {};
+ const options = {};
const returnedResourcename = await addWalkthrough(mockContext, S3MockDataBuilder.mockFilePath, mockContext, options);
expect(returnedResourcename).toEqual(S3MockDataBuilder.mockResourceName);
@@ -202,7 +202,7 @@ describe('add s3 walkthrough tests', () => {
stateManager.getMeta = jest.fn().mockReturnValue(S3MockDataBuilder.mockAmplifyMeta);
- let options = {};
+ const options = {};
const returnedResourcename = await addWalkthrough(mockContext, S3MockDataBuilder.mockFilePath, mockContext, options);
expect(returnedResourcename).toEqual(S3MockDataBuilder.mockResourceName);
@@ -241,8 +241,8 @@ describe('update s3 permission walkthrough tests', () => {
getResourceStatus: () => {
return { allResources: S3MockDataBuilder.getMockGetAllResourcesNoExistingLambdas() };
}, //eslint-disable-line
- copyBatch: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
- updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
+ copyBatch: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
+ updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
pathManager: {
getBackendDirPath: jest.fn().mockReturnValue('mockTargetDir'),
},
@@ -445,8 +445,8 @@ describe('update s3 lambda-trigger walkthrough tests', () => {
getResourceStatus: () => {
return { allResources: S3MockDataBuilder.getMockGetAllResourcesNoExistingLambdas() };
}, //eslint-disable-line
- copyBatch: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
- updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
+ copyBatch: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
+ updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
pathManager: {
getBackendDirPath: jest.fn().mockReturnValue('mockTargetDir'),
},
@@ -710,8 +710,8 @@ describe('migrate s3 and update s3 permission walkthrough tests', () => {
getResourceStatus: async () => {
return { allResources: S3MockDataBuilder.getMockGetAllResourcesNoExistingLambdas() };
},
- copyBatch: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
- updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve, reject) => resolve(true))),
+ copyBatch: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
+ updateamplifyMetaAfterResourceAdd: jest.fn().mockReturnValue(new Promise((resolve) => resolve(true))),
pathManager: {
getBackendDirPath: jest.fn().mockReturnValue('mockTargetDir'),
},
diff --git a/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/ddb-stack-transform.ts b/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/ddb-stack-transform.ts
index edf2fedb3c1..18b9e58f2c8 100644
--- a/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/ddb-stack-transform.ts
+++ b/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/ddb-stack-transform.ts
@@ -1,10 +1,8 @@
-import { AmplifyDDBResourceTemplate, getProjectInfo } from '@aws-amplify/cli-extensibility-helper';
-import { $TSContext, AmplifyError, buildOverrideDir, JSONUtilities, pathManager } from '@aws-amplify/amplify-cli-core';
-import { formatter } from '@aws-amplify/amplify-prompts';
+import { getProjectInfo } from '@aws-amplify/cli-extensibility-helper';
+import { $TSContext, AmplifyError, buildOverrideDir, JSONUtilities, pathManager, runOverride } from '@aws-amplify/amplify-cli-core';
import * as cdk from 'aws-cdk-lib';
import * as fs from 'fs-extra';
import * as path from 'path';
-import * as vm from 'vm2';
import { getDdbAttrType } from '../cfn-template-utils';
import { DynamoDBCLIInputs } from '../service-walkthrough-types/dynamoDB-user-input-types';
import { DynamoDBInputState } from '../service-walkthroughs/dynamoDB-input-state';
@@ -188,48 +186,22 @@ export class DDBStackTransform {
async applyOverrides(): Promise {
const backendDir = pathManager.getBackendDirPath();
const resourceDirPath = pathManager.getResourceDirectoryPath(undefined, 'storage', this._resourceName);
- const overrideJSFilePath = path.resolve(path.join(resourceDirPath, 'build', 'override.js'));
-
const isBuild = await buildOverrideDir(backendDir, resourceDirPath);
// skip if packageManager or override.ts not found
if (isBuild) {
- const { override } = await import(overrideJSFilePath).catch(() => {
- formatter.list(['No override File Found', `To override ${this._resourceName} run amplify override auth ${this._resourceName} `]);
- return undefined;
- });
-
- if (typeof override === 'function' && override) {
- const overrideCode: string = await fs.readFile(overrideJSFilePath, 'utf-8').catch(() => {
- formatter.list(['No override File Found', `To override ${this._resourceName} run amplify override auth`]);
- return '';
- });
-
- const sandboxNode = new vm.NodeVM({
- console: 'inherit',
- timeout: 5000,
- sandbox: {},
- require: {
- context: 'sandbox',
- builtin: ['path'],
- external: true,
+ const projectInfo = getProjectInfo();
+ try {
+ await runOverride(resourceDirPath, this._resourceTemplateObj, projectInfo);
+ } catch (err) {
+ throw new AmplifyError(
+ 'InvalidOverrideError',
+ {
+ message: `Executing overrides failed.`,
+ details: err.message,
+ resolution: 'There may be runtime errors in your overrides file. If so, fix the errors and try again.',
},
- });
- const projectInfo = getProjectInfo();
- try {
- await sandboxNode
- .run(overrideCode, overrideJSFilePath)
- .override(this._resourceTemplateObj as AmplifyDDBResourceTemplate, projectInfo);
- } catch (err) {
- throw new AmplifyError(
- 'InvalidOverrideError',
- {
- message: `Executing overrides failed.`,
- details: err.message,
- resolution: 'There may be runtime errors in your overrides file. If so, fix the errors and try again.',
- },
- err,
- );
- }
+ err,
+ );
}
}
}
diff --git a/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-transform.ts b/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-transform.ts
index 1e073bf45e6..36d666baf35 100644
--- a/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-transform.ts
+++ b/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/s3-stack-transform.ts
@@ -1,5 +1,5 @@
import * as cdk from 'aws-cdk-lib';
-import { AmplifyS3ResourceTemplate, getProjectInfo } from '@aws-amplify/cli-extensibility-helper';
+import { getProjectInfo } from '@aws-amplify/cli-extensibility-helper';
import {
$TSAny,
$TSContext,
@@ -10,11 +10,10 @@ import {
IAmplifyResource,
JSONUtilities,
pathManager,
+ runOverride,
} from '@aws-amplify/amplify-cli-core';
-import { formatter } from '@aws-amplify/amplify-prompts';
import * as fs from 'fs-extra';
import * as path from 'path';
-import * as vm from 'vm2';
import { S3PermissionType, S3UserInputs } from '../service-walkthrough-types/s3-user-input-types';
// eslint-disable-next-line import/no-cycle
import { canResourceBeTransformed, S3CFNDependsOn, S3CFNPermissionType, S3InputState } from '../service-walkthroughs/s3-user-input-state';
@@ -195,49 +194,23 @@ export class AmplifyS3ResourceStackTransform {
*/
applyOverrides = async (): Promise => {
const backendDir = pathManager.getBackendDirPath();
- const resourceDirPath = pathManager.getResourceDirectoryPath(undefined, AmplifyCategories.STORAGE, this.resourceName);
- const overrideJSFilePath = path.resolve(path.join(resourceDirPath, 'build', 'override.js'));
-
- const isBuild = await buildOverrideDir(backendDir, resourceDirPath);
+ const overrideDir = pathManager.getResourceDirectoryPath(undefined, AmplifyCategories.STORAGE, this.resourceName);
+ const isBuild = await buildOverrideDir(backendDir, overrideDir);
// Skip if packageManager or override.ts not found
if (isBuild) {
- const { override } = await import(overrideJSFilePath).catch(() => {
- formatter.list(['No override File Found', `To override ${this.resourceName} run amplify override auth ${this.resourceName} `]);
- return undefined;
- });
- // Pass stack object
- if (override && typeof override === 'function') {
- const overrideCode: string = await fs.readFile(overrideJSFilePath, 'utf-8').catch(() => {
- formatter.list(['No override File Found', `To override ${this.resourceName} run amplify override auth`]);
- return '';
- });
-
- const sandboxNode = new vm.NodeVM({
- console: 'inherit',
- timeout: 5000,
- sandbox: {},
- require: {
- context: 'sandbox',
- builtin: ['path'],
- external: true,
+ const projectInfo = getProjectInfo();
+ try {
+ await runOverride(overrideDir, this.resourceTemplateObj, projectInfo);
+ } catch (err: $TSAny) {
+ throw new AmplifyError(
+ 'InvalidOverrideError',
+ {
+ message: `Executing overrides failed.`,
+ details: err.message,
+ resolution: 'There may be runtime errors in your overrides file. If so, fix the errors and try again.',
},
- });
- try {
- const projectInfo = getProjectInfo();
- await sandboxNode
- .run(overrideCode, overrideJSFilePath)
- .override(this.resourceTemplateObj as AmplifyS3ResourceTemplate, projectInfo);
- } catch (err: $TSAny) {
- throw new AmplifyError(
- 'InvalidOverrideError',
- {
- message: `Executing overrides failed.`,
- details: err.message,
- resolution: 'There may be runtime errors in your overrides file. If so, fix the errors and try again.',
- },
- err,
- );
- }
+ err,
+ );
}
}
};
diff --git a/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.ts b/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.ts
index 7b7da64325f..ba1316d1fb9 100644
--- a/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.ts
+++ b/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.ts
@@ -731,22 +731,30 @@ export function migrate(context: $TSContext, projectPath: any, resourceName: any
}
export function getIAMPolicies(resourceName: string, crudOptions: $TSAny) {
- let policy = {};
+ let policy: $TSObject = {};
const actions: string[] = [];
crudOptions.forEach((crudOption: $TSAny) => {
switch (crudOption) {
case 'create':
- actions.push('dynamodb:Put*', 'dynamodb:Create*', 'dynamodb:BatchWriteItem');
+ actions.push('dynamodb:Put*', 'dynamodb:Create*', 'dynamodb:BatchWriteItem', 'dynamodb:PartiQLInsert');
break;
case 'update':
- actions.push('dynamodb:Update*', 'dynamodb:RestoreTable*');
+ actions.push('dynamodb:Update*', 'dynamodb:RestoreTable*', 'dynamodb:PartiQLUpdate');
break;
case 'read':
- actions.push('dynamodb:Get*', 'dynamodb:BatchGetItem', 'dynamodb:List*', 'dynamodb:Describe*', 'dynamodb:Scan', 'dynamodb:Query');
+ actions.push(
+ 'dynamodb:Get*',
+ 'dynamodb:BatchGetItem',
+ 'dynamodb:List*',
+ 'dynamodb:Describe*',
+ 'dynamodb:Scan',
+ 'dynamodb:Query',
+ 'dynamodb:PartiQLSelect',
+ );
break;
case 'delete':
- actions.push('dynamodb:Delete*');
+ actions.push('dynamodb:Delete*', 'dynamodb:PartiQLDelete');
break;
default:
console.log(`${crudOption} not supported`);
diff --git a/packages/amplify-cli-core/API.md b/packages/amplify-cli-core/API.md
index 9152a9a9096..c5f833aab56 100644
--- a/packages/amplify-cli-core/API.md
+++ b/packages/amplify-cli-core/API.md
@@ -8,9 +8,10 @@
import Ajv from 'ajv';
import { ApiKeyConfig } from '@aws-amplify/graphql-transformer-interfaces';
+import { ARN } from '@aws-sdk/util-arn-parser';
+import { BuildType } from '@aws-amplify/amplify-function-plugin-interface';
import * as cdk from 'aws-cdk-lib';
import { ChildProcess } from 'child_process';
-import { DeploymentResources } from '@aws-amplify/graphql-transformer-interfaces';
import * as execa from 'execa';
import opn from 'open';
import { Ora } from 'ora';
@@ -122,7 +123,7 @@ export class AmplifyError extends AmplifyException {
}
// @public (undocumented)
-export type AmplifyErrorType = 'AmplifyStudioError' | 'AmplifyStudioLoginError' | 'AmplifyStudioNotEnabledError' | 'ApiCategorySchemaNotFoundError' | 'APIRateExceededError' | 'AuthImportError' | 'BackendConfigValidationError' | 'BucketAlreadyExistsError' | 'BucketNotFoundError' | 'CategoryNotEnabledError' | 'CloudFormationTemplateError' | 'CommandNotSupportedError' | 'ConfigurationError' | 'CustomPoliciesFormatError' | 'DebugConfigValueNotSetError' | 'DeploymentError' | 'DeploymentInProgressError' | 'DestructiveMigrationError' | 'DiagnoseReportUploadError' | 'DirectoryAlreadyExistsError' | 'DirectoryError' | 'DuplicateLogicalIdError' | 'EnvironmentConfigurationError' | 'EnvironmentNameError' | 'EnvironmentNotInitializedError' | 'ExportError' | 'FeatureFlagsValidationError' | 'FileSystemPermissionsError' | 'FrameworkNotSupportedError' | 'FunctionTooLargeError' | 'GraphQLError' | 'InputValidationError' | 'InvalidAmplifyAppIdError' | 'InvalidCustomResourceError' | 'InvalidDirectiveError' | 'InvalidGSIMigrationError' | 'InvalidMigrationError' | 'InvalidOverrideError' | 'InvalidStackError' | 'InvalidTransformerError' | 'IterativeRollbackError' | 'LambdaFunctionInvokeError' | 'LambdaLayerDeleteError' | 'MigrationError' | 'MissingAmplifyMetaFileError' | 'MissingExpectedParameterError' | 'MissingOverridesInstallationRequirementsError' | 'MockProcessError' | 'ModelgenError' | 'NestedProjectInitError' | 'NotImplementedError' | 'NoUpdateBackendError' | 'OpenSslCertificateError' | 'PackagingLambdaFunctionError' | 'ParameterNotFoundError' | 'PermissionsError' | 'PluginMethodNotFoundError' | 'PluginNotFoundError' | 'PluginPolicyAddError' | 'ProfileConfigurationError' | 'ProjectAppIdResolveError' | 'ProjectInitError' | 'ProjectNotFoundError' | 'ProjectNotInitializedError' | 'PushResourcesError' | 'RegionNotAvailableError' | 'RemoveNotificationAppError' | 'ResourceAlreadyExistsError' | 'ResourceCountLimitExceedError' | 'ResourceDoesNotExistError' | 'ResourceInUseError' | 'ResourceNotReadyError' | 'ResourceRemoveError' | 'SchemaNotFoundError' | 'SchemaValidationError' | 'SearchableMockProcessError' | 'SearchableMockUnavailablePortError' | 'SearchableMockUnsupportedPlatformError' | 'ShellCommandExecutionError' | 'StackNotFoundError' | 'StackStateError' | 'StorageImportError' | 'TransformerContractError' | 'UnknownDirectiveError' | 'UnsupportedLockFileTypeError' | 'UserInputError';
+export type AmplifyErrorType = 'AmplifyStudioError' | 'AmplifyStudioLoginError' | 'AmplifyStudioNotEnabledError' | 'ApiCategorySchemaNotFoundError' | 'APIRateExceededError' | 'AuthImportError' | 'BackendConfigValidationError' | 'BucketAlreadyExistsError' | 'BucketNotFoundError' | 'CategoryNotEnabledError' | 'CloudFormationTemplateError' | 'CommandNotSupportedError' | 'ConfigurationError' | 'CustomPoliciesFormatError' | 'DebugConfigValueNotSetError' | 'DeploymentError' | 'DeploymentInProgressError' | 'DestructiveMigrationError' | 'DiagnoseReportUploadError' | 'DirectoryAlreadyExistsError' | 'DirectoryError' | 'DuplicateLogicalIdError' | 'EnvironmentConfigurationError' | 'EnvironmentNameError' | 'EnvironmentNotInitializedError' | 'ExportError' | 'FeatureFlagsValidationError' | 'FileSystemPermissionsError' | 'FrameworkNotSupportedError' | 'FunctionTooLargeError' | 'GraphQLError' | 'InputValidationError' | 'InvalidAmplifyAppIdError' | 'InvalidCustomResourceError' | 'InvalidDirectiveError' | 'InvalidGSIMigrationError' | 'InvalidMigrationError' | 'InvalidOverrideError' | 'InvalidStackError' | 'InvalidTransformerError' | 'IterativeRollbackError' | 'LambdaFunctionInvokeError' | 'LambdaLayerDeleteError' | 'MigrationError' | 'MissingAmplifyMetaFileError' | 'MissingExpectedParameterError' | 'MissingOverridesInstallationRequirementsError' | 'MockProcessError' | 'ModelgenError' | 'NestedProjectInitError' | 'NotImplementedError' | 'NoUpdateBackendError' | 'OpenSslCertificateError' | 'PackagingLambdaFunctionError' | 'ParameterNotFoundError' | 'PermissionsError' | 'PluginMethodNotFoundError' | 'PluginNotFoundError' | 'PluginPolicyAddError' | 'ProfileConfigurationError' | 'ProjectAppIdResolveError' | 'ProjectInitError' | 'ProjectNotFoundError' | 'ProjectNotInitializedError' | 'PushResourcesError' | 'RegionNotAvailableError' | 'RemoveNotificationAppError' | 'ResourceAlreadyExistsError' | 'ResourceCountLimitExceedError' | 'ResourceDoesNotExistError' | 'ResourceInUseError' | 'ResourceNotReadyError' | 'ResourceRemoveError' | 'SchemaNotFoundError' | 'SchemaValidationError' | 'ScriptingFeaturesDisabledError' | 'SearchableMockProcessError' | 'SearchableMockUnavailablePortError' | 'SearchableMockUnsupportedPlatformError' | 'ShellCommandExecutionError' | 'StackNotFoundError' | 'StackStateError' | 'StorageImportError' | 'TransformerContractError' | 'UnknownDirectiveError' | 'UnsupportedLockFileTypeError' | 'UserInputError';
// @public (undocumented)
export enum AmplifyEvent {
@@ -329,7 +330,7 @@ export class ApiCategoryFacade {
// (undocumented)
static getTransformerVersion(context: $TSContext): Promise;
// (undocumented)
- static transformGraphQLSchema(context: $TSContext, options: $TSAny): Promise;
+ static transformGraphQLSchema(context: $TSContext, options: $TSAny): Promise<$TSAny | undefined>;
}
// @public (undocumented)
@@ -819,6 +820,9 @@ export class ExportPathValidationError extends AmplifyError {
constructor(errMessage?: string);
}
+// @public (undocumented)
+export const extract: any;
+
// @public (undocumented)
export function fancy(message?: string): void;
@@ -942,6 +946,9 @@ export type GetPackageAssetPaths = () => Promise;
// @public (undocumented)
export const getPackageManager: (rootPath?: string) => Promise;
+// @public (undocumented)
+export const getPackageManagerByType: (packageManagerType: PackageManagerType) => PackageManager;
+
// @public (undocumented)
export const getPermissionsBoundaryArn: (env?: string) => string | undefined;
@@ -1478,15 +1485,31 @@ export { open_2 as open }
export const overriddenCategories: string[];
// @public (undocumented)
-export type PackageManager = {
- packageManager: PackageManagerType;
- lockFile: string;
- executable: string;
+export interface PackageManager {
+ // (undocumented)
+ readonly displayValue: string;
+ // (undocumented)
+ readonly executable: string;
+ // (undocumented)
+ getInstallArgs: (buildType: BuildType, resourceDir?: string) => string[];
+ // (undocumented)
+ getRunScriptArgs: (scriptName: string) => string[];
+ // (undocumented)
+ readonly lockFile: string;
+ // (undocumented)
+ readonly packageManager: PackageManagerType;
+ // (undocumented)
version?: SemVer;
-};
+}
+
+// @public (undocumented)
+export const packageManagers: Record;
// @public (undocumented)
-export type PackageManagerType = 'yarn' | 'npm';
+export type PackageManagerType = 'yarn' | 'npm' | 'pnpm' | 'custom';
+
+// @public (undocumented)
+export const parseArn: (arn: string) => ARN;
// @public (undocumented)
export function parseHelpCommands(input: $TSAny, commandsInfo: Array): {
@@ -1632,6 +1655,8 @@ export class PathManager {
// (undocumented)
getRootStackBuildDirPath: (projectPath: string) => string;
// (undocumented)
+ getStackBuildCategoryResourceDirPath: (projectPath: string, category: string, resourceName: string) => string;
+ // (undocumented)
getTagFilePath: (projectPath?: string) => string;
// (undocumented)
getTeamProviderInfoFilePath: (projectPath?: string) => string;
@@ -1902,6 +1927,9 @@ export interface ResourceTuple {
// @public (undocumented)
export function runHelp(context: $TSContext, commandsInfo: Array): void;
+// @public (undocumented)
+export const runOverride: (overrideDir: string, templateObject: $TSAny, projectInfo: $TSAny) => Promise;
+
// @public (undocumented)
export type Runtime = {
plugins: Plugin_2[];
diff --git a/packages/amplify-cli-core/CHANGELOG.md b/packages/amplify-cli-core/CHANGELOG.md
index 1226f7ca0ba..089592a3e28 100644
--- a/packages/amplify-cli-core/CHANGELOG.md
+++ b/packages/amplify-cli-core/CHANGELOG.md
@@ -3,6 +3,286 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.3.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.10...@aws-amplify/amplify-cli-core@4.3.11) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.3.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.9...@aws-amplify/amplify-cli-core@4.3.10) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.3.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.8...@aws-amplify/amplify-cli-core@4.3.9) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.3.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.7...@aws-amplify/amplify-cli-core@4.3.8) (2024-06-20)
+
+
+### Bug Fixes
+
+* **cli:** add feature flag to control subscription field redaction behavior ([#13827](https://github.com/aws-amplify/amplify-cli/issues/13827)) ([4f9aadb](https://github.com/aws-amplify/amplify-cli/commit/4f9aadbd33a9adfa6c93f39d55ccbe0b13285965))
+
+
+
+
+
+## [4.3.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.6...@aws-amplify/amplify-cli-core@4.3.7) (2024-06-06)
+
+
+### Bug Fixes
+
+* skip types in current cloud backend ([#13803](https://github.com/aws-amplify/amplify-cli/issues/13803)) ([81ce57a](https://github.com/aws-amplify/amplify-cli/commit/81ce57afdfe73ce951143e6b20607bb3c77b43ae))
+
+
+
+
+
+## [4.3.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.5...@aws-amplify/amplify-cli-core@4.3.6) (2024-05-24)
+
+
+### Bug Fixes
+
+* do not create read stream for zip entries that are not being extracted ([883b23b](https://github.com/aws-amplify/amplify-cli/commit/883b23b6cd22a3c59296ca04f4d7f088ebb2d0a9))
+* don't create symlinks after extracting zip ([#13791](https://github.com/aws-amplify/amplify-cli/issues/13791)) ([08f358d](https://github.com/aws-amplify/amplify-cli/commit/08f358da33163fa70930ae6ef900e1d018672ef1))
+
+
+
+
+
+## [4.3.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.4...@aws-amplify/amplify-cli-core@4.3.5) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.3.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.3...@aws-amplify/amplify-cli-core@4.3.4) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.2...@aws-amplify/amplify-cli-core@4.3.3) (2024-04-15)
+
+
+### Bug Fixes
+
+* **amplify-cli-core:** gracefully handle execa race condition ([#13692](https://github.com/aws-amplify/amplify-cli/issues/13692)) ([dcafcb2](https://github.com/aws-amplify/amplify-cli/commit/dcafcb2d8bdaf7af37afa305afb10396a840825b))
+* yarn modern install workspace ([#13197](https://github.com/aws-amplify/amplify-cli/issues/13197)) ([3ca4aa9](https://github.com/aws-amplify/amplify-cli/commit/3ca4aa99457e54a89805f86e56b475aaef531d7e))
+
+
+
+
+
+## [4.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.1...@aws-amplify/amplify-cli-core@4.3.2) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.3.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.3.0...@aws-amplify/amplify-cli-core@4.3.1) (2024-03-06)
+
+
+### Bug Fixes
+
+* dependabot alert for lodash.set ([#13558](https://github.com/aws-amplify/amplify-cli/issues/13558)) ([c7f9bbe](https://github.com/aws-amplify/amplify-cli/commit/c7f9bbeb4943280bdda10304ce4e17622c5ec9c7))
+
+
+### Reverts
+
+* Revert "chore: bump data package versions (#13486)" (#13487) ([3280d40](https://github.com/aws-amplify/amplify-cli/commit/3280d40a5ab50c675b0e2b8050ad35a69c83cdc2)), closes [#13486](https://github.com/aws-amplify/amplify-cli/issues/13486) [#13487](https://github.com/aws-amplify/amplify-cli/issues/13487)
+
+
+
+
+
+# [4.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.13...@aws-amplify/amplify-cli-core@4.3.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [4.2.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.11...@aws-amplify/amplify-cli-core@4.2.13) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [4.2.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.11...@aws-amplify/amplify-cli-core@4.2.12) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.2.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.10...@aws-amplify/amplify-cli-core@4.2.11) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.2.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.9...@aws-amplify/amplify-cli-core@4.2.10) (2023-10-12)
+
+
+### Bug Fixes
+
+* set awscloudformation flag to false in vscode settings after override ([#13310](https://github.com/aws-amplify/amplify-cli/issues/13310)) ([d60e505](https://github.com/aws-amplify/amplify-cli/commit/d60e505391b4f8fc58c2cc4d352698a6157f1b59))
+
+
+
+
+
+## [4.2.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.8...@aws-amplify/amplify-cli-core@4.2.9) (2023-10-05)
+
+
+### Bug Fixes
+
+* remove .cmd extension for pnpm and npm invocations ([#13133](https://github.com/aws-amplify/amplify-cli/issues/13133)) ([ea81e43](https://github.com/aws-amplify/amplify-cli/commit/ea81e43cb6cee4822d5fa6c3e1714decb7ed18b0))
+
+
+
+
+
+## [4.2.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.7...@aws-amplify/amplify-cli-core@4.2.8) (2023-10-03)
+
+
+### Bug Fixes
+
+* update api category and codegen to capture high-priority bug-fixes ([3836b90](https://github.com/aws-amplify/amplify-cli/commit/3836b90b3f9ccd654d9c1b61a4b83c9c4712290c))
+
+
+
+
+
+## [4.2.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.6...@aws-amplify/amplify-cli-core@4.2.7) (2023-09-22)
+
+
+### Bug Fixes
+
+* remove stale data ([#13128](https://github.com/aws-amplify/amplify-cli/issues/13128)) ([9703223](https://github.com/aws-amplify/amplify-cli/commit/970322372278762fff88f7046b44574b611ad210))
+
+
+
+
+
+## [4.2.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.5...@aws-amplify/amplify-cli-core@4.2.6) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-core
+
+
+
+
+
+## [4.2.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.4...@aws-amplify/amplify-cli-core@4.2.5) (2023-08-17)
+
+
+### Bug Fixes
+
+* do not store windows specific package manager extension ([#13047](https://github.com/aws-amplify/amplify-cli/issues/13047)) ([d29a075](https://github.com/aws-amplify/amplify-cli/commit/d29a075d3d115db44bcaf68d58e260c7f234a4d3))
+
+
+
+
+
+## [4.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.3...@aws-amplify/amplify-cli-core@4.2.4) (2023-08-09)
+
+
+### Bug Fixes
+
+* Dependabot alerts for semver, tough-cookie ([#12962](https://github.com/aws-amplify/amplify-cli/issues/12962)) ([175a86b](https://github.com/aws-amplify/amplify-cli/commit/175a86b89a54c65bb6e68c0609be503d61e39d63))
+* remove vm2 ([#12989](https://github.com/aws-amplify/amplify-cli/issues/12989)) ([7bc0b56](https://github.com/aws-amplify/amplify-cli/commit/7bc0b5654a585104a537c1a3f9615bd672435b58))
+* surface override build error if scripting features are disabled ([#13013](https://github.com/aws-amplify/amplify-cli/issues/13013)) ([fa80249](https://github.com/aws-amplify/amplify-cli/commit/fa802491f8767f50dc3636e190fb70eb492fa969))
+* upgrade proxy-agent to ^6.3.0 to remove vm2 deps ([#13012](https://github.com/aws-amplify/amplify-cli/issues/13012)) ([989ec35](https://github.com/aws-amplify/amplify-cli/commit/989ec35be4dfd2bea19ea82bbe317f212729950f))
+
+
+
+
+
+## [4.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.2...@aws-amplify/amplify-cli-core@4.2.3) (2023-07-28)
+
+
+### Bug Fixes
+
+* surface override build error if scripting features are disabled ([#13013](https://github.com/aws-amplify/amplify-cli/issues/13013)) ([#13023](https://github.com/aws-amplify/amplify-cli/issues/13023)) ([9e99800](https://github.com/aws-amplify/amplify-cli/commit/9e998008c6aef13ee50e6ce88cc78d8e9367b66a))
+
+
+
+
+
+## [4.2.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.1...@aws-amplify/amplify-cli-core@4.2.2) (2023-07-27)
+
+
+### Bug Fixes
+
+* parsing arn with multiple slashes when importing auth ([#13009](https://github.com/aws-amplify/amplify-cli/issues/13009)) ([455c514](https://github.com/aws-amplify/amplify-cli/commit/455c514fd9d29fcec37bc9a4de9c96fef80883b5))
+
+
+
+
+
+## [4.2.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.2.0...@aws-amplify/amplify-cli-core@4.2.1) (2023-07-24)
+
+
+### Bug Fixes
+
+* skip hooks if flag detected ([a58e13c](https://github.com/aws-amplify/amplify-cli/commit/a58e13c55fb7dfd9e4f4a945e96d429cbecd2f9a))
+
+
+
+
+
+# [4.2.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.1.0...@aws-amplify/amplify-cli-core@4.2.0) (2023-07-20)
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+
+
+
+
+
+# [4.1.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.0.8...@aws-amplify/amplify-cli-core@4.1.0) (2023-06-13)
+
+
+### Features
+
+* add status acm subcommand ([#12190](https://github.com/aws-amplify/amplify-cli/issues/12190)) ([a25ec17](https://github.com/aws-amplify/amplify-cli/commit/a25ec17bf1c5917d99b7eb8ec6e5a45b7def8a01))
+
+
+
+
+
## [4.0.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-core@4.0.6...@aws-amplify/amplify-cli-core@4.0.8) (2023-05-25)
diff --git a/packages/amplify-cli-core/package.json b/packages/amplify-cli-core/package.json
index 67a49b074e5..0e8ce95e362 100644
--- a/packages/amplify-cli-core/package.json
+++ b/packages/amplify-cli-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-cli-core",
- "version": "4.0.8",
+ "version": "4.3.11",
"description": "Amplify CLI Core",
"repository": {
"type": "git",
@@ -28,14 +28,16 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-logger": "1.3.2",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "@aws-amplify/graphql-transformer-interfaces": "^2.2.1",
+ "@aws-amplify/amplify-cli-logger": "1.3.8",
+ "@aws-amplify/amplify-function-plugin-interface": "1.12.1",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "@aws-amplify/graphql-transformer-interfaces": "^3.10.2",
+ "@aws-sdk/util-arn-parser": "^3.310.0",
"@yarnpkg/lockfile": "^1.1.0",
"ajv": "^6.12.6",
- "aws-cdk-lib": "~2.68.0",
+ "aws-cdk-lib": "~2.177.0",
"chalk": "^4.1.1",
- "ci-info": "^2.0.0",
+ "ci-info": "^3.8.0",
"cli-table3": "^0.6.0",
"cloudform-types": "^4.2.0",
"colors": "1.4.0",
@@ -51,14 +53,16 @@
"node-fetch": "^2.6.7",
"open": "^8.4.0",
"ora": "^4.0.3",
- "proxy-agent": "^5.0.0",
- "semver": "^7.3.5",
+ "proxy-agent": "^6.3.0",
+ "semver": "^7.5.4",
"typescript-json-schema": "~0.52.0",
"which": "^2.0.2",
- "yaml": "^2.2.2"
+ "yaml": "^2.2.2",
+ "yauzl": "^3.1.3"
},
"devDependencies": {
- "@aws-amplify/amplify-function-plugin-interface": "1.10.2",
+ "@aws-amplify/amplify-function-plugin-interface": "1.10.3",
+ "@types/archiver": "^5.3.1",
"@types/ejs": "^3.1.1",
"@types/fs-extra": "^8.0.1",
"@types/hjson": "^2.4.2",
@@ -69,7 +73,7 @@
"@types/uuid": "^8.0.0",
"@types/yarnpkg__lockfile": "^1.1.5",
"jest": "^29.5.0",
- "nock": "^13.0.11",
+ "nock": "^13.5.0",
"rimraf": "^3.0.0",
"strip-ansi": "^6.0.0",
"uuid": "^8.3.2"
diff --git a/packages/amplify-cli-core/src/__tests__/amplify-lockfile-dependency-detector/amplify-nodejs-detector.test.ts b/packages/amplify-cli-core/src/__tests__/amplify-lockfile-dependency-detector/amplify-nodejs-detector.test.ts
index ba1517ca35c..267500d2e93 100644
--- a/packages/amplify-cli-core/src/__tests__/amplify-lockfile-dependency-detector/amplify-nodejs-detector.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/amplify-lockfile-dependency-detector/amplify-nodejs-detector.test.ts
@@ -1,15 +1,19 @@
import * as path from 'path';
import { AmplifyNodePkgDetectorProps, AmplifyNodePkgDetector } from '../../amplify-node-pkg-detector';
-import { getPackageManager } from '../../utils/packageManager';
+import { getPackageManager, getPackageManagerByType } from '../../utils/packageManager';
import { coerce } from 'semver';
+import { $TSAny } from '@aws-amplify/amplify-cli-core';
-jest.mock('../../utils/packageManager');
+jest.mock('../../utils/packageManager', () => ({
+ ...(jest.requireActual('../../utils/packageManager') as {}),
+ getPackageManager: jest.fn(),
+}));
describe('no package Manager cases', () => {
it('error thrown when no package manager found', async () => {
(getPackageManager as jest.MockedFunction).mockReturnValue(new Promise((resolve) => resolve(null)));
const projectRoot = path.join(__dirname, 'resources');
- expect(
+ await expect(
async () =>
await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -18,20 +22,16 @@ describe('no package Manager cases', () => {
});
});
+const yarnPackageManager = getPackageManagerByType('yarn');
+const npmPackageManager = getPackageManagerByType('npm');
+
describe('parsing yarn lock files', () => {
it('throws error when lock file not found', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test-not-found.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test-not-found.lock';
+
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
- expect(
+ await expect(
async () =>
await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -40,36 +40,20 @@ describe('parsing yarn lock files', () => {
});
it('throw error on corrupted lock file', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test-error.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test-error.lock';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const amplifyDetectorProps: AmplifyNodePkgDetectorProps = {
projectRoot,
};
- expect(async () =>
+ await expect(async () =>
(await AmplifyNodePkgDetector.getInstance(amplifyDetectorProps)).detectAffectedDirectDependencies('@aws-cdk/core'),
).rejects.toThrowErrorMatchingInlineSnapshot(`"yarn.lock parsing failed with an error: Invalid value type 1:16 in lockfile"`);
});
it('correctly detect dependencies for @aws-cdk/core', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test.lock';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -108,16 +92,8 @@ describe('parsing yarn lock files', () => {
`);
});
it('correctly detect dependencies for amplify-cli-core', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test.lock';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -150,16 +126,8 @@ describe('parsing yarn lock files', () => {
});
it('correctly detect dependencies for fs-extra', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test.lock';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -206,16 +174,8 @@ describe('parsing yarn lock files', () => {
});
it('correctly detect dependencies for aws-cdk-lib', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test.lock';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -225,16 +185,8 @@ describe('parsing yarn lock files', () => {
it('should handle cycle in graph with yarn 1', async () => {
// this test will error with stack overflow if dfs is following cycle
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-test-with-cycle.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-test-with-cycle.lock';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -246,17 +198,10 @@ describe('parsing yarn lock files', () => {
describe('parsing package lock files', () => {
it('throws error when package lock file is missing', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-not-found.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-not-found.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
- expect(
+ await expect(
async () =>
await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -265,20 +210,13 @@ describe('parsing package lock files', () => {
});
it('throw error on corrupted package lock file', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test-error.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test-error.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const amplifyDetectorProps: AmplifyNodePkgDetectorProps = {
projectRoot,
};
- expect(async () =>
+ await expect(async () =>
(await AmplifyNodePkgDetector.getInstance(amplifyDetectorProps)).detectAffectedDirectDependencies('@aws-cdk/core'),
).rejects.toThrowErrorMatchingInlineSnapshot(
`"package-lock.json parsing failed with an error: 'jsonString' argument missing or empty"`,
@@ -286,15 +224,8 @@ describe('parsing package lock files', () => {
});
it('correctly detect dependencies', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -334,15 +265,8 @@ describe('parsing package lock files', () => {
});
it('correctly detect dependencies for @aws-cdk/core when present in peer dependencies', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test-peer-dependencies.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test-peer-dependencies.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -360,15 +284,8 @@ describe('parsing package lock files', () => {
`);
});
it('correctly detect dependencies for amplify-cli-core', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -401,15 +318,8 @@ describe('parsing package lock files', () => {
});
it('correctly detect dependencies for fs-extra', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -456,15 +366,8 @@ describe('parsing package lock files', () => {
});
it('correctly detect dependencies for aws-cdk-lib', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -473,15 +376,8 @@ describe('parsing package lock files', () => {
});
it('should handle cycle in graph with npm', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'npm',
- lockFile: 'package-lock-test-with-cycle.json',
- packageManager: 'npm',
- }),
- ),
- );
+ (npmPackageManager as $TSAny).lockFile = 'package-lock-test-with-cycle.json';
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -492,21 +388,14 @@ describe('parsing package lock files', () => {
describe('parsing yarn2 lock files', () => {
it('throw error on corrupted lock file', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-2-test.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-2-test.lock';
+ yarnPackageManager.version = coerce('1.22.0') ?? undefined;
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const amplifyDetectorProps: AmplifyNodePkgDetectorProps = {
projectRoot,
};
- expect(async () =>
+ await expect(async () =>
(await AmplifyNodePkgDetector.getInstance(amplifyDetectorProps)).detectAffectedDirectDependencies('@aws-cdk/core'),
).rejects.toThrowErrorMatchingInlineSnapshot(
`"yarn.lock parsing failed with an error: Unknown token: { line: 3, col: 2, type: 'INVALID', value: undefined } 3:2 in lockfile"`,
@@ -514,16 +403,9 @@ describe('parsing yarn2 lock files', () => {
});
it('correctly detect dependencies for @aws-cdk/core', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-2-test.lock',
- packageManager: 'yarn',
- version: coerce('2.0.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-2-test.lock';
+ yarnPackageManager.version = coerce('2.0.0') ?? undefined;
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -563,16 +445,9 @@ describe('parsing yarn2 lock files', () => {
});
it('correctly detect dependencies for amplify-cli-core', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-2-test.lock',
- packageManager: 'yarn',
- version: coerce('2.0.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-2-test.lock';
+ yarnPackageManager.version = coerce('2.0.0') ?? undefined;
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -605,16 +480,9 @@ describe('parsing yarn2 lock files', () => {
});
it('correctly detect dependencies for fs-extra', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-2-test.lock',
- packageManager: 'yarn',
- version: coerce('2.0.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-2-test.lock';
+ yarnPackageManager.version = coerce('2.0.0') ?? undefined;
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
@@ -661,16 +529,9 @@ describe('parsing yarn2 lock files', () => {
});
it('correctly detect dependencies for aws-cdk-lib', async () => {
- (getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'yarn-2-test.lock',
- packageManager: 'yarn',
- version: coerce('2.0.0') ?? undefined,
- }),
- ),
- );
+ (yarnPackageManager as $TSAny).lockFile = 'yarn-2-test.lock';
+ yarnPackageManager.version = coerce('2.0.0') ?? undefined;
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
const projectRoot = path.join(__dirname, 'resources');
const dec = await AmplifyNodePkgDetector.getInstance({
projectRoot,
diff --git a/packages/amplify-cli-core/src/__tests__/cliContextEnvironmentProvider.test.ts b/packages/amplify-cli-core/src/__tests__/cliContextEnvironmentProvider.test.ts
index eb836ecd7b2..c42e520d37e 100644
--- a/packages/amplify-cli-core/src/__tests__/cliContextEnvironmentProvider.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/cliContextEnvironmentProvider.test.ts
@@ -3,7 +3,7 @@ import { CLIEnvironmentProvider, CLIContextEnvironmentProvider } from '..';
describe('ContextCLIEnvironmentProvider tests', () => {
test('returns env name from initialized context', () => {
const context: any = {
- getEnvInfo: (_: boolean): any => {
+ getEnvInfo: (): any => {
return {
envName: 'testenv',
};
@@ -17,7 +17,7 @@ describe('ContextCLIEnvironmentProvider tests', () => {
test('returns empty env name from when envInfo is undefined in context', () => {
const context: any = {
- getEnvInfo: (_: boolean): any => {
+ getEnvInfo: (): any => {
return undefined;
},
};
@@ -29,7 +29,7 @@ describe('ContextCLIEnvironmentProvider tests', () => {
test('returns empty env name from when envInfo.envName is undefined in context', () => {
const context: any = {
- getEnvInfo: (_: boolean): any => {
+ getEnvInfo: (): any => {
return {
envName: undefined,
};
@@ -43,7 +43,7 @@ describe('ContextCLIEnvironmentProvider tests', () => {
test('returns empty env name from when getEnvInfo throws', () => {
const context: any = {
- getEnvInfo: (_: boolean): any => {
+ getEnvInfo: (): any => {
throw new Error();
},
};
@@ -55,7 +55,7 @@ describe('ContextCLIEnvironmentProvider tests', () => {
test('throws when undefined context passed in', () => {
expect(() => {
- const _: CLIEnvironmentProvider = new CLIContextEnvironmentProvider(undefined as any);
+ new CLIContextEnvironmentProvider(undefined as any);
}).toThrowError('CLIContextEnvironmentProvider expects a context instance');
});
});
diff --git a/packages/amplify-cli-core/src/__tests__/extractZip.test.ts b/packages/amplify-cli-core/src/__tests__/extractZip.test.ts
new file mode 100644
index 00000000000..67ff84567e2
--- /dev/null
+++ b/packages/amplify-cli-core/src/__tests__/extractZip.test.ts
@@ -0,0 +1,112 @@
+import * as fs from 'fs-extra';
+import * as path from 'path';
+import * as archiver from 'archiver';
+import { extract } from '@aws-amplify/amplify-cli-core';
+import * as os from 'os';
+
+describe('extract zip', () => {
+ let tempDir: string;
+ let inputDir: string;
+ let outputDir: string;
+ let zipFilePath: string;
+ const file1RelativePath = 'file1.txt';
+ const file1Content = Math.random().toString();
+ const file2RelativePath = 'file2.txt';
+ const file2Content = Math.random().toString();
+ const dir1RelativePath = 'dir1';
+ const file3RelativePath = path.join(dir1RelativePath, 'file3.txt');
+ const file3Content: string = Math.random().toString();
+ const dir2RelativePath = 'dir2';
+ const file4RelativePath = path.join(dir2RelativePath, 'file4.txt');
+ const file4Content: string = Math.random().toString();
+
+ beforeAll(async () => {
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'extractZipTest'));
+ inputDir = path.join(tempDir, 'inputDir');
+ outputDir = path.join(tempDir, 'outputDir');
+ fs.mkdirSync(inputDir);
+ fs.mkdirSync(path.join(inputDir, 'dir1'));
+ fs.mkdirSync(path.join(inputDir, 'dir2'));
+ fs.writeFileSync(path.join(inputDir, file1RelativePath), file1Content);
+ fs.writeFileSync(path.join(inputDir, file2RelativePath), file2Content);
+ fs.writeFileSync(path.join(inputDir, file3RelativePath), file3Content);
+ fs.writeFileSync(path.join(inputDir, file4RelativePath), file4Content);
+
+ zipFilePath = path.join(tempDir, 'archive.zip');
+ const output = fs.createWriteStream(zipFilePath);
+ const archive = archiver.create('zip', {});
+ archive.pipe(output);
+ archive.directory(inputDir, false);
+ await archive.finalize();
+ });
+
+ beforeEach(() => {
+ fs.removeSync(outputDir);
+ });
+
+ afterAll(() => {
+ fs.removeSync(tempDir);
+ });
+
+ it('should extract full zip', async () => {
+ await extract(zipFilePath, { dir: outputDir });
+ expect(fs.existsSync(path.join(outputDir, dir1RelativePath))).toStrictEqual(true);
+ expect(fs.existsSync(path.join(outputDir, dir2RelativePath))).toStrictEqual(true);
+ expect(fs.readFileSync(path.join(outputDir, file1RelativePath), 'utf-8')).toStrictEqual(file1Content);
+ expect(fs.readFileSync(path.join(outputDir, file2RelativePath), 'utf-8')).toStrictEqual(file2Content);
+ expect(fs.readFileSync(path.join(outputDir, file3RelativePath), 'utf-8')).toStrictEqual(file3Content);
+ expect(fs.readFileSync(path.join(outputDir, file4RelativePath), 'utf-8')).toStrictEqual(file4Content);
+ });
+
+ it('should skip directory', async () => {
+ await extract(zipFilePath, {
+ dir: outputDir,
+ skipEntryPrefixes: [dir1RelativePath],
+ });
+ expect(fs.existsSync(path.join(outputDir, dir1RelativePath))).toStrictEqual(false);
+ expect(fs.existsSync(path.join(outputDir, dir2RelativePath))).toStrictEqual(true);
+ expect(fs.readFileSync(path.join(outputDir, file1RelativePath), 'utf-8')).toStrictEqual(file1Content);
+ expect(fs.readFileSync(path.join(outputDir, file2RelativePath), 'utf-8')).toStrictEqual(file2Content);
+ expect(fs.existsSync(path.join(outputDir, file3RelativePath))).toStrictEqual(false);
+ expect(fs.readFileSync(path.join(outputDir, file4RelativePath), 'utf-8')).toStrictEqual(file4Content);
+ });
+
+ it('should skip top level file', async () => {
+ await extract(zipFilePath, {
+ dir: outputDir,
+ skipEntryPrefixes: [file1RelativePath],
+ });
+ expect(fs.existsSync(path.join(outputDir, dir1RelativePath))).toStrictEqual(true);
+ expect(fs.existsSync(path.join(outputDir, dir2RelativePath))).toStrictEqual(true);
+ expect(fs.existsSync(path.join(outputDir, file1RelativePath))).toStrictEqual(false);
+ expect(fs.readFileSync(path.join(outputDir, file2RelativePath), 'utf-8')).toStrictEqual(file2Content);
+ expect(fs.readFileSync(path.join(outputDir, file3RelativePath), 'utf-8')).toStrictEqual(file3Content);
+ expect(fs.readFileSync(path.join(outputDir, file4RelativePath), 'utf-8')).toStrictEqual(file4Content);
+ });
+
+ it('should skip nested file', async () => {
+ await extract(zipFilePath, {
+ dir: outputDir,
+ skipEntryPrefixes: [file4RelativePath],
+ });
+ expect(fs.existsSync(path.join(outputDir, dir1RelativePath))).toStrictEqual(true);
+ expect(fs.existsSync(path.join(outputDir, dir2RelativePath))).toStrictEqual(true);
+ expect(fs.readFileSync(path.join(outputDir, file1RelativePath), 'utf-8')).toStrictEqual(file1Content);
+ expect(fs.readFileSync(path.join(outputDir, file2RelativePath), 'utf-8')).toStrictEqual(file2Content);
+ expect(fs.readFileSync(path.join(outputDir, file3RelativePath), 'utf-8')).toStrictEqual(file3Content);
+ expect(fs.existsSync(path.join(outputDir, file4RelativePath))).toStrictEqual(false);
+ });
+
+ it('should skip multiple entries', async () => {
+ await extract(zipFilePath, {
+ dir: outputDir,
+ skipEntryPrefixes: [file1RelativePath, dir2RelativePath],
+ });
+ expect(fs.existsSync(path.join(outputDir, dir1RelativePath))).toStrictEqual(true);
+ expect(fs.existsSync(path.join(outputDir, dir2RelativePath))).toStrictEqual(false);
+ expect(fs.existsSync(path.join(outputDir, file1RelativePath))).toStrictEqual(false);
+ expect(fs.readFileSync(path.join(outputDir, file2RelativePath), 'utf-8')).toStrictEqual(file2Content);
+ expect(fs.readFileSync(path.join(outputDir, file3RelativePath), 'utf-8')).toStrictEqual(file3Content);
+ expect(fs.existsSync(path.join(outputDir, file4RelativePath))).toStrictEqual(false);
+ });
+});
diff --git a/packages/amplify-cli-core/src/__tests__/featureFlags.test.ts b/packages/amplify-cli-core/src/__tests__/featureFlags.test.ts
index 4407c59d8af..2181262f133 100644
--- a/packages/amplify-cli-core/src/__tests__/featureFlags.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/featureFlags.test.ts
@@ -148,7 +148,7 @@ describe('feature flags', () => {
test('initialize feature flag provider successfully', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -191,7 +191,7 @@ describe('feature flags', () => {
test('initialize feature flag provider fail with json error', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -211,7 +211,7 @@ describe('feature flags', () => {
test('initialize feature flag provider successfully - overrides 1', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -237,7 +237,7 @@ describe('feature flags', () => {
test('initialize feature flag provider successfully - overrides 2', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -263,7 +263,7 @@ describe('feature flags', () => {
test('initialize feature flag provider successfully - overrides 3', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -289,7 +289,7 @@ describe('feature flags', () => {
test('initialize feature flag provider successfully - overrides 4', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -315,7 +315,7 @@ describe('feature flags', () => {
test('initialize feature flag provider fail with env error - section', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -333,7 +333,7 @@ describe('feature flags', () => {
test('initialize feature flag provider fail with env error - value', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -351,7 +351,7 @@ describe('feature flags', () => {
test('initialize feature flag provider fail with env error - bool', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -369,7 +369,7 @@ describe('feature flags', () => {
test('initialize feature flag provider fail with env error - number', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -387,7 +387,7 @@ describe('feature flags', () => {
test('initialize feature flag provider fail unknown flags unless false', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -415,7 +415,7 @@ The following feature flags have validation errors:
test('initialize feature flag provider with unknown false flag', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -464,12 +464,12 @@ The following feature flags have validation errors:
process.env = { ...realProcessEnv };
});
- test('initialization does not fail when process.env is not available', () => {
+ test('initialization does not fail when process.env is not available', async () => {
process.env = {};
expect(process.env).toEqual({});
- provider.load();
+ await provider.load();
});
test('successfully parse every form of variables', async () => {
@@ -555,7 +555,7 @@ The following feature flags have validation errors:
describe('file provider tests', () => {
test('missing projectPath argument', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -573,7 +573,7 @@ The following feature flags have validation errors:
test('reads features when both files exists', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -603,7 +603,7 @@ The following feature flags have validation errors:
test('reads features when no environment file exist', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -627,7 +627,7 @@ The following feature flags have validation errors:
test('reads features when no files exist', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -647,7 +647,7 @@ The following feature flags have validation errors:
test('reads features when only environment file exists', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => ({
+ getEnvInfo: (): any => ({
envName: 'dev',
}),
};
@@ -673,7 +673,7 @@ The following feature flags have validation errors:
test('reads features when no files exists and env is unavailable', async () => {
const context: any = {
- getEnvInfo: (__: boolean): any => undefined,
+ getEnvInfo: (): any => undefined,
};
const envProvider: CLIEnvironmentProvider = new CLIContextEnvironmentProvider(context);
diff --git a/packages/amplify-cli-core/src/__tests__/help.test.ts b/packages/amplify-cli-core/src/__tests__/help.test.ts
index e401d6c4680..4a32c748c5b 100644
--- a/packages/amplify-cli-core/src/__tests__/help.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/help.test.ts
@@ -148,42 +148,42 @@ describe('amplify help functions: ', () => {
];
it('lookup valid command (init) and expect not null', () => {
- let initCommandInfo = lookUpCommand(mockCommandsInfo, 'init');
+ const initCommandInfo = lookUpCommand(mockCommandsInfo, 'init');
expect(initCommandInfo).not.toBeUndefined();
});
it('lookup invalid command and expect null', () => {
- let invalidCommandInfo = lookUpCommand(mockCommandsInfo, 'invalidcommand');
+ const invalidCommandInfo = lookUpCommand(mockCommandsInfo, 'invalidcommand');
expect(invalidCommandInfo).toBeUndefined();
});
it('lookup valid command (init) and expect correct command name', () => {
- let initCommandInfo = lookUpCommand(mockCommandsInfo, 'init');
+ const initCommandInfo = lookUpCommand(mockCommandsInfo, 'init');
expect(initCommandInfo!.command).toBe('init');
});
it('lookup valid command (configure) and expect correct command name', () => {
- let initCommandInfo = lookUpCommand(mockCommandsInfo, 'configure');
+ const initCommandInfo = lookUpCommand(mockCommandsInfo, 'configure');
expect(initCommandInfo!.command).toBe('configure');
});
it('lookup valid subcommand (configure project) and expect not null', () => {
- let configureProjectSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'configure', 'project');
+ const configureProjectSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'configure', 'project');
expect(configureProjectSubCommandInfo).not.toBeUndefined();
});
it('lookup invalid subcommand and expect null', () => {
- let invalidSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'invalidcommand', 'invalidsubcommand');
+ const invalidSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'invalidcommand', 'invalidsubcommand');
expect(invalidSubCommandInfo).toBeUndefined();
});
it('lookup valid subcommand (configure project) and expect correct subcommand name', () => {
- let configureProjectSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'configure', 'project');
+ const configureProjectSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'configure', 'project');
expect(configureProjectSubCommandInfo!.subCommand).toBe('project');
});
it('lookup valid subcommand (configure hosting) correct subcommand name', () => {
- let configureHostingSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'configure', 'hosting');
+ const configureHostingSubCommandInfo = lookUpSubcommand(mockCommandsInfo, 'configure', 'hosting');
expect(configureHostingSubCommandInfo!.subCommand).toBe('hosting');
});
@@ -195,7 +195,7 @@ describe('amplify help functions: ', () => {
plugin: 'core',
subCommands: ['configure'],
};
- let specifiedCommands = parseHelpCommands(configureInput, mockCommandsInfo);
+ const specifiedCommands = parseHelpCommands(configureInput, mockCommandsInfo);
expect(specifiedCommands.command).toBe('configure');
expect(specifiedCommands.subCommand).toBe('');
});
@@ -208,14 +208,13 @@ describe('amplify help functions: ', () => {
options: { help: true, yes: false },
subCommands: ['mock', 'function'],
};
- let specifiedCommands = parseHelpCommands(mockFunctionInput, mockCommandsInfo);
+ const specifiedCommands = parseHelpCommands(mockFunctionInput, mockCommandsInfo);
expect(specifiedCommands.command).toBe('mock');
expect(specifiedCommands.subCommand).toBe('function');
});
it('run help invalid command', () => {
- let mockContext: $TSContext;
- mockContext = {
+ const mockContext = {
input: {
argv: ['node', 'amplify', 'invalid', 'command', '-h'],
command: 'help',
@@ -230,9 +229,7 @@ describe('amplify help functions: ', () => {
});
it('run help command (mock)', () => {
- let mockContext: $TSContext;
-
- mockContext = {
+ const mockContext = {
print: {
info: jest.fn(),
},
@@ -249,9 +246,7 @@ describe('amplify help functions: ', () => {
});
it('run help subcommand (mock function)', () => {
- let mockContext: $TSContext;
-
- mockContext = {
+ const mockContext = {
print: {
info: jest.fn(),
},
diff --git a/packages/amplify-cli-core/src/__tests__/hooks/hooksExecutor.test.ts b/packages/amplify-cli-core/src/__tests__/hooks/hooksExecutor.test.ts
index 5fd048d7f08..e307c606ccf 100644
--- a/packages/amplify-cli-core/src/__tests__/hooks/hooksExecutor.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/hooks/hooksExecutor.test.ts
@@ -1,7 +1,6 @@
import * as path from 'path';
import * as execa from 'execa';
-import * as fs from 'fs-extra';
-import { executeHooks, HooksMeta, skipHooksFilePath } from '../../hooks';
+import { executeHooks, HooksMeta } from '../../hooks';
import * as skipHooksModule from '../../hooks/skipHooks';
import { pathManager, stateManager } from '../../state-manager';
import { CommandLineInput } from '../../types';
@@ -43,6 +42,7 @@ jest.mock('which', () => ({
if (runtimeName === 'python3') return pathToPython3Runtime;
if (runtimeName === 'python') return pathToPythonRuntime;
if (runtimeName === 'node') return pathToNodeRuntime;
+ throw new Error('unknown runtime');
}),
}));
jest.mock('fs-extra', () => {
@@ -81,26 +81,22 @@ describe('hooksExecutioner tests', () => {
});
afterEach(() => {
HooksMeta.releaseInstance();
+ delete process.env.AMPLIFY_CLI_DISABLE_SCRIPTING_FEATURES;
});
test('skip Hooks test', async () => {
mockSkipHooks.mockRestore();
- const orgSkipHooksExist = fs.existsSync(skipHooksFilePath);
-
- fs.ensureFileSync(skipHooksFilePath);
- // skip hooks file exists so no execa calls should be made
+ process.env.AMPLIFY_CLI_DISABLE_SCRIPTING_FEATURES = 'true';
+ // skip hooks flag exists so no execa calls should be made
await executeHooks(HooksMeta.getInstance({ command: 'push', plugin: 'core' } as CommandLineInput, 'pre'));
expect(execa).toHaveBeenCalledTimes(0);
- fs.removeSync(skipHooksFilePath);
- // skip hooks file does not exists so execa calls should be made
+ delete process.env.AMPLIFY_CLI_DISABLE_SCRIPTING_FEATURES;
+ // skip hooks flag does not exist so execa calls should be made
await executeHooks(HooksMeta.getInstance({ command: 'push', plugin: 'core' } as CommandLineInput, 'pre'));
expect(execa).not.toHaveBeenCalledTimes(0);
- // restoring the original state of skip hooks file
- if (!orgSkipHooksExist) fs.removeSync(skipHooksFilePath);
- else fs.ensureFileSync(skipHooksFilePath);
mockSkipHooks = jest.spyOn(skipHooksModule, 'skipHooks');
});
@@ -182,4 +178,40 @@ describe('hooksExecutioner tests', () => {
duplicateErrorThrown,
);
});
+
+ test('should not exit process if execa fails with exitCode being 0', async () => {
+ const execaMock = execa as jest.Mocked;
+ (execaMock as any).mockReturnValue({
+ exitCode: 0,
+ errNo: -32,
+ code: 'EPIPE',
+ syscall: 'write',
+ originalMessage: 'write EPIPE',
+ shortMessage: 'Command failed with EPIPE',
+ escapedCommand: 'testCommand',
+ stderr: '',
+ failed: true,
+ timedOut: false,
+ isCanceled: false,
+ killed: false,
+ });
+ const processExitMock = jest.spyOn(process, 'exit').mockImplementation(() => undefined as never);
+ await executeHooks(HooksMeta.getInstance({ command: 'add', plugin: 'auth' } as CommandLineInput, 'pre'));
+ expect(processExitMock).toBeCalledTimes(0);
+ });
+
+ test('should exit process with exit code 76 if execa fails with exitCode other than 0', async () => {
+ const execaMock = execa as jest.Mocked;
+ (execaMock as any).mockReturnValue({
+ exitCode: 1,
+ stderr: '',
+ failed: true,
+ timedOut: false,
+ isCanceled: false,
+ killed: false,
+ });
+ const processExitMock = jest.spyOn(process, 'exit').mockImplementation(() => undefined as never);
+ await executeHooks(HooksMeta.getInstance({ command: 'add', plugin: 'auth' } as CommandLineInput, 'pre'));
+ expect(processExitMock).toBeCalledWith(76);
+ });
});
diff --git a/packages/amplify-cli-core/src/__tests__/jsonUtilities.test.ts b/packages/amplify-cli-core/src/__tests__/jsonUtilities.test.ts
index 929ff4141ad..ef0cd6be7c0 100644
--- a/packages/amplify-cli-core/src/__tests__/jsonUtilities.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/jsonUtilities.test.ts
@@ -160,7 +160,7 @@ describe('JSONUtilities tests', () => {
test('JSON parse throws error when jsonString is undefined', () => {
expect(() => {
- const _ = JSONUtilities.parse(undefined as unknown as string);
+ JSONUtilities.parse(undefined as unknown as string);
}).toThrowError(`'jsonString' argument missing or empty`);
});
diff --git a/packages/amplify-cli-core/src/__tests__/packageManager.test.ts b/packages/amplify-cli-core/src/__tests__/packageManager.test.ts
index c9208bb064b..5958b3de32c 100644
--- a/packages/amplify-cli-core/src/__tests__/packageManager.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/packageManager.test.ts
@@ -71,7 +71,7 @@ describe('packageManager tests', () => {
const packageManager = await getPackageManager(testDirectory);
- expect(which_mock.sync).toBeCalledTimes(1);
+ expect(which_mock.sync).toBeCalledTimes(2);
expect(packageManager).toBeDefined();
expect(packageManager!.packageManager).toEqual('npm');
});
diff --git a/packages/amplify-cli-core/src/__tests__/pathManager.test.ts b/packages/amplify-cli-core/src/__tests__/pathManager.test.ts
index f32b47e1663..3b8e8b233b0 100644
--- a/packages/amplify-cli-core/src/__tests__/pathManager.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/pathManager.test.ts
@@ -45,3 +45,13 @@ describe('test getAmplifyPackageLibDirPath', () => {
}
});
});
+
+describe('test getStackBuildCategoryResourceDirPath', () => {
+ const category = 'storage';
+ const resourceName = 'testResource';
+ const expectedPath = path.join(pathManager.getRootStackBuildDirPath('projectPath'), category, resourceName);
+
+ it('should return correct path', () => {
+ expect(pathManager.getStackBuildCategoryResourceDirPath('projectPath', category, resourceName)).toEqual(expectedPath);
+ });
+});
diff --git a/packages/amplify-cli-core/src/__tests__/utils/isResourceNameUnique.test.ts b/packages/amplify-cli-core/src/__tests__/utils/isResourceNameUnique.test.ts
index 91446026a58..9e918148f5f 100644
--- a/packages/amplify-cli-core/src/__tests__/utils/isResourceNameUnique.test.ts
+++ b/packages/amplify-cli-core/src/__tests__/utils/isResourceNameUnique.test.ts
@@ -11,13 +11,23 @@ stateManager_mock.getMeta.mockReturnValue({
},
});
-test('conflict exists if names differ by case only', () => {
+test('conflict exists if names differ by case only - throw error', () => {
expect(() => isResourceNameUnique('api', 'testblog')).toThrowErrorMatchingInlineSnapshot(
`"A resource named 'testBlog' already exists. Amplify resource names must be unique and are case-insensitive."`,
);
});
+test('conflict exists - exit without throwing error', () => {
+ const result = isResourceNameUnique('api', 'testBlog', false);
+ expect(result).toBe(false);
+});
+
test('conflict does not exist if names differ by characters', () => {
const result = isResourceNameUnique('api', 'newname');
expect(result).toBe(true);
});
+
+test('conflict does not exist if category not found', () => {
+ const result = isResourceNameUnique('nosuchcategory', 'newname');
+ expect(result).toBe(true);
+});
diff --git a/packages/amplify-cli-core/src/__tests__/utils/recursiveOmit.test.ts b/packages/amplify-cli-core/src/__tests__/utils/recursiveOmit.test.ts
new file mode 100644
index 00000000000..93e8dee21a3
--- /dev/null
+++ b/packages/amplify-cli-core/src/__tests__/utils/recursiveOmit.test.ts
@@ -0,0 +1,104 @@
+import { recursiveOmit } from '../../utils';
+import { $TSObject } from '../..';
+
+describe('recursiveOmit', () => {
+ let testObject: $TSObject;
+
+ beforeEach(() => {
+ testObject = {
+ prop1: {
+ prop2: {
+ prop3: 'val3',
+ prop4: 'val4',
+ },
+ prop5: {
+ prop6: 'val6',
+ },
+ },
+ };
+ });
+
+ test('empty path does not mutate object', () => {
+ const result = {
+ prop1: {
+ prop2: {
+ prop3: 'val3',
+ prop4: 'val4',
+ },
+ prop5: {
+ prop6: 'val6',
+ },
+ },
+ };
+
+ recursiveOmit(testObject, []);
+ expect(testObject).toEqual(result);
+ });
+
+ test('wrong path does not mutate object', () => {
+ const result = {
+ prop1: {
+ prop2: {
+ prop3: 'val3',
+ prop4: 'val4',
+ },
+ prop5: {
+ prop6: 'val6',
+ },
+ },
+ };
+
+ recursiveOmit(testObject, ['prop1', 'prop7']);
+ expect(testObject).toEqual(result);
+ });
+
+ test('deleting a key with subkeys removes them all', () => {
+ const result = {};
+
+ recursiveOmit(testObject, ['prop1']);
+ expect(testObject).toEqual(result);
+ });
+
+ test('deleting a key with subkeys does not mutate sibling keys and subkeys', () => {
+ const result = {
+ prop1: {
+ prop5: {
+ prop6: 'val6',
+ },
+ },
+ };
+
+ recursiveOmit(testObject, ['prop1', 'prop2']);
+ expect(testObject).toEqual(result);
+ });
+
+ test('deleting a key in a specific path does not affect sibling keys if there are any', () => {
+ const result = {
+ prop1: {
+ prop2: {
+ prop4: 'val4',
+ },
+ prop5: {
+ prop6: 'val6',
+ },
+ },
+ };
+
+ recursiveOmit(testObject, ['prop1', 'prop2', 'prop3']);
+ expect(testObject).toEqual(result);
+ });
+
+ test('deleting a key in a specific path results in deleting keys that no longer have child keys', () => {
+ const result = {
+ prop1: {
+ prop2: {
+ prop3: 'val3',
+ prop4: 'val4',
+ },
+ },
+ };
+
+ recursiveOmit(testObject, ['prop1', 'prop5', 'prop6']);
+ expect(testObject).toEqual(result);
+ });
+});
diff --git a/packages/amplify-cli-core/src/banner-message/index.ts b/packages/amplify-cli-core/src/banner-message/index.ts
index 42a24c40776..b2dc8776725 100644
--- a/packages/amplify-cli-core/src/banner-message/index.ts
+++ b/packages/amplify-cli-core/src/banner-message/index.ts
@@ -1,6 +1,6 @@
import fetch from 'node-fetch';
import semver from 'semver';
-import ProxyAgent from 'proxy-agent';
+import { ProxyAgent } from 'proxy-agent';
import { getLogger } from '../logger';
export type Message = {
@@ -43,7 +43,8 @@ export class BannerMessage {
try {
logger.info(`fetch banner messages from ${url}`);
const proxy = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
- const fetchOptions = proxy ? { agent: new ProxyAgent(proxy) } : {};
+ // HTTP_PROXY & HTTPS_PROXY env vars are read automatically by ProxyAgent, but we check to see if they are set before using the proxy
+ const fetchOptions = proxy ? { agent: new ProxyAgent() } : {};
const result = await fetch(url, fetchOptions);
const body = await result.json();
if (!semver.satisfies(body.version, MAX_SUPPORTED_MESSAGE_CONFIG_VERSION)) {
diff --git a/packages/amplify-cli-core/src/errors/amplify-exception.ts b/packages/amplify-cli-core/src/errors/amplify-exception.ts
index 1685f388b3c..52034d32578 100644
--- a/packages/amplify-cli-core/src/errors/amplify-exception.ts
+++ b/packages/amplify-cli-core/src/errors/amplify-exception.ts
@@ -169,6 +169,7 @@ export type AmplifyErrorType =
| 'ResourceRemoveError'
| 'SchemaNotFoundError'
| 'SchemaValidationError'
+ | 'ScriptingFeaturesDisabledError'
| 'SearchableMockProcessError'
| 'SearchableMockUnavailablePortError'
| 'SearchableMockUnsupportedPlatformError'
diff --git a/packages/amplify-cli-core/src/extractZip.js b/packages/amplify-cli-core/src/extractZip.js
new file mode 100644
index 00000000000..13907dbb103
--- /dev/null
+++ b/packages/amplify-cli-core/src/extractZip.js
@@ -0,0 +1,169 @@
+/* eslint-disable no-bitwise */
+/* eslint-disable spellcheck/spell-checker */
+/**
+ * This file is copied from https://github.com/max-mapper/extract-zip
+ * and turned off creating symlinks on the machine where archive is extracted
+ */
+const { createWriteStream, promises: fs } = require('fs');
+const path = require('path');
+const { promisify } = require('util');
+const stream = require('stream');
+const yauzl = require('yauzl');
+const { getAmplifyLogger } = require('@aws-amplify/amplify-cli-logger');
+
+const openZip = promisify(yauzl.open);
+const pipeline = promisify(stream.pipeline);
+
+class Extractor {
+ constructor(zipPath, opts) {
+ this.zipPath = zipPath;
+ this.opts = opts;
+ }
+
+ async extract() {
+ this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
+ this.canceled = false;
+
+ return new Promise((resolve, reject) => {
+ this.zipfile.on('error', (err) => {
+ this.canceled = true;
+ reject(err);
+ });
+ this.zipfile.readEntry();
+
+ this.zipfile.on('close', () => {
+ if (!this.canceled) {
+ resolve();
+ }
+ });
+
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
+ this.zipfile.on('entry', async (entry) => {
+ if (this.canceled) {
+ return;
+ }
+
+ if (entry.fileName.startsWith('__MACOSX/')) {
+ this.zipfile.readEntry();
+ return;
+ }
+
+ if (this.opts.skipEntryPrefixes && Array.isArray(this.opts.skipEntryPrefixes) && this.opts.skipEntryPrefixes.length > 0) {
+ for (const skipEntriesPrefix of this.opts.skipEntryPrefixes) {
+ if (entry.fileName.startsWith(skipEntriesPrefix)) {
+ this.zipfile.readEntry();
+ return;
+ }
+ }
+ }
+
+ const destDir = path.dirname(path.join(this.opts.dir, entry.fileName));
+
+ try {
+ await fs.mkdir(destDir, { recursive: true });
+
+ const canonicalDestDir = await fs.realpath(destDir);
+ const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir);
+
+ if (relativeDestDir.split(path.sep).includes('..')) {
+ throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
+ }
+
+ await this.extractEntry(entry);
+ this.zipfile.readEntry();
+ } catch (err) {
+ this.canceled = true;
+ this.zipfile.close();
+ reject(err);
+ }
+ });
+ });
+ }
+
+ async extractEntry(entry) {
+ /* istanbul ignore if */
+ if (this.canceled) {
+ return;
+ }
+
+ if (this.opts.onEntry) {
+ this.opts.onEntry(entry, this.zipfile);
+ }
+
+ const dest = path.join(this.opts.dir, entry.fileName);
+
+ // convert external file attr int into a fs stat mode int
+ const mode = (entry.externalFileAttributes >> 16) & 0xffff;
+ // check if it's a symlink or dir (using stat mode constants)
+ const IFMT = 61440;
+ const IFDIR = 16384;
+ const IFLNK = 40960;
+ const symlink = (mode & IFMT) === IFLNK;
+ let isDir = (mode & IFMT) === IFDIR;
+
+ // Failsafe, borrowed from jsZip
+ if (!isDir && entry.fileName.endsWith('/')) {
+ isDir = true;
+ }
+
+ // check for windows weird way of specifying a directory
+ // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566
+ const madeBy = entry.versionMadeBy >> 8;
+ if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
+
+ const procMode = this.getExtractedMode(mode, isDir) & 0o777;
+
+ // always ensure folders are created
+ const destDir = isDir ? dest : path.dirname(dest);
+
+ const mkdirOptions = { recursive: true };
+ if (isDir) {
+ mkdirOptions.mode = procMode;
+ }
+ await fs.mkdir(destDir, mkdirOptions);
+ if (isDir) return;
+
+ if (symlink) {
+ getAmplifyLogger().logError({ message: 'Found symlinks in the zipped directory. These symlinks will not be extracted' });
+ return;
+ }
+ const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry);
+ await pipeline(readStream, createWriteStream(dest, { mode: procMode }));
+ }
+
+ getExtractedMode(entryMode, isDir) {
+ let mode = entryMode;
+ // Set defaults, if necessary
+ if (mode === 0) {
+ if (isDir) {
+ if (this.opts.defaultDirMode) {
+ mode = parseInt(this.opts.defaultDirMode, 10);
+ }
+
+ if (!mode) {
+ mode = 0o755;
+ }
+ } else {
+ if (this.opts.defaultFileMode) {
+ mode = parseInt(this.opts.defaultFileMode, 10);
+ }
+
+ if (!mode) {
+ mode = 0o644;
+ }
+ }
+ }
+
+ return mode;
+ }
+}
+
+module.exports = async function (zipPath, opts) {
+ if (!path.isAbsolute(opts.dir)) {
+ throw new Error('Target directory is expected to be absolute');
+ }
+
+ await fs.mkdir(opts.dir, { recursive: true });
+ opts.dir = await fs.realpath(opts.dir);
+ return new Extractor(zipPath, opts).extract();
+};
diff --git a/packages/amplify-cli-core/src/feature-flags/featureFlags.ts b/packages/amplify-cli-core/src/feature-flags/featureFlags.ts
index 54133b0310b..e105906b37e 100644
--- a/packages/amplify-cli-core/src/feature-flags/featureFlags.ts
+++ b/packages/amplify-cli-core/src/feature-flags/featureFlags.ts
@@ -671,6 +671,12 @@ export class FeatureFlags {
defaultValueForExistingProjects: false,
defaultValueForNewProjects: true,
},
+ {
+ name: 'subscriptionsInheritPrimaryAuth',
+ type: 'boolean',
+ defaultValueForExistingProjects: false,
+ defaultValueForNewProjects: false,
+ },
]);
this.registerFlag('frontend-ios', [
diff --git a/packages/amplify-cli-core/src/help/commands-info.ts b/packages/amplify-cli-core/src/help/commands-info.ts
index ec4a68fdfdd..a582300d775 100644
--- a/packages/amplify-cli-core/src/help/commands-info.ts
+++ b/packages/amplify-cli-core/src/help/commands-info.ts
@@ -59,7 +59,16 @@ export const commandsInfo: Array = [
command: 'configure',
commandDescription: 'Configure the CLI to work with your AWS profile',
commandUsage: 'amplify configure [subcommand]',
- commandFlags: [],
+ commandFlags: [
+ { short: '', long: 'usage-data-on', flagDescription: 'Turn on usage data sharing.' },
+ { short: '', long: 'usage-data-off', flagDescription: 'Turn off usage data sharing.' },
+ { short: '', long: 'share-project-config-on', flagDescription: 'Turn on non-sensitive project configurations sharing on failures.' },
+ {
+ short: '',
+ long: 'share-project-config-off',
+ flagDescription: 'Turn off non-sensitive project configurations sharing on failures.',
+ },
+ ],
subCommands: [
{
subCommand: 'project',
@@ -697,7 +706,7 @@ export const commandsInfo: Array = [
{
short: '',
long: 'send-report',
- flagDescription: 'Share non-sensitive configurations of your Amplify backend with the Amplify team',
+ flagDescription: 'Share non-sensitive project configurations of your Amplify backend with the Amplify team',
},
{
short: '',
diff --git a/packages/amplify-cli-core/src/hooks/hooksExecutor.ts b/packages/amplify-cli-core/src/hooks/hooksExecutor.ts
index 758652bf5db..b0c430719c6 100644
--- a/packages/amplify-cli-core/src/hooks/hooksExecutor.ts
+++ b/packages/amplify-cli-core/src/hooks/hooksExecutor.ts
@@ -86,9 +86,17 @@ const execHelper = async (
error: errorParameter,
}),
stripFinalNewline: false,
+ stdout: 'inherit',
+ // added to do further checks before throwing due to EPIPE error
+ reject: false,
});
- childProcess?.stdout?.pipe(process.stdout);
const childProcessResult = await childProcess;
+
+ // throw if child process ended with anything other than exitCode 0
+ if (childProcessResult && childProcess.exitCode !== 0) {
+ throw childProcessResult;
+ }
+
if (!childProcessResult?.stdout?.endsWith(EOL)) {
printer.blankLine();
}
diff --git a/packages/amplify-cli-core/src/hooks/skipHooks.ts b/packages/amplify-cli-core/src/hooks/skipHooks.ts
index 10ae6e74bb6..7676e7074d2 100644
--- a/packages/amplify-cli-core/src/hooks/skipHooks.ts
+++ b/packages/amplify-cli-core/src/hooks/skipHooks.ts
@@ -1,11 +1,8 @@
-import * as fs from 'fs-extra';
-import { skipHooksFilePath } from './hooksConstants';
-
export function skipHooks(): boolean {
// DO NOT CHANGE: used to skip hooks on Admin UI
- try {
- return fs.existsSync(skipHooksFilePath);
- } catch (err) {
+ if (process.env.AMPLIFY_CLI_DISABLE_SCRIPTING_FEATURES) {
+ return true;
+ } else {
return false;
}
}
diff --git a/packages/amplify-cli-core/src/index.ts b/packages/amplify-cli-core/src/index.ts
index 19c1882230e..0fd92bdc425 100644
--- a/packages/amplify-cli-core/src/index.ts
+++ b/packages/amplify-cli-core/src/index.ts
@@ -1,6 +1,7 @@
/* eslint-disable import/no-cycle */
import * as ExeInfo from './exeInfo';
-export { ExeInfo };
+const extract = require('./extractZip');
+export { ExeInfo, extract };
export * from './banner-message';
export * from './category-interfaces';
export * from './cfnUtilities';
diff --git a/packages/amplify-cli-core/src/overrides-manager/index.ts b/packages/amplify-cli-core/src/overrides-manager/index.ts
index a05e7cc0df0..e3b19f3d02c 100644
--- a/packages/amplify-cli-core/src/overrides-manager/index.ts
+++ b/packages/amplify-cli-core/src/overrides-manager/index.ts
@@ -1,2 +1,3 @@
export * from './migration-message';
export * from './override-skeleton-generator';
+export * from './override-runner';
diff --git a/packages/amplify-cli-core/src/overrides-manager/override-runner.ts b/packages/amplify-cli-core/src/overrides-manager/override-runner.ts
new file mode 100644
index 00000000000..edd7bb990b3
--- /dev/null
+++ b/packages/amplify-cli-core/src/overrides-manager/override-runner.ts
@@ -0,0 +1,15 @@
+import { $TSAny } from '../index';
+import * as path from 'path';
+
+export const runOverride = async (overrideDir: string, templateObject: $TSAny, projectInfo: $TSAny): Promise => {
+ const overrideJSFilePath = path.join(overrideDir, 'build', 'override.js');
+ // before importing the override file, we should clear the require cache to avoid
+ // importing an outdated version of the override file
+ // see: https://github.com/nodejs/modules/issues/307
+ // and https://stackoverflow.com/questions/9210542/node-js-require-cache-possible-to-invalidate
+ delete require.cache[require.resolve(overrideJSFilePath)];
+ const overrideImport = require(overrideJSFilePath);
+ if (overrideImport && overrideImport?.override && typeof overrideImport?.override === 'function') {
+ await overrideImport.override(templateObject, projectInfo);
+ }
+};
diff --git a/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts b/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts
index d51ebf15a9a..2ef3baa4f0d 100644
--- a/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts
+++ b/packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts
@@ -2,8 +2,9 @@ import { printer, prompter } from '@aws-amplify/amplify-prompts';
import execa from 'execa';
import * as fs from 'fs-extra';
import * as path from 'path';
-import { $TSContext, AmplifyError, getPackageManager, pathManager } from '../index';
+import { $TSContext, AmplifyError, getPackageManager, pathManager, skipHooks, stateManager } from '../index';
import { JSONUtilities } from '../jsonUtilities';
+import { merge } from 'lodash';
/**
* This method generates the default/template overrides file
@@ -47,6 +48,11 @@ export const buildOverrideDir = async (cwd: string, destDirPath: string): Promis
// return when no override file found
return false;
}
+ if (skipHooks()) {
+ throw new AmplifyError('ScriptingFeaturesDisabledError', {
+ message: 'A flag to disable overrides has been detected, please deploy from a different environment.',
+ });
+ }
const overrideBackendPackageJson = path.join(pathManager.getBackendDirPath(), 'package.json');
if (!fs.existsSync(overrideBackendPackageJson)) {
const overrideSamplePackageJsonPath = path.join(__dirname, '..', '..', 'resources', 'overrides-resource', 'package.json');
@@ -58,6 +64,10 @@ export const buildOverrideDir = async (cwd: string, destDirPath: string): Promis
const overrideSampleTsconfigJsonPath = path.join(__dirname, '..', '..', 'resources', 'overrides-resource', 'tsconfig.json');
fs.writeFileSync(overrideBackendTsConfigJson, fs.readFileSync(overrideSampleTsconfigJsonPath));
}
+
+ // ensure awscloudformation folder is not excluded in vscode
+ setSettingsJsonAwscloudformationFlagFalse();
+
const packageManager = await getPackageManager(cwd);
if (packageManager === null) {
@@ -149,3 +159,27 @@ export const generateTsConfigforProject = (srcResourceDirPath: string, destDirPa
fs.writeFileSync(overrideFileName, fs.readFileSync(path.join(srcResourceDirPath, 'override.ts.sample')));
fs.writeFileSync(resourceTsConfigFileName, fs.readFileSync(path.join(srcResourceDirPath, 'tsconfig.resource.json')));
};
+
+/**
+ * this method sets the flag to false in vscode settings.json to show awscloudformation folder in vscode
+ */
+const setSettingsJsonAwscloudformationFlagFalse = (): void => {
+ if (stateManager.getLocalEnvInfo().defaultEditor !== 'vscode') {
+ return;
+ }
+
+ const workspaceSettingsPath = '.vscode/settings.json';
+ const exclusionRules = {
+ 'files.exclude': {
+ 'amplify/backend/awscloudformation': false,
+ },
+ };
+
+ try {
+ // if settings file exists, safely add exclude settings to it
+ const settings = JSONUtilities.readJson(workspaceSettingsPath);
+ JSONUtilities.writeJson(workspaceSettingsPath, merge(settings, exclusionRules));
+ } catch (error) {
+ // workspace settings file does not exist, noop
+ }
+};
diff --git a/packages/amplify-cli-core/src/plugin-facade/api-category-facade.ts b/packages/amplify-cli-core/src/plugin-facade/api-category-facade.ts
index 3496a363e87..8270ff8da23 100644
--- a/packages/amplify-cli-core/src/plugin-facade/api-category-facade.ts
+++ b/packages/amplify-cli-core/src/plugin-facade/api-category-facade.ts
@@ -1,5 +1,3 @@
-import { DeploymentResources } from '@aws-amplify/graphql-transformer-interfaces';
-// eslint-disable-next-line import/no-cycle
import { $TSAny, $TSContext } from '..';
const API_CATEGORY_NAME = 'api';
@@ -26,7 +24,7 @@ export class ApiCategoryFacade {
* Perform the actual transformation for a given project. This is predominantlyu a side-effecting call, but we
* also return the deployment resources as well.
*/
- static async transformGraphQLSchema(context: $TSContext, options: $TSAny): Promise {
+ static async transformGraphQLSchema(context: $TSContext, options: $TSAny): Promise<$TSAny | undefined> {
return context.amplify.invokePluginMethod(context, API_CATEGORY_NAME, undefined, 'transformGraphQLSchema', [context, options]);
}
}
diff --git a/packages/amplify-cli-core/src/state-manager/pathManager.ts b/packages/amplify-cli-core/src/state-manager/pathManager.ts
index 04d0d8277c6..d0777807a24 100644
--- a/packages/amplify-cli-core/src/state-manager/pathManager.ts
+++ b/packages/amplify-cli-core/src/state-manager/pathManager.ts
@@ -248,6 +248,16 @@ export class PathManager {
PathConstants.BuildDirName,
]);
+ getStackBuildCategoryResourceDirPath = (projectPath: string, category: string, resourceName: string): string =>
+ this.constructPath(projectPath, [
+ PathConstants.AmplifyDirName,
+ PathConstants.BackendDirName,
+ PathConstants.ProviderName,
+ PathConstants.BuildDirName,
+ category,
+ resourceName,
+ ]);
+
getCurrentCloudRootStackDirPath = (projectPath: string): string =>
this.constructPath(projectPath, [
PathConstants.AmplifyDirName,
diff --git a/packages/amplify-cli-core/src/utils/arn-parser.ts b/packages/amplify-cli-core/src/utils/arn-parser.ts
new file mode 100644
index 00000000000..3328538fe4f
--- /dev/null
+++ b/packages/amplify-cli-core/src/utils/arn-parser.ts
@@ -0,0 +1,5 @@
+import { ARN, parse } from '@aws-sdk/util-arn-parser';
+
+export const parseArn = (arn: string): ARN => {
+ return parse(arn);
+};
diff --git a/packages/amplify-cli-core/src/utils/doc-links.ts b/packages/amplify-cli-core/src/utils/doc-links.ts
index e2b7168d881..e5d41f6ab58 100644
--- a/packages/amplify-cli-core/src/utils/doc-links.ts
+++ b/packages/amplify-cli-core/src/utils/doc-links.ts
@@ -9,6 +9,7 @@ export function getGraphQLTransformerFunctionDocLink(version: number): string {
}
}
+// Currently not used in this project, but there are dependencies in other projects https://github.com/search?q=org%3Aaws-amplify+getGraphQLTransformerAuthDocLink&type=code
export function getGraphQLTransformerAuthDocLink(version: number): string {
switch (version) {
case 1:
@@ -20,6 +21,7 @@ export function getGraphQLTransformerAuthDocLink(version: number): string {
}
}
+// Currently not used in this project, but there are dependencies in other projects https://github.com/search?q=org%3Aaws-amplify+getGraphQLTransformerAuthSubscriptionsDocLink&type=code
export function getGraphQLTransformerAuthSubscriptionsDocLink(version: number): string {
switch (version) {
case 1:
@@ -42,6 +44,7 @@ export function getGraphQLTransformerOpenSearchDocLink(version: number): string
}
}
+// Currently not used in this project, but there are dependencies in other projects https://github.com/search?q=org%3Aaws-amplify+getGraphQLTransformerOpenSearchProductionDocLink&type=code
export function getGraphQLTransformerOpenSearchProductionDocLink(version: number): string {
switch (version) {
case 1:
diff --git a/packages/amplify-cli-core/src/utils/index.ts b/packages/amplify-cli-core/src/utils/index.ts
index ab7dfaffbb2..83e0c37c5b6 100644
--- a/packages/amplify-cli-core/src/utils/index.ts
+++ b/packages/amplify-cli-core/src/utils/index.ts
@@ -1,3 +1,4 @@
+export * from './arn-parser';
export * from './doc-links';
export * from './fileSize';
/* eslint-disable import/no-cycle */
diff --git a/packages/amplify-cli-core/src/utils/isResourceNameUnique.ts b/packages/amplify-cli-core/src/utils/isResourceNameUnique.ts
index 0dd72ba25b5..b496886ed03 100644
--- a/packages/amplify-cli-core/src/utils/isResourceNameUnique.ts
+++ b/packages/amplify-cli-core/src/utils/isResourceNameUnique.ts
@@ -1,5 +1,6 @@
import { stateManager } from '../state-manager';
+// Currently not used in this project, but there are dependencies in other projects https://github.com/search?q=org%3Aaws-amplify+isResourceNameUnique&type=code
export const isResourceNameUnique = (category: string, resourceName: string, throwOnMatch = true) => {
const meta = stateManager.getMeta();
const resourceNames = Object.keys(meta?.[category] || {});
diff --git a/packages/amplify-cli-core/src/utils/packageManager.ts b/packages/amplify-cli-core/src/utils/packageManager.ts
index 8be588cfc25..d97a962dfd3 100644
--- a/packages/amplify-cli-core/src/utils/packageManager.ts
+++ b/packages/amplify-cli-core/src/utils/packageManager.ts
@@ -1,39 +1,109 @@
import * as fs from 'fs-extra';
import * as path from 'path';
-import * as which from 'which';
+import which from 'which';
import { coerce, SemVer } from 'semver';
import { execWithOutputAsString } from './shell-utils';
+import { AmplifyError } from '../errors/amplify-error';
+import { BuildType } from '@aws-amplify/amplify-function-plugin-interface';
/**
* package managers type
*/
-export type PackageManagerType = 'yarn' | 'npm';
-
+export type PackageManagerType = 'yarn' | 'npm' | 'pnpm' | 'custom';
const packageJson = 'package.json';
/**
* package Manager type
*/
-export type PackageManager = {
- packageManager: PackageManagerType;
- lockFile: string;
- executable: string;
+export interface PackageManager {
+ readonly packageManager: PackageManagerType;
+ readonly lockFile: string;
+ readonly executable: string;
+ readonly displayValue: string;
+ version?: SemVer;
+ getRunScriptArgs: (scriptName: string) => string[];
+ getInstallArgs: (buildType: BuildType, resourceDir?: string) => string[];
+}
+
+class NpmPackageManager implements PackageManager {
+ readonly packageManager = 'npm';
+ readonly displayValue = 'NPM';
+ readonly executable = 'npm';
+ readonly lockFile = 'package-lock.json';
+
+ getRunScriptArgs = (scriptName: string) => ['run-script', scriptName];
+ getInstallArgs = (buildType = BuildType.PROD) => ['install', '--no-bin-links'].concat(buildType === 'PROD' ? ['--production'] : []);
+}
+
+class YarnPackageManager implements PackageManager {
+ readonly packageManager: PackageManagerType = 'yarn';
+ readonly displayValue = 'Yarn';
+ readonly executable = 'yarn';
+ readonly lockFile = 'yarn.lock';
+ version?: SemVer;
+
+ getRunScriptArgs = (scriptName: string) => [scriptName];
+ getInstallArgs = (buildType = BuildType.PROD, resourceDir = '') => {
+ const useYarnModern = this.version?.major && this.version?.major > 1;
+ /**
+ * Since Yarn 2, resourceDir needs to be treated as a separate project,
+ * otherwise it'll be hoisted to use the lock.file from the parent directory,
+ * so we need to create a lock file for it.
+ * ref: https://github.com/yarnpkg/yarn/issues/5716#issuecomment-817330338
+ */
+ if (useYarnModern) {
+ if (fs.existsSync(`${resourceDir}/${this.lockFile}`)) {
+ console.log(`${resourceDir}/${this.lockFile} already exists.`);
+ } else {
+ fs.writeFileSync(`${resourceDir}/${this.lockFile}`, '');
+ }
+ }
+ return (useYarnModern ? ['workspaces', 'focus'] : ['--no-bin-links']).concat(buildType === 'PROD' ? ['--production'] : []);
+ };
+}
+
+class PnpmPackageManager implements PackageManager {
+ readonly packageManager: PackageManagerType = 'pnpm';
+ readonly displayValue = 'PNPM';
+ readonly executable = 'pnpm';
+ readonly lockFile = 'pnpm-lock.yaml';
+
+ getRunScriptArgs = (scriptName: string) => [scriptName];
+ getInstallArgs = () => ['install'];
+}
+
+class CustomPackageManager implements PackageManager {
+ readonly packageManager: PackageManagerType = 'custom';
+ readonly displayValue = 'Custom Build Command or Script Path';
+ lockFile;
+ executable;
version?: SemVer;
+
+ constructor() {
+ this.lockFile = '';
+ this.executable = '';
+ }
+ getRunScriptArgs = () => {
+ throw new AmplifyError('PackagingLambdaFunctionError', {
+ message: `Packaging lambda function failed. Unsupported package manager`,
+ });
+ };
+ getInstallArgs = () => {
+ throw new AmplifyError('PackagingLambdaFunctionError', {
+ message: `Packaging lambda function failed. Unsupported package manager`,
+ });
+ };
+}
+
+export const packageManagers: Record = {
+ npm: new NpmPackageManager(),
+ yarn: new YarnPackageManager(),
+ pnpm: new PnpmPackageManager(),
+ custom: new CustomPackageManager(),
};
-const isWindows = process.platform === 'win32';
-
-const packageManagers: Record = {
- npm: {
- packageManager: 'npm',
- lockFile: 'package-lock.json',
- executable: isWindows ? 'npm.cmd' : 'npm',
- },
- yarn: {
- packageManager: 'yarn',
- lockFile: 'yarn.lock',
- executable: isWindows ? 'yarn.cmd' : 'yarn',
- },
+export const getPackageManagerByType = (packageManagerType: PackageManagerType): PackageManager => {
+ return packageManagers[packageManagerType];
};
/**
@@ -44,9 +114,7 @@ const packageManagers: Record = {
* 4. Check if package-lock.json is present
* 5. Check if yarn present on the system
* 6. Fallback to npm
-
@returns {PackageManager | null} instance for the package manager that was detected or null if not found.
-
*/
export const getPackageManager = async (rootPath?: string): Promise => {
const effectiveRootPath = rootPath ?? process.cwd();
@@ -58,10 +126,16 @@ export const getPackageManager = async (rootPath?: string): Promise => {
- return {
- ...packageManagers.yarn,
- version: coerce(await execWithOutputAsString(`${packageManagers.yarn.executable} --version`, { cwd: rootPath })) ?? undefined,
- };
+ packageManagers.yarn.version =
+ coerce(await execWithOutputAsString(`${packageManagers.yarn.executable} --version`, { cwd: rootPath })) ?? undefined;
+ return packageManagers.yarn;
};
diff --git a/packages/amplify-cli-core/tsconfig.json b/packages/amplify-cli-core/tsconfig.json
index 43fb5103aee..a8a2f58a00c 100644
--- a/packages/amplify-cli-core/tsconfig.json
+++ b/packages/amplify-cli-core/tsconfig.json
@@ -3,6 +3,7 @@
"compilerOptions": {
"outDir": "./lib",
"rootDir": "./src",
+ "allowJs": true,
"useUnknownInCatchVariables": false
}
}
diff --git a/packages/amplify-cli-extensibility-helper/CHANGELOG.md b/packages/amplify-cli-extensibility-helper/CHANGELOG.md
index d613bf9965f..668010dec31 100644
--- a/packages/amplify-cli-extensibility-helper/CHANGELOG.md
+++ b/packages/amplify-cli-extensibility-helper/CHANGELOG.md
@@ -3,6 +3,225 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [3.0.35](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.34...@aws-amplify/cli-extensibility-helper@3.0.35) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.34](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.33...@aws-amplify/cli-extensibility-helper@3.0.34) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.33](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.32...@aws-amplify/cli-extensibility-helper@3.0.33) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.32](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.31...@aws-amplify/cli-extensibility-helper@3.0.32) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.31](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.30...@aws-amplify/cli-extensibility-helper@3.0.31) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.30](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.29...@aws-amplify/cli-extensibility-helper@3.0.30) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.29](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.28...@aws-amplify/cli-extensibility-helper@3.0.29) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.28](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.27...@aws-amplify/cli-extensibility-helper@3.0.28) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.26...@aws-amplify/cli-extensibility-helper@3.0.27) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.25...@aws-amplify/cli-extensibility-helper@3.0.26) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.24...@aws-amplify/cli-extensibility-helper@3.0.25) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.23...@aws-amplify/cli-extensibility-helper@3.0.24) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.21...@aws-amplify/cli-extensibility-helper@3.0.23) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [3.0.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.21...@aws-amplify/cli-extensibility-helper@3.0.22) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.20...@aws-amplify/cli-extensibility-helper@3.0.21) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.19...@aws-amplify/cli-extensibility-helper@3.0.20) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.18...@aws-amplify/cli-extensibility-helper@3.0.19) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.17...@aws-amplify/cli-extensibility-helper@3.0.18) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.16...@aws-amplify/cli-extensibility-helper@3.0.17) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.15...@aws-amplify/cli-extensibility-helper@3.0.16) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.14...@aws-amplify/cli-extensibility-helper@3.0.15) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.13...@aws-amplify/cli-extensibility-helper@3.0.14) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.12...@aws-amplify/cli-extensibility-helper@3.0.13) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.11...@aws-amplify/cli-extensibility-helper@3.0.12) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.10...@aws-amplify/cli-extensibility-helper@3.0.11) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.9...@aws-amplify/cli-extensibility-helper@3.0.10) (2023-07-20)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
+## [3.0.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.8...@aws-amplify/cli-extensibility-helper@3.0.9) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/cli-extensibility-helper
+
+
+
+
+
## [3.0.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-extensibility-helper@3.0.6...@aws-amplify/cli-extensibility-helper@3.0.8) (2023-05-25)
diff --git a/packages/amplify-cli-extensibility-helper/package.json b/packages/amplify-cli-extensibility-helper/package.json
index 415dd87425c..5876c164955 100644
--- a/packages/amplify-cli-extensibility-helper/package.json
+++ b/packages/amplify-cli-extensibility-helper/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/cli-extensibility-helper",
- "version": "3.0.8",
+ "version": "3.0.35",
"description": "Amplify CLI Extensibility Helper utility package",
"repository": {
"type": "git",
@@ -28,9 +28,9 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-category-custom": "3.0.8",
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "aws-cdk-lib": "~2.68.0"
+ "@aws-amplify/amplify-category-custom": "3.1.25",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "aws-cdk-lib": "~2.177.0"
},
"jest": {
"transform": {
diff --git a/packages/amplify-cli-logger/.npmignore b/packages/amplify-cli-logger/.npmignore
new file mode 100644
index 00000000000..2c166892c41
--- /dev/null
+++ b/packages/amplify-cli-logger/.npmignore
@@ -0,0 +1,4 @@
+**/__tests__/**
+src
+tsconfig.json
+tsconfig.tsbuildinfo
diff --git a/packages/amplify-cli-logger/CHANGELOG.md b/packages/amplify-cli-logger/CHANGELOG.md
index dda8c9f5a03..bc3db942f6f 100644
--- a/packages/amplify-cli-logger/CHANGELOG.md
+++ b/packages/amplify-cli-logger/CHANGELOG.md
@@ -3,6 +3,60 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.6...@aws-amplify/amplify-cli-logger@1.3.8) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [1.3.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.6...@aws-amplify/amplify-cli-logger@1.3.7) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-logger
+
+
+
+
+
+## [1.3.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.5...@aws-amplify/amplify-cli-logger@1.3.6) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-logger
+
+
+
+
+
+## [1.3.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.4...@aws-amplify/amplify-cli-logger@1.3.5) (2023-08-31)
+
+
+### Bug Fixes
+
+* exclude tests from publish ([#13153](https://github.com/aws-amplify/amplify-cli/issues/13153)) ([1b1fe09](https://github.com/aws-amplify/amplify-cli/commit/1b1fe09a1c08be0262a1013f71354abd7160722a))
+
+
+
+
+
+## [1.3.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.3...@aws-amplify/amplify-cli-logger@1.3.4) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-logger
+
+
+
+
+
+## [1.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.2...@aws-amplify/amplify-cli-logger@1.3.3) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-logger
+
+
+
+
+
## [1.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-logger@1.3.0...@aws-amplify/amplify-cli-logger@1.3.2) (2023-04-14)
**Note:** Version bump only for package @aws-amplify/amplify-cli-logger
diff --git a/packages/amplify-cli-logger/package.json b/packages/amplify-cli-logger/package.json
index 2441fdfcbfd..3439a5129e6 100644
--- a/packages/amplify-cli-logger/package.json
+++ b/packages/amplify-cli-logger/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-cli-logger",
- "version": "1.3.2",
+ "version": "1.3.8",
"description": "Amplify CLI Logger",
"main": "lib/index.js",
"types": "lib/index.d.ts",
diff --git a/packages/amplify-cli-logger/src/__tests__/TestBasePath.test.ts b/packages/amplify-cli-logger/src/__tests__/TestBasePath.test.ts
deleted file mode 100644
index 7b5111b143a..00000000000
--- a/packages/amplify-cli-logger/src/__tests__/TestBasePath.test.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import os from 'os';
-import path from 'path';
-import { constants } from '../constants';
-
-describe('test base path creation', () => {
- const homedirectory = 'home';
- const localPath = 'myProj';
-
- const homedir = jest.spyOn(os, 'homedir').mockReturnValue(homedirectory);
- const join = jest.spyOn(path, 'join');
-
- afterAll(() => {
- jest.clearAllMocks();
- });
-
- it('case: getLocalAuditLogFile', () => {
- require('../baseLogFilePath').getLocalLogFileDirectory(localPath);
- expect(join).toBeCalledWith(localPath, constants.LOG_DIRECTORY);
- });
-
- it('case: getLogAuditFilePath', () => {
- process.argv = ['node', 'dev'];
- require('../baseLogFilePath').getLogDirectory();
- expect(homedir).toBeCalled();
- expect(join).toBeCalledWith(homedirectory, constants.DOT_AMPLIFY, constants.LOG_DIRECTORY + '-dev');
- });
-
- it('case: getLogFilePath', () => {
- process.argv = ['node', ''];
- require('../baseLogFilePath').getLogDirectory();
- expect(homedir).toBeCalled();
- expect(join).toBeCalledWith(homedirectory, constants.DOT_AMPLIFY, constants.LOG_DIRECTORY);
- });
-});
diff --git a/packages/amplify-cli-logger/src/__tests__/TestFilePath.test.ts b/packages/amplify-cli-logger/src/__tests__/TestFilePath.test.ts
deleted file mode 100644
index 25913e4ee1b..00000000000
--- a/packages/amplify-cli-logger/src/__tests__/TestFilePath.test.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import os from 'os';
-import path from 'path';
-import { constants } from '../constants';
-
-describe('test path creation', () => {
- const localPath = 'myProj';
- const join = jest.spyOn(path, 'join');
- const localLogDirectory = 'localLogDirectory';
- const logDirectory = 'logDirectory';
- jest.mock('../baseLogFilePath', () => ({
- getLocalLogFileDirectory: jest.fn().mockReturnValue(localLogDirectory),
- getLogDirectory: jest.fn().mockReturnValue(logDirectory),
- }));
- afterAll(() => {
- jest.clearAllMocks();
- });
- it('case: getLocalAuditLogFile', () => {
- require('../getLogFilePath').getLocalAuditLogFile(localPath);
- expect(join).toBeCalledWith(localLogDirectory, constants.LOG_AUDIT_FOLDER, constants.LOG_AUDIT_FILENAME);
- });
- it('case: getLocalLogFilePath', () => {
- require('../getLogFilePath').getLocalLogFilePath(localPath);
- expect(join).toBeCalledWith(localLogDirectory, constants.LOG_FILENAME);
- });
-
- it('case: getLogAuditFilePath', () => {
- require('../getLogFilePath').getLogAuditFilePath();
- expect(join).toBeCalledWith(logDirectory, constants.LOG_AUDIT_FOLDER, constants.LOG_AUDIT_FILENAME);
- });
-
- it('case: getLogFilePath', () => {
- require('../getLogFilePath').getLogFilePath();
- expect(join).toBeCalledWith(logDirectory, constants.LOG_FILENAME);
- });
-});
diff --git a/packages/amplify-cli-logger/src/__tests__/getLogFilePath.test.ts b/packages/amplify-cli-logger/src/__tests__/getLogFilePath.test.ts
new file mode 100644
index 00000000000..c25c61e2861
--- /dev/null
+++ b/packages/amplify-cli-logger/src/__tests__/getLogFilePath.test.ts
@@ -0,0 +1,57 @@
+import path from 'path';
+import os from 'os';
+import { constants as c } from '../constants';
+import { getLogFilePath, getLocalLogFilePath, getLogAuditFilePath, getLocalAuditLogFile } from '../getLogFilePath';
+
+describe('test log file path creation', () => {
+ const slash = path.sep;
+ const projectPath = 'myProj';
+ const homeDir = 'home';
+
+ jest.spyOn(os, 'homedir').mockReturnValue(homeDir);
+
+ afterAll(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('log audit file in a specified directory', () => {
+ const result = getLocalAuditLogFile(projectPath);
+ const expected = projectPath + slash + c.LOG_DIRECTORY + slash + c.LOG_AUDIT_FOLDER + slash + c.LOG_AUDIT_FILENAME;
+ expect(result).toBe(expected);
+ });
+
+ it('log file in a specified directory', () => {
+ const result = getLocalLogFilePath(projectPath);
+ const expected = projectPath + slash + c.LOG_DIRECTORY + slash + c.LOG_FILENAME;
+ expect(result).toBe(expected);
+ });
+
+ it('log audit file in home directory', () => {
+ jest.replaceProperty(process, 'argv', ['node', '']);
+ const result = getLogAuditFilePath();
+ const expected = homeDir + slash + c.DOT_AMPLIFY + slash + c.LOG_DIRECTORY + slash + c.LOG_AUDIT_FOLDER + slash + c.LOG_AUDIT_FILENAME;
+ expect(result).toBe(expected);
+ });
+
+ it('log file in home directory', () => {
+ jest.replaceProperty(process, 'argv', ['node', '']);
+ const result = getLogFilePath();
+ const expected = homeDir + slash + c.DOT_AMPLIFY + slash + c.LOG_DIRECTORY + slash + c.LOG_FILENAME;
+ expect(result).toBe(expected);
+ });
+
+ it('logs-dev folder in home directory for dev build audit file', () => {
+ jest.replaceProperty(process, 'argv', ['node', 'dev']);
+ const result = getLogAuditFilePath();
+ const expected =
+ homeDir + slash + c.DOT_AMPLIFY + slash + c.LOG_DIRECTORY + '-dev' + slash + c.LOG_AUDIT_FOLDER + slash + c.LOG_AUDIT_FILENAME;
+ expect(result).toBe(expected);
+ });
+
+ it('logs-dev folder in home directory for dev build log file', () => {
+ jest.replaceProperty(process, 'argv', ['node', 'dev']);
+ const result = getLogFilePath();
+ const expected = homeDir + slash + c.DOT_AMPLIFY + slash + c.LOG_DIRECTORY + '-dev' + slash + c.LOG_FILENAME;
+ expect(result).toBe(expected);
+ });
+});
diff --git a/packages/amplify-cli-logger/src/baseLogFilePath.ts b/packages/amplify-cli-logger/src/baseLogFilePath.ts
deleted file mode 100644
index bb01314e8ce..00000000000
--- a/packages/amplify-cli-logger/src/baseLogFilePath.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import * as path from 'path';
-import { constants } from './constants';
-import * as os from 'os';
-
-function getFolder() {
- let folder = constants.LOG_DIRECTORY;
-
- if (process.argv.length > 1) {
- const executable = process.argv[1];
-
- if (executable && executable.includes('dev')) {
- folder += '-dev';
- }
- }
- return folder;
-}
-
-export function getLocalLogFileDirectory(projectPath: string): string {
- return path.join(projectPath, constants.LOG_DIRECTORY);
-}
-
-export function getLogDirectory(): string {
- return path.join(os.homedir(), constants.DOT_AMPLIFY, getFolder());
-}
diff --git a/packages/amplify-cli-logger/src/getLogFilePath.ts b/packages/amplify-cli-logger/src/getLogFilePath.ts
index e98533d978c..1b032dfa42a 100644
--- a/packages/amplify-cli-logger/src/getLogFilePath.ts
+++ b/packages/amplify-cli-logger/src/getLogFilePath.ts
@@ -1,6 +1,27 @@
import path from 'path';
+import os from 'os';
import { constants } from './constants';
-import { getLogDirectory, getLocalLogFileDirectory } from './baseLogFilePath';
+
+function getFolder() {
+ let folder = constants.LOG_DIRECTORY;
+
+ if (process.argv.length > 1) {
+ const executable = process.argv[1];
+
+ if (executable && executable.includes('dev')) {
+ folder += '-dev';
+ }
+ }
+ return folder;
+}
+
+function getLocalLogFileDirectory(projectPath: string): string {
+ return path.join(projectPath, constants.LOG_DIRECTORY);
+}
+
+function getLogDirectory(): string {
+ return path.join(os.homedir(), constants.DOT_AMPLIFY, getFolder());
+}
export function getLogFilePath(): string {
return path.join(getLogDirectory(), constants.LOG_FILENAME);
diff --git a/packages/amplify-cli-npm/CHANGELOG.md b/packages/amplify-cli-npm/CHANGELOG.md
index 9e70b503d68..077535a5ff8 100644
--- a/packages/amplify-cli-npm/CHANGELOG.md
+++ b/packages/amplify-cli-npm/CHANGELOG.md
@@ -3,6 +3,372 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [12.14.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.14.1...@aws-amplify/cli@12.14.2) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.14.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.14.0...@aws-amplify/cli@12.14.1) (2025-01-16)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.14.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.13.1...@aws-amplify/cli@12.14.0) (2025-01-02)
+
+
+### Features
+
+* bump version ([7cb8f88](https://github.com/aws-amplify/amplify-cli/commit/7cb8f882b17f4a6f783a300f5e7894097d166407))
+
+
+
+
+
+## [12.13.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.13.0...@aws-amplify/cli@12.13.1) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.13.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.6...@aws-amplify/cli@12.13.0) (2024-10-05)
+
+
+### Features
+
+* add init prompts for Gen2 ([#13849](https://github.com/aws-amplify/amplify-cli/issues/13849)) ([7ab8fae](https://github.com/aws-amplify/amplify-cli/commit/7ab8faef1e2ce0c15db783d236aeee9d312ec135))
+
+
+
+
+
+## [12.12.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.5...@aws-amplify/cli@12.12.6) (2024-08-06)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.12.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.4...@aws-amplify/cli@12.12.5) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.12.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.3...@aws-amplify/cli@12.12.4) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.12.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.2...@aws-amplify/cli@12.12.3) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.12.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.1...@aws-amplify/cli@12.12.2) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.12.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.12.0...@aws-amplify/cli@12.12.1) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.12.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.11.1...@aws-amplify/cli@12.12.0) (2024-05-07)
+
+
+### Features
+
+* bump version ([#13759](https://github.com/aws-amplify/amplify-cli/issues/13759)) ([5f002de](https://github.com/aws-amplify/amplify-cli/commit/5f002defb602bb4604811793032ff4b6d99ff9c2))
+
+
+
+
+
+## [12.11.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.11.0...@aws-amplify/cli@12.11.1) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.11.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.10.3...@aws-amplify/cli@12.11.0) (2024-04-15)
+
+
+### Features
+
+* bump version ([#13697](https://github.com/aws-amplify/amplify-cli/issues/13697)) ([88f6e23](https://github.com/aws-amplify/amplify-cli/commit/88f6e23a20eaba9cc85ec045ec1cf5656e17ab8b))
+
+
+
+
+
+## [12.10.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.10.2...@aws-amplify/cli@12.10.3) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.10.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.10.1...@aws-amplify/cli@12.10.2) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.10.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.10.0...@aws-amplify/cli@12.10.1) (2024-01-10)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.10.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.9.0...@aws-amplify/cli@12.10.0) (2023-12-16)
+
+
+### Features
+
+* bump version 12.9.0 ([#13462](https://github.com/aws-amplify/amplify-cli/issues/13462)) ([02afaa4](https://github.com/aws-amplify/amplify-cli/commit/02afaa492bec6f5e73dd6bad234fc4646ebcc4c3))
+
+
+
+
+
+# [12.9.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.8.2...@aws-amplify/cli@12.9.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [12.8.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.8.0...@aws-amplify/cli@12.8.2) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [12.8.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.8.0...@aws-amplify/cli@12.8.1) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.8.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.7.1...@aws-amplify/cli@12.8.0) (2023-11-08)
+
+
+### Features
+
+* bump version ([6619b9b](https://github.com/aws-amplify/amplify-cli/commit/6619b9b49564b573d1296ab634e4a45ac4a00cb3))
+
+
+
+
+
+## [12.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.7.0...@aws-amplify/cli@12.7.1) (2023-10-21)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.6.0...@aws-amplify/cli@12.7.0) (2023-10-12)
+
+
+### Features
+
+* force version bump ([8edf74d](https://github.com/aws-amplify/amplify-cli/commit/8edf74d625301aa022e02c022d5b149c8fbb67c8))
+
+
+
+
+
+# [12.6.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.5.2...@aws-amplify/cli@12.6.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [12.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.5.1...@aws-amplify/cli@12.5.2) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.5.0...@aws-amplify/cli@12.5.1) (2023-09-27)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.4.0...@aws-amplify/cli@12.5.0) (2023-09-22)
+
+
+### Features
+
+* update main CLI version ([#13250](https://github.com/aws-amplify/amplify-cli/issues/13250)) ([f1f3118](https://github.com/aws-amplify/amplify-cli/commit/f1f3118f69f6f7702d5bb949d50e5cde44982024))
+
+
+
+
+
+# [12.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.3.0...@aws-amplify/cli@12.4.0) (2023-08-31)
+
+
+### Features
+
+* bump version to 12.4.0 ([#13154](https://github.com/aws-amplify/amplify-cli/issues/13154)) ([244e092](https://github.com/aws-amplify/amplify-cli/commit/244e092066968a24c5ec47c150354248490b3010))
+
+
+
+
+
+# [12.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.2.5...@aws-amplify/cli@12.3.0) (2023-08-17)
+
+
+### Features
+
+* bump version ([#13114](https://github.com/aws-amplify/amplify-cli/issues/13114)) ([ad713f7](https://github.com/aws-amplify/amplify-cli/commit/ad713f7f2213ec60268724f1e9dc896f289b3c0b))
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+### Reverts
+
+* Revert "test: remove extra hash (#13071)" (#13084) ([5013f9a](https://github.com/aws-amplify/amplify-cli/commit/5013f9ac745215816c63f41d14104365e99c81cf)), closes [#13071](https://github.com/aws-amplify/amplify-cli/issues/13071) [#13084](https://github.com/aws-amplify/amplify-cli/issues/13084)
+
+
+
+
+
+## [12.2.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.2.4...@aws-amplify/cli@12.2.5) (2023-08-14)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.2.3...@aws-amplify/cli@12.2.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.2.2...@aws-amplify/cli@12.2.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.2.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.2.1...@aws-amplify/cli@12.2.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+## [12.2.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.2.0...@aws-amplify/cli@12.2.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.2.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.1.1...@aws-amplify/cli@12.2.0) (2023-07-20)
+
+
+### Bug Fixes
+
+* add check for codebuild when updating url ([#12924](https://github.com/aws-amplify/amplify-cli/issues/12924)) ([d399855](https://github.com/aws-amplify/amplify-cli/commit/d399855bf8004c9ce88a6ba7c00dd42476ac748b))
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [12.1.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.1.0...@aws-amplify/cli@12.1.1) (2023-06-16)
+
+**Note:** Version bump only for package @aws-amplify/cli
+
+
+
+
+
+# [12.1.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.0.3...@aws-amplify/cli@12.1.0) (2023-06-13)
+
+
+### Bug Fixes
+
+* don't buffer when extracting binary ([#12621](https://github.com/aws-amplify/amplify-cli/issues/12621)) ([0ee53e6](https://github.com/aws-amplify/amplify-cli/commit/0ee53e612981d5441fb00690f05d25a941e96dd0))
+
+
+### Features
+
+* bump version ([#12752](https://github.com/aws-amplify/amplify-cli/issues/12752)) ([2def814](https://github.com/aws-amplify/amplify-cli/commit/2def814808a18440a7be71baccda902f07fedc49))
+
+
+
+
+
## [12.0.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli@12.0.1...@aws-amplify/cli@12.0.3) (2023-05-25)
diff --git a/packages/amplify-cli-npm/binary.ts b/packages/amplify-cli-npm/binary.ts
index 8700cc3b333..282f2f6f65c 100644
--- a/packages/amplify-cli-npm/binary.ts
+++ b/packages/amplify-cli-npm/binary.ts
@@ -1,6 +1,6 @@
import fs from 'fs';
import path from 'path';
-import { spawnSync, execSync } from 'child_process';
+import { spawnSync } from 'child_process';
import util from 'util';
import tar from 'tar-stream';
import { createGunzip } from 'zlib';
@@ -72,26 +72,14 @@ const getCompressedBinaryUrl = (): string => {
const compressedBinaryName = getPlatformCompressedBinaryName();
let url = `${BINARY_LOCATION}/${version}/${compressedBinaryName}`;
- if (process.env.IS_AMPLIFY_CI) {
- url = url.replace('.tgz', `-${getCommitHash()}.tgz`);
+ if (process.env.IS_AMPLIFY_CI && process.env.CODEBUILD_SRC_DIR) {
+ // use cloudfront distribution for e2e
+ url = `https://${process.env.PKG_CLI_CLOUDFRONT_URL}/${version}/${compressedBinaryName}`;
}
return url;
};
-/**
- * CI-only, used for testing hash-based binaries
- *
- * @returns string
- */
-const getCommitHash = (): string => {
- if (process.env.hash) {
- return process.env.hash;
- }
- const hash = execSync('(git rev-parse HEAD | cut -c 1-12) || false').toString();
- return hash.substr(0, 12);
-};
-
/**
* Wraps logic to download and run binary
*/
diff --git a/packages/amplify-cli-npm/index.ts b/packages/amplify-cli-npm/index.ts
index b24c84ba74c..266bc77f889 100644
--- a/packages/amplify-cli-npm/index.ts
+++ b/packages/amplify-cli-npm/index.ts
@@ -16,4 +16,4 @@ export const install = async (): Promise => {
return binary.install();
};
-// force version bump to 12.1.0
+// force version bump to 12.14.0
diff --git a/packages/amplify-cli-npm/package.json b/packages/amplify-cli-npm/package.json
index c935adb8dea..c37a0a97f97 100644
--- a/packages/amplify-cli-npm/package.json
+++ b/packages/amplify-cli-npm/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/cli",
- "version": "12.0.3",
+ "version": "12.14.2",
"description": "Amplify CLI",
"repository": {
"type": "git",
@@ -31,12 +31,12 @@
"node": ">=12.0.0"
},
"dependencies": {
- "axios": "^0.26.0",
+ "axios": "^1.6.7",
"rimraf": "^3.0.2",
"tar-stream": "^2.2.0"
},
"devDependencies": {
- "@aws-amplify/cli-internal": "12.0.3",
+ "@aws-amplify/cli-internal": "12.14.2",
"@types/tar": "^6.1.1",
"rimraf": "^3.0.2"
},
diff --git a/packages/amplify-cli-shared-interfaces/CHANGELOG.md b/packages/amplify-cli-shared-interfaces/CHANGELOG.md
index ee2df52de03..fbb477732de 100644
--- a/packages/amplify-cli-shared-interfaces/CHANGELOG.md
+++ b/packages/amplify-cli-shared-interfaces/CHANGELOG.md
@@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.2.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-shared-interfaces@1.2.3...@aws-amplify/amplify-cli-shared-interfaces@1.2.5) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [1.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-shared-interfaces@1.2.3...@aws-amplify/amplify-cli-shared-interfaces@1.2.4) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-shared-interfaces
+
+
+
+
+
+## [1.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-shared-interfaces@1.2.2...@aws-amplify/amplify-cli-shared-interfaces@1.2.3) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-cli-shared-interfaces
+
+
+
+
+
## [1.2.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-cli-shared-interfaces@1.2.0...@aws-amplify/amplify-cli-shared-interfaces@1.2.2) (2023-04-14)
**Note:** Version bump only for package @aws-amplify/amplify-cli-shared-interfaces
diff --git a/packages/amplify-cli-shared-interfaces/package.json b/packages/amplify-cli-shared-interfaces/package.json
index 1492feca335..a0e2688b7eb 100644
--- a/packages/amplify-cli-shared-interfaces/package.json
+++ b/packages/amplify-cli-shared-interfaces/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-cli-shared-interfaces",
- "version": "1.2.2",
+ "version": "1.2.5",
"description": "API interfaces to be shared across different amplfy-cli packages",
"main": "lib/index.js",
"scripts": {
diff --git a/packages/amplify-cli/CHANGELOG.md b/packages/amplify-cli/CHANGELOG.md
index 3e8bd3824fb..e3d3afa61a3 100644
--- a/packages/amplify-cli/CHANGELOG.md
+++ b/packages/amplify-cli/CHANGELOG.md
@@ -3,6 +3,421 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [12.14.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.14.1...@aws-amplify/cli-internal@12.14.2) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.14.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.14.0...@aws-amplify/cli-internal@12.14.1) (2025-01-16)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.14.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.13.1...@aws-amplify/cli-internal@12.14.0) (2025-01-02)
+
+
+### Features
+
+* bump version ([7cb8f88](https://github.com/aws-amplify/amplify-cli/commit/7cb8f882b17f4a6f783a300f5e7894097d166407))
+
+
+### Reverts
+
+* Revert "chore: cateogry-api + codegen version bump (#14048)" (#14049) ([5a0cdbf](https://github.com/aws-amplify/amplify-cli/commit/5a0cdbfa46856da320323923a4336d6ba60d82b9)), closes [#14048](https://github.com/aws-amplify/amplify-cli/issues/14048) [#14049](https://github.com/aws-amplify/amplify-cli/issues/14049)
+
+
+
+
+
+## [12.13.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.13.0...@aws-amplify/cli-internal@12.13.1) (2024-11-18)
+
+
+### Bug Fixes
+
+* add opt-out for appId mismatch check during init ([#14013](https://github.com/aws-amplify/amplify-cli/issues/14013)) ([87a6b4c](https://github.com/aws-amplify/amplify-cli/commit/87a6b4c66b064e73f520355cd7b563090f87b6cb))
+
+
+
+
+
+# [12.13.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.6...@aws-amplify/cli-internal@12.13.0) (2024-10-05)
+
+
+### Bug Fixes
+
+* avoid copying node_modules folder for increased performance ([24c8f85](https://github.com/aws-amplify/amplify-cli/commit/24c8f853cbadb96659efe7befaf07be0c15b7794))
+* prevent init if local files belong to other app ([#13954](https://github.com/aws-amplify/amplify-cli/issues/13954)) ([d79627c](https://github.com/aws-amplify/amplify-cli/commit/d79627c816e46ebddde16bb1f870f6955a2aec22))
+
+
+### Features
+
+* add init prompts for Gen2 ([#13849](https://github.com/aws-amplify/amplify-cli/issues/13849)) ([7ab8fae](https://github.com/aws-amplify/amplify-cli/commit/7ab8faef1e2ce0c15db783d236aeee9d312ec135))
+
+
+
+
+
+## [12.12.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.5...@aws-amplify/cli-internal@12.12.6) (2024-08-06)
+
+
+### Bug Fixes
+
+* update awaiter s3 key ([#13872](https://github.com/aws-amplify/amplify-cli/issues/13872)) ([dacfab7](https://github.com/aws-amplify/amplify-cli/commit/dacfab73fcc53586b873f99e149d44c390b2d76f))
+
+
+
+
+
+## [12.12.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.4...@aws-amplify/cli-internal@12.12.5) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.12.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.3...@aws-amplify/cli-internal@12.12.4) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.12.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.2...@aws-amplify/cli-internal@12.12.3) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.12.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.1...@aws-amplify/cli-internal@12.12.2) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.12.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.12.0...@aws-amplify/cli-internal@12.12.1) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.12.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.11.1...@aws-amplify/cli-internal@12.12.0) (2024-05-07)
+
+
+### Features
+
+* bump version ([#13759](https://github.com/aws-amplify/amplify-cli/issues/13759)) ([5f002de](https://github.com/aws-amplify/amplify-cli/commit/5f002defb602bb4604811793032ff4b6d99ff9c2))
+
+
+
+
+
+## [12.11.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.11.0...@aws-amplify/cli-internal@12.11.1) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.11.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.10.3...@aws-amplify/cli-internal@12.11.0) (2024-04-15)
+
+
+### Bug Fixes
+
+* upgrade Go runtime and fix e2e ([#13671](https://github.com/aws-amplify/amplify-cli/issues/13671)) ([395f717](https://github.com/aws-amplify/amplify-cli/commit/395f717cf52e7beef76f00ee08d37877138b0c30))
+
+
+### Features
+
+* bump version ([#13697](https://github.com/aws-amplify/amplify-cli/issues/13697)) ([88f6e23](https://github.com/aws-amplify/amplify-cli/commit/88f6e23a20eaba9cc85ec045ec1cf5656e17ab8b))
+
+
+
+
+
+## [12.10.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.10.2...@aws-amplify/cli-internal@12.10.3) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.10.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.10.1...@aws-amplify/cli-internal@12.10.2) (2024-03-06)
+
+
+### Bug Fixes
+
+* dependabot alert for lodash.set ([#13558](https://github.com/aws-amplify/amplify-cli/issues/13558)) ([c7f9bbe](https://github.com/aws-amplify/amplify-cli/commit/c7f9bbeb4943280bdda10304ce4e17622c5ec9c7))
+
+
+
+
+
+## [12.10.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.10.0...@aws-amplify/cli-internal@12.10.1) (2024-01-10)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.10.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.9.0...@aws-amplify/cli-internal@12.10.0) (2023-12-16)
+
+
+### Features
+
+* bump version 12.9.0 ([#13462](https://github.com/aws-amplify/amplify-cli/issues/13462)) ([02afaa4](https://github.com/aws-amplify/amplify-cli/commit/02afaa492bec6f5e73dd6bad234fc4646ebcc4c3))
+
+
+
+
+
+# [12.9.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.8.2...@aws-amplify/cli-internal@12.9.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [12.8.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.8.0...@aws-amplify/cli-internal@12.8.2) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [12.8.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.8.0...@aws-amplify/cli-internal@12.8.1) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.8.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.7.1...@aws-amplify/cli-internal@12.8.0) (2023-11-08)
+
+
+### Features
+
+* bump npm version tot 12.7.0 ([31c8ae2](https://github.com/aws-amplify/amplify-cli/commit/31c8ae2ac0b2f8dcab4c1fe2e2d7e98253ba80ff))
+
+
+
+
+
+## [12.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.7.0...@aws-amplify/cli-internal@12.7.1) (2023-10-21)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.6.0...@aws-amplify/cli-internal@12.7.0) (2023-10-12)
+
+
+### Features
+
+* codegen support for Amplify Android Lazy loading and custom selection set ([8f9d855](https://github.com/aws-amplify/amplify-cli/commit/8f9d855a6eb74a8d0452b2878a65ff5222ac61ee))
+
+
+
+
+
+# [12.6.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.5.2...@aws-amplify/cli-internal@12.6.0) (2023-10-05)
+
+
+### Bug Fixes
+
+* pulling with env append to local files ([#13227](https://github.com/aws-amplify/amplify-cli/issues/13227)) ([ef1c43f](https://github.com/aws-amplify/amplify-cli/commit/ef1c43fd955596366114e883b2db31fda55feaf8))
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [12.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.5.1...@aws-amplify/cli-internal@12.5.2) (2023-10-03)
+
+
+### Bug Fixes
+
+* update api category and codegen to capture high-priority bug-fixes ([3836b90](https://github.com/aws-amplify/amplify-cli/commit/3836b90b3f9ccd654d9c1b61a4b83c9c4712290c))
+
+
+
+
+
+## [12.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.5.0...@aws-amplify/cli-internal@12.5.1) (2023-09-27)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.4.0...@aws-amplify/cli-internal@12.5.0) (2023-09-22)
+
+
+### Bug Fixes
+
+* add better error messaging when initializing an already initialized project ([98257a4](https://github.com/aws-amplify/amplify-cli/commit/98257a49da36d48e08c22dec6a5bc56d06d90a68))
+* remove stale data ([#13128](https://github.com/aws-amplify/amplify-cli/issues/13128)) ([9703223](https://github.com/aws-amplify/amplify-cli/commit/970322372278762fff88f7046b44574b611ad210))
+* update condition again ([b57f9ed](https://github.com/aws-amplify/amplify-cli/commit/b57f9ed097a78880531dc8e8d85aa023e72fbe53))
+* update condition for already initialized error ([842bf00](https://github.com/aws-amplify/amplify-cli/commit/842bf004a12d8fb8fbafb4868b2760b67cd55b7e))
+
+
+### Features
+
+* ensure modelgen does not throw an error when running in an uninitialized directory ([#13221](https://github.com/aws-amplify/amplify-cli/issues/13221)) ([8b5d433](https://github.com/aws-amplify/amplify-cli/commit/8b5d433163af10de1f1464055d62f04676cb3daf))
+* support codegen and modelgen commands in non-amplify directories ([#13245](https://github.com/aws-amplify/amplify-cli/issues/13245)) ([85dd5cb](https://github.com/aws-amplify/amplify-cli/commit/85dd5cb6b33d8df41e35c2cbcf3b3b0e390b1af0))
+* update main CLI version ([#13250](https://github.com/aws-amplify/amplify-cli/issues/13250)) ([f1f3118](https://github.com/aws-amplify/amplify-cli/commit/f1f3118f69f6f7702d5bb949d50e5cde44982024))
+
+
+
+
+
+# [12.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.3.0...@aws-amplify/cli-internal@12.4.0) (2023-08-31)
+
+
+### Features
+
+* bump version to 12.4.0 ([#13154](https://github.com/aws-amplify/amplify-cli/issues/13154)) ([244e092](https://github.com/aws-amplify/amplify-cli/commit/244e092066968a24c5ec47c150354248490b3010))
+
+
+
+
+
+# [12.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.2.5...@aws-amplify/cli-internal@12.3.0) (2023-08-17)
+
+
+### Bug Fixes
+
+* remove error incorrectly swallowed (fixes [#13030](https://github.com/aws-amplify/amplify-cli/issues/13030)) ([#13041](https://github.com/aws-amplify/amplify-cli/issues/13041)) ([2941584](https://github.com/aws-amplify/amplify-cli/commit/294158417ab176db4ece2acf043cc16355e9c737))
+
+
+### Features
+
+* bump version ([#13114](https://github.com/aws-amplify/amplify-cli/issues/13114)) ([ad713f7](https://github.com/aws-amplify/amplify-cli/commit/ad713f7f2213ec60268724f1e9dc896f289b3c0b))
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [12.2.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.2.4...@aws-amplify/cli-internal@12.2.5) (2023-08-14)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.2.3...@aws-amplify/cli-internal@12.2.4) (2023-08-09)
+
+
+### Bug Fixes
+
+* Dependabot alerts for semver, tough-cookie ([#12962](https://github.com/aws-amplify/amplify-cli/issues/12962)) ([175a86b](https://github.com/aws-amplify/amplify-cli/commit/175a86b89a54c65bb6e68c0609be503d61e39d63))
+
+
+
+
+
+## [12.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.2.2...@aws-amplify/cli-internal@12.2.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.2.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.2.1...@aws-amplify/cli-internal@12.2.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+## [12.2.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.2.0...@aws-amplify/cli-internal@12.2.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.2.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.1.1...@aws-amplify/cli-internal@12.2.0) (2023-07-20)
+
+
+### Bug Fixes
+
+* added Prepush after init and before deploy ([#12674](https://github.com/aws-amplify/amplify-cli/issues/12674)) ([a54f837](https://github.com/aws-amplify/amplify-cli/commit/a54f83743b5995317170c9b4f5a140e5a1aa57f3))
+* beta reporter endpoints urls ([#12806](https://github.com/aws-amplify/amplify-cli/issues/12806)) ([88b5f90](https://github.com/aws-amplify/amplify-cli/commit/88b5f907c5f599dbef988de4476a26daf80466d0))
+* usage data should not throw errors ([#12839](https://github.com/aws-amplify/amplify-cli/issues/12839)) ([fbea273](https://github.com/aws-amplify/amplify-cli/commit/fbea273f9b65cd21e8d02ddfe4a803a843c2afe4))
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [12.1.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.1.0...@aws-amplify/cli-internal@12.1.1) (2023-06-16)
+
+**Note:** Version bump only for package @aws-amplify/cli-internal
+
+
+
+
+
+# [12.1.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.0.3...@aws-amplify/cli-internal@12.1.0) (2023-06-13)
+
+
+### Bug Fixes
+
+* deploy category resources when calling amplify push ([#12587](https://github.com/aws-amplify/amplify-cli/issues/12587)) ([260723c](https://github.com/aws-amplify/amplify-cli/commit/260723cb67432308dd35a4ddbedacfbbc69c6c81))
+* do not throw when localEnvInfo is missing on pull (fixes 12492) ([#12528](https://github.com/aws-amplify/amplify-cli/issues/12528)) ([0ae8689](https://github.com/aws-amplify/amplify-cli/commit/0ae8689efbb3907393f493c8707ab025573fb487))
+
+
+### Features
+
+* bump version ([#12752](https://github.com/aws-amplify/amplify-cli/issues/12752)) ([2def814](https://github.com/aws-amplify/amplify-cli/commit/2def814808a18440a7be71baccda902f07fedc49))
+
+
+
+
+
## [12.0.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@12.0.1...@aws-amplify/cli-internal@12.0.3) (2023-05-25)
diff --git a/packages/amplify-cli/package.json b/packages/amplify-cli/package.json
index e98fe403472..a5d4eb93922 100644
--- a/packages/amplify-cli/package.json
+++ b/packages/amplify-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/cli-internal",
- "version": "12.0.3",
+ "version": "12.14.2",
"description": "Amplify CLI",
"repository": {
"type": "git",
@@ -34,49 +34,49 @@
"node": ">=12.0.0"
},
"dependencies": {
- "@aws-amplify/amplify-app": "5.0.8",
- "@aws-amplify/amplify-category-analytics": "5.0.10",
- "@aws-amplify/amplify-category-api": "^5.4.1",
- "@aws-amplify/amplify-category-auth": "3.2.3",
- "@aws-amplify/amplify-category-custom": "3.0.8",
- "@aws-amplify/amplify-category-function": "5.3.3",
- "@aws-amplify/amplify-category-geo": "3.2.3",
- "@aws-amplify/amplify-category-hosting": "3.5.11",
- "@aws-amplify/amplify-category-interactions": "5.1.3",
- "@aws-amplify/amplify-category-notifications": "2.24.10",
- "@aws-amplify/amplify-category-predictions": "5.2.3",
- "@aws-amplify/amplify-category-storage": "5.2.3",
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-cli-logger": "1.3.2",
- "@aws-amplify/amplify-cli-shared-interfaces": "1.2.2",
- "@aws-amplify/amplify-console-hosting": "2.5.8",
- "@aws-amplify/amplify-container-hosting": "2.6.8",
- "@aws-amplify/amplify-dotnet-function-template-provider": "2.5.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
- "@aws-amplify/amplify-frontend-android": "3.5.4",
- "@aws-amplify/amplify-frontend-flutter": "1.4.2",
- "@aws-amplify/amplify-frontend-ios": "3.6.10",
- "@aws-amplify/amplify-frontend-javascript": "3.9.8",
- "@aws-amplify/amplify-go-function-template-provider": "1.4.3",
- "@aws-amplify/amplify-nodejs-function-template-provider": "2.8.3",
- "@aws-amplify/amplify-prompts": "2.7.0",
- "@aws-amplify/amplify-provider-awscloudformation": "8.2.3",
- "@aws-amplify/amplify-python-function-template-provider": "1.4.3",
- "@aws-amplify/amplify-util-import": "2.6.0",
- "@aws-amplify/amplify-util-mock": "5.2.3",
- "@aws-amplify/amplify-util-uibuilder": "1.8.3",
+ "@aws-amplify/amplify-app": "5.0.38",
+ "@aws-amplify/amplify-category-analytics": "5.0.37",
+ "@aws-amplify/amplify-category-api": "^5.12.10",
+ "@aws-amplify/amplify-category-auth": "3.7.17",
+ "@aws-amplify/amplify-category-custom": "3.1.25",
+ "@aws-amplify/amplify-category-function": "5.7.11",
+ "@aws-amplify/amplify-category-geo": "3.5.17",
+ "@aws-amplify/amplify-category-hosting": "3.5.38",
+ "@aws-amplify/amplify-category-interactions": "5.1.30",
+ "@aws-amplify/amplify-category-notifications": "2.26.27",
+ "@aws-amplify/amplify-category-predictions": "5.5.17",
+ "@aws-amplify/amplify-category-storage": "5.5.16",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-cli-logger": "1.3.8",
+ "@aws-amplify/amplify-cli-shared-interfaces": "1.2.5",
+ "@aws-amplify/amplify-console-hosting": "2.5.35",
+ "@aws-amplify/amplify-container-hosting": "2.8.15",
+ "@aws-amplify/amplify-dotnet-function-template-provider": "2.7.1",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
+ "@aws-amplify/amplify-frontend-android": "3.5.8",
+ "@aws-amplify/amplify-frontend-flutter": "1.4.7",
+ "@aws-amplify/amplify-frontend-ios": "3.7.9",
+ "@aws-amplify/amplify-frontend-javascript": "3.10.19",
+ "@aws-amplify/amplify-go-function-template-provider": "1.4.8",
+ "@aws-amplify/amplify-nodejs-function-template-provider": "2.10.11",
+ "@aws-amplify/amplify-prompts": "2.8.6",
+ "@aws-amplify/amplify-provider-awscloudformation": "8.11.3",
+ "@aws-amplify/amplify-python-function-template-provider": "1.4.7",
+ "@aws-amplify/amplify-util-import": "2.8.3",
+ "@aws-amplify/amplify-util-mock": "5.10.11",
+ "@aws-amplify/amplify-util-uibuilder": "1.14.16",
"@aws-cdk/cloudformation-diff": "~2.68.0",
- "amplify-codegen": "^4.1.1",
- "amplify-dotnet-function-runtime-provider": "2.0.3",
- "amplify-go-function-runtime-provider": "2.3.21",
- "amplify-java-function-runtime-provider": "2.3.21",
- "amplify-java-function-template-provider": "1.5.20",
- "amplify-nodejs-function-runtime-provider": "2.4.3",
- "amplify-python-function-runtime-provider": "2.4.21",
- "aws-cdk-lib": "~2.68.0",
- "aws-sdk": "^2.1354.0",
+ "amplify-codegen": "^4.10.2",
+ "amplify-dotnet-function-runtime-provider": "2.1.1",
+ "amplify-go-function-runtime-provider": "2.3.48",
+ "amplify-java-function-runtime-provider": "2.3.48",
+ "amplify-java-function-template-provider": "1.5.24",
+ "amplify-nodejs-function-runtime-provider": "2.5.25",
+ "amplify-python-function-runtime-provider": "2.4.48",
+ "aws-cdk-lib": "~2.177.0",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
- "ci-info": "^2.0.0",
+ "ci-info": "^3.8.0",
"cli-table3": "^0.6.0",
"cloudform-types": "^4.2.0",
"colors": "1.4.0",
@@ -87,7 +87,7 @@
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
"graphql": "^15.5.0",
- "graphql-transformer-core": "^8.1.2",
+ "graphql-transformer-core": "^8.2.13",
"gunzip-maybe": "^1.4.2",
"hidefile": "^3.0.0",
"ini": "^1.3.5",
@@ -97,7 +97,7 @@
"ora": "^4.0.3",
"progress": "^2.0.3",
"promise-sequential": "^1.1.1",
- "semver": "^7.3.5",
+ "semver": "^7.5.4",
"tar-fs": "^2.1.1",
"treeify": "^1.1.0",
"update-notifier": "^5.1.0",
@@ -105,9 +105,8 @@
"which": "^2.0.2"
},
"devDependencies": {
- "@aws-amplify/amplify-function-plugin-interface": "1.10.2",
+ "@aws-amplify/amplify-function-plugin-interface": "1.12.1",
"@types/archiver": "^5.3.1",
- "@types/ci-info": "^2.0.0",
"@types/columnify": "^1.5.1",
"@types/folder-hash": "^4.0.1",
"@types/fs-extra": "^8.0.1",
@@ -120,8 +119,10 @@
"@types/tar-fs": "^2.0.0",
"@types/treeify": "^1.0.0",
"@types/update-notifier": "^5.1.0",
+ "amplify-headless-interface": "1.17.7",
"cloudform-types": "^4.2.0",
- "nock": "^12.0.3",
+ "jest": "^29.5.0",
+ "nock": "^13.5.0",
"typescript": "^4.9.5"
},
"jest": {
diff --git a/packages/amplify-cli/src/__tests__/amplify-exception-handler.test.ts b/packages/amplify-cli/src/__tests__/amplify-exception-handler.test.ts
index d78994db8cc..49d9efb2711 100644
--- a/packages/amplify-cli/src/__tests__/amplify-exception-handler.test.ts
+++ b/packages/amplify-cli/src/__tests__/amplify-exception-handler.test.ts
@@ -1,3 +1,4 @@
+import { EOL } from 'os';
import { AmplifyError } from '@aws-amplify/amplify-cli-core';
import { printer } from '@aws-amplify/amplify-prompts'; // eslint-disable-line import/no-extraneous-dependencies
import { reportError } from '../commands/diagnose';
@@ -8,7 +9,7 @@ const printerMock = printer as any;
const reportErrorMock = reportError as jest.MockedFunction;
jest.mock('../commands/diagnose', () => ({
- reportError: jest.fn(async (__context: Context, __error: Error | undefined): Promise => {
+ reportError: jest.fn(async (): Promise => {
/* no-op */
}),
}));
@@ -30,7 +31,7 @@ describe('test exception handler', () => {
} as unknown as Context;
beforeEach(() => {
jest.resetAllMocks();
- processExit = jest.spyOn(process, 'exit').mockImplementation((__code?: number) => undefined as never);
+ processExit = jest.spyOn(process, 'exit').mockImplementation(() => undefined as never);
init(contextMock);
});
it('error handler should call usageData emitError', async () => {
@@ -56,30 +57,34 @@ describe('test exception handler', () => {
it('error handler should print error', async () => {
const amplifyError = new AmplifyError('NotImplementedError', {
- message: 'Test Not implemented',
- details: 'Test Not implemented',
- resolution: 'Test Not implemented',
+ message: 'Test Not implemented(message)',
+ details: 'Test Not implemented(details)',
+ resolution: 'Test Not implemented(resolution)',
});
await handleException(amplifyError);
- expect(printerMock.error).toHaveBeenCalledWith(amplifyError.message);
- expect(printerMock.info).toHaveBeenCalledWith(amplifyError.details);
+ expect(printerMock.error).toHaveBeenCalledWith(`${amplifyError.message}${EOL}${amplifyError.details}`);
+ expect(printerMock.info).toHaveBeenCalledTimes(2);
+ expect(printerMock.info).toHaveBeenNthCalledWith(1, `Resolution: ${amplifyError.resolution}`);
+ expect(printerMock.info).toHaveBeenLastCalledWith('Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/');
expect(printerMock.debug).toHaveBeenCalledWith(amplifyError.stack);
});
it('error handler should handle encountered errors gracefully', async () => {
const amplifyError = new AmplifyError('NotImplementedError', {
- message: 'Test Not implemented',
- details: 'Test Not implemented',
- resolution: 'Test Not implemented',
+ message: 'Test Not implemented(message)',
+ details: 'Test Not implemented(details)',
+ resolution: 'Test Not implemented(resolution)',
});
reportErrorMock.mockRejectedValueOnce(new Error('MockTestError'));
await handleException(amplifyError);
- expect(printerMock.error).toHaveBeenCalledWith(amplifyError.message);
- expect(printerMock.info).toHaveBeenCalledWith(amplifyError.details);
+ expect(printerMock.error).toHaveBeenCalledWith(`${amplifyError.message}${EOL}${amplifyError.details}`);
+ expect(printerMock.info).toHaveBeenCalledTimes(2);
+ expect(printerMock.info).toHaveBeenNthCalledWith(1, `Resolution: ${amplifyError.resolution}`);
+ expect(printerMock.info).toHaveBeenLastCalledWith('Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/');
expect(printerMock.debug).toHaveBeenCalledWith(amplifyError.stack);
expect(printerMock.error).toHaveBeenCalledWith('Failed to report error: MockTestError');
});
diff --git a/packages/amplify-cli/src/__tests__/commands/init.test.ts b/packages/amplify-cli/src/__tests__/commands/init.test.ts
index 16503e5d414..f4e29eec1b4 100644
--- a/packages/amplify-cli/src/__tests__/commands/init.test.ts
+++ b/packages/amplify-cli/src/__tests__/commands/init.test.ts
@@ -1,14 +1,32 @@
-import { $TSContext, getPackageManager, JSONUtilities, LocalEnvInfo, pathManager, stateManager } from '@aws-amplify/amplify-cli-core';
+import {
+ $TSContext,
+ getPackageManager,
+ JSONUtilities,
+ LocalEnvInfo,
+ pathManager,
+ stateManager,
+ getPackageManagerByType,
+ $TSAny,
+} from '@aws-amplify/amplify-cli-core';
import { execSync } from 'child_process';
import { ensureDir, existsSync, readFileSync, readJSON, readdirSync } from 'fs-extra';
import { sync } from 'which';
-import { preInitSetup } from '../../init-steps/preInitSetup';
+import { getPreInitSetup } from '../../init-steps/preInitSetup';
import { analyzeProject } from '../../init-steps/s0-analyzeProject';
import { initFrontend } from '../../init-steps/s1-initFrontend';
import { scaffoldProjectHeadless } from '../../init-steps/s8-scaffoldHeadless';
import { coerce } from 'semver';
-jest.mock('@aws-amplify/amplify-cli-core');
+jest.mock('@aws-amplify/amplify-cli-core', () => ({
+ ...(jest.requireActual('@aws-amplify/amplify-cli-core') as {}),
+ FeatureFlags: {
+ getBoolean: jest.fn(),
+ getNumber: jest.fn(),
+ isInitialized: jest.fn().mockReturnValue(true),
+ ensureDefaultFeatureFlags: jest.fn(),
+ },
+ getPackageManager: jest.fn(),
+}));
jest.mock('child_process');
jest.mock('fs-extra');
jest.mock('which');
@@ -19,16 +37,11 @@ jest.mock('which');
(existsSync as jest.Mock).mockReturnValue(true);
(readdirSync as jest.Mock).mockReturnValue([]);
(sync as jest.MockedFunction).mockReturnValue('mock/path');
-(getPackageManager as jest.MockedFunction).mockReturnValue(
- new Promise((resolve) =>
- resolve({
- executable: 'yarn',
- lockFile: 'mock.lock',
- packageManager: 'yarn',
- version: coerce('1.22.0') ?? undefined,
- }),
- ),
-);
+
+const packageManager = getPackageManagerByType('yarn');
+(packageManager as $TSAny).lockFile = 'mock.lock';
+(packageManager as $TSAny).version = coerce('1.22.0') ?? undefined;
+(getPackageManager as jest.MockedFunction).mockResolvedValue(packageManager);
describe('amplify init:', () => {
const mockGetProjectConfigFilePath = jest.spyOn(pathManager, 'getProjectConfigFilePath');
@@ -124,7 +137,9 @@ describe('amplify init:', () => {
},
},
};
- await preInitSetup(context as unknown as $TSContext);
+ const recommendGen2 = true;
+ const step = getPreInitSetup(!recommendGen2);
+ await step(context as unknown as $TSContext);
expect(execSync).toBeCalledWith(`git ls-remote ${appUrl}`, { stdio: 'ignore' });
expect(execSync).toBeCalledWith(`git clone ${appUrl} .`, { stdio: 'inherit' });
expect(execSync).toBeCalledWith('yarn install', { stdio: 'inherit' });
diff --git a/packages/amplify-cli/src/__tests__/commands/status.test.ts b/packages/amplify-cli/src/__tests__/commands/status.test.ts
index 01319d92c17..ba5878a9175 100644
--- a/packages/amplify-cli/src/__tests__/commands/status.test.ts
+++ b/packages/amplify-cli/src/__tests__/commands/status.test.ts
@@ -4,7 +4,7 @@ import { showApiAuthAcm } from '@aws-amplify/amplify-category-api';
jest.mock('@aws-amplify/amplify-category-hosting');
jest.mock('@aws-amplify/amplify-cli-core');
jest.mock('@aws-amplify/amplify-category-api', () => ({
- showApiAuthAcm: jest.fn(async (_: any, __: string) => ''),
+ showApiAuthAcm: jest.fn(async () => ''),
}));
const pathManagerMock = pathManager as jest.Mocked;
diff --git a/packages/amplify-cli/src/__tests__/commands/uninstall.pkg.test.ts b/packages/amplify-cli/src/__tests__/commands/uninstall.pkg.test.ts
index 20f42c3ff42..f38ba57c8dc 100644
--- a/packages/amplify-cli/src/__tests__/commands/uninstall.pkg.test.ts
+++ b/packages/amplify-cli/src/__tests__/commands/uninstall.pkg.test.ts
@@ -5,7 +5,6 @@ import * as fs from 'fs-extra';
import { hideSync } from 'hidefile';
import { setRegPendingDelete } from '../../utils/win-utils';
import { windowsPathSerializer } from '../testUtils/snapshot-serializer';
-import * as path from 'path';
jest.mock('execa');
const execa_mock = execa as jest.Mocked;
@@ -14,7 +13,7 @@ execa_mock.command.mockResolvedValue({} as any);
jest.mock('fs-extra');
const fs_mock = fs as jest.Mocked;
-let userConfirmation = true;
+const userConfirmation = true;
const context_stub = {
amplify: {
confirmPrompt: async () => userConfirmation,
@@ -72,7 +71,7 @@ describe('uninstall packaged CLI on mac / linux', () => {
});
it('throws if it cannot remove the .amplify dir', async () => {
- fs_mock.remove.mockImplementationOnce(async () => {
+ fs_mock.remove.mockImplementationOnce(() => {
throw new Error('fs remove did not work!');
});
diff --git a/packages/amplify-cli/src/__tests__/commands/upgrade.pkg.test.ts b/packages/amplify-cli/src/__tests__/commands/upgrade.pkg.test.ts
index 1129462dcd7..5d71361a074 100644
--- a/packages/amplify-cli/src/__tests__/commands/upgrade.pkg.test.ts
+++ b/packages/amplify-cli/src/__tests__/commands/upgrade.pkg.test.ts
@@ -1,9 +1,7 @@
-/* eslint-disable jest/no-interpolation-in-snapshots */
import * as fs from 'fs-extra';
import fetch, { Response } from 'node-fetch';
import { $TSContext } from '@aws-amplify/amplify-cli-core';
import * as core from '@aws-amplify/amplify-cli-core';
-import * as path from 'path';
import execa from 'execa';
import { run } from '../../commands/upgrade';
import { windowsPathSerializer } from '../testUtils/snapshot-serializer';
@@ -156,10 +154,10 @@ describe('run upgrade using packaged CLI', () => {
let movedBinToTemp = false;
fsMock.move
- .mockImplementationOnce(async () => {
+ .mockImplementationOnce(() => {
movedBinToTemp = true;
})
- .mockImplementationOnce(async () => {
+ .mockImplementationOnce(() => {
if (!movedBinToTemp) throw new Error('fs.move was not called before copying extracted file to bin location');
});
diff --git a/packages/amplify-cli/src/__tests__/execution-manager.test.ts b/packages/amplify-cli/src/__tests__/execution-manager.test.ts
index d338ca9c4b6..2322ce248a5 100644
--- a/packages/amplify-cli/src/__tests__/execution-manager.test.ts
+++ b/packages/amplify-cli/src/__tests__/execution-manager.test.ts
@@ -5,6 +5,9 @@ import { CLIInput as CommandLineInput } from '../domain/command-input';
import { Context } from '../domain/context';
import { PluginInfo } from '@aws-amplify/amplify-cli-core';
import { executeCommand } from '../execution-manager';
+import { printer } from '@aws-amplify/amplify-prompts';
+
+jest.mock('@aws-amplify/amplify-prompts');
const handleAmplifyEventMock = jest.fn();
jest.mock('../../__mocks__/faked-plugin', () => ({
@@ -66,6 +69,7 @@ describe('execution manager', () => {
beforeEach(() => {
jest.clearAllMocks();
+ mockContext.parameters = { options: {} };
});
it.each([
@@ -74,6 +78,7 @@ describe('execution manager', () => {
['pull', { event: AmplifyEvent.PrePull, data: {} }],
['models', { event: AmplifyEvent.PreCodegenModels, data: {} }],
])('executeCommand raise pre %s event', async (command, args) => {
+ mockFs.readdirSync.mockReturnValue([]);
mockFs.existsSync.mockReturnValue(true);
mockContext.input.command = command;
await executeCommand(mockContext);
@@ -86,9 +91,23 @@ describe('execution manager', () => {
['pull', { event: AmplifyEvent.PostPull, data: {} }],
['models', { event: AmplifyEvent.PostCodegenModels, data: {} }],
])('executeCommand raise post %s event', async (command, args) => {
+ mockFs.readdirSync.mockReturnValue([]);
mockFs.existsSync.mockReturnValue(true);
mockContext.input.command = command;
await executeCommand(mockContext);
expect(handleAmplifyEventMock).toBeCalledWith(mockContext, args);
});
+
+ it.each([[AmplifyEvent.PreCodegenModels], [AmplifyEvent.PostCodegenModels]])(
+ 'executeCommand skips %s when target and model-schema parameters are provided',
+ async (event) => {
+ mockFs.readdirSync.mockReturnValue([]);
+ mockFs.existsSync.mockReturnValue(true);
+ mockContext.input.command = 'models';
+ mockContext.parameters.options = { target: 'javascript', 'model-schema': 'schema.graphql' };
+ await executeCommand(mockContext);
+ expect(printer.info).toBeCalledWith(expect.stringContaining(`Skipping ${event}`));
+ expect(handleAmplifyEventMock).not.toBeCalledWith(mockContext, { event, data: {} });
+ },
+ );
});
diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/execute-provider-utils.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/execute-provider-utils.test.ts
index c2db5c58a21..8b66c704be4 100644
--- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/execute-provider-utils.test.ts
+++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/execute-provider-utils.test.ts
@@ -8,7 +8,7 @@ jest.mock('../../../extensions/amplify-helpers/get-provider-plugins.ts', () => (
jest.mock('../../../../__mocks__/faked-plugin', () => ({
providerUtils: {
compileSchema: jest.fn().mockReturnValue(Promise.resolve({})),
- zipFiles: jest.fn((context, [srcDir, dstZipFilePath]) => {
+ zipFiles: jest.fn(() => {
return Promise.resolve({});
}),
},
diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/remove-resource.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/remove-resource.test.ts
index d94320d9fc0..1b4ccea3fa6 100644
--- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/remove-resource.test.ts
+++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/remove-resource.test.ts
@@ -1,6 +1,5 @@
import { stateManager, exitOnNextTick, ResourceDoesNotExistError } from '@aws-amplify/amplify-cli-core';
import { printer, prompter } from '@aws-amplify/amplify-prompts';
-import * as inquirer from 'inquirer';
import * as path from 'path';
import { removeResourceParameters } from '../../../extensions/amplify-helpers/envResourceParams';
import { removeResource, forceRemoveResource } from '../../../extensions/amplify-helpers/remove-resource';
@@ -24,6 +23,9 @@ jest.mock('@aws-amplify/amplify-cli-core', () => ({
},
pathManager: {
getResourceDirectoryPath: jest.fn((_, categoryName, resourceName) => path.join('backendDirPath', categoryName, resourceName)),
+ getStackBuildCategoryResourceDirPath: jest.fn((_, categoryName, resourceName) =>
+ path.join('backendDirPath/awscloudformation/build/', categoryName, resourceName),
+ ),
},
exitOnNextTick: jest.fn().mockImplementation(() => {
throw 'process.exit mock';
@@ -31,7 +33,6 @@ jest.mock('@aws-amplify/amplify-cli-core', () => ({
}));
const stateManagerMock = stateManager as jest.Mocked;
-const inquirerMock = inquirer as jest.Mocked;
jest.mock('@aws-amplify/amplify-prompts');
const prompterMock = prompter as jest.Mocked;
@@ -149,14 +150,21 @@ describe('remove-resource', () => {
it('print the deletion info when choose LambdaLayer', async () => {
prompterMock.pick.mockResolvedValueOnce('lambdaLayer1');
- await expect(
- removeResource(context as any, 'function', undefined, {
+
+ let error;
+ try {
+ await removeResource(context as any, 'function', undefined, {
serviceDeletionInfo: {
LambdaLayer: 'lambdaLayer deletion info message',
},
serviceSuffix: { Lambda: '(function)', LambdaLayer: '(layer)' },
- }),
- ).rejects.toThrowError('An error occurred when removing the resources from the local directory');
+ });
+ } catch (e) {
+ error = e;
+ }
+ expect(error).toBeDefined();
+ expect(error.message).toBe('Resource cannot be removed because it has a dependency on another resource');
+ expect(error.details).toBe('Dependency: Lambda - lambda1. Remove the dependency first.');
expect(prompterMock.pick).toBeCalledWith('Choose the resource you would want to remove', [
{
@@ -193,6 +201,8 @@ describe('remove-resource', () => {
},
});
expect(context.filesystem.remove).toBeCalledWith(path.join('backendDirPath', 'function', 'lambda1'));
+ expect(context.filesystem.remove).toBeCalledWith(path.join('backendDirPath/awscloudformation/build', 'function', 'lambda1'));
+ expect(context.filesystem.remove).toBeCalledTimes(2);
expect(removeResourceParameters).toBeCalledWith(context, 'function', 'lambda1');
expect(updateBackendConfigAfterResourceRemove).toBeCalledWith('function', 'lambda1');
expect(printer.success).toBeCalledWith('Successfully removed resource');
@@ -210,9 +220,15 @@ describe('remove-resource', () => {
});
it('throw an error when the dependent resources has a specified resource', async () => {
- await expect(removeResource(context as any, 'function', 'lambdaLayer1')).rejects.toThrowError(
- 'An error occurred when removing the resources from the local directory',
- );
+ let error;
+ try {
+ await removeResource(context as any, 'function', 'lambdaLayer1');
+ } catch (e) {
+ error = e;
+ }
+ expect(error).toBeDefined();
+ expect(error.message).toBe('Resource cannot be removed because it has a dependency on another resource');
+ expect(error.details).toBe('Dependency: Lambda - lambda1. Remove the dependency first.');
});
it('print message to unlink the imported resource on confirm prompt when the specified service is imported resource', async () => {
@@ -257,6 +273,7 @@ describe('remove-resource', () => {
},
});
expect(context.filesystem.remove).toBeCalledWith('backendDirPath/function/lambdaLayer1');
+ expect(context.filesystem.remove).toBeCalledWith('backendDirPath/awscloudformation/build/function/lambdaLayer1');
expect(removeResourceParameters).toBeCalledWith(context, 'function', 'lambdaLayer1');
expect(updateBackendConfigAfterResourceRemove).toBeCalledWith('function', 'lambdaLayer1');
expect(printer.success).toBeCalledWith('Successfully removed resource');
diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status-diff.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status-diff.test.ts
index 640bad9c82f..da2fb7e8990 100644
--- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status-diff.test.ts
+++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status-diff.test.ts
@@ -4,7 +4,6 @@ import * as fs from 'fs-extra';
import { stateManager, pathManager } from '@aws-amplify/amplify-cli-core';
import { CLOUD_INITIALIZED } from '../../../extensions/amplify-helpers/get-cloud-init-status';
import { capitalize, globCFNFilePath, ResourceDiff, stackMutationType } from '../../../extensions/amplify-helpers/resource-status-diff';
-import { cronJobSetting } from '../../../../../amplify-category-function/lib/provider-utils/awscloudformation/utils/constants';
// Mock Glob to fetch test cloudformation
jest.mock('glob');
diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status.test.ts
index 06dae0c4508..dd7c7e0f8a6 100644
--- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status.test.ts
+++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/resource-status.test.ts
@@ -485,9 +485,11 @@ describe('resource-status', () => {
const fsMock = fs as jest.Mocked;
fsMock.existsSync.mockReturnValue(true);
const hashElementMock = hashElement as jest.MockedFunction;
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
hashElementMock.mockImplementation(async () => ({
hash: sampleHash1,
}));
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
hashElementMock.mockImplementationOnce(async () => ({
hash: sampleHash2,
}));
@@ -740,7 +742,6 @@ describe('resource-status', () => {
it('throws an error when non amplify project', async () => {
(getCloudInitStatus as jest.MockedFunction).mockReturnValue(NON_AMPLIFY_PROJECT);
- // eslint-disable-next-line jest/valid-expect
await expect(getResourceStatus()).rejects.toThrow('No Amplify backend project files detected within this folder.');
});
});
@@ -816,9 +817,11 @@ describe('resource-status', () => {
const fsMock = fs as jest.Mocked;
fsMock.existsSync.mockReturnValue(true);
const hashElementMock = hashElement as jest.MockedFunction;
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
hashElementMock.mockImplementation(async () => ({
hash: sampleHash1,
}));
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
hashElementMock.mockImplementationOnce(async () => ({
hash: sampleHash2,
}));
diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/service-select-prompt.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/service-select-prompt.test.ts
index 0dc9892731a..ccfb03b9d4f 100644
--- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/service-select-prompt.test.ts
+++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/service-select-prompt.test.ts
@@ -1,8 +1,10 @@
import { stateManager } from '@aws-amplify/amplify-cli-core';
+import { printer } from '@aws-amplify/amplify-prompts';
+
+jest.mock('@aws-amplify/amplify-prompts');
+const printerMock = printer as jest.Mocked;
let context = {};
-let errorMessages: string[] = [];
-let infoMessages: string[] = [];
describe('serviceSelectPrompt', () => {
const mockExit = jest.fn();
@@ -37,9 +39,6 @@ describe('serviceSelectPrompt', () => {
};
beforeEach(() => {
- errorMessages = [];
- infoMessages = [];
-
context = {
runtime: {
plugins: [
@@ -51,8 +50,6 @@ describe('serviceSelectPrompt', () => {
},
print: {
success: jest.fn(),
- error: (message: string) => errorMessages.push(message),
- info: (message: string) => infoMessages.push(message),
},
usageData: {
emitError: jest.fn(),
@@ -122,11 +119,9 @@ describe('serviceSelectPrompt', () => {
};
promptMock.mockImplementation(() => Promise.resolve(promptResponse));
-
- await serviceSelectionPrompt(context, '', undefined);
-
- expect(errorMessages.length).toEqual(1);
- expect(mockExit).toBeCalledWith(1);
+ await expect(serviceSelectionPrompt(context, '', undefined)).rejects.toThrowError(
+ 'No services defined by configured providers for category',
+ );
});
it('should gracefully handle null providers', async () => {
@@ -138,11 +133,9 @@ describe('serviceSelectPrompt', () => {
};
promptMock.mockImplementation(() => Promise.resolve(promptResponse));
-
- await serviceSelectionPrompt(context, '', undefined);
-
- expect(errorMessages.length).toEqual(1);
- expect(mockExit).toBeCalledWith(1);
+ await expect(serviceSelectionPrompt(context, '', undefined)).rejects.toThrowError(
+ 'No services defined by configured providers for category',
+ );
});
it('should return a service immediately if only one exists', async () => {
@@ -161,7 +154,7 @@ describe('serviceSelectPrompt', () => {
service: 'awscloudformation',
};
expect(selectedProvider).toEqual(expectedResult);
- expect(infoMessages.length).toEqual(1);
+ expect(printerMock.info).toHaveBeenCalledWith('Using service: awscloudformation, provided by: awscloudformation');
});
it('should prompt if more than one provider is available', async () => {
diff --git a/packages/amplify-cli/src/__tests__/flow-report.test.ts b/packages/amplify-cli/src/__tests__/flow-report.test.ts
index 972e822932c..d7a6c91ca7f 100644
--- a/packages/amplify-cli/src/__tests__/flow-report.test.ts
+++ b/packages/amplify-cli/src/__tests__/flow-report.test.ts
@@ -14,7 +14,6 @@ import {
} from 'amplify-headless-interface';
import { v4 as uuid } from 'uuid';
import { Redactor } from '@aws-amplify/amplify-cli-logger';
-import crypto from 'crypto';
import { CLIFlowReport } from '../domain/amplify-usageData/FlowReport';
describe('Test FlowReport Logging', () => {
@@ -216,8 +215,6 @@ const getGeoHeadlessTestInput = () => {
return headlessPayload;
};
-const getAPIHeadlessTestInput = () => {};
-
const getGraphQLHeadlessTestInput = () => {
const headlessPayload: AddApiRequest = {
version: 1,
diff --git a/packages/amplify-cli/src/__tests__/init-steps/preInitSetup.test.ts b/packages/amplify-cli/src/__tests__/init-steps/preInitSetup.test.ts
new file mode 100644
index 00000000000..f2fd428f332
--- /dev/null
+++ b/packages/amplify-cli/src/__tests__/init-steps/preInitSetup.test.ts
@@ -0,0 +1,95 @@
+import { $TSContext } from '@aws-amplify/amplify-cli-core';
+import { printer, prompter } from '@aws-amplify/amplify-prompts';
+import { getPreInitSetup, preInitSetup, gen2Recommendation } from '../../init-steps/preInitSetup';
+import { isNewProject } from '../../init-steps/s0-analyzeProject';
+
+// Mock dependencies
+jest.mock('@aws-amplify/amplify-cli-core', () => ({
+ ...(jest.requireActual('@aws-amplify/amplify-cli-core') as {}),
+ FeatureFlags: {
+ getBoolean: jest.fn(),
+ getNumber: jest.fn(),
+ isInitialized: jest.fn().mockReturnValue(true),
+ ensureDefaultFeatureFlags: jest.fn(),
+ },
+ getPackageManager: jest.fn(),
+}));
+
+jest.mock('@aws-amplify/amplify-prompts', () => ({
+ printer: {
+ warn: jest.fn(),
+ },
+ prompter: {
+ confirmContinue: jest.fn(),
+ pick: jest.fn(),
+ },
+}));
+
+jest.mock('../../init-steps/s0-analyzeProject', () => ({
+ isNewProject: jest.fn(),
+}));
+
+describe('preInitSetup', () => {
+ it('should return preInitSetupBasic when isHeadless is true', () => {
+ const result = getPreInitSetup(false);
+ expect(result).toBe(preInitSetup);
+ });
+
+ it('should return a function when isHeadless is false', () => {
+ const result = getPreInitSetup(false);
+ expect(typeof result).toBe('function');
+ });
+});
+
+describe('gen2Recommendation', () => {
+ let context;
+
+ beforeEach(() => {
+ context = { exeInfo: {} } as $TSContext;
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('should recommend using Gen 2 for new projects', async () => {
+ const isNewProjectMock = jest.mocked(isNewProject);
+ isNewProjectMock.mockReturnValue(true);
+
+ const confirmContinueMock = jest.mocked(prompter.confirmContinue);
+ confirmContinueMock.mockResolvedValue(true);
+
+ const pickMock = jest.mocked(prompter.pick);
+ pickMock.mockResolvedValue('I am a current Gen 1 user');
+
+ await gen2Recommendation(context);
+
+ expect(require('@aws-amplify/amplify-prompts').printer.warn).toHaveBeenCalledWith(
+ 'For new projects, we recommend starting with AWS Amplify Gen 2, our new code-first developer experience. Get started at https://docs.amplify.aws/react/start/quickstart/',
+ );
+ expect(confirmContinueMock).toHaveBeenCalledWith('Do you want to continue with Amplify Gen 1?');
+ expect(pickMock).toHaveBeenCalledWith(
+ 'Why would you like to use Amplify Gen 1?',
+ [
+ 'I am a current Gen 1 user',
+ 'Gen 2 is missing features I need from Gen 1',
+ 'I find the Gen 1 CLI easier to use',
+ 'Prefer not to answer',
+ ],
+ { initial: 3 },
+ );
+ expect(context.exeInfo.projectConfig).toEqual({ whyContinueWithGen1: 'I am a current Gen 1 user' });
+ });
+
+ it('should return the context for existing projects', async () => {
+ const isNewProjectMock = jest.mocked(isNewProject);
+ isNewProjectMock.mockReturnValue(false);
+
+ const result = await gen2Recommendation(context);
+
+ expect(result).toEqual(context);
+ expect(printer.warn).not.toHaveBeenCalled();
+ expect(prompter.confirmContinue).not.toHaveBeenCalled();
+ expect(prompter.pick).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/amplify-cli/src/__tests__/init-steps/s0-analyzeProject.test.ts b/packages/amplify-cli/src/__tests__/init-steps/s0-analyzeProject.test.ts
index 8077a908a1b..11e5c63ecf8 100644
--- a/packages/amplify-cli/src/__tests__/init-steps/s0-analyzeProject.test.ts
+++ b/packages/amplify-cli/src/__tests__/init-steps/s0-analyzeProject.test.ts
@@ -1,8 +1,9 @@
-import { $TSContext, stateManager } from '@aws-amplify/amplify-cli-core';
+import { $TSContext, AmplifyError, stateManager } from '@aws-amplify/amplify-cli-core';
import { analyzeProject } from '../../init-steps/s0-analyzeProject';
import { constructMockPluginPlatform } from '../extensions/amplify-helpers/mock-plugin-platform';
import { CLIInput as CommandLineInput } from '../../domain/command-input';
import { constructContext } from '../../context-manager';
+import * as fs from 'fs-extra';
jest.spyOn(stateManager, 'getLocalAWSInfo').mockReturnValue({ envA: 'test', envB: 'test' });
jest.spyOn(stateManager, 'getLocalEnvInfo').mockReturnValue({ defaultEditor: 'Visual Studio Code' });
@@ -75,4 +76,26 @@ describe('analyzeProject', () => {
await analyzeProject(mockContext);
expect(mockContext.exeInfo.isNewEnv).toBe(true);
});
+
+ it('throws helpful error message when running subsequent init -y commands', async () => {
+ const appID = 'testAppID';
+ const currentEnv = 'dev';
+
+ mockContext.parameters = {
+ options: {
+ yes: true,
+ },
+ };
+
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+ jest.spyOn(stateManager, 'getAppID').mockReturnValue(appID);
+ jest.spyOn(stateManager, 'getCurrentEnvName').mockReturnValue(currentEnv);
+
+ const amplifyError = new AmplifyError('ProjectInitError', {
+ message: `Amplify project ${appID} is already initialized for environment ${currentEnv}`,
+ resolution: `To create a new environment run \`amplify add env\``,
+ });
+
+ await expect(analyzeProject(mockContext)).rejects.toThrow(amplifyError);
+ });
});
diff --git a/packages/amplify-cli/src/__tests__/input-validation.test.ts b/packages/amplify-cli/src/__tests__/input-validation.test.ts
index fdc047680f3..eb6f1116fbd 100644
--- a/packages/amplify-cli/src/__tests__/input-validation.test.ts
+++ b/packages/amplify-cli/src/__tests__/input-validation.test.ts
@@ -1,14 +1,67 @@
import { verifyInput } from '../input-manager';
-import { PluginPlatform } from '@aws-amplify/amplify-cli-core';
+import { PluginInfo, PluginManifest, PluginPlatform, getPackageManager, getPackageManagerByType } from '@aws-amplify/amplify-cli-core';
import { CLIInput as CommandLineInput } from '../domain/command-input';
+jest.mock('@aws-amplify/amplify-cli-core', () => ({
+ ...(jest.requireActual('@aws-amplify/amplify-cli-core') as {}),
+ getPackageManager: jest.fn(),
+}));
+
+const npmPackageManager = getPackageManagerByType('npm');
+const yarnPackageManager = getPackageManagerByType('yarn');
+const pnpmPackageManager = getPackageManagerByType('pnpm');
+
describe('input validation tests', () => {
- it('status -v option should be treated as verbose', () => {
+ beforeEach(() => jest.clearAllMocks());
+
+ it('status -v option should be treated as verbose', async () => {
const input = new CommandLineInput(['status', '-v']);
input.command = 'status';
input.options = { v: true };
- verifyInput(new PluginPlatform(), input);
+ await verifyInput(new PluginPlatform(), input);
expect(input?.options?.verbose).toBe(true);
});
+
+ it('display npx Amplify Gen 2 message with command not found message', async () => {
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(npmPackageManager);
+ const input = new CommandLineInput(['sandbox']);
+ input.command = 'sandbox';
+
+ const version = 'latestVersion';
+ const pluginPlatform = new PluginPlatform();
+ pluginPlatform.plugins.core = [new PluginInfo('', version, '', new PluginManifest('', ''))];
+
+ const verifyInputResult = await verifyInput(pluginPlatform, input);
+ expect(verifyInputResult.message).toContain('can NOT find command');
+ expect(verifyInputResult.message).toContain('npx @aws-amplify/backend-cli sandbox');
+ });
+
+ it('display yarn dlx Amplify Gen 2 message with command not found message', async () => {
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(yarnPackageManager);
+ const input = new CommandLineInput(['sandbox']);
+ input.command = 'sandbox';
+
+ const version = 'latestVersion';
+ const pluginPlatform = new PluginPlatform();
+ pluginPlatform.plugins.core = [new PluginInfo('', version, '', new PluginManifest('', ''))];
+
+ const verifyInputResult = await verifyInput(pluginPlatform, input);
+ expect(verifyInputResult.message).toContain('can NOT find command');
+ expect(verifyInputResult.message).toContain('yarn dlx @aws-amplify/backend-cli sandbox');
+ });
+
+ it('display pnpm dlx Amplify Gen 2 message with command not found message', async () => {
+ (getPackageManager as jest.MockedFunction).mockResolvedValue(pnpmPackageManager);
+ const input = new CommandLineInput(['sandbox']);
+ input.command = 'sandbox';
+
+ const version = 'latestVersion';
+ const pluginPlatform = new PluginPlatform();
+ pluginPlatform.plugins.core = [new PluginInfo('', version, '', new PluginManifest('', ''))];
+
+ const verifyInputResult = await verifyInput(pluginPlatform, input);
+ expect(verifyInputResult.message).toContain('can NOT find command');
+ expect(verifyInputResult.message).toContain('pnpm dlx @aws-amplify/backend-cli sandbox');
+ });
});
diff --git a/packages/amplify-cli/src/__tests__/plugin-helpers/verify-plugin.test.ts b/packages/amplify-cli/src/__tests__/plugin-helpers/verify-plugin.test.ts
index 2ab1a5c8089..14eaea4f177 100644
--- a/packages/amplify-cli/src/__tests__/plugin-helpers/verify-plugin.test.ts
+++ b/packages/amplify-cli/src/__tests__/plugin-helpers/verify-plugin.test.ts
@@ -48,12 +48,14 @@ describe('verify-plugin', () => {
});
it('returns PluginDirPathNotExist error when specify not exist path', async () => {
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementation(() => Promise.resolve(false));
const result = await verifyPlugin(path.join('path', 'to', 'plugin'));
expect(result).toEqual(new PluginVerificationResult(false, PluginVerificationError.PluginDirPathNotExist));
});
it('returns PluginDirPathNotExist error when specify non directory path', async () => {
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementation(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(false),
@@ -64,6 +66,7 @@ describe('verify-plugin', () => {
});
it('returns InvalidNodePackage error when specify package.json not exists directory path', async () => {
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementation(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -83,6 +86,7 @@ describe('verify-plugin', () => {
it('returns MissingManifest error when amplify-plugin.json is not exists.', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -95,6 +99,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(false));
const result = await verifyPlugin(path.join('path', 'to', 'plugin'));
@@ -104,6 +109,7 @@ describe('verify-plugin', () => {
it('returns MissingManifest error when amplify-plugin.json is not file.', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -116,6 +122,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const statManifest = {
isFile: jest.fn().mockReturnValue(false),
@@ -129,6 +136,7 @@ describe('verify-plugin', () => {
it('returns InvalidManifest error when amplify-plugin.json is not json file.', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -141,6 +149,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const statManifest = {
isFile: jest.fn().mockReturnValue(true),
@@ -160,6 +169,7 @@ describe('verify-plugin', () => {
it('returns InvalidManifest error when plugin name is invalid', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -172,6 +182,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const statManifest = {
isFile: jest.fn().mockReturnValue(true),
@@ -199,6 +210,7 @@ describe('verify-plugin', () => {
it('returns MissingHandleAmplifyEventMethod error when plugin has invalid handle methods', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -211,6 +223,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const statManifest = {
isFile: jest.fn().mockReturnValue(true),
@@ -242,6 +255,7 @@ describe('verify-plugin', () => {
it('returns that verified is true when plugin pass all verifications', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -254,6 +268,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const statManifest = {
isFile: jest.fn().mockReturnValue(true),
@@ -279,6 +294,7 @@ describe('verify-plugin', () => {
it('returns that verified is true when plugin has no event handlers', async () => {
// stat package.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const stat = {
isDirectory: jest.fn().mockReturnValue(true),
@@ -291,6 +307,7 @@ describe('verify-plugin', () => {
readJsonMock.mockReturnValueOnce(packageJson);
// stat amplify-plugin.json
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
fsMock.pathExists.mockImplementationOnce(() => Promise.resolve(true));
const statManifest = {
isFile: jest.fn().mockReturnValue(true),
diff --git a/packages/amplify-cli/src/__tests__/usage-data.test.ts b/packages/amplify-cli/src/__tests__/usage-data.test.ts
index 885672e911a..c7e0a565ce3 100644
--- a/packages/amplify-cli/src/__tests__/usage-data.test.ts
+++ b/packages/amplify-cli/src/__tests__/usage-data.test.ts
@@ -1,21 +1,29 @@
-import url from 'url';
import nock from 'nock';
+import url from 'url';
import * as uuid from 'uuid';
+import { AmplifyError, ManuallyTimedCodePath } from '@aws-amplify/amplify-cli-core';
+import { ProjectSettings } from '@aws-amplify/amplify-cli-core/src/types';
+import { printer } from '@aws-amplify/amplify-prompts';
+import { SerializableError } from '../domain/amplify-usageData/SerializableError';
import { UsageData } from '../domain/amplify-usageData/UsageData';
+import { UsageDataPayload } from '../domain/amplify-usageData/UsageDataPayload';
import { getUrl } from '../domain/amplify-usageData/getUsageDataUrl';
-import { AmplifyError } from '@aws-amplify/amplify-cli-core';
import { CLIInput as CommandLineInput } from '../domain/command-input';
-import { ManuallyTimedCodePath } from '@aws-amplify/amplify-cli-core';
-import { UsageDataPayload } from '../domain/amplify-usageData/UsageDataPayload';
-import { SerializableError } from '../domain/amplify-usageData/SerializableError';
-import { ProjectSettings } from '@aws-amplify/amplify-cli-core/src/types';
const baseOriginalUrl = 'https://cli.amplify';
const pathToUrl = '/metrics';
const originalUrl = `${baseOriginalUrl}${pathToUrl}`;
+jest.mock('@aws-amplify/amplify-prompts');
+
describe('test usageData', () => {
+ const printerMock = printer as jest.Mocked;
+
+ beforeEach(() => {
+ printerMock.debug = jest.fn();
+ });
+
beforeAll(() => {
process.env = Object.assign(process.env, { AMPLIFY_CLI_BETA_USAGE_TRACKING_URL: originalUrl });
});
@@ -174,12 +182,11 @@ describe('test usageData', () => {
expect((UsageData.Instance as unknown as any).pushNormalizationFactor).toEqual(3);
});
- it('errors if starting a duplicate timer', () => {
+ it('should not error if starting a duplicate timer', () => {
const usageData = UsageData.Instance;
usageData.startCodePathTimer(ManuallyTimedCodePath.INIT_ENV_CATEGORIES);
- expect(() => usageData.startCodePathTimer(ManuallyTimedCodePath.INIT_ENV_CATEGORIES)).toThrowErrorMatchingInlineSnapshot(
- '"initEnvCategories already has a running timer"',
- );
+ expect(() => usageData.startCodePathTimer(ManuallyTimedCodePath.INIT_ENV_CATEGORIES)).not.toThrowError();
+ expect(printerMock.debug).toBeCalledWith(`${ManuallyTimedCodePath.INIT_ENV_CATEGORIES} already has a running timer`);
});
it('does nothing when stopping a timer that is not running', () => {
diff --git a/packages/amplify-cli/src/amplify-exception-handler.ts b/packages/amplify-cli/src/amplify-exception-handler.ts
index 7ff118dc00a..04b4c2f096c 100644
--- a/packages/amplify-cli/src/amplify-exception-handler.ts
+++ b/packages/amplify-cli/src/amplify-exception-handler.ts
@@ -1,3 +1,4 @@
+import { EOL } from 'os';
import {
$TSAny,
AmplifyException,
@@ -123,10 +124,10 @@ const executeSafely = async (functionToExecute: () => Promise | void, erro
const printAmplifyException = (amplifyException: AmplifyException): void => {
const { message, details, resolution, link, stack } = amplifyException;
-
- printer.error(message);
if (details) {
- printer.info(details);
+ printer.error(message + EOL + details);
+ } else {
+ printer.error(message);
}
printer.blankLine();
if (resolution) {
diff --git a/packages/amplify-cli/src/attach-backend.ts b/packages/amplify-cli/src/attach-backend.ts
index 7b392358759..405ef20a1cc 100644
--- a/packages/amplify-cli/src/attach-backend.ts
+++ b/packages/amplify-cli/src/attach-backend.ts
@@ -125,7 +125,7 @@ const backupAmplifyFolder = (): void => {
});
}
try {
- fs.moveSync(amplifyDirPath, backupAmplifyDirPath);
+ fs.copySync(amplifyDirPath, backupAmplifyDirPath);
} catch (e) {
if (e.code === 'EPERM') {
throw new AmplifyError(
diff --git a/packages/amplify-cli/src/commands/configure.ts b/packages/amplify-cli/src/commands/configure.ts
index 0342170b8d9..44dcf2683e4 100644
--- a/packages/amplify-cli/src/commands/configure.ts
+++ b/packages/amplify-cli/src/commands/configure.ts
@@ -1,4 +1,5 @@
import { $TSContext } from '@aws-amplify/amplify-cli-core';
+import { printer } from '@aws-amplify/amplify-prompts';
import { analyzeProject } from '../config-steps/c0-analyzeProject';
import { configFrontendHandler } from '../config-steps/c1-configFrontend';
import { configProviders } from '../config-steps/c2-configProviders';
@@ -7,17 +8,31 @@ import { onFailure } from '../config-steps/c9-onFailure';
import { onSuccess } from '../config-steps/c9-onSuccess';
import { normalizeInputParams } from '../input-params-manager';
import { write } from '../app-config';
+import { DebugConfig } from '../app-config/debug-config';
import { Context } from '../domain/context';
export const run = async (context: Context) => {
if (context.parameters.options['usage-data-off']) {
write(context, { usageDataConfig: { isUsageTrackingEnabled: false } });
- context.print.success('Usage Data has been turned off');
+ printer.success('Usage Data has been turned off');
return;
}
+
if (context.parameters.options['usage-data-on']) {
write(context, { usageDataConfig: { isUsageTrackingEnabled: true } });
- context.print.success('Usage Data has been turned on');
+ printer.success('Usage Data has been turned on');
+ return;
+ }
+
+ if (context.parameters.options['share-project-config-off']) {
+ DebugConfig.Instance.setAndWriteShareProject(false);
+ printer.success('Share Project Config has been turned off');
+ return;
+ }
+
+ if (context.parameters.options['share-project-config-on']) {
+ DebugConfig.Instance.setAndWriteShareProject(true);
+ printer.success('Share Project Config has been turned on');
return;
}
@@ -27,7 +42,7 @@ export const run = async (context: Context) => {
const providerPlugin = await import(context.amplify.getProviderPlugins(context).awscloudformation);
await providerPlugin.adminLoginFlow(context, appId, envName);
} catch (e) {
- context.print.error(`Failed to authenticate: ${e.message || 'Unknown error occurred.'}`);
+ printer.error(`Failed to authenticate: ${e.message || 'Unknown error occurred.'}`);
await context.usageData.emitError(e);
process.exit(1);
}
diff --git a/packages/amplify-cli/src/commands/helpers/reporter-apis.ts b/packages/amplify-cli/src/commands/helpers/reporter-apis.ts
index 17887cfa1f3..3801c411f83 100644
--- a/packages/amplify-cli/src/commands/helpers/reporter-apis.ts
+++ b/packages/amplify-cli/src/commands/helpers/reporter-apis.ts
@@ -8,7 +8,7 @@ import fetch from 'node-fetch';
export const getPublicKey = async (): Promise => {
let url = 'https://aws-amplify.github.io/amplify-cli/report-public-key.pub';
if (process.env.AMPLIFY_CLI_BETA_PUBLIC_KEY_URL && typeof process.env.AMPLIFY_CLI_BETA_PUBLIC_KEY_URL === 'string') {
- url = process.env.AMPLIFY_CLI_BETA_USAGE_TRACKING_URL || url;
+ url = process.env.AMPLIFY_CLI_BETA_PUBLIC_KEY_URL || url;
}
const res = await fetch(url);
if (!res.ok) {
@@ -25,7 +25,7 @@ export const getPublicKey = async (): Promise => {
export const reporterEndpoint = (): string => {
const prodUrl = 'https://api.cli.amplify.aws/diagnose/report';
if (process.env.AMPLIFY_CLI_BETA_REPORT_URL && typeof process.env.AMPLIFY_CLI_BETA_REPORT_URL === 'string') {
- return process.env.AMPLIFY_CLI_BETA_USAGE_TRACKING_URL || prodUrl;
+ return process.env.AMPLIFY_CLI_BETA_REPORT_URL || prodUrl;
}
return prodUrl;
};
diff --git a/packages/amplify-cli/src/commands/init.ts b/packages/amplify-cli/src/commands/init.ts
index 2d2545a1d4d..87db5254692 100644
--- a/packages/amplify-cli/src/commands/init.ts
+++ b/packages/amplify-cli/src/commands/init.ts
@@ -1,15 +1,16 @@
-import { $TSContext, LocalEnvInfo } from '@aws-amplify/amplify-cli-core';
+import { $TSContext, AmplifyError, LocalEnvInfo, stateManager } from '@aws-amplify/amplify-cli-core';
import { constructInputParams } from '../amplify-service-helper';
import { Context } from '../domain/context';
import { raisePostEnvAddEvent } from '../execution-manager';
import { postInitSetup } from '../init-steps/postInitSetup';
-import { preInitSetup } from '../init-steps/preInitSetup';
+import { getPreInitSetup } from '../init-steps/preInitSetup';
import { analyzeProject, analyzeProjectHeadless } from '../init-steps/s0-analyzeProject';
import { initFrontend } from '../init-steps/s1-initFrontend';
import { initProviders } from '../init-steps/s2-initProviders';
import { scaffoldProjectHeadless } from '../init-steps/s8-scaffoldHeadless';
import { onHeadlessSuccess, onSuccess } from '../init-steps/s9-onSuccess';
import { checkForNestedProject } from './helpers/projectUtils';
+import { getAmplifyAppId } from '../extensions/amplify-helpers/get-amplify-appId';
const constructExeInfo = (context: $TSContext): void => {
context.exeInfo = {
@@ -18,11 +19,12 @@ const constructExeInfo = (context: $TSContext): void => {
};
};
+const recommendGen2 = true;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const runStrategy = (quickstart: boolean) =>
quickstart
- ? [preInitSetup, analyzeProjectHeadless, scaffoldProjectHeadless, onHeadlessSuccess]
- : [preInitSetup, analyzeProject, initFrontend, initProviders, onSuccess, postInitSetup];
+ ? [getPreInitSetup(!recommendGen2), analyzeProjectHeadless, scaffoldProjectHeadless, onHeadlessSuccess]
+ : [getPreInitSetup(recommendGen2), analyzeProject, initFrontend, initProviders, onSuccess, postInitSetup];
/**
* entry point for the init command
@@ -31,6 +33,23 @@ export const run = async (context: $TSContext): Promise => {
constructExeInfo(context);
checkForNestedProject();
+ // Opt-out mechanism for customers that are using old app backend environments with existing apps intentionally
+ const { AMPLIFY_SKIP_APP_ID_MISMATCH_CHECK } = process.env;
+ if (AMPLIFY_SKIP_APP_ID_MISMATCH_CHECK !== 'true') {
+ // check for appId mismatch
+ const projectPath = process.cwd();
+ if (stateManager.metaFileExists(projectPath)) {
+ const inputAppId = context.exeInfo?.inputParams?.amplify?.appId;
+ const appId = getAmplifyAppId();
+ if (inputAppId && appId && inputAppId !== appId) {
+ throw new AmplifyError('InvalidAmplifyAppIdError', {
+ message: `Amplify appId mismatch.`,
+ resolution: `You are currently working in the amplify project with Id ${appId}. If this is intentional, you may bypass this protection by setting the environment variable AMPLIFY_SKIP_APP_ID_MISMATCH_CHECK to true.`,
+ });
+ }
+ }
+ }
+
const steps = runStrategy(!!context?.parameters?.options?.quickstart);
for (const step of steps) {
await step(context);
diff --git a/packages/amplify-cli/src/domain/amplify-usageData/SerializableError.ts b/packages/amplify-cli/src/domain/amplify-usageData/SerializableError.ts
index 9464011129a..887f411cbfa 100644
--- a/packages/amplify-cli/src/domain/amplify-usageData/SerializableError.ts
+++ b/packages/amplify-cli/src/domain/amplify-usageData/SerializableError.ts
@@ -55,21 +55,28 @@ const processPaths = (paths: string[]): string[] => {
}
const longestString = paths.reduce((a, b) => (a.length > b.length ? a : b));
const directoriesToRemove = longestString.split('/');
- const directoriesRemoved = new Set();
- directoriesToRemove.forEach((directory) => {
+ const directoriesRemoved: Array = [];
+ for (const directory of directoriesToRemove) {
if (directory === '') {
- return;
+ continue;
}
+ let removedInAnyPath = false;
for (let i = 0; i < result.length; i++) {
if (result[i].startsWith(`/${directory}`) && result[i] !== longestString) {
result[i] = result[i].replace(`/${directory}`, '');
- directoriesRemoved.add(directory);
+ removedInAnyPath = true;
}
}
- });
+ if (removedInAnyPath) {
+ directoriesRemoved.push(directory);
+ } else {
+ // if current segment is not in any path this means we removed common prefix from all paths.
+ break;
+ }
+ }
return result.map((r) => {
- if (r === longestString) {
+ if (r === longestString && directoriesRemoved.length > 0) {
return longestString.replace(path.join(...directoriesRemoved), '');
}
return r;
diff --git a/packages/amplify-cli/src/domain/amplify-usageData/UsageData.ts b/packages/amplify-cli/src/domain/amplify-usageData/UsageData.ts
index b41d64a11dd..ac53cce121f 100644
--- a/packages/amplify-cli/src/domain/amplify-usageData/UsageData.ts
+++ b/packages/amplify-cli/src/domain/amplify-usageData/UsageData.ts
@@ -1,6 +1,6 @@
/* eslint-disable class-methods-use-this */
import { ICommandInput, IFlowReport } from '@aws-amplify/amplify-cli-shared-interfaces';
-import { prompter } from '@aws-amplify/amplify-prompts';
+import { prompter, printer } from '@aws-amplify/amplify-prompts';
import https from 'https';
import { pick } from 'lodash';
import { UrlWithStringQuery } from 'url';
@@ -117,9 +117,10 @@ export class UsageData implements IUsageData {
*/
startCodePathTimer(codePath: StartableTimedCodePath): void {
if (this.codePathTimers.has(codePath)) {
- throw new Error(`${codePath} already has a running timer`);
+ printer.debug(`${codePath} already has a running timer`);
+ } else {
+ this.codePathTimers.set(codePath, Timer.start());
}
- this.codePathTimers.set(codePath, Timer.start());
}
/**
diff --git a/packages/amplify-cli/src/execution-manager.ts b/packages/amplify-cli/src/execution-manager.ts
index 208a87670a7..ae844c7e77c 100644
--- a/packages/amplify-cli/src/execution-manager.ts
+++ b/packages/amplify-cli/src/execution-manager.ts
@@ -1,6 +1,6 @@
import * as fs from 'fs-extra';
import * as path from 'path';
-import { prompter } from '@aws-amplify/amplify-prompts';
+import { printer, prompter } from '@aws-amplify/amplify-prompts';
import { twoStringSetsAreEqual, twoStringSetsAreDisjoint } from './utils/set-ops';
import { Context } from './domain/context';
import { scan, getPluginsWithNameAndCommand, getPluginsWithEventHandler } from './plugin-manager';
@@ -269,6 +269,9 @@ const raisePreExportEvent = async (context: Context): Promise => {
};
const raisePreCodegenModelsEvent = async (context: Context): Promise => {
+ if (shouldSkipCodegenModelsEvents(context, AmplifyEvent.PreCodegenModels)) {
+ return;
+ }
await raiseEvent(context, { event: AmplifyEvent.PreCodegenModels, data: {} });
};
@@ -309,7 +312,22 @@ const raisePostPullEvent = async (context: Context): Promise => {
await raiseEvent(context, { event: AmplifyEvent.PostPull, data: {} });
};
+const shouldSkipCodegenModelsEvents = (context: Context, event: AmplifyEvent): boolean => {
+ const optionsIndicatingUninitializedModelgen = ['target', 'model-schema'];
+ const cliOptions = context?.parameters?.options ? new Set(Object.keys(context.parameters.options)) : new Set();
+ const skipEvents = optionsIndicatingUninitializedModelgen.every((option) => cliOptions.has(option));
+ if (skipEvents) {
+ printer.info(
+ `Skipping ${event} lifecycle event, due to presence of ${JSON.stringify(optionsIndicatingUninitializedModelgen)} in context options`,
+ );
+ }
+ return skipEvents;
+};
+
const raisePostCodegenModelsEvent = async (context: Context): Promise => {
+ if (shouldSkipCodegenModelsEvents(context, AmplifyEvent.PostCodegenModels)) {
+ return;
+ }
await raiseEvent(context, { event: AmplifyEvent.PostCodegenModels, data: {} });
};
diff --git a/packages/amplify-cli/src/extensions/amplify-helpers/docs-manager.ts b/packages/amplify-cli/src/extensions/amplify-helpers/docs-manager.ts
index fb1b7e142b5..d118d8b2765 100644
--- a/packages/amplify-cli/src/extensions/amplify-helpers/docs-manager.ts
+++ b/packages/amplify-cli/src/extensions/amplify-helpers/docs-manager.ts
@@ -3,10 +3,10 @@ const ReadMeContent = `# Getting Started with Amplify CLI
This directory was generated by [Amplify CLI](https://docs.amplify.aws/cli).
Helpful resources:
-- Amplify documentation: https://docs.amplify.aws
-- Amplify CLI documentation: https://docs.amplify.aws/cli
-- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files
-- Join Amplify's community: https://amplify.aws/community/
+- Amplify documentation: https://docs.amplify.aws.
+- Amplify CLI documentation: https://docs.amplify.aws/cli.
+- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files.
+- Join Amplify's community: https://amplify.aws/community/.
`;
export function writeReadMeFile(readMeFilePath: string): void {
diff --git a/packages/amplify-cli/src/extensions/amplify-helpers/read-json-file.ts b/packages/amplify-cli/src/extensions/amplify-helpers/read-json-file.ts
index c8b590623b1..9fdc6db413b 100644
--- a/packages/amplify-cli/src/extensions/amplify-helpers/read-json-file.ts
+++ b/packages/amplify-cli/src/extensions/amplify-helpers/read-json-file.ts
@@ -1,6 +1,7 @@
//TODO Remove this whole function once read-json removed from everywhere
import { JSONUtilities, $TSAny } from '@aws-amplify/amplify-cli-core';
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function readJsonFile(jsonFilePath, encoding = 'utf8', throwOnError = true): $TSAny {
return JSONUtilities.readJson(jsonFilePath, {
throwIfNotExist: throwOnError,
diff --git a/packages/amplify-cli/src/extensions/amplify-helpers/remove-resource.ts b/packages/amplify-cli/src/extensions/amplify-helpers/remove-resource.ts
index 975aa895f5b..8d6e29a3a4d 100644
--- a/packages/amplify-cli/src/extensions/amplify-helpers/remove-resource.ts
+++ b/packages/amplify-cli/src/extensions/amplify-helpers/remove-resource.ts
@@ -1,6 +1,7 @@
import {
$TSContext,
AmplifyError,
+ AmplifyException,
AmplifyFault,
exitOnNextTick,
pathManager,
@@ -9,7 +10,6 @@ import {
stateManager,
} from '@aws-amplify/amplify-cli-core';
import { printer, prompter } from '@aws-amplify/amplify-prompts';
-import * as inquirer from 'inquirer';
import _ from 'lodash';
import { removeResourceParameters } from './envResourceParams';
import { updateBackendConfigAfterResourceRemove } from './update-backend-config';
@@ -77,7 +77,6 @@ export async function removeResource(
if (resourceNameCallback) {
await resourceNameCallback(resourceName);
}
-
const resourceDir = pathManager.getResourceDirectoryPath(undefined, category, resourceName);
if (options.headless !== true) {
@@ -99,6 +98,9 @@ export async function removeResource(
try {
return await deleteResourceFiles(context, category, resourceName, resourceDir);
} catch (err) {
+ if (err instanceof AmplifyException) {
+ throw err;
+ }
throw new AmplifyFault(
'ResourceRemoveFault',
{ message: 'An error occurred when removing the resources from the local directory' },
@@ -113,14 +115,14 @@ const deleteResourceFiles = async (context: $TSContext, category: string, resour
const { allResources } = await context.amplify.getResourceStatus();
allResources.forEach((resourceItem) => {
if (resourceItem.dependsOn) {
- resourceItem.dependsOn.forEach((dependsOnItem) => {
+ for (const dependsOnItem of resourceItem.dependsOn) {
if (dependsOnItem.category === category && dependsOnItem.resourceName === resourceName) {
throw new AmplifyError('ResourceRemoveError', {
message: 'Resource cannot be removed because it has a dependency on another resource',
details: `Dependency: ${resourceItem.service} - ${resourceItem.resourceName}. Remove the dependency first.`,
});
}
- });
+ }
}
});
}
@@ -136,7 +138,9 @@ const deleteResourceFiles = async (context: $TSContext, category: string, resour
stateManager.setMeta(undefined, amplifyMeta);
// Remove resource directory from backend/
+ const stackBuildDir = pathManager.getStackBuildCategoryResourceDirPath('', category, resourceName);
context.filesystem.remove(resourceDir);
+ context.filesystem.remove(stackBuildDir);
removeResourceParameters(context, category, resourceName);
updateBackendConfigAfterResourceRemove(category, resourceName);
diff --git a/packages/amplify-cli/src/extensions/amplify-helpers/service-select-prompt.ts b/packages/amplify-cli/src/extensions/amplify-helpers/service-select-prompt.ts
index a2b0027136e..0d942b2dd6f 100644
--- a/packages/amplify-cli/src/extensions/amplify-helpers/service-select-prompt.ts
+++ b/packages/amplify-cli/src/extensions/amplify-helpers/service-select-prompt.ts
@@ -1,4 +1,5 @@
-import { $TSAny, $TSContext, exitOnNextTick, ResourceDoesNotExistError, ServiceSelection } from '@aws-amplify/amplify-cli-core';
+import { $TSAny, $TSContext, AmplifyError, ServiceSelection } from '@aws-amplify/amplify-cli-core';
+import { printer } from '@aws-amplify/amplify-prompts';
import * as inquirer from 'inquirer';
import { getProjectConfig } from './get-project-config';
@@ -58,15 +59,14 @@ async function serviceQuestionWalkthrough(
}
if (options.length === 0) {
- const errMessage = `No services defined by configured providers for category: ${category}`;
- context.print.error(errMessage);
- await context.usageData.emitError(new ResourceDoesNotExistError(errMessage));
- exitOnNextTick(1);
+ throw new AmplifyError('ResourceDoesNotExistError', {
+ message: `No services defined by configured providers for category: ${category}`,
+ });
}
if (options.length === 1) {
// No need to ask questions
- context.print.info(`Using service: ${options[0].value.service}, provided by: ${options[0].value.providerName}`);
+ printer.info(`Using service: ${options[0].value.service}, provided by: ${options[0].value.providerName}`);
return new Promise((resolve) => {
resolve(options[0].value);
});
diff --git a/packages/amplify-cli/src/extensions/amplify-helpers/update-amplify-meta.ts b/packages/amplify-cli/src/extensions/amplify-helpers/update-amplify-meta.ts
index fd05291a6b2..a5c69375946 100644
--- a/packages/amplify-cli/src/extensions/amplify-helpers/update-amplify-meta.ts
+++ b/packages/amplify-cli/src/extensions/amplify-helpers/update-amplify-meta.ts
@@ -5,7 +5,6 @@ import { buildTypeKeyMap, ServiceName } from '@aws-amplify/amplify-category-func
import { $TSAny, $TSMeta, $TSObject, JSONUtilities, pathManager, ResourceTuple, stateManager } from '@aws-amplify/amplify-cli-core';
import { BuildType } from '@aws-amplify/amplify-function-plugin-interface';
import * as fs from 'fs-extra';
-import glob from 'glob';
import _ from 'lodash';
import * as path from 'path';
import { ensureAmplifyMetaFrontendConfig } from './on-category-outputs-change';
@@ -77,13 +76,13 @@ const moveBackendResourcesToCurrentCloudBackend = (resources: $TSObject[]): void
}
fs.ensureDirSync(targetDir);
+ const isLambdaOrCustom =
+ resource?.service === ServiceName.LambdaFunction || (resource?.service && resource?.service.includes('custom'));
// in the case that the resource is being deleted, the sourceDir won't exist
if (fs.pathExistsSync(sourceDir)) {
- fs.copySync(sourceDir, targetDir);
- if (resource?.service === ServiceName.LambdaFunction || (resource?.service && resource?.service.includes('custom'))) {
- removeNodeModulesDir(targetDir);
- }
+ const nodeModulesFilterFn = (src: string): boolean => path.basename(src) !== 'node_modules';
+ fs.copySync(sourceDir, targetDir, { ...(isLambdaOrCustom ? { filter: nodeModulesFilterFn } : {}) });
}
}
@@ -109,18 +108,6 @@ const moveBackendResourcesToCurrentCloudBackend = (resources: $TSObject[]): void
}
};
-const removeNodeModulesDir = (currentCloudBackendDir: string): void => {
- const nodeModulesDirs = glob.sync('**/node_modules', {
- cwd: currentCloudBackendDir,
- absolute: true,
- });
- for (const nodeModulesPath of nodeModulesDirs) {
- if (fs.existsSync(nodeModulesPath)) {
- fs.removeSync(nodeModulesPath);
- }
- }
-};
-
/**
* Update amplify-meta.json and backend-config.json
*/
diff --git a/packages/amplify-cli/src/index.ts b/packages/amplify-cli/src/index.ts
index 8b1f97e722d..6dfe0674fa0 100644
--- a/packages/amplify-cli/src/index.ts
+++ b/packages/amplify-cli/src/index.ts
@@ -86,7 +86,7 @@ export const run = async (startTime: number): Promise => {
ensureFilePermissions(pathManager.getAWSCredentialsFilePath());
ensureFilePermissions(pathManager.getAWSConfigFilePath());
- let verificationResult = verifyInput(pluginPlatform, input);
+ let verificationResult = await verifyInput(pluginPlatform, input);
// invalid input might be because plugin platform might have been updated,
// scan and try again
@@ -96,7 +96,7 @@ export const run = async (startTime: number): Promise => {
}
pluginPlatform = await scan();
input = getCommandLineInput(pluginPlatform);
- verificationResult = verifyInput(pluginPlatform, input);
+ verificationResult = await verifyInput(pluginPlatform, input);
}
if (!verificationResult.verified) {
if (verificationResult.helpCommandAvailable) {
@@ -209,14 +209,14 @@ async function sigIntHandler(context: Context): Promise {
*/
export const execute = async (input: CLIInput): Promise => {
let pluginPlatform = await getPluginPlatform();
- let verificationResult = verifyInput(pluginPlatform, input);
+ let verificationResult = await verifyInput(pluginPlatform, input);
if (!verificationResult.verified) {
if (verificationResult.message) {
printer.warn(verificationResult.message);
}
pluginPlatform = await scan();
- verificationResult = verifyInput(pluginPlatform, input);
+ verificationResult = await verifyInput(pluginPlatform, input);
}
if (!verificationResult.verified) {
@@ -257,5 +257,4 @@ export const executeAmplifyCommand = async (context: Context): Promise =>
}
};
-// bump version to 12.1.0
-//
+// bump version to 12.14.0
diff --git a/packages/amplify-cli/src/init-steps/preInitSetup.ts b/packages/amplify-cli/src/init-steps/preInitSetup.ts
index 1f5eea6654c..80b89aabbe7 100644
--- a/packages/amplify-cli/src/init-steps/preInitSetup.ts
+++ b/packages/amplify-cli/src/init-steps/preInitSetup.ts
@@ -3,6 +3,19 @@ import { execSync } from 'child_process';
import * as fs from 'fs-extra';
import * as url from 'url';
import { generateLocalEnvInfoFile } from './s9-onSuccess';
+import { printer, prompter } from '@aws-amplify/amplify-prompts';
+import { isNewProject } from './s0-analyzeProject';
+
+export const getPreInitSetup = (recommendGen2: boolean) => {
+ if (recommendGen2) {
+ return async (context) => {
+ await gen2Recommendation(context);
+ await preInitSetup(context);
+ };
+ } else {
+ return preInitSetup;
+ }
+};
/**
* Executes before init
@@ -22,6 +35,42 @@ export const preInitSetup = async (context: $TSContext): Promise<$TSContext> =>
return context;
};
+/**
+ * recommend using Gen 2 or continue with Gen 1.
+ * ask for why they are using Gen 1 and store the answer in project-config
+ */
+export const gen2Recommendation = async (context: $TSContext): Promise<$TSContext> => {
+ if (!isNewProject(context)) {
+ return context;
+ }
+ printer.warn(
+ 'For new projects, we recommend starting with AWS Amplify Gen 2, our new code-first developer experience. Get started at https://docs.amplify.aws/react/start/quickstart/',
+ );
+
+ const continueWithGen1 = await prompter.confirmContinue('Do you want to continue with Amplify Gen 1?');
+
+ if (!continueWithGen1) {
+ process.exit(0);
+ }
+
+ const whyContinueWithGen1 = await prompter.pick(
+ 'Why would you like to use Amplify Gen 1?',
+ [
+ 'I am a current Gen 1 user',
+ 'Gen 2 is missing features I need from Gen 1',
+ 'I find the Gen 1 CLI easier to use',
+ 'Prefer not to answer',
+ ],
+ { initial: 3 },
+ );
+
+ context.exeInfo.projectConfig = {
+ whyContinueWithGen1,
+ };
+
+ return context;
+};
+
/**
* Checks whether a url is a valid remote github repository
*
diff --git a/packages/amplify-cli/src/init-steps/s0-analyzeProject.ts b/packages/amplify-cli/src/init-steps/s0-analyzeProject.ts
index b93d4f59caa..261845048a7 100644
--- a/packages/amplify-cli/src/init-steps/s0-analyzeProject.ts
+++ b/packages/amplify-cli/src/init-steps/s0-analyzeProject.ts
@@ -99,12 +99,27 @@ export const analyzeProject = async (context: $TSContext): Promise<$TSContext> =
}
const projectPath = process.cwd();
context.exeInfo.isNewProject = isNewProject(context);
+ context.exeInfo.forcePush = !!context?.parameters?.options?.forcePush;
const projectName = await getProjectName(context);
if (context.exeInfo.isNewProject && context.parameters.command !== 'env') {
await displayAndSetDefaults(context, projectPath, projectName);
}
+ if (
+ !context.exeInfo.isNewProject &&
+ context.parameters.options &&
+ context.parameters.options.yes &&
+ !context.exeInfo.inputParams.amplify?.envName
+ ) {
+ throw new AmplifyError('ProjectInitError', {
+ message: `Amplify project ${stateManager.getAppID()} is already initialized for environment ${stateManager.getCurrentEnvName(
+ projectPath,
+ )}`,
+ resolution: 'To create a new environment run `amplify add env`',
+ });
+ }
+
const envName = await getEnvName(context);
let defaultEditor = getDefaultEditor();
@@ -137,6 +152,7 @@ export const analyzeProject = async (context: $TSContext): Promise<$TSContext> =
const setProjectConfig = (context: $TSContext, projectName: string): void => {
context.exeInfo.isNewProject = isNewProject(context);
context.exeInfo.projectConfig = {
+ ...context.exeInfo.projectConfig,
projectName,
version: amplifyCLIConstants.CURRENT_PROJECT_CONFIG_VERSION,
};
@@ -310,7 +326,7 @@ const isNewEnv = (envName: string): boolean => {
return !allEnvs.includes(envName);
};
-const isNewProject = (context: $TSContext): boolean => {
+export const isNewProject = (context: $TSContext): boolean => {
let newProject = true;
const projectPath = process.cwd();
const projectConfigFilePath = context.amplify.pathManager.getProjectConfigFilePath(projectPath);
diff --git a/packages/amplify-cli/src/init-steps/s9-onSuccess.ts b/packages/amplify-cli/src/init-steps/s9-onSuccess.ts
index a5d49324065..4a88d76d67c 100644
--- a/packages/amplify-cli/src/init-steps/s9-onSuccess.ts
+++ b/packages/amplify-cli/src/init-steps/s9-onSuccess.ts
@@ -64,7 +64,14 @@ export const onSuccess = async (context: $TSContext): Promise => {
}
await FeatureFlags.ensureDefaultFeatureFlags(true);
- const result = await prompter.yesOrNo('Help improve Amplify CLI by sharing non sensitive configurations on failures', false);
+ const result = await prompter.yesOrNo('Help improve Amplify CLI by sharing non-sensitive project configurations on failures', false);
+ printer.info(`
+ ${
+ result
+ ? 'Thank you for helping us improve Amplify CLI!'
+ : 'You can always opt-in by running "amplify configure --share-project-config-on"'
+ }`);
+
const actualResult = context.exeInfo.inputParams.yes ? undefined : result;
DebugConfig.Instance.setAndWriteShareProject(actualResult);
}
@@ -86,16 +93,7 @@ export const onSuccess = async (context: $TSContext): Promise => {
await initializeEnv(context, currentAmplifyMeta);
if (!context.parameters.options?.app) {
- printWelcomeMessage(context);
- }
-
- const appId = currentAmplifyMeta?.providers?.awscloudformation?.AmplifyAppId;
-
- if (!appId) {
- printer.warn('The maximum number of apps that you can create with Amplify in this region has likely been reached:');
- printer.info('For more information on Amplify Service Quotas, see:');
- printer.info('https://docs.aws.amazon.com/general/latest/gr/amplify.html#service-quotas-amplify');
- printer.blankLine();
+ printWelcomeMessage();
}
};
@@ -219,20 +217,18 @@ const generateHooksSampleDirectory = (context: $TSContext): void => {
stateManager.setSampleHooksDir(projectPath, sampleHookScriptsDirPath);
};
-const printWelcomeMessage = (context: $TSContext): void => {
- context.print.info('');
- context.print.success('Your project has been successfully initialized and connected to the cloud!');
- context.print.info('');
- context.print.success('Some next steps:');
- context.print.info('"amplify status" will show you what you\'ve added already and if it\'s locally configured or deployed');
- context.print.info('"amplify add " will allow you to add features like user login or a backend API');
- context.print.info('"amplify push" will build all your local backend resources and provision it in the cloud');
- context.print.info('"amplify console" to open the Amplify Console and view your project status');
- context.print.info(
- '"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud',
- );
- context.print.info('');
- context.print.success('Pro tip:');
- context.print.info('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything');
- context.print.info('');
+const printWelcomeMessage = (): void => {
+ printer.success('Your project has been successfully initialized and connected to the cloud!');
+ printer.info('Some next steps:', 'green');
+ printer.info(`
+"amplify status" will show you what you've added already and if it's locally configured or deployed
+"amplify add " will allow you to add features like user login or a backend API
+"amplify push" will build all your local backend resources and provision it in the cloud
+"amplify console" to open the Amplify Console and view your project status
+"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud
+`);
+ printer.blankLine();
+ printer.info('Pro tip:', 'green');
+ printer.info('Try "amplify add api" to create a backend API and then "amplify push" to deploy everything');
+ printer.blankLine();
};
diff --git a/packages/amplify-cli/src/input-manager.ts b/packages/amplify-cli/src/input-manager.ts
index 815484515e0..e1a22519fcc 100644
--- a/packages/amplify-cli/src/input-manager.ts
+++ b/packages/amplify-cli/src/input-manager.ts
@@ -1,9 +1,10 @@
// normalize command line arguments, allow verb / noun place switch
-import { constants, PluginPlatform, pathManager, stateManager, commandsInfo } from '@aws-amplify/amplify-cli-core';
+import { constants, PluginPlatform, pathManager, stateManager, commandsInfo, getPackageManager } from '@aws-amplify/amplify-cli-core';
import { getPluginsWithName, getAllPluginNames } from './plugin-manager';
import { InputVerificationResult } from './domain/input-verification-result';
import { insertAmplifyIgnore } from './extensions/amplify-helpers/git-manager';
import { CLIInput } from './domain/command-input';
+import { EOL } from 'os';
export function getCommandLineInput(pluginPlatform: PluginPlatform): CLIInput {
const result = new CLIInput(process.argv);
@@ -139,7 +140,7 @@ function normalizeInput(input: CLIInput): CLIInput {
return input;
}
-export function verifyInput(pluginPlatform: PluginPlatform, input: CLIInput): InputVerificationResult {
+export async function verifyInput(pluginPlatform: PluginPlatform, input: CLIInput): Promise {
const result = new InputVerificationResult();
// Normalize status command options
@@ -235,7 +236,12 @@ export function verifyInput(pluginPlatform: PluginPlatform, input: CLIInput): In
commandString += ' ' + input.subCommands!.join(' ');
}
- result.message = `The Amplify CLI can NOT find command: ${commandString}`;
+ const packageManager = (await getPackageManager())?.packageManager ?? 'npm';
+ const executeCommand = packageManager === 'npm' ? 'npx' : `${packageManager} dlx`;
+
+ const amplifyGen2Message = `If you are trying to use Amplify Gen 2, install the @aws-amplify/backend-cli package or execute using the package name directly:${EOL}${executeCommand} @aws-amplify/backend-cli${commandString}`;
+
+ result.message = `The Amplify CLI can NOT find command: ${commandString}${EOL}${EOL}${amplifyGen2Message}`;
}
} else {
result.verified = false;
diff --git a/packages/amplify-console-hosting/CHANGELOG.md b/packages/amplify-console-hosting/CHANGELOG.md
index 4bd3a19865f..0114babaae8 100644
--- a/packages/amplify-console-hosting/CHANGELOG.md
+++ b/packages/amplify-console-hosting/CHANGELOG.md
@@ -3,6 +3,231 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.5.35](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.34...@aws-amplify/amplify-console-hosting@2.5.35) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.34](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.33...@aws-amplify/amplify-console-hosting@2.5.34) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.33](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.32...@aws-amplify/amplify-console-hosting@2.5.33) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.32](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.31...@aws-amplify/amplify-console-hosting@2.5.32) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.31](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.30...@aws-amplify/amplify-console-hosting@2.5.31) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.30](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.29...@aws-amplify/amplify-console-hosting@2.5.30) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.29](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.28...@aws-amplify/amplify-console-hosting@2.5.29) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.28](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.27...@aws-amplify/amplify-console-hosting@2.5.28) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.27](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.26...@aws-amplify/amplify-console-hosting@2.5.27) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.26](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.25...@aws-amplify/amplify-console-hosting@2.5.26) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.25](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.24...@aws-amplify/amplify-console-hosting@2.5.25) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.24](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.23...@aws-amplify/amplify-console-hosting@2.5.24) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.21...@aws-amplify/amplify-console-hosting@2.5.23) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.5.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.21...@aws-amplify/amplify-console-hosting@2.5.22) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.20...@aws-amplify/amplify-console-hosting@2.5.21) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.19...@aws-amplify/amplify-console-hosting@2.5.20) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.18...@aws-amplify/amplify-console-hosting@2.5.19) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.17...@aws-amplify/amplify-console-hosting@2.5.18) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.16...@aws-amplify/amplify-console-hosting@2.5.17) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.15...@aws-amplify/amplify-console-hosting@2.5.16) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.14...@aws-amplify/amplify-console-hosting@2.5.15) (2023-08-17)
+
+
+### Bug Fixes
+
+* **amplify-console-hosting:** add missing proxy support ([#12510](https://github.com/aws-amplify/amplify-cli/issues/12510)) ([40d24f5](https://github.com/aws-amplify/amplify-cli/commit/40d24f5ce268f518e7c2714b9e2a2d51c5e326c3))
+
+
+
+
+
+## [2.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.13...@aws-amplify/amplify-console-hosting@2.5.14) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.12...@aws-amplify/amplify-console-hosting@2.5.13) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.11...@aws-amplify/amplify-console-hosting@2.5.12) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.10...@aws-amplify/amplify-console-hosting@2.5.11) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
+## [2.5.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.9...@aws-amplify/amplify-console-hosting@2.5.10) (2023-07-20)
+
+
+### Bug Fixes
+
+* avoid empty and string rejects ([#12818](https://github.com/aws-amplify/amplify-cli/issues/12818)) ([911faa7](https://github.com/aws-amplify/amplify-cli/commit/911faa767db594c516d1c3b65ee4369ad207f4f4))
+
+
+
+
+
+## [2.5.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.8...@aws-amplify/amplify-console-hosting@2.5.9) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-hosting
+
+
+
+
+
## [2.5.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-console-hosting@2.5.6...@aws-amplify/amplify-console-hosting@2.5.8) (2023-05-25)
diff --git a/packages/amplify-console-hosting/package.json b/packages/amplify-console-hosting/package.json
index bd56585efae..3319fc6ac1c 100644
--- a/packages/amplify-console-hosting/package.json
+++ b/packages/amplify-console-hosting/package.json
@@ -1,14 +1,14 @@
{
"name": "@aws-amplify/amplify-console-hosting",
- "version": "2.5.8",
+ "version": "2.5.35",
"description": "cli plugin for AWS Amplify Console hosting",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"author": "Amazon Web Services",
"license": "Apache-2.0",
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
"archiver": "^5.3.0",
"chalk": "^4.1.1",
"cli-table3": "^0.6.0",
@@ -17,7 +17,8 @@
"glob": "^7.2.0",
"inquirer": "^7.3.3",
"node-fetch": "^2.6.7",
- "ora": "^4.0.3"
+ "ora": "^4.0.3",
+ "proxy-agent": "^6.3.0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/amplify-console-hosting/src/utils/amplify-console-utils.js b/packages/amplify-console-hosting/src/utils/amplify-console-utils.js
index f0cef4e40a9..93dd998d3b2 100644
--- a/packages/amplify-console-hosting/src/utils/amplify-console-utils.js
+++ b/packages/amplify-console-hosting/src/utils/amplify-console-utils.js
@@ -1,6 +1,7 @@
-const fetch = require('node-fetch');
-const fs = require('fs-extra');
const { spinner } = require('@aws-amplify/amplify-cli-core');
+const fs = require('fs-extra');
+const fetch = require('node-fetch');
+const { ProxyAgent } = require('proxy-agent');
const DEPLOY_ARTIFACTS_MESSAGE = 'Deploying build artifacts to the Amplify Console..';
const DEPLOY_COMPLETE_MESSAGE = 'Deployment complete!';
@@ -55,7 +56,7 @@ function waitJobToSucceed(job, amplifyClient) {
return new Promise(async (resolve, reject) => {
const timeout = setTimeout(() => {
console.log('Job Timeout before succeeded');
- reject();
+ reject(new Error('Job Timeout before succeeded'));
}, 1000 * 60 * 10);
let processing = true;
try {
@@ -84,9 +85,13 @@ function waitJobToSucceed(job, amplifyClient) {
}
async function httpPutFile(filePath, url) {
+ // HTTP_PROXY & HTTPS_PROXY env vars are read automatically by ProxyAgent, but we check to see if they are set before using the proxy
+ const proxy = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
+ const proxyOption = proxy ? { agent: new ProxyAgent() } : {};
await fetch(url, {
method: 'PUT',
body: fs.readFileSync(filePath),
+ ...proxyOption,
});
}
diff --git a/packages/amplify-console-hosting/src/utils/build-utils.js b/packages/amplify-console-hosting/src/utils/build-utils.js
index fab45b6404e..131852a7aaf 100644
--- a/packages/amplify-console-hosting/src/utils/build-utils.js
+++ b/packages/amplify-console-hosting/src/utils/build-utils.js
@@ -9,7 +9,7 @@ const DIR_NOT_FOUND_ERROR_MESSAGE = 'Please ensure your build artifacts path exi
function zipFile(sourceDir, destFilePath, extraFiles) {
return new Promise((resolve, reject) => {
if (!fs.pathExistsSync(sourceDir)) {
- reject(DIR_NOT_FOUND_ERROR_MESSAGE);
+ reject(new Error(DIR_NOT_FOUND_ERROR_MESSAGE));
}
const zipFilePath = destFilePath;
const output = fs.createWriteStream(zipFilePath);
diff --git a/packages/amplify-console-integration-tests/CHANGELOG.md b/packages/amplify-console-integration-tests/CHANGELOG.md
index 049e0dc6533..9a66fbae562 100644
--- a/packages/amplify-console-integration-tests/CHANGELOG.md
+++ b/packages/amplify-console-integration-tests/CHANGELOG.md
@@ -3,6 +3,267 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.11.19](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.18...@aws-amplify/amplify-console-integration-tests@2.11.19) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.18](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.17...@aws-amplify/amplify-console-integration-tests@2.11.18) (2025-01-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.17](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.16...@aws-amplify/amplify-console-integration-tests@2.11.17) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.16](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.15...@aws-amplify/amplify-console-integration-tests@2.11.16) (2024-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.15](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.14...@aws-amplify/amplify-console-integration-tests@2.11.15) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.14](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.13...@aws-amplify/amplify-console-integration-tests@2.11.14) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.13](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.12...@aws-amplify/amplify-console-integration-tests@2.11.13) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.12](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.11...@aws-amplify/amplify-console-integration-tests@2.11.12) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.11](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.10...@aws-amplify/amplify-console-integration-tests@2.11.11) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.10](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.9...@aws-amplify/amplify-console-integration-tests@2.11.10) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.9](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.8...@aws-amplify/amplify-console-integration-tests@2.11.9) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.8](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.7...@aws-amplify/amplify-console-integration-tests@2.11.8) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.7](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.6...@aws-amplify/amplify-console-integration-tests@2.11.7) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.6](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.5...@aws-amplify/amplify-console-integration-tests@2.11.6) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.5](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.4...@aws-amplify/amplify-console-integration-tests@2.11.5) (2023-12-11)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.4](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.2...@aws-amplify/amplify-console-integration-tests@2.11.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-console-integration-tests/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-console-integration-tests/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.11.3](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.2...@aws-amplify/amplify-console-integration-tests@2.11.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.2](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.1...@aws-amplify/amplify-console-integration-tests@2.11.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.11.1](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.11.0...@aws-amplify/amplify-console-integration-tests@2.11.1) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+# [2.11.0](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.10.3...@aws-amplify/amplify-console-integration-tests@2.11.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-console-integration-tests/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-console-integration-tests/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [2.10.3](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.10.2...@aws-amplify/amplify-console-integration-tests@2.10.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.10.2](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.10.1...@aws-amplify/amplify-console-integration-tests@2.10.2) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.10.1](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.10.0...@aws-amplify/amplify-console-integration-tests@2.10.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+# [2.10.0](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.9.4...@aws-amplify/amplify-console-integration-tests@2.10.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-console-integration-tests/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [2.9.4](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.9.3...@aws-amplify/amplify-console-integration-tests@2.9.4) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.9.3](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.9.2...@aws-amplify/amplify-console-integration-tests@2.9.3) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.9.2](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.9.1...@aws-amplify/amplify-console-integration-tests@2.9.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+## [2.9.1](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.9.0...@aws-amplify/amplify-console-integration-tests@2.9.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-console-integration-tests
+
+
+
+
+
+# [2.9.0](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.8.4...@aws-amplify/amplify-console-integration-tests@2.9.0) (2023-07-20)
+
+
+### Bug Fixes
+
+* ensure AWS_REGION matches CLI_REGION in all tests ([#12837](https://github.com/aws-amplify/amplify-console-integration-tests/issues/12837)) ([7be43e4](https://github.com/aws-amplify/amplify-console-integration-tests/commit/7be43e41ded3bf09fd20cd9d9b95467491344cbe))
+* fix yarn path ([#12769](https://github.com/aws-amplify/amplify-console-integration-tests/issues/12769)) ([dca98aa](https://github.com/aws-amplify/amplify-console-integration-tests/commit/dca98aa35e544dce4cf0ac9f340919b87041e65f))
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-console-integration-tests/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-console-integration-tests/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [2.8.4](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.8.3...@aws-amplify/amplify-console-integration-tests@2.8.4) (2023-06-13)
+
+
+### Bug Fixes
+
+* console integration tests ([#12748](https://github.com/aws-amplify/amplify-console-integration-tests/issues/12748)) ([e177b13](https://github.com/aws-amplify/amplify-console-integration-tests/commit/e177b1396aac2509176fea1d7fe77f5f97db0720))
+
+
+
+
+
## [2.8.3](https://github.com/aws-amplify/amplify-console-integration-tests/compare/@aws-amplify/amplify-console-integration-tests@2.8.1...@aws-amplify/amplify-console-integration-tests@2.8.3) (2023-05-25)
diff --git a/packages/amplify-console-integration-tests/__tests__/consoleHosting.test.ts b/packages/amplify-console-integration-tests/__tests__/consoleHosting.test.ts
index 41c44aba031..dbf63d99706 100644
--- a/packages/amplify-console-integration-tests/__tests__/consoleHosting.test.ts
+++ b/packages/amplify-console-integration-tests/__tests__/consoleHosting.test.ts
@@ -42,18 +42,14 @@ describe('amplify console add hosting', () => {
// Manual tests
it('add / publish / configure/ serve /remove hosting for manual deployment should succeed', async () => {
- try {
- await addManualHosting(projRoot);
- expect(fs.existsSync(path.join(projRoot, 'amplify', 'backend', 'hosting', 'amplifyhosting'))).toBe(true);
- const type = loadTypeFromTeamProviderInfo(projRoot, ORIGINAL_ENV);
- expect(type).toBe(TYPE_MANUAL);
- npmInstall(projRoot);
- await amplifyPublish(projRoot);
- await removeHosting(projRoot);
- await amplifyPush(projRoot);
- } catch (err) {
- throw err;
- }
+ await addManualHosting(projRoot);
+ expect(fs.existsSync(path.join(projRoot, 'amplify', 'backend', 'hosting', 'amplifyhosting'))).toBe(true);
+ const type = loadTypeFromTeamProviderInfo(projRoot, ORIGINAL_ENV);
+ expect(type).toBe(TYPE_MANUAL);
+ npmInstall(projRoot);
+ await amplifyPublish(projRoot);
+ await removeHosting(projRoot);
+ await amplifyPush(projRoot);
});
it('when hosting is enabled, add new env should be able to deploy frontend successfully', async () => {
diff --git a/packages/amplify-console-integration-tests/__tests__/pullAndInit.test.ts b/packages/amplify-console-integration-tests/__tests__/pullAndInit.test.ts
index d6caa59b7b8..f0ed8c8c026 100644
--- a/packages/amplify-console-integration-tests/__tests__/pullAndInit.test.ts
+++ b/packages/amplify-console-integration-tests/__tests__/pullAndInit.test.ts
@@ -134,7 +134,7 @@ describe('amplify console build', () => {
const originalProjectDirPath = await util.createNewProjectDir('console-original');
await headlessInit(originalProjectDirPath, amplifyParam, providersParam, codegenParam);
expect(checkAmplifyFolderStructure(originalProjectDirPath)).toBeTruthy();
- let originalTeamProviderInfo = getTeamProviderInfo(originalProjectDirPath);
+ const originalTeamProviderInfo = getTeamProviderInfo(originalProjectDirPath);
expect(originalTeamProviderInfo).toBeDefined();
expect(originalTeamProviderInfo['devteama']).toBeDefined();
@@ -153,7 +153,7 @@ describe('amplify console build', () => {
};
await headlessInit(clonedProjectDirPath, amplifyParam, providersParam, codegenParam);
expect(checkAmplifyFolderStructure(clonedProjectDirPath)).toBeTruthy();
- let clonedTeamProviderInfo = getTeamProviderInfo(clonedProjectDirPath);
+ const clonedTeamProviderInfo = getTeamProviderInfo(clonedProjectDirPath);
expect(clonedTeamProviderInfo).toBeDefined();
expect(clonedTeamProviderInfo['devteamb']).toBeDefined();
@@ -246,7 +246,7 @@ describe('amplify app console tests', () => {
expect(authTeamInfo).not.toHaveProperty('hostedUIProviderCreds');
// with frontend
- const frontendConfig = deleteAmplifyDir(projRoot);
+ deleteAmplifyDir(projRoot);
await headlessPull(
projRoot,
{ envName, appId },
diff --git a/packages/amplify-console-integration-tests/package.json b/packages/amplify-console-integration-tests/package.json
index 2c18f7222b2..de31660fb2e 100644
--- a/packages/amplify-console-integration-tests/package.json
+++ b/packages/amplify-console-integration-tests/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-console-integration-tests",
- "version": "2.8.3",
+ "version": "2.11.19",
"description": "",
"repository": {
"type": "git",
@@ -21,10 +21,10 @@
"setup-profile": "ts-node ./src/setup-profile.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-e2e-core": "5.0.3",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-e2e-core": "5.7.1",
"@types/ini": "^1.3.30",
- "aws-sdk": "^2.1354.0",
+ "aws-sdk": "^2.1464.0",
"dotenv": "^8.2.0",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
diff --git a/packages/amplify-console-integration-tests/src/setup-tests.ts b/packages/amplify-console-integration-tests/src/setup-tests.ts
index 40c28754c89..234192392e6 100644
--- a/packages/amplify-console-integration-tests/src/setup-tests.ts
+++ b/packages/amplify-console-integration-tests/src/setup-tests.ts
@@ -9,3 +9,13 @@ removeYarnPaths();
const JEST_TIMEOUT = 1000 * 60 * 60; // 1 hour
jest.setTimeout(JEST_TIMEOUT);
+
+beforeEach(async () => {
+ if (process.env.CLI_REGION) {
+ console.log(`CLI_REGION set to: ${process.env.CLI_REGION}. Overwriting AWS_REGION and AWS_DEFAULT_REGION`);
+ process.env.AWS_REGION = process.env.CLI_REGION;
+ process.env.AWS_DEFAULT_REGION = process.env.CLI_REGION;
+ } else {
+ console.log('No CLI_REGION variable found');
+ }
+});
diff --git a/packages/amplify-container-hosting/CHANGELOG.md b/packages/amplify-container-hosting/CHANGELOG.md
index cccae56b8e6..4e76f4b95bb 100644
--- a/packages/amplify-container-hosting/CHANGELOG.md
+++ b/packages/amplify-container-hosting/CHANGELOG.md
@@ -3,6 +3,272 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.8.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.14...@aws-amplify/amplify-container-hosting@2.8.15) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.13...@aws-amplify/amplify-container-hosting@2.8.14) (2025-01-16)
+
+
+### Reverts
+
+* Revert "chore: cateogry-api + codegen version bump (#14048)" (#14049) ([5a0cdbf](https://github.com/aws-amplify/amplify-cli/commit/5a0cdbfa46856da320323923a4336d6ba60d82b9)), closes [#14048](https://github.com/aws-amplify/amplify-cli/issues/14048) [#14049](https://github.com/aws-amplify/amplify-cli/issues/14049)
+
+
+
+
+
+## [2.8.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.12...@aws-amplify/amplify-container-hosting@2.8.13) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.11...@aws-amplify/amplify-container-hosting@2.8.12) (2024-08-06)
+
+
+### Bug Fixes
+
+* update awaiter s3 key ([#13872](https://github.com/aws-amplify/amplify-cli/issues/13872)) ([dacfab7](https://github.com/aws-amplify/amplify-cli/commit/dacfab73fcc53586b873f99e149d44c390b2d76f))
+
+
+
+
+
+## [2.8.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.10...@aws-amplify/amplify-container-hosting@2.8.11) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.9...@aws-amplify/amplify-container-hosting@2.8.10) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.8...@aws-amplify/amplify-container-hosting@2.8.9) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.7...@aws-amplify/amplify-container-hosting@2.8.8) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.6...@aws-amplify/amplify-container-hosting@2.8.7) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.5...@aws-amplify/amplify-container-hosting@2.8.6) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.4...@aws-amplify/amplify-container-hosting@2.8.5) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.3...@aws-amplify/amplify-container-hosting@2.8.4) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.2...@aws-amplify/amplify-container-hosting@2.8.3) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.1...@aws-amplify/amplify-container-hosting@2.8.2) (2024-03-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.8.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.8.0...@aws-amplify/amplify-container-hosting@2.8.1) (2023-12-16)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+# [2.8.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.6...@aws-amplify/amplify-container-hosting@2.8.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [2.7.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.4...@aws-amplify/amplify-container-hosting@2.7.6) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.7.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.4...@aws-amplify/amplify-container-hosting@2.7.5) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.7.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.3...@aws-amplify/amplify-container-hosting@2.7.4) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.7.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.2...@aws-amplify/amplify-container-hosting@2.7.3) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.7.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.1...@aws-amplify/amplify-container-hosting@2.7.2) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.7.0...@aws-amplify/amplify-container-hosting@2.7.1) (2023-10-03)
+
+
+### Bug Fixes
+
+* update api category and codegen to capture high-priority bug-fixes ([3836b90](https://github.com/aws-amplify/amplify-cli/commit/3836b90b3f9ccd654d9c1b61a4b83c9c4712290c))
+
+
+
+
+
+# [2.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.16...@aws-amplify/amplify-container-hosting@2.7.0) (2023-09-22)
+
+
+### Features
+
+* support codegen and modelgen commands in non-amplify directories ([#13245](https://github.com/aws-amplify/amplify-cli/issues/13245)) ([85dd5cb](https://github.com/aws-amplify/amplify-cli/commit/85dd5cb6b33d8df41e35c2cbcf3b3b0e390b1af0))
+
+
+
+
+
+## [2.6.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.15...@aws-amplify/amplify-container-hosting@2.6.16) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.14...@aws-amplify/amplify-container-hosting@2.6.15) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.13...@aws-amplify/amplify-container-hosting@2.6.14) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.12...@aws-amplify/amplify-container-hosting@2.6.13) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.11...@aws-amplify/amplify-container-hosting@2.6.12) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.10...@aws-amplify/amplify-container-hosting@2.6.11) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.9...@aws-amplify/amplify-container-hosting@2.6.10) (2023-07-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
+## [2.6.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.8...@aws-amplify/amplify-container-hosting@2.6.9) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-container-hosting
+
+
+
+
+
## [2.6.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-container-hosting@2.6.6...@aws-amplify/amplify-container-hosting@2.6.8) (2023-05-25)
diff --git a/packages/amplify-container-hosting/package.json b/packages/amplify-container-hosting/package.json
index 5978cc0afa5..da2475dc858 100644
--- a/packages/amplify-container-hosting/package.json
+++ b/packages/amplify-container-hosting/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-container-hosting",
- "version": "2.6.8",
+ "version": "2.8.15",
"description": "amplify-cli hosting plugin for containers",
"repository": {
"type": "git",
@@ -26,9 +26,9 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-category-api": "^5.4.1",
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-environment-parameters": "1.6.3",
+ "@aws-amplify/amplify-category-api": "^5.12.10",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-environment-parameters": "1.9.16",
"fs-extra": "^8.1.0",
"inquirer": "^7.3.3",
"mime-types": "^2.1.26",
diff --git a/packages/amplify-dotnet-function-runtime-provider/CHANGELOG.md b/packages/amplify-dotnet-function-runtime-provider/CHANGELOG.md
index 3c47f4652a4..88e2a1ac9bb 100644
--- a/packages/amplify-dotnet-function-runtime-provider/CHANGELOG.md
+++ b/packages/amplify-dotnet-function-runtime-provider/CHANGELOG.md
@@ -3,6 +3,236 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.1.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.1.0...amplify-dotnet-function-runtime-provider@2.1.1) (2025-01-30)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+# [2.1.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.29...amplify-dotnet-function-runtime-provider@2.1.0) (2025-01-02)
+
+
+### Features
+
+* lambda dotnet 8 support ([#14026](https://github.com/aws-amplify/amplify-cli/issues/14026)) ([540bfe1](https://github.com/aws-amplify/amplify-cli/commit/540bfe1187907609c3c813e1208c12b6a2a6ac6c))
+
+
+
+
+
+## [2.0.29](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.28...amplify-dotnet-function-runtime-provider@2.0.29) (2024-08-02)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.28](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.27...amplify-dotnet-function-runtime-provider@2.0.28) (2024-06-27)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.27](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.26...amplify-dotnet-function-runtime-provider@2.0.27) (2024-06-20)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.26](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.25...amplify-dotnet-function-runtime-provider@2.0.26) (2024-06-06)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.25](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.24...amplify-dotnet-function-runtime-provider@2.0.25) (2024-05-24)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.24](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.23...amplify-dotnet-function-runtime-provider@2.0.24) (2024-05-07)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.23](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.22...amplify-dotnet-function-runtime-provider@2.0.23) (2024-04-18)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.22](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.21...amplify-dotnet-function-runtime-provider@2.0.22) (2024-04-15)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.21](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.20...amplify-dotnet-function-runtime-provider@2.0.21) (2024-03-29)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.20](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.19...amplify-dotnet-function-runtime-provider@2.0.20) (2024-03-06)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.19](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.18...amplify-dotnet-function-runtime-provider@2.0.19) (2023-12-11)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.18](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.16...amplify-dotnet-function-runtime-provider@2.0.18) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.0.17](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.16...amplify-dotnet-function-runtime-provider@2.0.17) (2023-11-08)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.16](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.15...amplify-dotnet-function-runtime-provider@2.0.16) (2023-11-08)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.15](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.14...amplify-dotnet-function-runtime-provider@2.0.15) (2023-10-12)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.14](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.13...amplify-dotnet-function-runtime-provider@2.0.14) (2023-10-05)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.13](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.12...amplify-dotnet-function-runtime-provider@2.0.13) (2023-10-03)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.12](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.11...amplify-dotnet-function-runtime-provider@2.0.12) (2023-09-22)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.11](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.10...amplify-dotnet-function-runtime-provider@2.0.11) (2023-08-31)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.10](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.9...amplify-dotnet-function-runtime-provider@2.0.10) (2023-08-17)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.9](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.8...amplify-dotnet-function-runtime-provider@2.0.9) (2023-08-09)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.8](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.7...amplify-dotnet-function-runtime-provider@2.0.8) (2023-07-28)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.7](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.6...amplify-dotnet-function-runtime-provider@2.0.7) (2023-07-27)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.6](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.5...amplify-dotnet-function-runtime-provider@2.0.6) (2023-07-24)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.5](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.4...amplify-dotnet-function-runtime-provider@2.0.5) (2023-07-20)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
+## [2.0.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.3...amplify-dotnet-function-runtime-provider@2.0.4) (2023-06-13)
+
+**Note:** Version bump only for package amplify-dotnet-function-runtime-provider
+
+
+
+
+
## [2.0.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-dotnet-function-runtime-provider@2.0.1...amplify-dotnet-function-runtime-provider@2.0.3) (2023-05-25)
diff --git a/packages/amplify-dotnet-function-runtime-provider/amplify-plugin.json b/packages/amplify-dotnet-function-runtime-provider/amplify-plugin.json
index 1995d5169cf..8de54cf6415 100644
--- a/packages/amplify-dotnet-function-runtime-provider/amplify-plugin.json
+++ b/packages/amplify-dotnet-function-runtime-provider/amplify-plugin.json
@@ -11,8 +11,8 @@
},
"runtimes": [
{
- "name": ".NET 6",
- "value": "dotnet6"
+ "name": ".NET 8",
+ "value": "dotnet8"
}
]
}
diff --git a/packages/amplify-dotnet-function-runtime-provider/package.json b/packages/amplify-dotnet-function-runtime-provider/package.json
index b77249a5754..8c0d2675012 100644
--- a/packages/amplify-dotnet-function-runtime-provider/package.json
+++ b/packages/amplify-dotnet-function-runtime-provider/package.json
@@ -1,6 +1,6 @@
{
"name": "amplify-dotnet-function-runtime-provider",
- "version": "2.0.3",
+ "version": "2.1.1",
"description": "Provides functionality related to functions in .NET on AWS",
"repository": {
"type": "git",
@@ -22,9 +22,9 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-function-plugin-interface": "1.10.2",
- "@aws-amplify/amplify-prompts": "2.7.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-function-plugin-interface": "1.12.1",
+ "@aws-amplify/amplify-prompts": "2.8.6",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
diff --git a/packages/amplify-dotnet-function-runtime-provider/src/constants.ts b/packages/amplify-dotnet-function-runtime-provider/src/constants.ts
index 5cae3c69ea9..7a382ec25c8 100644
--- a/packages/amplify-dotnet-function-runtime-provider/src/constants.ts
+++ b/packages/amplify-dotnet-function-runtime-provider/src/constants.ts
@@ -1,4 +1,6 @@
-export const currentSupportedVersion = '6.0';
-export const dotnet6 = 'dotnet6';
+// see https://aws.amazon.com/blogs/compute/introducing-the-net-8-runtime-for-aws-lambda
+// https://docs.aws.amazon.com/lambda/latest/dg/lambda-csharp.html
+export const currentSupportedVersion = '8.0';
+export const dotnet8 = 'dotnet8';
export const handlerMethodName = 'LambdaHandler';
export const executableName = 'dotnet';
diff --git a/packages/amplify-dotnet-function-runtime-provider/src/index.ts b/packages/amplify-dotnet-function-runtime-provider/src/index.ts
index e3079905d6c..40f867b6a06 100644
--- a/packages/amplify-dotnet-function-runtime-provider/src/index.ts
+++ b/packages/amplify-dotnet-function-runtime-provider/src/index.ts
@@ -1,5 +1,5 @@
import { FunctionRuntimeContributorFactory } from '@aws-amplify/amplify-function-plugin-interface';
-import { dotnet6 } from './constants';
+import { dotnet8 } from './constants';
import { detectDotNet } from './utils/detect';
import { build } from './utils/build';
import { packageAssemblies } from './utils/package';
@@ -10,14 +10,14 @@ export const functionRuntimeContributorFactory: FunctionRuntimeContributorFactor
checkDependencies: detectDotNet,
contribute: async (contributionRequest) => {
switch (contributionRequest.selection) {
- case dotnet6:
+ case dotnet8:
return {
runtime: {
- name: '.NET 6',
- value: dotnet6,
- cloudTemplateValue: dotnet6,
+ name: '.NET 8',
+ value: dotnet8,
+ cloudTemplateValue: dotnet8,
defaultHandler: `${contributionRequest.contributionContext.resourceName}::${contributionRequest.contributionContext.resourceName}.${contributionRequest.contributionContext.functionName}::LambdaHandler`,
- layerExecutablePath: dotnet6,
+ layerExecutablePath: dotnet8,
},
};
default:
diff --git a/packages/amplify-dotnet-function-runtime-provider/src/utils/detect.ts b/packages/amplify-dotnet-function-runtime-provider/src/utils/detect.ts
index ccab26c2f06..2635213cc6d 100644
--- a/packages/amplify-dotnet-function-runtime-provider/src/utils/detect.ts
+++ b/packages/amplify-dotnet-function-runtime-provider/src/utils/detect.ts
@@ -21,7 +21,7 @@ export const detectDotNet = async (): Promise => {
if (sdkResult.exitCode !== 0) {
throw new Error(`${executableName} failed SDK detection, exit code was ${sdkResult.exitCode}`);
}
- const requiredSdkRegex = /^6\.0/m;
+ const requiredSdkRegex = /^8\.0/m;
const sdkInstalled = installedSdks && installedSdks.match(requiredSdkRegex);
const toolResult = execa.sync(executableName, ['tool', 'list', '--global']);
@@ -37,13 +37,13 @@ export const detectDotNet = async (): Promise => {
if (installedToolList.match(/^amazon\.lambda\.tools/m)) {
toolInstalled = true;
}
- const requiredTestToolVersionRegex = /^amazon\.lambda\.testtool-6\.0/m;
+ const requiredTestToolVersionRegex = /^amazon\.lambda\.testtool-8\.0/m;
if (installedToolList.match(requiredTestToolVersionRegex)) {
testToolInstalled = true;
}
}
- // Verify that a dotnet 6 SDK and the dotnet Lambda tools is installed locally
+ // Verify that a dotnet 8 SDK and the dotnet Lambda tools is installed locally
if (sdkInstalled && toolInstalled && testToolInstalled) {
return {
hasRequiredDependencies: true,
@@ -54,7 +54,7 @@ export const detectDotNet = async (): Promise => {
errorMessage: 'Unable to detect required dependencies:\n',
};
if (!sdkInstalled) {
- result.errorMessage += '- The .NET 6 SDK must be installed. It can be installed from https://dotnet.microsoft.com/download\n';
+ result.errorMessage += '- The .NET 8 SDK must be installed. It can be installed from https://dotnet.microsoft.com/download\n';
}
if (!toolInstalled) {
result.errorMessage +=
@@ -62,7 +62,7 @@ export const detectDotNet = async (): Promise => {
}
if (!testToolInstalled) {
result.errorMessage +=
- '- The Amazon.Lambda.TestTool-6.0 global tool must be installed. Please install by running "dotnet tool install -g Amazon.Lambda.TestTool-6.0".\n';
+ '- The Amazon.Lambda.TestTool-8.0 global tool must be installed. Please install by running "dotnet tool install -g Amazon.Lambda.TestTool-8.0".\n';
}
return result;
}
diff --git a/packages/amplify-dotnet-function-runtime-provider/src/utils/invoke.ts b/packages/amplify-dotnet-function-runtime-provider/src/utils/invoke.ts
index 2dd3172457e..94fc724df13 100644
--- a/packages/amplify-dotnet-function-runtime-provider/src/utils/invoke.ts
+++ b/packages/amplify-dotnet-function-runtime-provider/src/utils/invoke.ts
@@ -14,7 +14,7 @@ export const invoke = async (request: InvocationRequest): Promise => {
tempDir = fs.mkdtempSync(path.join(request.srcRoot, 'amplify'));
eventFile = path.join(tempDir, 'event.json');
fs.writeFileSync(eventFile, request.event);
- const lambdaTestTool = 'lambda-test-tool-6.0';
+ const lambdaTestTool = 'lambda-test-tool-8.0';
const execPromise = execa(
executableName,
[lambdaTestTool, '--no-ui', '--function-handler', request.handler, '--payload', eventFile, '--pause-exit', 'false'],
diff --git a/packages/amplify-dotnet-function-runtime-provider/src/utils/package.ts b/packages/amplify-dotnet-function-runtime-provider/src/utils/package.ts
index 05545c445df..93a49e94087 100644
--- a/packages/amplify-dotnet-function-runtime-provider/src/utils/package.ts
+++ b/packages/amplify-dotnet-function-runtime-provider/src/utils/package.ts
@@ -14,7 +14,7 @@ export const packageAssemblies = async (request: PackageRequest, context: any):
}
const packageHash = (await context.amplify.hashDir(distPath, [])) as string;
- const framework = 'net6.0';
+ const framework = 'net8.0';
try {
const result = execa.sync(
executableName,
diff --git a/packages/amplify-dotnet-function-template-provider/CHANGELOG.md b/packages/amplify-dotnet-function-template-provider/CHANGELOG.md
index 269c7c0d794..7ab32426bb8 100644
--- a/packages/amplify-dotnet-function-template-provider/CHANGELOG.md
+++ b/packages/amplify-dotnet-function-template-provider/CHANGELOG.md
@@ -3,6 +3,242 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.7.0...@aws-amplify/amplify-dotnet-function-template-provider@2.7.1) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+# [2.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.10...@aws-amplify/amplify-dotnet-function-template-provider@2.7.0) (2025-01-02)
+
+
+### Features
+
+* lambda dotnet 8 support ([#14026](https://github.com/aws-amplify/amplify-cli/issues/14026)) ([540bfe1](https://github.com/aws-amplify/amplify-cli/commit/540bfe1187907609c3c813e1208c12b6a2a6ac6c))
+
+
+
+
+
+## [2.6.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.9...@aws-amplify/amplify-dotnet-function-template-provider@2.6.10) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.8...@aws-amplify/amplify-dotnet-function-template-provider@2.6.9) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.7...@aws-amplify/amplify-dotnet-function-template-provider@2.6.8) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.6...@aws-amplify/amplify-dotnet-function-template-provider@2.6.7) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.5...@aws-amplify/amplify-dotnet-function-template-provider@2.6.6) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.4...@aws-amplify/amplify-dotnet-function-template-provider@2.6.5) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.3...@aws-amplify/amplify-dotnet-function-template-provider@2.6.4) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.2...@aws-amplify/amplify-dotnet-function-template-provider@2.6.3) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.1...@aws-amplify/amplify-dotnet-function-template-provider@2.6.2) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.6.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.6.0...@aws-amplify/amplify-dotnet-function-template-provider@2.6.1) (2024-03-06)
+
+
+### Reverts
+
+* Revert "chore: bump data package versions (#13486)" (#13487) ([3280d40](https://github.com/aws-amplify/amplify-cli/commit/3280d40a5ab50c675b0e2b8050ad35a69c83cdc2)), closes [#13486](https://github.com/aws-amplify/amplify-cli/issues/13486) [#13487](https://github.com/aws-amplify/amplify-cli/issues/13487)
+
+
+
+
+
+# [2.6.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.23...@aws-amplify/amplify-dotnet-function-template-provider@2.6.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [2.5.23](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.21...@aws-amplify/amplify-dotnet-function-template-provider@2.5.23) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.5.22](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.21...@aws-amplify/amplify-dotnet-function-template-provider@2.5.22) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.21](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.20...@aws-amplify/amplify-dotnet-function-template-provider@2.5.21) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.20](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.19...@aws-amplify/amplify-dotnet-function-template-provider@2.5.20) (2023-10-12)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.19](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.18...@aws-amplify/amplify-dotnet-function-template-provider@2.5.19) (2023-10-05)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.18](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.17...@aws-amplify/amplify-dotnet-function-template-provider@2.5.18) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.17](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.16...@aws-amplify/amplify-dotnet-function-template-provider@2.5.17) (2023-09-22)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.16](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.15...@aws-amplify/amplify-dotnet-function-template-provider@2.5.16) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.15](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.14...@aws-amplify/amplify-dotnet-function-template-provider@2.5.15) (2023-08-17)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.13...@aws-amplify/amplify-dotnet-function-template-provider@2.5.14) (2023-08-09)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.12...@aws-amplify/amplify-dotnet-function-template-provider@2.5.13) (2023-07-28)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.11...@aws-amplify/amplify-dotnet-function-template-provider@2.5.12) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.10...@aws-amplify/amplify-dotnet-function-template-provider@2.5.11) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.9...@aws-amplify/amplify-dotnet-function-template-provider@2.5.10) (2023-07-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
+## [2.5.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.8...@aws-amplify/amplify-dotnet-function-template-provider@2.5.9) (2023-06-13)
+
+**Note:** Version bump only for package @aws-amplify/amplify-dotnet-function-template-provider
+
+
+
+
+
## [2.5.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-dotnet-function-template-provider@2.5.6...@aws-amplify/amplify-dotnet-function-template-provider@2.5.8) (2023-05-25)
diff --git a/packages/amplify-dotnet-function-template-provider/amplify-plugin.json b/packages/amplify-dotnet-function-template-provider/amplify-plugin.json
index 8ec143910c2..55520d1281f 100644
--- a/packages/amplify-dotnet-function-template-provider/amplify-plugin.json
+++ b/packages/amplify-dotnet-function-template-provider/amplify-plugin.json
@@ -7,7 +7,7 @@
"conditions": {
"provider": "awscloudformation",
"services": ["Lambda"],
- "runtime": ["dotnet6"]
+ "runtime": ["dotnet8"]
},
"templates": [
{
diff --git a/packages/amplify-dotnet-function-template-provider/package.json b/packages/amplify-dotnet-function-template-provider/package.json
index 042a27f9095..cfd53890574 100644
--- a/packages/amplify-dotnet-function-template-provider/package.json
+++ b/packages/amplify-dotnet-function-template-provider/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-dotnet-function-template-provider",
- "version": "2.5.8",
+ "version": "2.7.1",
"description": ".NET templates supplied by the Amplify Team",
"repository": {
"type": "git",
@@ -25,9 +25,9 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-function-plugin-interface": "1.10.2",
- "graphql-transformer-core": "^8.1.2"
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-function-plugin-interface": "1.12.1",
+ "graphql-transformer-core": "^8.2.13"
},
"devDependencies": {
"@types/inquirer": "^6.5.0",
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/Function.csproj.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/Function.csproj.ejs
index 856022f3673..721233e1543 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/Function.csproj.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/Function.csproj.ejs
@@ -1,6 +1,6 @@
- net6.0
+ net8.0
true
Lambda
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/aws-lambda-tools-defaults.json.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/aws-lambda-tools-defaults.json.ejs
index 7927f76fe20..728f19b43e0 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/aws-lambda-tools-defaults.json.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/Crud/aws-lambda-tools-defaults.json.ejs
@@ -11,9 +11,9 @@
"profile":"",
"region" : "",
"configuration" : "Release",
- "framework" : "net6.0",
+ "framework" : "net8.0",
"function-runtime":"props.runtime.value",
- "function-memory-size" : 256,
+ "function-memory-size" : 512,
"function-timeout" : 30,
"function-handler" : "<%= props.resourceName %>::<%= props.resourceName %>.<%= props.functionName %>::LambdaHandler"
}
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/Function.csproj.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/Function.csproj.ejs
index 5345fd6f1fe..f1d6008bd36 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/Function.csproj.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/Function.csproj.ejs
@@ -1,6 +1,6 @@
- net6.0
+ net8.0
true
Lambda
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/aws-lambda-tools-defaults.json.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/aws-lambda-tools-defaults.json.ejs
index 7927f76fe20..728f19b43e0 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/aws-lambda-tools-defaults.json.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/HelloWorld/aws-lambda-tools-defaults.json.ejs
@@ -11,9 +11,9 @@
"profile":"",
"region" : "",
"configuration" : "Release",
- "framework" : "net6.0",
+ "framework" : "net8.0",
"function-runtime":"props.runtime.value",
- "function-memory-size" : 256,
+ "function-memory-size" : 512,
"function-timeout" : 30,
"function-handler" : "<%= props.resourceName %>::<%= props.resourceName %>.<%= props.functionName %>::LambdaHandler"
}
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/Function.csproj.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/Function.csproj.ejs
index 23fb4926dee..ab40e416e97 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/Function.csproj.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/Function.csproj.ejs
@@ -1,6 +1,6 @@
- net6.0
+ net8.0
true
Lambda
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/aws-lambda-tools-defaults.json.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/aws-lambda-tools-defaults.json.ejs
index 7927f76fe20..728f19b43e0 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/aws-lambda-tools-defaults.json.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/Serverless/aws-lambda-tools-defaults.json.ejs
@@ -11,9 +11,9 @@
"profile":"",
"region" : "",
"configuration" : "Release",
- "framework" : "net6.0",
+ "framework" : "net8.0",
"function-runtime":"props.runtime.value",
- "function-memory-size" : 256,
+ "function-memory-size" : 512,
"function-timeout" : 30,
"function-handler" : "<%= props.resourceName %>::<%= props.resourceName %>.<%= props.functionName %>::LambdaHandler"
}
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/Function.csproj.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/Function.csproj.ejs
index afa478d6396..ba368ee44cb 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/Function.csproj.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/Function.csproj.ejs
@@ -1,6 +1,6 @@
- net6.0
+ net8.0
true
Lambda
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/aws-lambda-tools-defaults.json.ejs b/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/aws-lambda-tools-defaults.json.ejs
index 7927f76fe20..728f19b43e0 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/aws-lambda-tools-defaults.json.ejs
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/Trigger/aws-lambda-tools-defaults.json.ejs
@@ -11,9 +11,9 @@
"profile":"",
"region" : "",
"configuration" : "Release",
- "framework" : "net6.0",
+ "framework" : "net8.0",
"function-runtime":"props.runtime.value",
- "function-memory-size" : 256,
+ "function-memory-size" : 512,
"function-timeout" : 30,
"function-handler" : "<%= props.resourceName %>::<%= props.resourceName %>.<%= props.functionName %>::LambdaHandler"
}
diff --git a/packages/amplify-dotnet-function-template-provider/resources/lambda/global.json b/packages/amplify-dotnet-function-template-provider/resources/lambda/global.json
index 10b65be8642..502b8f67132 100644
--- a/packages/amplify-dotnet-function-template-provider/resources/lambda/global.json
+++ b/packages/amplify-dotnet-function-template-provider/resources/lambda/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "6.0.100",
+ "version": "8.0.404",
"rollForward": "latestFeature"
}
}
diff --git a/packages/amplify-dynamodb-simulator/CHANGELOG.md b/packages/amplify-dynamodb-simulator/CHANGELOG.md
index 31500f8548c..e6509295b08 100644
--- a/packages/amplify-dynamodb-simulator/CHANGELOG.md
+++ b/packages/amplify-dynamodb-simulator/CHANGELOG.md
@@ -3,6 +3,231 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [2.9.20](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.19...amplify-dynamodb-simulator@2.9.20) (2025-01-30)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.19](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.18...amplify-dynamodb-simulator@2.9.19) (2024-08-02)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.18](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.17...amplify-dynamodb-simulator@2.9.18) (2024-06-27)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.17](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.16...amplify-dynamodb-simulator@2.9.17) (2024-06-20)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.16](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.15...amplify-dynamodb-simulator@2.9.16) (2024-06-06)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.15](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.14...amplify-dynamodb-simulator@2.9.15) (2024-05-24)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.14](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.13...amplify-dynamodb-simulator@2.9.14) (2024-05-07)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.13](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.12...amplify-dynamodb-simulator@2.9.13) (2024-04-18)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.12](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.11...amplify-dynamodb-simulator@2.9.12) (2024-04-15)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.11](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.10...amplify-dynamodb-simulator@2.9.11) (2024-03-29)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.10](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.9...amplify-dynamodb-simulator@2.9.10) (2024-03-06)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.9](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.8...amplify-dynamodb-simulator@2.9.9) (2023-12-11)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.8](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.6...amplify-dynamodb-simulator@2.9.8) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [2.9.7](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.6...amplify-dynamodb-simulator@2.9.7) (2023-11-08)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.6](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.5...amplify-dynamodb-simulator@2.9.6) (2023-11-08)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.5](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.4...amplify-dynamodb-simulator@2.9.5) (2023-10-12)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.3...amplify-dynamodb-simulator@2.9.4) (2023-10-05)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.2...amplify-dynamodb-simulator@2.9.3) (2023-10-03)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.1...amplify-dynamodb-simulator@2.9.2) (2023-09-22)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.9.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.9.0...amplify-dynamodb-simulator@2.9.1) (2023-08-31)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+# [2.9.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.8.4...amplify-dynamodb-simulator@2.9.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+## [2.8.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.8.3...amplify-dynamodb-simulator@2.8.4) (2023-08-09)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.8.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.8.2...amplify-dynamodb-simulator@2.8.3) (2023-07-28)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.8.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.8.1...amplify-dynamodb-simulator@2.8.2) (2023-07-27)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+## [2.8.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.8.0...amplify-dynamodb-simulator@2.8.1) (2023-07-24)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
+# [2.8.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.7.4...amplify-dynamodb-simulator@2.8.0) (2023-07-20)
+
+
+### Features
+
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+
+
+
+## [2.7.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.7.3...amplify-dynamodb-simulator@2.7.4) (2023-06-13)
+
+**Note:** Version bump only for package amplify-dynamodb-simulator
+
+
+
+
+
## [2.7.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-dynamodb-simulator@2.7.1...amplify-dynamodb-simulator@2.7.3) (2023-05-25)
diff --git a/packages/amplify-dynamodb-simulator/package.json b/packages/amplify-dynamodb-simulator/package.json
index 8481e502a35..1ed0efac889 100644
--- a/packages/amplify-dynamodb-simulator/package.json
+++ b/packages/amplify-dynamodb-simulator/package.json
@@ -1,6 +1,6 @@
{
"name": "amplify-dynamodb-simulator",
- "version": "2.7.3",
+ "version": "2.9.20",
"description": "DynamoDB emulator nodejs wrapper",
"repository": {
"type": "git",
@@ -21,8 +21,8 @@
"test": "jest --logHeapUsage --passWithNoTests"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "aws-sdk": "^2.1354.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "aws-sdk": "^2.1464.0",
"detect-port": "^1.3.0",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
diff --git a/packages/amplify-e2e-core/CHANGELOG.md b/packages/amplify-e2e-core/CHANGELOG.md
index 9ee979819a4..10917a90306 100644
--- a/packages/amplify-e2e-core/CHANGELOG.md
+++ b/packages/amplify-e2e-core/CHANGELOG.md
@@ -3,6 +3,312 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.7.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.7.0...@aws-amplify/amplify-e2e-core@5.7.1) (2025-01-30)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+# [5.7.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.6.1...@aws-amplify/amplify-e2e-core@5.7.0) (2025-01-02)
+
+
+### Features
+
+* lambda dotnet 8 support ([#14026](https://github.com/aws-amplify/amplify-cli/issues/14026)) ([540bfe1](https://github.com/aws-amplify/amplify-cli/commit/540bfe1187907609c3c813e1208c12b6a2a6ac6c))
+
+
+
+
+
+## [5.6.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.6.0...@aws-amplify/amplify-e2e-core@5.6.1) (2024-11-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+# [5.6.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.10...@aws-amplify/amplify-e2e-core@5.6.0) (2024-10-05)
+
+
+### Features
+
+* add init prompts for Gen2 ([#13849](https://github.com/aws-amplify/amplify-cli/issues/13849)) ([7ab8fae](https://github.com/aws-amplify/amplify-cli/commit/7ab8faef1e2ce0c15db783d236aeee9d312ec135))
+
+
+
+
+
+## [5.5.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.9...@aws-amplify/amplify-e2e-core@5.5.10) (2024-08-02)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.9](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.8...@aws-amplify/amplify-e2e-core@5.5.9) (2024-06-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.8](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.7...@aws-amplify/amplify-e2e-core@5.5.8) (2024-06-20)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.7](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.6...@aws-amplify/amplify-e2e-core@5.5.7) (2024-06-06)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.6](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.5...@aws-amplify/amplify-e2e-core@5.5.6) (2024-05-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.4...@aws-amplify/amplify-e2e-core@5.5.5) (2024-05-07)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.3...@aws-amplify/amplify-e2e-core@5.5.4) (2024-04-18)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.2...@aws-amplify/amplify-e2e-core@5.5.3) (2024-04-15)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.1...@aws-amplify/amplify-e2e-core@5.5.2) (2024-03-29)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.5.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.5.0...@aws-amplify/amplify-e2e-core@5.5.1) (2024-03-06)
+
+
+### Bug Fixes
+
+* limit query parameter parsing in auth admin api ([#13512](https://github.com/aws-amplify/amplify-cli/issues/13512)) ([2480681](https://github.com/aws-amplify/amplify-cli/commit/24806814ce2275fe7d70e5484c3c485023b8041a))
+
+
+### Reverts
+
+* Revert "chore: bump data package versions (#13486)" (#13487) ([3280d40](https://github.com/aws-amplify/amplify-cli/commit/3280d40a5ab50c675b0e2b8050ad35a69c83cdc2)), closes [#13486](https://github.com/aws-amplify/amplify-cli/issues/13486) [#13487](https://github.com/aws-amplify/amplify-cli/issues/13487)
+
+
+
+
+
+# [5.5.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.4.4...@aws-amplify/amplify-e2e-core@5.5.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [5.4.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.4.2...@aws-amplify/amplify-e2e-core@5.4.4) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [5.4.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.4.2...@aws-amplify/amplify-e2e-core@5.4.3) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.4.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.4.1...@aws-amplify/amplify-e2e-core@5.4.2) (2023-11-08)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.4.0...@aws-amplify/amplify-e2e-core@5.4.1) (2023-10-12)
+
+
+### Bug Fixes
+
+* add retained secrets to syncSecretDeltas ([#13300](https://github.com/aws-amplify/amplify-cli/issues/13300)) ([f3c9c05](https://github.com/aws-amplify/amplify-cli/commit/f3c9c05617b55560ac78f824cf71d4001cb5c58b))
+
+
+
+
+
+# [5.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.3.3...@aws-amplify/amplify-e2e-core@5.4.0) (2023-10-05)
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [5.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.3.2...@aws-amplify/amplify-e2e-core@5.3.3) (2023-10-03)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.3.1...@aws-amplify/amplify-e2e-core@5.3.2) (2023-09-22)
+
+
+### Reverts
+
+* Revert "test: add function to run init with only yes option" ([08734a9](https://github.com/aws-amplify/amplify-cli/commit/08734a9d2d9dba671ed3cff59b84f4f456c03927))
+
+
+
+
+
+## [5.3.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.3.0...@aws-amplify/amplify-e2e-core@5.3.1) (2023-08-31)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+# [5.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.2.0...@aws-amplify/amplify-e2e-core@5.3.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+# [5.2.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.1.3...@aws-amplify/amplify-e2e-core@5.2.0) (2023-08-09)
+
+
+### Bug Fixes
+
+* Dependabot alerts for semver, tough-cookie ([#12962](https://github.com/aws-amplify/amplify-cli/issues/12962)) ([175a86b](https://github.com/aws-amplify/amplify-cli/commit/175a86b89a54c65bb6e68c0609be503d61e39d63))
+* surface override build error if scripting features are disabled ([#13013](https://github.com/aws-amplify/amplify-cli/issues/13013)) ([fa80249](https://github.com/aws-amplify/amplify-cli/commit/fa802491f8767f50dc3636e190fb70eb492fa969))
+
+
+### Features
+
+* replace oauth and userpoolclient lambdas with cfn and sdk calls ([#12935](https://github.com/aws-amplify/amplify-cli/issues/12935)) ([b3ab512](https://github.com/aws-amplify/amplify-cli/commit/b3ab5125f2ec405afd1af9d2f77b8683d5914010))
+* replace role mapping lambda in auth category ([#13003](https://github.com/aws-amplify/amplify-cli/issues/13003)) ([4ce0329](https://github.com/aws-amplify/amplify-cli/commit/4ce032932702305b9f9564a77418855ceb0f0fca))
+
+
+
+
+
+## [5.1.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.1.2...@aws-amplify/amplify-e2e-core@5.1.3) (2023-07-28)
+
+
+### Bug Fixes
+
+* surface override build error if scripting features are disabled ([#13013](https://github.com/aws-amplify/amplify-cli/issues/13013)) ([#13023](https://github.com/aws-amplify/amplify-cli/issues/13023)) ([9e99800](https://github.com/aws-amplify/amplify-cli/commit/9e998008c6aef13ee50e6ce88cc78d8e9367b66a))
+
+
+
+
+
+## [5.1.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.1.1...@aws-amplify/amplify-e2e-core@5.1.2) (2023-07-27)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+## [5.1.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.1.0...@aws-amplify/amplify-e2e-core@5.1.1) (2023-07-24)
+
+**Note:** Version bump only for package @aws-amplify/amplify-e2e-core
+
+
+
+
+
+# [5.1.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.0.4...@aws-amplify/amplify-e2e-core@5.1.0) (2023-07-20)
+
+
+### Bug Fixes
+
+* added Prepush after init and before deploy ([#12674](https://github.com/aws-amplify/amplify-cli/issues/12674)) ([a54f837](https://github.com/aws-amplify/amplify-cli/commit/a54f83743b5995317170c9b4f5a140e5a1aa57f3))
+* adjust path finding for schemas in codebuild ([#12771](https://github.com/aws-amplify/amplify-cli/issues/12771)) ([fb24fe7](https://github.com/aws-amplify/amplify-cli/commit/fb24fe759a9e41e1ca86815b2f18d1b186e8cc99))
+* update notification channel name lookup ([#12763](https://github.com/aws-amplify/amplify-cli/issues/12763)) ([92ca721](https://github.com/aws-amplify/amplify-cli/commit/92ca721134d59b68e85d4f92f4814d6717a3be3a))
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+### Reverts
+
+* Revert "chore: cleanup stale resources in CodeBuild (#12779)" (#12853) ([d19d17e](https://github.com/aws-amplify/amplify-cli/commit/d19d17ebcace24c9db56331c0c2bd053f8ec0966)), closes [#12779](https://github.com/aws-amplify/amplify-cli/issues/12779) [#12853](https://github.com/aws-amplify/amplify-cli/issues/12853)
+
+
+
+
+
+## [5.0.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.0.3...@aws-amplify/amplify-e2e-core@5.0.4) (2023-06-13)
+
+
+### Bug Fixes
+
+* deploy category resources when calling amplify push ([#12587](https://github.com/aws-amplify/amplify-cli/issues/12587)) ([260723c](https://github.com/aws-amplify/amplify-cli/commit/260723cb67432308dd35a4ddbedacfbbc69c6c81))
+* do not throw when localEnvInfo is missing on pull (fixes 12492) ([#12528](https://github.com/aws-amplify/amplify-cli/issues/12528)) ([0ae8689](https://github.com/aws-amplify/amplify-cli/commit/0ae8689efbb3907393f493c8707ab025573fb487))
+* functions e2e tests on windows ([#12745](https://github.com/aws-amplify/amplify-cli/issues/12745)) ([0de4529](https://github.com/aws-amplify/amplify-cli/commit/0de45299fbaafb090893f96c1884cdcff321f511))
+
+
+
+
+
## [5.0.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-e2e-core@5.0.1...@aws-amplify/amplify-e2e-core@5.0.3) (2023-05-25)
diff --git a/packages/amplify-e2e-core/failed-test-reporter.js b/packages/amplify-e2e-core/failed-test-reporter.js
index dc42024a28b..f901eff688c 100644
--- a/packages/amplify-e2e-core/failed-test-reporter.js
+++ b/packages/amplify-e2e-core/failed-test-reporter.js
@@ -20,7 +20,7 @@ class FailedTestNameReporter {
getFailedTestRegEx(results) {
let failedTestNames = [];
if (results.testResults) {
- for (let result of results.testResults) {
+ for (const result of results.testResults) {
failedTestNames = [...failedTestNames, ...this.getFailedTestRegEx(result)];
}
} else if (results.status === 'failed') {
diff --git a/packages/amplify-e2e-core/package.json b/packages/amplify-e2e-core/package.json
index 6abcaaef126..4351aa6c38c 100644
--- a/packages/amplify-e2e-core/package.json
+++ b/packages/amplify-e2e-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-e2e-core",
- "version": "5.0.3",
+ "version": "5.7.1",
"description": "",
"repository": {
"type": "git",
@@ -22,23 +22,27 @@
"clean": "rimraf ./lib tsconfig.tsbuildinfo"
},
"dependencies": {
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "amplify-headless-interface": "1.17.3",
- "aws-sdk": "^2.1354.0",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-sdk/client-sts": "3.624.0",
+ "@aws-sdk/credential-providers": "3.624.0",
+ "amplify-headless-interface": "1.17.7",
+ "aws-amplify": "^5.3.16",
+ "aws-appsync": "^4.1.1",
+ "aws-sdk": "^2.1464.0",
"chalk": "^4.1.1",
"dotenv": "^8.2.0",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
- "graphql-transformer-core": "^8.1.2",
+ "graphql-transformer-core": "^8.2.13",
"ini": "^1.3.5",
"jest-circus": "^27.0.0",
"jest-environment-node": "^26.6.2",
"lodash": "^4.17.21",
"node-fetch": "^2.6.7",
- "node-pty": "beta",
+ "node-pty": "^1.0.0",
"retimer": "2.0.0",
"rimraf": "^3.0.0",
- "semver": "^7.3.5",
+ "semver": "^7.5.4",
"strip-ansi": "^6.0.0",
"throat": "^5.0.0",
"uuid": "^8.3.2"
diff --git a/packages/amplify-e2e-core/src/categories/auth.ts b/packages/amplify-e2e-core/src/categories/auth.ts
index a1d67b9fdd1..3b94f5cf928 100644
--- a/packages/amplify-e2e-core/src/categories/auth.ts
+++ b/packages/amplify-e2e-core/src/categories/auth.ts
@@ -153,7 +153,7 @@ interface AddApiOptions {
const defaultOptions: AddApiOptions = {
apiName: '\r',
- testingWithLatestCodebase: true,
+ testingWithLatestCodebase: false,
transformerVersion: 2,
};
@@ -383,10 +383,15 @@ export function updateAuthSignInSignOutUrl(cwd: string, settings: any): Promise<
if (settings?.overrides?.category === 'auth') {
chain.wait('A migration is needed to support latest updates on auth resources').sendConfirmYes();
}
+ chain.wait('What do you want to do?');
+
+ if (settings?.socialProvidersAlreadyExist) {
+ chain.sendKeyDown(3);
+ } else {
+ chain.sendKeyDown(2);
+ }
+
chain
- .wait('What do you want to do?')
- .send(KEY_DOWN_ARROW)
- .send(KEY_DOWN_ARROW)
.sendCarriageReturn()
.wait('Which redirect signin URIs do you want to edit?')
.selectAll()
@@ -414,6 +419,352 @@ export function updateAuthSignInSignOutUrl(cwd: string, settings: any): Promise<
});
}
+export function updateAuthToUpdateUrls(
+ cwd: string,
+ settings: {
+ signinUrl: string;
+ signoutUrl: string;
+ testingWithLatestCodebase: boolean;
+ updateSigninUrl: string;
+ updateSignoutUrl: string;
+ },
+): Promise {
+ const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false;
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd, stripColors: true });
+ return chain
+ .wait('What do you want to do?')
+ .send(KEY_DOWN_ARROW)
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Which redirect signin URIs do you want to edit?')
+ .selectAll()
+ .wait(`Update https://www.google.com/`)
+ .send(settings.updateSigninUrl)
+ .sendCarriageReturn()
+ .wait('Do you want to add redirect signin URIs?')
+ .sendNo()
+ .sendCarriageReturn()
+ .wait('Which redirect signout URIs do you want to edit?')
+ .selectAll()
+ .wait(`Update https://www.nytimes.com/`)
+ .send(settings.updateSignoutUrl)
+ .sendCarriageReturn()
+ .wait('Do you want to add redirect signout URIs?')
+ .sendNo()
+ .sendCarriageReturn()
+ .runAsync();
+}
+
+export function updateAuthToAddOauthProviders(
+ cwd: string,
+ settings: {
+ testingWithLatestCodebase: boolean;
+ },
+): Promise {
+ const {
+ FACEBOOK_APP_ID,
+ FACEBOOK_APP_SECRET,
+ GOOGLE_APP_ID,
+ GOOGLE_APP_SECRET,
+ AMAZON_APP_ID,
+ AMAZON_APP_SECRET,
+ APPLE_APP_ID,
+ APPLE_KEY_ID,
+ APPLE_TEAM_ID,
+ APPLE_PRIVATE_KEY,
+ } = getSocialProviders();
+
+ const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false;
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd, stripColors: true });
+
+ return chain
+ .wait('What do you want to do?')
+ .send(KEY_DOWN_ARROW)
+ .send(KEY_DOWN_ARROW)
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Select the identity providers you want to configure for your user pool:')
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App ID for your OAuth flow:')
+ .send(FACEBOOK_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App Secret for your OAuth flow:')
+ .send(FACEBOOK_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client ID for your OAuth flow:')
+ .send(GOOGLE_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client Secret for your OAuth flow:')
+ .send(GOOGLE_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Amazon App ID for your OAuth flow:')
+ .send(AMAZON_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Amazon App Secret for your OAuth flow:')
+ .send(AMAZON_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Services ID for your OAuth flow:')
+ .send(APPLE_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Team ID for your OAuth flow:')
+ .send(APPLE_TEAM_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Key ID for your OAuth flow:')
+ .send(APPLE_KEY_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Private Key for your OAuth flow')
+ .send(APPLE_PRIVATE_KEY)
+ .runAsync();
+}
+
+export function updateAuthSignInSignOutUrlWithAll(
+ cwd: string,
+ settings: { signinUrl: string; signoutUrl: string; testingWithLatestCodebase?: boolean },
+): Promise {
+ const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false;
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd, stripColors: true });
+
+ return chain
+ .wait('What do you want to do?')
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Select the authentication/authorization services that you want to use:')
+ .sendCarriageReturn()
+ .wait('Allow unauthenticated logins?')
+ .sendCarriageReturn()
+ .wait('Do you want to enable 3rd party authentication providers in your identity pool?')
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Do you want to add User Pool Groups?')
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Do you want to add an admin queries API?')
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Multifactor authentication (MFA) user login options:')
+ .sendCarriageReturn()
+ .wait('Email based user registration/forgot password:')
+ .sendCarriageReturn()
+ .wait('Specify an email verification subject:')
+ .sendCarriageReturn()
+ .wait('Specify an email verification message:')
+ .sendCarriageReturn()
+ .wait('Do you want to override the default password policy for this User Pool?')
+ .sendCarriageReturn()
+ .wait("Specify the app's refresh token expiration period (in days):")
+ .sendCarriageReturn()
+ .wait('Do you want to specify the user attributes this app can read and write?')
+ .sendCarriageReturn()
+ .wait('Do you want to enable any of the following capabilities?')
+ .sendCarriageReturn()
+ .wait('Do you want to use an OAuth flow?')
+ .sendCarriageReturn()
+ .wait('What domain name prefix do you want to use?')
+ .sendCarriageReturn()
+ .wait('Enter your redirect signin URI:')
+ .sendLine(settings.signinUrl)
+ .wait('Do you want to add another redirect signin URI')
+ .sendConfirmNo()
+ .sendCarriageReturn()
+ .wait('Enter your redirect signout URI:')
+ .sendLine(settings.signoutUrl)
+ .sendCarriageReturn()
+ .wait('Do you want to add another redirect signout URI')
+ .sendConfirmNo()
+ .sendCarriageReturn()
+ .wait('Select the OAuth flows enabled for this project')
+ .sendCarriageReturn()
+ .wait('Select the OAuth scopes enabled for this project')
+ .sendCarriageReturn()
+ .wait('Select the identity providers you want to configure for your user pool:')
+ .sendCarriageReturn()
+ .wait('Do you want to configure Lambda Triggers for Cognito?')
+ .sendCarriageReturn()
+ .wait('Which triggers do you want to enable for Cognito')
+ .sendCarriageReturn()
+ .runAsync();
+}
+
+export function updateAuthToAddSignInSignOutUrlAfterPull(
+ cwd: string,
+ settings: {
+ signinUrl: string;
+ signoutUrl: string;
+ testingWithLatestCodebase: boolean;
+ updateSigninUrl: string;
+ updateSignoutUrl: string;
+ },
+): Promise {
+ const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false;
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd, stripColors: true });
+ const {
+ FACEBOOK_APP_ID,
+ FACEBOOK_APP_SECRET,
+ GOOGLE_APP_ID,
+ GOOGLE_APP_SECRET,
+ AMAZON_APP_ID,
+ AMAZON_APP_SECRET,
+ APPLE_APP_ID,
+ APPLE_KEY_ID,
+ APPLE_TEAM_ID,
+ APPLE_PRIVATE_KEY,
+ } = getSocialProviders(true);
+
+ return chain
+ .wait('What do you want to do?')
+ .sendCarriageReturn()
+ .wait('What domain name prefix do you want to use?')
+ .sendCarriageReturn()
+ .wait('Enter your redirect signin URI:')
+ .send(settings.updateSigninUrl)
+ .sendCarriageReturn()
+ .wait('Do you want to add another redirect signin URI')
+ .sendNo()
+ .sendCarriageReturn()
+ .wait('Enter your redirect signout URI:')
+ .sendLine(settings.signoutUrl)
+ .sendCarriageReturn()
+ .wait('Do you want to add another redirect signout URI')
+ .sendNo()
+ .sendCarriageReturn()
+ .wait('Select the identity providers you want to configure for your user pool:')
+ .selectAll()
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App ID for your OAuth flow:')
+ .send(FACEBOOK_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App Secret for your OAuth flow:')
+ .send(FACEBOOK_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client ID for your OAuth flow:')
+ .send(GOOGLE_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client Secret for your OAuth flow:')
+ .send(GOOGLE_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Amazon App ID for your OAuth flow:')
+ .send(AMAZON_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Amazon App Secret for your OAuth flow:')
+ .send(AMAZON_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Services ID for your OAuth flow:')
+ .send(APPLE_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Team ID for your OAuth flow:')
+ .send(APPLE_TEAM_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Key ID for your OAuth flow:')
+ .send(APPLE_KEY_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Private Key for your OAuth flow')
+ .send(APPLE_PRIVATE_KEY)
+ .sendCarriageReturn()
+ .runAsync();
+}
+
+export function updateAuthDomainPrefixWithAllProvidersConfigured(
+ cwd: string,
+ settings: { domainPrefix: string; testingWithLatestCodebase?: boolean },
+): Promise {
+ const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false;
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd, stripColors: true });
+ const {
+ FACEBOOK_APP_ID,
+ FACEBOOK_APP_SECRET,
+ GOOGLE_APP_ID,
+ GOOGLE_APP_SECRET,
+ AMAZON_APP_ID,
+ AMAZON_APP_SECRET,
+ APPLE_APP_ID,
+ APPLE_KEY_ID,
+ APPLE_TEAM_ID,
+ APPLE_PRIVATE_KEY,
+ } = getSocialProviders(true);
+
+ return chain
+ .wait('What do you want to do?')
+ .send(KEY_DOWN_ARROW)
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Select the authentication/authorization services that you want to use:')
+ .sendCarriageReturn()
+ .wait('Do you want to add User Pool Groups?')
+ .sendCarriageReturn()
+ .wait('Do you want to add an admin queries API?')
+ .sendCarriageReturn()
+ .wait('Multifactor authentication (MFA) user login options:')
+ .sendCarriageReturn()
+ .wait('Email based user registration/forgot password:')
+ .sendCarriageReturn()
+ .wait('Specify an email verification subject:')
+ .sendCarriageReturn()
+ .wait('Specify an email verification message:')
+ .sendCarriageReturn()
+ .wait('Do you want to override the default password policy for this User Pool?')
+ .sendCarriageReturn()
+ .wait("Specify the app's refresh token expiration period (in days):")
+ .sendCarriageReturn()
+ .wait('Do you want to specify the user attributes this app can read and write?')
+ .sendCarriageReturn()
+ .wait('Do you want to enable any of the following capabilities?')
+ .sendCarriageReturn()
+ .wait('Do you want to use an OAuth flow?')
+ .sendCarriageReturn()
+ .wait('What domain name prefix do you want to use?')
+ .sendLine(settings.domainPrefix)
+ .wait('Which redirect signin URIs do you want to edit?')
+ .sendCarriageReturn()
+ .wait('Do you want to add redirect signin URIs?')
+ .sendNo()
+ .sendCarriageReturn()
+ .wait('Which redirect signout URIs do you want to edit?')
+ .sendCarriageReturn()
+ .wait('Do you want to add redirect signout URIs?')
+ .sendNo()
+ .sendCarriageReturn()
+ .wait('Select the OAuth flows enabled for this project')
+ .sendCarriageReturn()
+ .wait('Select the OAuth scopes enabled for this project')
+ .sendCarriageReturn()
+ .wait('Select the identity providers you want to configure for your user pool:')
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App ID for your OAuth flow:')
+ .send(FACEBOOK_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App Secret for your OAuth flow:')
+ .send(FACEBOOK_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client ID for your OAuth flow:')
+ .send(GOOGLE_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client Secret for your OAuth flow:')
+ .send(GOOGLE_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Amazon App ID for your OAuth flow:')
+ .send(AMAZON_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Amazon App Secret for your OAuth flow:')
+ .send(AMAZON_APP_SECRET)
+ .sendCarriageReturn()
+ .wait('Enter your Services ID for your OAuth flow:')
+ .send(APPLE_APP_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Team ID for your OAuth flow:')
+ .send(APPLE_TEAM_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Key ID for your OAuth flow:')
+ .send(APPLE_KEY_ID)
+ .sendCarriageReturn()
+ .wait('Enter your Private Key for your OAuth flow')
+ .send(APPLE_PRIVATE_KEY)
+ .sendCarriageReturn()
+ .wait('Do you want to configure Lambda Triggers for Cognito?')
+ .sendNo()
+ .sendCarriageReturn()
+ .runAsync();
+}
+
export function updateAuthToRemoveFederation(cwd: string, settings: any): Promise {
const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false;
return new Promise((resolve, reject) => {
@@ -1072,15 +1423,22 @@ export function addAuthWithMaxOptions(cwd: string, settings: any): Promise
} = getSocialProviders(true);
return new Promise((resolve, reject) => {
- const chain = spawn(getCLIPath(), ['add', 'auth'], { cwd, stripColors: true })
+ const chain = spawn(getCLIPath(settings?.testingWithLatestCodebase ?? false), ['add', 'auth'], { cwd, stripColors: true })
.wait('Do you want to use the default authentication and security configuration?')
.send(KEY_DOWN_ARROW)
.send(KEY_DOWN_ARROW)
.sendCarriageReturn()
.wait('Select the authentication/authorization services that you want to use')
.sendCarriageReturn()
- .wait('Provide a friendly name for your resource that will be used')
- .sendCarriageReturn()
+ .wait('Provide a friendly name for your resource that will be used');
+
+ if (settings?.name) {
+ chain.sendLine(settings.name);
+ } else {
+ chain.sendCarriageReturn();
+ }
+
+ chain
.wait('Enter a name for your identity pool')
.sendCarriageReturn()
.wait('Allow unauthenticated logins')
@@ -1290,24 +1648,44 @@ export function addAuthWithPreTokenGenerationTrigger(projectDir: string): Promis
});
}
-export function updateAuthAddUserGroups(projectDir: string, groupNames: string[], settings?: any): Promise {
+export function updateAuthAddUserGroups(
+ projectDir: string,
+ groupNames: string[],
+ settings?: {
+ testingWithLatestCodebase?: boolean;
+ updateUserPoolGroupsPosition?: number;
+ hasExistingUserPoolGroups?: boolean;
+ overrides?: {
+ category: string;
+ };
+ },
+): Promise {
if (groupNames.length == 0) {
return undefined;
}
const testingWithLatestCodebase = settings && settings.testingWithLatestCodebase ? settings.testingWithLatestCodebase : false;
+ const updateUserPoolGroupsPosition = settings?.updateUserPoolGroupsPosition ?? 2;
return new Promise((resolve, reject) => {
const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd: projectDir, stripColors: true });
if (settings?.overrides?.category === 'auth') {
chain.wait('A migration is needed to support latest updates on auth resources').sendConfirmYes();
}
- chain
- .wait('What do you want to do?')
- .send(KEY_DOWN_ARROW)
- .send(KEY_DOWN_ARROW)
- .sendCarriageReturn()
- .wait('Provide a name for your user pool group')
- .send(groupNames[0])
- .sendCarriageReturn();
+ chain.wait('What do you want to do?');
+ for (let i = 0; i < updateUserPoolGroupsPosition; i++) {
+ chain.send(KEY_DOWN_ARROW);
+ }
+ chain.sendCarriageReturn();
+
+ if (settings?.hasExistingUserPoolGroups) {
+ chain
+ .wait('Select any user pool groups you want to delete')
+ .sendCarriageReturn()
+ .wait('Do you want to add another User Pool Group')
+ .sendYes()
+ .sendCarriageReturn();
+ }
+
+ chain.wait('Provide a name for your user pool group').send(groupNames[0]).sendCarriageReturn();
if (groupNames.length > 1) {
let index = 1;
@@ -1338,6 +1716,54 @@ export function updateAuthAddUserGroups(projectDir: string, groupNames: string[]
});
}
+export async function updateAuthAddUserGroupsAfterPull(
+ projectDir: string,
+ groupNames: string[],
+ settings?: {
+ testingWithLatestCodebase: boolean;
+ },
+): Promise {
+ if (groupNames.length == 0) {
+ return undefined;
+ }
+ const testingWithLatestCodebase = settings?.testingWithLatestCodebase || false;
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd: projectDir, stripColors: true });
+
+ chain
+ .wait('What do you want to do?')
+ .send(KEY_DOWN_ARROW)
+ .send(KEY_DOWN_ARROW)
+ .send(KEY_DOWN_ARROW)
+ .sendCarriageReturn()
+ .wait('Select any user pool groups you want to delete:')
+ .sendCarriageReturn()
+ .wait('Do you want to add another User Pool Group')
+ .sendConfirmYes()
+ .wait('Provide a name for your user pool group')
+ .send(groupNames[0])
+ .sendCarriageReturn();
+
+ if (groupNames.length > 1) {
+ let index = 1;
+ while (index < groupNames.length) {
+ chain
+ .wait('Do you want to add another User Pool Group')
+ .sendConfirmYes()
+ .wait('Provide a name for your user pool group')
+ .send(groupNames[index++])
+ .sendCarriageReturn();
+ }
+ }
+
+ return await chain
+ .wait('Do you want to add another User Pool Group')
+ .sendCarriageReturn()
+ .wait('Sort the user pool groups in order of preference')
+ .sendCarriageReturn()
+ .wait('"amplify publish" will build all your local backend and frontend resources')
+ .runAsync();
+}
+
export function addAuthUserPoolOnlyWithOAuth(cwd: string, settings: AddAuthUserPoolOnlyWithOAuthSettings): Promise {
return new Promise((resolve, reject) => {
spawn(getCLIPath(), ['add', 'auth'], { cwd, stripColors: true })
@@ -1811,3 +2237,138 @@ export function updateAuthWithGroupTrigger(cwd: string): Promise {
.sendCarriageReturn()
.runAsync();
}
+
+export const addAuthWithOidcForNonJSProject = async (
+ cwd: string,
+ settings?: {
+ resourceName?: string;
+ frontend?: string;
+ testingWithLatestCodebase?: boolean;
+ },
+): Promise => {
+ const {
+ FACEBOOK_APP_ID,
+ FACEBOOK_APP_SECRET,
+ GOOGLE_APP_ID,
+ GOOGLE_APP_SECRET,
+ AMAZON_APP_ID,
+ AMAZON_APP_SECRET,
+ APPLE_APP_ID,
+ APPLE_TEAM_ID,
+ APPLE_KEY_ID,
+ APPLE_PRIVATE_KEY,
+ } = getSocialProviders();
+
+ const resolvedSettings = { frontend: 'android', resourceName: 'oidcauthtest', testingWithLatestCodebase: false, ...settings };
+
+ const chain = spawn(getCLIPath(resolvedSettings.testingWithLatestCodebase), ['add', 'auth'], { cwd, stripColors: true })
+ .wait('Do you want to use the default authentication')
+ .sendKeyDown(2)
+ .sendCarriageReturn() // Manual config
+ .wait('Select the authentication/authorization services that you want to use')
+ .sendCarriageReturn()
+ .wait('Provide a friendly name for your resource')
+ .sendLine(resolvedSettings.resourceName)
+ .wait('Enter a name for your identity pool')
+ .sendCarriageReturn()
+ .wait('Allow unauthenticated logins?')
+ .sendCarriageReturn() // No
+ .wait('Do you want to enable 3rd party authentication providers in your identity pool')
+ .sendCarriageReturn() // Yes
+ .wait('Select the third party identity providers you want to configure for your identity pool')
+ .sendCtrlA()
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App ID for your identity pool')
+ .send('fbIDPool')
+ .sendCarriageReturn()
+ .wait('Enter your Google Web Client ID for your identity pool:')
+ .send('googleIDPool')
+ .sendCarriageReturn();
+ if (resolvedSettings.frontend === 'ios') {
+ chain.wait('Enter your Google iOS Client ID for your identity pool').sendLine('googleiosclientId');
+ } else if (resolvedSettings.frontend === 'android') {
+ chain.wait('Enter your Google Android Client ID for your identity pool').sendLine('googleandroidclientid');
+ }
+ chain
+ .wait('Enter your Amazon App ID for your identity pool')
+ .send('amazonIDPool')
+ .sendCarriageReturn()
+ .wait('Enter your Bundle Identifier for your identity pool')
+ .send('appleIDPool')
+ .sendCarriageReturn()
+ .wait('Provide a name for your user pool')
+ .sendCarriageReturn()
+ .wait('How do you want users to be able to sign in')
+ .sendCarriageReturn()
+ .wait('Do you want to add User Pool Groups?')
+ .sendCarriageReturn()
+ .wait('Provide a name for your user pool group')
+ .sendLine('users')
+ .wait('Do you want to add another User Pool Group')
+ .sendCarriageReturn() // No
+ .wait('Sort the user pool groups in order of preference')
+ .sendCarriageReturn()
+ .wait('Do you want to add an admin queries API?')
+ .sendKeyDown()
+ .sendCarriageReturn()
+ .wait('Multifactor authentication (MFA) user login options')
+ .sendCarriageReturn()
+ .wait('Email based user registration/forgot password')
+ .sendCarriageReturn()
+ .wait('Specify an email verification subject:')
+ .sendCarriageReturn()
+ .wait('Specify an email verification message:')
+ .sendCarriageReturn()
+ .wait('Do you want to override the default password policy for this User Pool?')
+ .sendCarriageReturn()
+ .wait('What attributes are required for signing up?')
+ .sendCarriageReturn()
+ .wait("Specify the app's refresh token expiration period (in days)")
+ .sendCarriageReturn()
+ .wait('Do you want to specify the user attributes this app can read and write?')
+ .sendCarriageReturn()
+ .wait('Do you want to enable any of the following capabilities?')
+ .sendCarriageReturn()
+ .wait('Do you want to use an OAuth flow?')
+ .sendCarriageReturn()
+ .wait('What domain name prefix do you want to use?')
+ .sendCarriageReturn()
+ .wait('Enter your redirect signin URI')
+ .sendLine('https://www.google.com/')
+ .wait('Do you want to add another redirect signin URI')
+ .sendCarriageReturn() // No
+ .wait('Enter your redirect signout URI')
+ .sendLine('https://www.nytimes.com/')
+ .wait('Do you want to add another redirect signout UR')
+ .sendCarriageReturn() // No
+ .wait('Select the OAuth scopes enabled for this project')
+ .sendCarriageReturn()
+ .wait('Select the social providers you want to configure for your user pool')
+ .sendCtrlA()
+ .sendCarriageReturn()
+ .wait('Enter your Facebook App ID for your OAuth flow')
+ .sendLine(FACEBOOK_APP_ID)
+ .wait('Enter your Facebook App Secret for your OAuth flow')
+ .sendLine(FACEBOOK_APP_SECRET)
+ .wait('Enter your Google Web Client ID for your OAuth flow')
+ .sendLine(GOOGLE_APP_ID)
+ .wait('Enter your Google Web Client Secret for your OAuth flow')
+ .sendLine(GOOGLE_APP_SECRET)
+ .wait('Enter your Amazon App ID for your OAuth flow')
+ .sendLine(AMAZON_APP_ID)
+ .wait('Enter your Amazon App Secret for your OAuth flow')
+ .sendLine(AMAZON_APP_SECRET)
+ .wait('Enter your Services ID for your OAuth flow')
+ .sendLine(APPLE_APP_ID)
+ .wait('Enter your Team ID for your OAuth flow')
+ .sendLine(APPLE_TEAM_ID)
+ .wait('Enter your Key ID for your OAuth flow')
+ .sendLine(APPLE_KEY_ID)
+ .wait('Enter your Private Key for your OAuth flow')
+ .sendLine(APPLE_PRIVATE_KEY)
+ .wait('Do you want to configure Lambda Triggers for Cognito?')
+ .sendConfirmNo()
+ .sendEof();
+
+ return chain.runAsync();
+};
diff --git a/packages/amplify-e2e-core/src/categories/codegen.ts b/packages/amplify-e2e-core/src/categories/codegen.ts
index 63d7ce42302..42af1c9ac10 100644
--- a/packages/amplify-e2e-core/src/categories/codegen.ts
+++ b/packages/amplify-e2e-core/src/categories/codegen.ts
@@ -1,5 +1,14 @@
import { getCLIPath, nspawn as spawn } from '..';
-export const generateModels = async (cwd: string): Promise => {
- await spawn(getCLIPath(), ['codegen', 'models'], { cwd, stripColors: true }).runAsync();
+export const generateModels = (
+ cwd: string,
+ settings?: {
+ expectXcode?: boolean;
+ },
+): Promise => {
+ const chain = spawn(getCLIPath(), ['codegen', 'models'], { cwd, stripColors: true });
+ if (settings?.expectXcode) {
+ chain.wait('Updating Xcode project').wait('Successfully added models').wait('Amplify setup completed successfully.');
+ }
+ return chain.runAsync();
};
diff --git a/packages/amplify-e2e-core/src/categories/geo.ts b/packages/amplify-e2e-core/src/categories/geo.ts
index ef95914dfdc..ae4f9b9876a 100644
--- a/packages/amplify-e2e-core/src/categories/geo.ts
+++ b/packages/amplify-e2e-core/src/categories/geo.ts
@@ -26,7 +26,11 @@ const defaultSearchIndexQuestion = `Set this search index as the default? It wil
const defaultMapQuestion = `Set this Map as the default? It will be used in Amplify Map API calls if no explicit reference is provided.`;
const defaultGeofenceCollectionQuestion = `Set this geofence collection as the default? It will be used in Amplify geofence collection API calls if no explicit reference is provided.`;
+const isWindowsPlatform = (): boolean => !!process?.platform?.startsWith('win');
export function getGeoJSONFilePath(fileName: string): string {
+ if (process.env.CODEBUILD_SRC_DIR && isWindowsPlatform()) {
+ return path.join(process.env.CODEBUILD_SRC_DIR, 'packages', 'amplify-e2e-tests', 'geo-json-files', fileName);
+ }
return path.join(__dirname, '..', '..', '..', 'amplify-e2e-tests', 'geo-json-files', fileName);
}
diff --git a/packages/amplify-e2e-core/src/categories/lambda-function.ts b/packages/amplify-e2e-core/src/categories/lambda-function.ts
index a917a9055f8..b17349b6bbc 100644
--- a/packages/amplify-e2e-core/src/categories/lambda-function.ts
+++ b/packages/amplify-e2e-core/src/categories/lambda-function.ts
@@ -7,12 +7,12 @@ import _ from 'lodash';
import { loadFeatureFlags } from '../utils/feature-flags';
type FunctionActions = 'create' | 'update';
-type FunctionRuntimes = 'dotnet6' | 'go' | 'java' | 'nodejs' | 'python';
+type FunctionRuntimes = 'dotnet8' | 'go' | 'java' | 'nodejs' | 'python';
type FunctionCallback = (chain: any, cwd: string, settings: any) => any;
// runtimeChoices are shared between tests
-export const runtimeChoices = ['.NET 6', 'Go', 'Java', 'NodeJS', 'Python'];
+export const runtimeChoices = ['.NET 8', 'Go', 'Java', 'NodeJS', 'Python'];
// templateChoices is per runtime
const dotNetTemplateChoices = [
@@ -51,7 +51,7 @@ const additionalPermissions = (cwd: string, chain: ExecutionContext, settings: a
if (settings.resourceChoices === undefined) {
settings.resourceChoices = settings.resources;
}
- // when single resource, it gets autoselected
+ // when single resource, it gets auto selected
if (settings.resourceChoices.length > 1) {
chain.wait('Select the one you would like your Lambda to access');
if (settings.keepExistingResourceSelection) {
@@ -116,15 +116,26 @@ const updateFunctionCore = (cwd: string, chain: ExecutionContext, settings: Core
}
}
if (settings.secretsConfig) {
- if (settings.secretsConfig.operation === 'add') {
- throw new Error('Secres update walkthrough only supports update and delete');
- }
- // this walkthrough assumes 1 existing secret is configured for the function
const actions = ['Add a secret', 'Update a secret', 'Remove secrets', "I'm done"];
- const action = settings.secretsConfig.operation === 'delete' ? actions[2] : actions[1];
+ const operation = settings.secretsConfig.operation;
+ let action: string;
+ if (operation === 'add') {
+ action = actions[0];
+ } else if (operation === 'delete') {
+ action = actions[2];
+ } else {
+ action = actions[1];
+ }
chain.wait('What do you want to do?');
singleSelect(chain, action, actions);
- switch (settings.secretsConfig.operation) {
+ switch (operation) {
+ case 'add': {
+ chain.wait('Enter a secret name');
+ chain.sendLine(settings.secretsConfig.name);
+ chain.wait('Enter the value for');
+ chain.sendLine(settings.secretsConfig.value);
+ break;
+ }
case 'delete': {
chain.wait('Select the secrets to delete:');
chain.sendLine(' '); // assumes one secret
@@ -137,14 +148,27 @@ const updateFunctionCore = (cwd: string, chain: ExecutionContext, settings: Core
break;
}
}
+
chain.wait('What do you want to do?');
chain.sendCarriageReturn(); // "I'm done"
+
+ if (operation === 'add') {
+ // assumes function is already pushed to the cloud
+ chain.wait('This will immediately update secret values in the cloud');
+ chain.sendCarriageReturn(); // "Yes"
+ chain.wait('Do you want to edit the local lambda function now');
+ chain.sendCarriageReturn(); // "No"
+ }
}
};
export type CoreFunctionSettings = {
testingWithLatestCodebase?: boolean;
name?: string;
+ packageManager?: {
+ name: string;
+ command?: string;
+ };
functionTemplate?: string;
expectFailure?: boolean;
additionalPermissions?: any;
@@ -206,7 +230,8 @@ const coreFunction = (
settings.schedulePermissions ||
settings.layerOptions ||
settings.environmentVariables ||
- settings.secretsConfig
+ settings.secretsConfig ||
+ settings.packageManager
) {
chain.sendConfirmYes().wait('Do you want to access other resources in this project from your Lambda function?');
if (settings.additionalPermissions) {
@@ -256,6 +281,20 @@ const coreFunction = (
chain.sendConfirmYes();
addSecretWalkthrough(chain, settings.secretsConfig);
}
+
+ if (runtime === 'nodejs') {
+ chain.wait('Choose the package manager that you want to use:');
+ if (settings.packageManager?.name) {
+ chain.sendLine(settings.packageManager.name);
+ } else {
+ chain.sendCarriageReturn(); // npm
+ }
+
+ if (settings.packageManager?.name.toLowerCase().includes('custom')) {
+ chain.wait('Enter command or script path to build your function:');
+ chain.sendLine(settings.packageManager.command);
+ }
+ }
} else {
chain.sendConfirmNo();
}
@@ -397,9 +436,9 @@ export interface LayerOptions {
select?: string[]; // list options to select
layerAndFunctionExist?: boolean; // whether this test involves both a function and a layer
expectedListOptions?: string[]; // the expected list of all layers
- versions?: Record; // map with keys for each element of select that determines the verison and expected version for each layer
+ versions?: Record; // map with keys for each element of select that determines the version and expected version for each layer
customArns?: string[]; // external ARNs to enter
- skipLayerAssignment?: boolean; // true if the layer assigment must be left unchanged for the function, otherwise true
+ skipLayerAssignment?: boolean; // true if the layer assignment must be left unchanged for the function, otherwise true
layerWalkthrough?: (chain: ExecutionContext) => void; // If this function is provided the addLayerWalkthrough will invoke it instead of the standard one, suitable for full customization
}
@@ -616,7 +655,7 @@ export const functionCloudInvoke = async (
const getTemplateChoices = (runtime: FunctionRuntimes) => {
switch (runtime) {
- case 'dotnet6':
+ case 'dotnet8':
return dotNetTemplateChoices;
case 'go':
return goTemplateChoices;
@@ -633,8 +672,8 @@ const getTemplateChoices = (runtime: FunctionRuntimes) => {
const getRuntimeDisplayName = (runtime: FunctionRuntimes) => {
switch (runtime) {
- case 'dotnet6':
- return '.NET 6';
+ case 'dotnet8':
+ return '.NET 8';
case 'go':
return 'Go';
case 'java':
diff --git a/packages/amplify-e2e-core/src/categories/notifications.ts b/packages/amplify-e2e-core/src/categories/notifications.ts
index 369f772e2ec..058bd3fe21a 100644
--- a/packages/amplify-e2e-core/src/categories/notifications.ts
+++ b/packages/amplify-e2e-core/src/categories/notifications.ts
@@ -43,7 +43,7 @@ export const addNotificationChannel = async (
channel: string,
hasAnalytics = false,
hasAuth = false,
- testingWithLatestCodebase = true,
+ testingWithLatestCodebase = false,
): Promise => {
const chain = spawn(getCLIPath(testingWithLatestCodebase), ['add', 'notification'], { cwd, stripColors: true });
@@ -77,3 +77,27 @@ export const addNotificationChannel = async (
return chain.wait(`The ${channel} channel has been successfully enabled`).sendEof().runAsync();
};
+
+/**
+ * Update notification resource for a given channel
+ *
+ * @param cwd the current working directory to run CLI in
+ * @param settings settings required to add a notification channel
+ * @param settings.resourceName the name to give to the created pinpoint resource
+ * @param channel the channel to add
+ */
+export const updateNotificationChannel = async (
+ cwd: string,
+ channel: string,
+ enable = true,
+ testingWithLatestCodebase = false,
+): Promise => {
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'notification'], { cwd, stripColors: true });
+ chain.wait('Choose the notification channel to configure').sendLine(channel);
+ chain.wait(`Do you want to ${enable ? 'enable' : 'disable'} the ${channel} channel`).sendYes();
+
+ return chain
+ .wait(`The ${channel} channel has been ${enable ? 'enabled' : 'disabled'}`)
+ .sendEof()
+ .runAsync();
+};
diff --git a/packages/amplify-e2e-core/src/categories/storage.ts b/packages/amplify-e2e-core/src/categories/storage.ts
index f7886c1c0d0..2b3a84ef36e 100644
--- a/packages/amplify-e2e-core/src/categories/storage.ts
+++ b/packages/amplify-e2e-core/src/categories/storage.ts
@@ -278,11 +278,11 @@ export function overrideDDB(cwd: string) {
});
}
-export function buildOverrideStorage(cwd: string) {
+export function buildOverrideStorage(cwd: string, env?: Record) {
return new Promise((resolve, reject) => {
// Add 'storage' as a category param once implemented
const args = ['build'];
- const chain = spawn(getCLIPath(), args, { cwd, stripColors: true });
+ const chain = spawn(getCLIPath(), args, { cwd, stripColors: true, env });
chain.run((err: Error) => {
if (!err) {
resolve({});
@@ -458,35 +458,49 @@ export function addS3WithGuestAccess(cwd: string): Promise {
}
// Expects 2 existing user pool groups
-export function addS3WithGroupAccess(cwd: string, settings: any): Promise {
- return new Promise((resolve, reject) => {
- spawn(getCLIPath(), ['add', 'storage'], { cwd, stripColors: true })
- .wait('Select from one of the below mentioned services')
- .sendCarriageReturn() // Content
- .wait('Provide a friendly name for your resource')
- .sendCarriageReturn() // Default name
- .wait('Provide bucket name')
- .sendCarriageReturn() // Default name
- .wait('Restrict access by')
- .sendKeyDown()
- .sendCarriageReturn() // Individual groups
- .wait('Select groups')
- .selectAll() // select all groups
- .wait(`What kind of access do you want for ${settings?.userGroup1 ?? 'Admins'} users`) // for users?
- .selectAll() // Select all permissions
- .wait(`What kind of access do you want for ${settings?.userGroup2 ?? 'Users'} users`) // for users?
- .selectAll() // Select all permissions
- .wait('Do you want to add a Lambda Trigger for your S3 Bucket')
- .sendConfirmNo()
- .sendEof()
- .run((err: Error) => {
- if (!err) {
- resolve();
- } else {
- reject(err);
- }
- });
- });
+export function addS3WithGroupAccess(cwd: string, settings?: { userGroup1?: string; userGroup2?: string }): Promise {
+ return spawn(getCLIPath(), ['add', 'storage'], { cwd, stripColors: true })
+ .wait('Select from one of the below mentioned services')
+ .sendCarriageReturn() // Content
+ .wait('Provide a friendly name for your resource')
+ .sendCarriageReturn() // Default name
+ .wait('Provide bucket name')
+ .sendCarriageReturn() // Default name
+ .wait('Restrict access by')
+ .sendKeyDown()
+ .sendCarriageReturn() // Individual groups
+ .wait('Select groups')
+ .selectAll() // select all groups
+ .wait(`What kind of access do you want for ${settings?.userGroup1 ?? 'Admins'} users`) // for users?
+ .selectAll() // Select all permissions
+ .wait(`What kind of access do you want for ${settings?.userGroup2 ?? 'Users'} users`) // for users?
+ .selectAll() // Select all permissions
+ .wait('Do you want to add a Lambda Trigger for your S3 Bucket')
+ .sendConfirmNo()
+ .sendEof()
+ .runAsync();
+}
+
+export function addS3WithFirstGroupAccess(cwd: string): Promise {
+ return spawn(getCLIPath(), ['add', 'storage'], { cwd, stripColors: true })
+ .wait('Select from one of the below mentioned services')
+ .sendCarriageReturn() // Content
+ .wait('Provide a friendly name for your resource')
+ .sendCarriageReturn() // Default name
+ .wait('Provide bucket name')
+ .sendCarriageReturn() // Default name
+ .wait('Restrict access by')
+ .sendKeyDown()
+ .sendCarriageReturn() // Individual groups
+ .wait('Select groups')
+ .send(' ') // select first group
+ .sendCarriageReturn()
+ .wait(`What kind of access do you want for`)
+ .selectAll() // Select all permissions
+ .wait('Do you want to add a Lambda Trigger for your S3 Bucket')
+ .sendNo()
+ .sendCarriageReturn()
+ .runAsync();
}
export function addS3WithTrigger(cwd: string): Promise {
@@ -610,9 +624,9 @@ export function updateS3AddTriggerNewFunctionWithFunctionExisting(cwd: string, s
});
}
-export function addS3StorageWithIdpAuth(projectDir: string): Promise {
+export function addS3StorageWithIdpAuth(projectDir: string, testingWithLatestCodebase = false): Promise {
return new Promise((resolve, reject) => {
- const chain = spawn(getCLIPath(), ['add', 'storage'], { cwd: projectDir, stripColors: true });
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['add', 'storage'], { cwd: projectDir, stripColors: true });
chain.wait('Select from one of the below mentioned services:').sendCarriageReturn(); //select - Content (Images, audio, video, etc.)
@@ -647,9 +661,9 @@ export function addS3StorageWithIdpAuth(projectDir: string): Promise {
});
}
-export function addS3Storage(projectDir: string): Promise {
+export function addS3Storage(projectDir: string, testingWithLatestCodebase = false): Promise {
return new Promise((resolve, reject) => {
- const chain = spawn(getCLIPath(), ['add', 'storage'], { cwd: projectDir, stripColors: true });
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['add', 'storage'], { cwd: projectDir, stripColors: true });
chain
.wait('Select from one of the below mentioned services:') //'Content (Images, audio, video, etc.)'
.sendCarriageReturn()
@@ -677,9 +691,9 @@ export function addS3Storage(projectDir: string): Promise {
});
}
-export function addS3StorageWithAuthOnly(projectDir: string): Promise {
+export function addS3StorageWithAuthOnly(projectDir: string, testingWithLatestCodebase = false): Promise {
return new Promise((resolve, reject) => {
- const chain = spawn(getCLIPath(), ['add', 'storage'], { cwd: projectDir, stripColors: true });
+ const chain = spawn(getCLIPath(testingWithLatestCodebase), ['add', 'storage'], { cwd: projectDir, stripColors: true });
chain
.wait('Select from one of the below mentioned services:') //'Content (Images, audio, video, etc.)'
.sendCarriageReturn()
diff --git a/packages/amplify-e2e-core/src/configure/index.ts b/packages/amplify-e2e-core/src/configure/index.ts
index 81fc4398412..4c5523e7af2 100644
--- a/packages/amplify-e2e-core/src/configure/index.ts
+++ b/packages/amplify-e2e-core/src/configure/index.ts
@@ -8,6 +8,15 @@ type AmplifyConfiguration = {
region?: string;
};
+type CommandFlags = 'usage-data-on' | 'usage-data-off' | 'share-project-config-on' | 'share-project-config-off';
+
+const commandFlagsReturnMessage: { [key in CommandFlags]: string } = {
+ 'usage-data-on': 'Usage Data has been turned on',
+ 'usage-data-off': 'Usage Data has been turned off',
+ 'share-project-config-on': 'Share Project Config has been turned on',
+ 'share-project-config-off': 'Share Project Config has been turned off',
+};
+
const defaultSettings = {
profileName: 'amplify-integ-test-user',
region: 'us-east-2',
@@ -27,6 +36,7 @@ export const amplifyRegions = [
'eu-central-1',
'ap-northeast-1',
'ap-northeast-2',
+ 'ap-northeast-3',
'ap-southeast-1',
'ap-southeast-2',
'ap-south-1',
@@ -41,42 +51,48 @@ const authenticationOptions = ['AWS profile', 'AWS access keys'];
const MANDATORY_PARAMS = ['accessKeyId', 'secretAccessKey', 'region'];
-export function amplifyConfigure(settings: AmplifyConfiguration): Promise {
- const s = { ...defaultSettings, ...settings };
- const missingParam = MANDATORY_PARAMS.filter((p) => !Object.keys(s).includes(p));
- if (missingParam.length) {
- throw new Error(`mandatory params ${missingParam.join(' ')} are missing`);
- }
-
- return new Promise((resolve, reject) => {
- const chain = spawn(getCLIPath(), ['configure'], { stripColors: true })
- .wait('Sign in to your AWS administrator account:')
- .wait('Press Enter to continue')
- .sendCarriageReturn()
- .wait('Specify the AWS Region');
-
- singleSelect(chain, s.region, amplifyRegions);
+export function amplifyConfigure(cwd: string | null, settings: AmplifyConfiguration | CommandFlags | null): Promise {
+ if (typeof settings === 'string') {
+ return spawn(getCLIPath(), ['configure', `--${settings}`], { cwd, stripColors: true })
+ .wait(commandFlagsReturnMessage[settings])
+ .runAsync();
+ } else {
+ const allSettings = { ...defaultSettings, ...settings };
+ const missingParam = MANDATORY_PARAMS.filter((p) => !Object.keys(allSettings).includes(p));
+ if (missingParam.length) {
+ throw new Error(`mandatory params ${missingParam.join(' ')} are missing`);
+ }
- chain
- .wait('Press Enter to continue')
- .sendCarriageReturn()
- .wait('accessKeyId')
- .pauseRecording()
- .sendLine(s.accessKeyId)
- .wait('secretAccessKey')
- .sendLine(s.secretAccessKey)
- .resumeRecording()
- .wait('Profile Name:')
- .sendLine(s.profileName)
- .wait('Successfully set up the new user.')
- .run((err: Error) => {
- if (!err) {
- resolve();
- } else {
- reject(err);
- }
- });
- });
+ return new Promise((resolve, reject) => {
+ const chain = spawn(getCLIPath(), ['configure'], { cwd, stripColors: true })
+ .wait('Sign in to your AWS administrator account:')
+ .wait('Press Enter to continue')
+ .sendCarriageReturn()
+ .wait('Specify the AWS Region');
+
+ singleSelect(chain, allSettings.region, amplifyRegions);
+
+ chain
+ .wait('Press Enter to continue')
+ .sendCarriageReturn()
+ .wait('accessKeyId')
+ .pauseRecording()
+ .sendLine(allSettings.accessKeyId)
+ .wait('secretAccessKey')
+ .sendLine(allSettings.secretAccessKey)
+ .resumeRecording()
+ .wait('Profile Name:')
+ .sendLine(allSettings.profileName)
+ .wait('Successfully set up the new user.')
+ .run((err: Error) => {
+ if (!err) {
+ resolve();
+ } else {
+ reject(err);
+ }
+ });
+ });
+ }
}
export const amplifyConfigureBeforeOrAtV10_7 = (settings: AmplifyConfiguration): Promise => {
diff --git a/packages/amplify-e2e-core/src/index.ts b/packages/amplify-e2e-core/src/index.ts
index fe4cc70584a..1ed94b3ecdf 100644
--- a/packages/amplify-e2e-core/src/index.ts
+++ b/packages/amplify-e2e-core/src/index.ts
@@ -19,7 +19,7 @@ export * from './init';
export * from './utils';
export * from './categories';
export * from './export';
-export { addFeatureFlag } from './utils/feature-flags';
+export { addFeatureFlag, loadFeatureFlags } from './utils/feature-flags';
export * from './cli-version-controller';
declare global {
diff --git a/packages/amplify-e2e-core/src/init/amplifyPull.ts b/packages/amplify-e2e-core/src/init/amplifyPull.ts
index 48449160b35..6dcd4ba64f4 100644
--- a/packages/amplify-e2e-core/src/init/amplifyPull.ts
+++ b/packages/amplify-e2e-core/src/init/amplifyPull.ts
@@ -166,8 +166,7 @@ export const amplifyStudioHeadlessPull = (
awscloudformation: {
configLevel: 'project',
useProfile: true,
- // eslint-disable-next-line spellcheck/spell-checker
- profileName: profileName ?? 'amplify-integ-test-user',
+ profileName: profileName ?? TEST_PROFILE_NAME,
},
};
const args = ['pull', '--amplify', JSON.stringify({ appId, envName }), '--providers', JSON.stringify(providersConfig), '--yes'];
diff --git a/packages/amplify-e2e-core/src/init/amplifyPush.ts b/packages/amplify-e2e-core/src/init/amplifyPush.ts
index 41ab098ca07..699091354e6 100644
--- a/packages/amplify-e2e-core/src/init/amplifyPush.ts
+++ b/packages/amplify-e2e-core/src/init/amplifyPush.ts
@@ -68,6 +68,17 @@ export const amplifyPushLegacy = async (cwd: string): Promise => {
.runAsync();
};
+/**
+ * Function to test amplify push with --yes
+ */
+export const amplifyPushNonInteractive = async (cwd: string, testingWithLatestCodebase = false): Promise => {
+ await spawn(getCLIPath(testingWithLatestCodebase), ['push', '--yes'], {
+ cwd,
+ stripColors: true,
+ noOutputTimeout: pushTimeoutMS,
+ }).runAsync();
+};
+
/**
* Function to test amplify push with codegen for graphql API
*/
@@ -203,8 +214,8 @@ export function amplifyPushUpdateLegacy(
/**
* Function to test amplify push
*/
-export const amplifyPushAuth = (cwd: string, testingWithLatestCodebase = false): Promise =>
- spawn(getCLIPath(testingWithLatestCodebase), ['push'], { cwd, stripColors: true, noOutputTimeout: pushTimeoutMS })
+export const amplifyPushAuth = (cwd: string, testingWithLatestCodebase = false, env?: Record): Promise =>
+ spawn(getCLIPath(testingWithLatestCodebase), ['push'], { cwd, stripColors: true, noOutputTimeout: pushTimeoutMS, env })
.wait('Are you sure you want to continue?')
.sendYes()
.wait(/.*/)
@@ -400,14 +411,18 @@ export const amplifyPushDestructiveApiUpdate = (cwd: string, includeForce: boole
/**
* Function to test amplify push with overrides functionality
*/
-export const amplifyPushOverride = async (cwd: string, testingWithLatestCodebase = false): Promise => {
+export const amplifyPushOverride = async (
+ cwd: string,
+ testingWithLatestCodebase = false,
+ env: Record = {},
+): Promise => {
// Test detailed status
await spawn(getCLIPath(testingWithLatestCodebase), ['status', '-v'], { cwd, stripColors: true, noOutputTimeout: pushTimeoutMS })
.wait(/.*/)
.runAsync();
// Test amplify push
- await spawn(getCLIPath(testingWithLatestCodebase), ['push'], { cwd, stripColors: true, noOutputTimeout: pushTimeoutMS })
+ await spawn(getCLIPath(testingWithLatestCodebase), ['push'], { cwd, stripColors: true, noOutputTimeout: pushTimeoutMS, env })
.wait('Are you sure you want to continue?')
.sendConfirmYes()
.wait(/.*/)
diff --git a/packages/amplify-e2e-core/src/init/initProjectHelper.ts b/packages/amplify-e2e-core/src/init/initProjectHelper.ts
index 5771cf9f17b..88c32280bf4 100644
--- a/packages/amplify-e2e-core/src/init/initProjectHelper.ts
+++ b/packages/amplify-e2e-core/src/init/initProjectHelper.ts
@@ -27,6 +27,8 @@ const defaultSettings = {
providerConfig: undefined,
permissionsBoundaryArn: undefined,
includeUsageDataPrompt: true,
+ includeGen2RecommendationPrompt: true,
+ testingWithLatestCodebase: false,
};
export function initJSProjectWithProfile(cwd: string, settings?: Partial): Promise {
@@ -53,12 +55,22 @@ export function initJSProjectWithProfile(cwd: string, settings?: Partial 20) console.warn('Project names should not be longer than 20 characters. This may cause tests to break.');
- const chain = spawn(getCLIPath(), cliArgs, {
+ const chain = spawn(getCLIPath(s.testingWithLatestCodebase), cliArgs, {
cwd,
stripColors: true,
env,
disableCIDetection: s.disableCIDetection,
- })
+ });
+
+ if (s.includeGen2RecommendationPrompt) {
+ chain
+ .wait('Do you want to continue with Amplify Gen 1?')
+ .sendYes()
+ .wait('Why would you like to use Amplify Gen 1?')
+ .sendCarriageReturn();
+ }
+
+ chain
.wait('Enter a name for the project')
.sendLine(s.name)
.wait('Initialize the project with the above configuration?')
@@ -90,7 +102,7 @@ export function initJSProjectWithProfile(cwd: string, settings?: Partial {
@@ -170,6 +186,10 @@ export function initIosProjectWithProfile(cwd: string, settings: Record {
@@ -199,6 +219,40 @@ export function initIosProjectWithProfile(cwd: string, settings: Record {
+ return spawn(getCLIPath(), ['init'], {
+ cwd,
+ stripColors: true,
+ })
+ .wait('Do you want to continue with Amplify Gen 1?')
+ .sendYes()
+ .wait('Why would you like to use Amplify Gen 1?')
+ .sendCarriageReturn()
+ .wait('Enter a name for the project')
+ .sendCarriageReturn()
+ .wait('Initialize the project with the above configuration?')
+ .sendConfirmNo()
+ .wait('Enter a name for the environment')
+ .sendLine(defaultSettings.envName)
+ .wait('Choose your default editor:')
+ .sendKeyDown(2)
+ .sendCarriageReturn()
+ .wait("Choose the type of app that you're building")
+ .sendLine('ios')
+ .wait('Select the authentication method you want to use:')
+ .sendCarriageReturn()
+ .wait('Please choose the profile you want to use')
+ .sendLine(defaultSettings.profileName)
+ .wait(/Help improve Amplify CLI by sharing non( |-)sensitive( | project )configurations on failures/)
+ .sendYes()
+ .wait('Updating Xcode project:')
+ .wait('Amplify project found.')
+ .wait('Amplify config files found.')
+ .wait('Successfully updated project')
+ .wait('Amplify setup completed successfully.')
+ .runAsync();
+}
+
export function initFlutterProjectWithProfile(cwd: string, settings: Record): Promise {
const s = { ...defaultSettings, ...settings };
@@ -206,6 +260,10 @@ export function initFlutterProjectWithProfile(cwd: string, settings: Record {
const chain = spawn(getCLIPath(), ['init'], { cwd, stripColors: true })
+ .wait('Do you want to continue with Amplify Gen 1?')
+ .sendYes()
+ .wait('Why would you like to use Amplify Gen 1?')
+ .sendCarriageReturn()
.wait('Enter a name for the project')
.sendLine(s.name)
.wait('Initialize the project with the above configuration?')
@@ -226,7 +284,7 @@ export function initFlutterProjectWithProfile(cwd: string, settings: Record {
@@ -255,6 +313,10 @@ export function initProjectWithAccessKey(
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
},
})
+ .wait('Do you want to continue with Amplify Gen 1?')
+ .sendYes()
+ .wait('Why would you like to use Amplify Gen 1?')
+ .sendCarriageReturn()
.wait('Enter a name for the project')
.sendLine(s.name)
.wait('Initialize the project with the above configuration?')
@@ -289,7 +351,7 @@ export function initProjectWithAccessKey(
singleSelect(chain, s.region, amplifyRegions);
chain
- .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures')
+ .wait('Help improve Amplify CLI by sharing non-sensitive project configurations on failures')
.sendYes()
.wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/)
.run((err: Error) => {
@@ -482,6 +544,16 @@ export function amplifyStatus(cwd: string, expectedStatus: string, testingWithLa
});
}
-export function initHeadless(cwd: string, envName: string, appId: string): Promise {
- return spawn(getCLIPath(), ['init', '--yes', '--envName', envName, '--appId', appId], { cwd, stripColors: true }).runAsync();
+export function initHeadless(cwd: string, envName?: string, appId?: string): Promise {
+ const cliArgs = ['init', '--yes'];
+
+ if (envName) {
+ cliArgs.push('--envName', envName);
+ }
+
+ if (appId) {
+ cliArgs.push('--appId', appId);
+ }
+
+ return spawn(getCLIPath(), cliArgs, { cwd, stripColors: true }).runAsync();
}
diff --git a/packages/amplify-e2e-core/src/nexpect-reporter.js b/packages/amplify-e2e-core/src/nexpect-reporter.js
index e9f3a5392f5..47fd9ba5b75 100644
--- a/packages/amplify-e2e-core/src/nexpect-reporter.js
+++ b/packages/amplify-e2e-core/src/nexpect-reporter.js
@@ -96,8 +96,8 @@ class AmplifyCLIExecutionReporter {
}),
);
}
- let sanitizedSections = [];
- for (let section of commandAndParams) {
+ const sanitizedSections = [];
+ for (const section of commandAndParams) {
// this ensures only alphanumeric values are in the file name
sanitizedSections.push(section.replace(/[^a-z0-9]/gi, '_').toLowerCase());
}
diff --git a/packages/amplify-e2e-tests/src/schema-api-directives/authHelper.ts b/packages/amplify-e2e-core/src/utils/auth-utils.ts
similarity index 50%
rename from packages/amplify-e2e-tests/src/schema-api-directives/authHelper.ts
rename to packages/amplify-e2e-core/src/utils/auth-utils.ts
index 9b6f490577e..194efe18861 100644
--- a/packages/amplify-e2e-tests/src/schema-api-directives/authHelper.ts
+++ b/packages/amplify-e2e-core/src/utils/auth-utils.ts
@@ -1,16 +1,24 @@
+import { Amplify, Auth } from 'aws-amplify';
+import AWSAppSyncClient, { AUTH_TYPE } from 'aws-appsync';
import { CognitoIdentityServiceProvider } from 'aws-sdk';
-import { getProjectMeta, getBackendAmplifyMeta } from '@aws-amplify/amplify-e2e-core';
-import Amplify, { Auth } from 'aws-amplify';
import fs from 'fs-extra';
import path from 'path';
-import AWSAppSyncClient, { AUTH_TYPE } from 'aws-appsync';
+import { getAwsAndroidConfig, getAwsIOSConfig, getBackendAmplifyMeta, getCLIInputs, getProjectMeta, setCLIInputs } from './projectMeta';
+import { getUserPoolClients } from './sdk-calls';
+import { AddAuthUserPoolOnlyWithOAuthSettings } from '../categories';
-const tempPassword = 'tempPassword';
+const tempPassword = 'tempPassword1@';
//setupUser will add user to a cognito group and make its status to be "CONFIRMED",
//if groupName is specified, add the user to the group.
-export async function setupUser(userPoolId: string, username: string, password: string, groupName?: string) {
- const cognitoClient = getConfiguredCognitoClient();
+export async function setupUser(
+ userPoolId: string,
+ username: string,
+ password: string,
+ groupName?: string,
+ region?: string,
+): Promise {
+ const cognitoClient = getConfiguredCognitoClient(region);
await cognitoClient
.adminCreateUser({
UserPoolId: userPoolId,
@@ -34,12 +42,8 @@ export async function setupUser(userPoolId: string, username: string, password:
}
}
-export async function addUserToGroup(
- cognitoClient: CognitoIdentityServiceProvider,
- userPoolId: string,
- username: string,
- groupName?: string,
-) {
+export async function addUserToGroup(userPoolId: string, username: string, groupName: string, region?: string): Promise {
+ const cognitoClient = getConfiguredCognitoClient(region);
await cognitoClient
.adminAddUserToGroup({
UserPoolId: userPoolId,
@@ -49,14 +53,14 @@ export async function addUserToGroup(
.promise();
}
-export function getConfiguredCognitoClient(): CognitoIdentityServiceProvider {
- const cognitoClient = new CognitoIdentityServiceProvider({ apiVersion: '2016-04-19', region: process.env.CLI_REGION });
+export function getConfiguredCognitoClient(region = process.env.CLI_REGION): CognitoIdentityServiceProvider {
+ const cognitoClient = new CognitoIdentityServiceProvider({ apiVersion: '2016-04-19', region });
const awsconfig = {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
sessionToken: process.env.AWS_SESSION_TOKEN,
- region: process.env.CLI_REGION,
+ region,
};
cognitoClient.config.update(awsconfig);
@@ -64,7 +68,7 @@ export function getConfiguredCognitoClient(): CognitoIdentityServiceProvider {
return cognitoClient;
}
-export function getConfiguredAppsyncClientCognitoAuth(url: string, region: string, user: any): any {
+export function getConfiguredAppsyncClientCognitoAuth(url: string, region: string, user: any) {
return new AWSAppSyncClient({
url,
region,
@@ -76,7 +80,7 @@ export function getConfiguredAppsyncClientCognitoAuth(url: string, region: strin
});
}
-export function getConfiguredAppsyncClientOIDCAuth(url: string, region: string, user: any): any {
+export function getConfiguredAppsyncClientOIDCAuth(url: string, region: string, user: any) {
return new AWSAppSyncClient({
url,
region,
@@ -100,7 +104,7 @@ export function getConfiguredAppsyncClientAPIKeyAuth(url: string, region: string
});
}
-export function getConfiguredAppsyncClientIAMAuth(url: string, region: string): any {
+export function getConfiguredAppsyncClientIAMAuth(url: string, region: string) {
return new AWSAppSyncClient({
url,
region,
@@ -121,6 +125,10 @@ export async function signInUser(username: string, password: string) {
return user;
}
+export async function signOutUser(): Promise {
+ await Auth.signOut({ global: true });
+}
+
export function configureAmplify(projectDir: string) {
const awsconfig = getAWSExports(projectDir);
Amplify.configure(awsconfig);
@@ -136,25 +144,33 @@ export function getAWSExports(projectDir: string) {
export function getUserPoolId(projectDir: string): string {
const amplifyMeta = getProjectMeta(projectDir);
- const cognitoResource = Object.values(amplifyMeta.auth).find((res: any) => {
+ const cognitoResource = Object.values<{ service: string; output: { UserPoolId: string } }>(amplifyMeta.auth).find((res) => {
return res.service === 'Cognito';
- }) as any;
+ });
return cognitoResource.output.UserPoolId;
}
+export function getHostedUIDomain(projectDir: string): string {
+ const amplifyMeta = getProjectMeta(projectDir);
+ const cognitoResource = Object.values<{ service: string; output: { HostedUIDomain: string } }>(amplifyMeta.auth).find((res) => {
+ return res.service === 'Cognito';
+ });
+ return cognitoResource.output.HostedUIDomain;
+}
+
export function getCognitoResourceName(projectDir: string): string {
const amplifyMeta = getBackendAmplifyMeta(projectDir);
- const cognitoResourceName = Object.keys(amplifyMeta.auth).find((key: any) => {
+ const cognitoResourceName = Object.keys(amplifyMeta.auth).find((key: string) => {
return amplifyMeta.auth[key].service === 'Cognito';
- }) as any;
+ });
return cognitoResourceName;
}
export function getApiKey(projectDir: string): string {
const amplifyMeta = getProjectMeta(projectDir);
- const appsyncResource = Object.values(amplifyMeta.api).find((res: any) => {
+ const appsyncResource = Object.values<{ service: string; output: { GraphQLAPIKeyOutput: string } }>(amplifyMeta.api).find((res) => {
return res.service === 'AppSync';
- }) as any;
+ });
return appsyncResource.output.GraphQLAPIKeyOutput;
}
@@ -166,11 +182,11 @@ export async function authenticateUser(username: string, tempPassword: string, p
}
}
-export function getUserPoolIssUrl(projectDir: string) {
+export function getUserPoolIssUrl(projectDir: string): string {
const amplifyMeta = getProjectMeta(projectDir);
- const cognitoResource = Object.values(amplifyMeta.auth).find((res: any) => {
+ const cognitoResource = Object.values<{ service: string; output: { UserPoolId: string } }>(amplifyMeta.auth).find((res) => {
return res.service === 'Cognito';
- }) as any;
+ });
const userPoolId = cognitoResource.output.UserPoolId;
const region = amplifyMeta.providers.awscloudformation.Region;
@@ -180,9 +196,72 @@ export function getUserPoolIssUrl(projectDir: string) {
export function getAppClientIDWeb(projectDir: string) {
const amplifyMeta = getProjectMeta(projectDir);
- const cognitoResource = Object.values(amplifyMeta.auth).find((res: any) => {
+ const cognitoResource = Object.values<{ service: string; output: { AppClientIDWeb: string } }>(amplifyMeta.auth).find((res) => {
return res.service === 'Cognito';
- }) as any;
+ });
return cognitoResource.output.AppClientIDWeb;
}
+
+/**
+ * asserts app client secret in projects files and on cloud
+ */
+export const assertAppClientSecretInFiles = async (projRoot: string, frontend: 'android' | 'ios'): Promise => {
+ let config;
+ switch (frontend) {
+ case 'android':
+ config = await getAwsAndroidConfig(projRoot);
+ break;
+ case 'ios':
+ config = await getAwsIOSConfig(projRoot);
+ break;
+ }
+ const clientSecretInAwsConfig = config.CognitoUserPool.Default.AppClientSecret;
+ expect(clientSecretInAwsConfig).toBeDefined();
+ const meta = getProjectMeta(projRoot);
+ const id = Object.keys(meta.auth)[0];
+ const authMeta = meta.auth[id];
+ const clientIds = [authMeta.output.AppClientID];
+ const clientSecretInMetaFile = authMeta.output.AppClientSecret;
+ // compare client secret in meta file and ios config file
+ expect(clientSecretInMetaFile).toBeDefined();
+ expect(clientSecretInAwsConfig).toEqual(clientSecretInMetaFile);
+ const clients = await getUserPoolClients(authMeta.output.UserPoolId, clientIds, meta.providers.awscloudformation.Region);
+ expect(clients[0].UserPoolClient.ClientSecret).toBeDefined();
+ // compare client secret in meta file with cloud value
+ expect(clients[0].UserPoolClient.ClientSecret).toEqual(clientSecretInMetaFile);
+};
+
+export const updateCLIParametersToGenerateUserPoolClientSecret = (projRoot: string, resourceName?: string) => {
+ if (!resourceName) {
+ const meta = getProjectMeta(projRoot);
+ resourceName = Object.keys(meta.auth)[0];
+ }
+ // update parameter to generate client Secret
+ const parameters = getCLIInputs(projRoot, 'auth', resourceName);
+ parameters.cognitoConfig.userpoolClientGenerateSecret = true;
+ setCLIInputs(projRoot, 'auth', resourceName, parameters);
+};
+
+export const createUserPoolOnlyWithOAuthSettings = (projectPrefix: string, shortId: string): AddAuthUserPoolOnlyWithOAuthSettings => {
+ return {
+ resourceName: `${projectPrefix}oares${shortId}`,
+ userPoolName: `${projectPrefix}oaup${shortId}`,
+ domainPrefix: `${projectPrefix}oadom${shortId}`,
+ signInUrl1: 'https://sin1/',
+ signInUrl2: 'https://sin2/',
+ signOutUrl1: 'https://sout1/',
+ signOutUrl2: 'https://sout2/',
+ facebookAppId: 'facebookAppId',
+ facebookAppSecret: 'facebookAppSecret',
+ googleAppId: 'googleAppId',
+ googleAppSecret: 'googleAppSecret',
+ amazonAppId: 'amazonAppId',
+ amazonAppSecret: 'amazonAppSecret',
+ appleAppClientId: 'com.fake.app',
+ appleAppTeamId: '2QLEWNDK6K',
+ appleAppKeyID: '2QLZXKYJ8J',
+ appleAppPrivateKey:
+ '----BEGIN PRIVATE KEY----MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgIltgNsTgTfSzUadYiCS0VYtDDMFln/J8i1yJsSIw5g+gCgYIKoZIzj0DAQehRANCAASI8E0L/DhR/mIfTT07v3VwQu6q8I76lgn7kFhT0HvWoLuHKGQFcFkXXCgztgBrprzd419mUChAnKE6y89bWcNw----END PRIVATE KEY----',
+ };
+};
diff --git a/packages/amplify-e2e-core/src/utils/credentials-rotator.ts b/packages/amplify-e2e-core/src/utils/credentials-rotator.ts
new file mode 100644
index 00000000000..e0e82f849d1
--- /dev/null
+++ b/packages/amplify-e2e-core/src/utils/credentials-rotator.ts
@@ -0,0 +1,70 @@
+import { AssumeRoleCommand, STSClient } from '@aws-sdk/client-sts';
+import { fromContainerMetadata } from '@aws-sdk/credential-providers';
+import { generateRandomShortId, TEST_PROFILE_NAME } from './index';
+import * as ini from 'ini';
+import * as fs from 'fs-extra';
+import { pathManager } from '@aws-amplify/amplify-cli-core';
+
+const refreshCredentials = async (roleArn: string) => {
+ const client = new STSClient({
+ // Use CodeBuild role to assume test account role. I.e. don't read credentials from process.env
+ credentials: fromContainerMetadata(),
+ });
+ const sessionName = `testSession${generateRandomShortId()}`;
+ const command = new AssumeRoleCommand({
+ RoleArn: roleArn,
+ RoleSessionName: sessionName,
+ DurationSeconds: 3600,
+ });
+ const response = await client.send(command);
+
+ const profileName = TEST_PROFILE_NAME;
+ const credentialsContents = ini.parse((await fs.readFile(pathManager.getAWSCredentialsFilePath())).toString());
+ credentialsContents[profileName] = credentialsContents[profileName] || {};
+ credentialsContents[profileName].aws_access_key_id = response.Credentials.AccessKeyId;
+ credentialsContents[profileName].aws_secret_access_key = response.Credentials.SecretAccessKey;
+ credentialsContents[profileName].aws_session_token = response.Credentials.SessionToken;
+ process.env.AWS_ACCESS_KEY_ID = response.Credentials.AccessKeyId;
+ process.env.AWS_SECRET_ACCESS_KEY = response.Credentials.SecretAccessKey;
+ process.env.AWS_SESSION_TOKEN = response.Credentials.SessionToken;
+ await fs.writeFile(pathManager.getAWSCredentialsFilePath(), ini.stringify(credentialsContents));
+};
+
+const tryRefreshCredentials = async (roleArn: string) => {
+ try {
+ await refreshCredentials(roleArn);
+ console.log('Test profile credentials refreshed');
+ } catch (e) {
+ console.error('Test profile credentials request failed');
+ console.error(e);
+ }
+};
+
+let isRotationBackgroundTaskAlreadyScheduled = false;
+
+/**
+ * Schedules a background task that attempts to refresh test account credentials
+ * on given interval.
+ *
+ * No-op outside Amplify CI environment.
+ *
+ * No-op if a background task has already been scheduled.
+ */
+export const tryScheduleCredentialRefresh = () => {
+ if (!process.env.IS_AMPLIFY_CI || !process.env.TEST_ACCOUNT_ROLE || isRotationBackgroundTaskAlreadyScheduled) {
+ return;
+ }
+
+ if (!process.env.USE_PARENT_ACCOUNT) {
+ throw new Error('Credentials rotator supports only tests running in parent account at this time');
+ }
+
+ // Attempts to refresh credentials in background every 15 minutes.
+ setInterval(() => {
+ void tryRefreshCredentials(process.env.TEST_ACCOUNT_ROLE);
+ }, 15 * 60 * 1000);
+
+ isRotationBackgroundTaskAlreadyScheduled = true;
+
+ console.log('Test profile credentials refresh was scheduled');
+};
diff --git a/packages/amplify-e2e-core/src/utils/index.ts b/packages/amplify-e2e-core/src/utils/index.ts
index 19652691bf6..af69143a86c 100644
--- a/packages/amplify-e2e-core/src/utils/index.ts
+++ b/packages/amplify-e2e-core/src/utils/index.ts
@@ -10,6 +10,7 @@ import { getLayerDirectoryName, LayerDirectoryType } from '..';
export * from './add-circleci-tags';
export * from './api';
export * from './appsync';
+export * from './auth-utils';
export * from './envVars';
export * from './getAppId';
export * from './headless';
@@ -28,12 +29,18 @@ export * from './admin-ui';
export * from './hooks';
export * from './git-operations';
export * from './help';
+export * from './credentials-rotator';
/**
* Whether the current environment is CircleCI or not
*/
export const isCI = (): boolean => JSON.parse(process.env.CI || 'false') && JSON.parse(process.env.CIRCLECI || 'false');
+/**
+ * Whether the current run is smoke test run.
+ */
+export const isSmokeTestRun = (): boolean => JSON.parse(process.env.IS_AMPLIFY_CLI_SMOKE_TEST_RUN || 'false');
+
// eslint-disable-next-line spellcheck/spell-checker
export const TEST_PROFILE_NAME = isCI() ? 'amplify-integ-test-user' : 'default';
diff --git a/packages/amplify-e2e-core/src/utils/nexpect.ts b/packages/amplify-e2e-core/src/utils/nexpect.ts
index f5946e704a2..1071f556723 100644
--- a/packages/amplify-e2e-core/src/utils/nexpect.ts
+++ b/packages/amplify-e2e-core/src/utils/nexpect.ts
@@ -160,7 +160,7 @@ function chain(context: Context): ExecutionContext {
wait(
expectation: string | RegExp,
- callback = (data: string) => {
+ callback: (data: string) => void = () => {
// empty
},
): ExecutionContext {
@@ -307,7 +307,7 @@ function chain(context: Context): ExecutionContext {
},
name: '_send',
shift: true,
- description: "'[send] Y ",
+ description: '[send] N',
requiresInput: false,
};
context.queue.push(_send);
@@ -737,7 +737,7 @@ export function nspawn(command: string | string[], params: string[] = [], option
}
const testingWithLatestCodebase = isTestingWithLatestCodebase(command);
- if (testingWithLatestCodebase || (process.platform === 'win32' && !command.endsWith('.exe'))) {
+ if (testingWithLatestCodebase || (process.platform === 'win32' && !(command.endsWith('.exe') || command.endsWith('.cmd')))) {
params.unshift(command);
command = getScriptRunnerPath(testingWithLatestCodebase);
}
@@ -753,7 +753,7 @@ export function nspawn(command: string | string[], params: string[] = [], option
// For push operations in E2E we have to explicitly disable the Amplify Console App creation
// as for the tests that need it, it is already enabled for init, setting the env var here
// disables the post push check we have in the CLI.
- if (params.length > 0 && params.find((param: string) => param.toLowerCase() === 'push')) {
+ if (params.length > 0 && params.some((param: string) => param.toLowerCase() === 'push')) {
pushEnv = {
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
};
@@ -771,14 +771,9 @@ export function nspawn(command: string | string[], params: string[] = [], option
};
// Undo ci-info detection, required for some tests
+ // see https://github.com/watson/ci-info/blob/master/index.js#L57
if (options.disableCIDetection === true) {
- delete childEnv.CI;
- delete childEnv.CONTINUOUS_INTEGRATION;
- delete childEnv.BUILD_NUMBER;
- delete childEnv.TRAVIS;
- delete childEnv.GITHUB_ACTIONS;
- delete childEnv.CIRCLECI;
- delete childEnv.CIRCLE_PULL_REQUEST;
+ childEnv.CI = false;
}
}
diff --git a/packages/amplify-e2e-core/src/utils/pinpoint.ts b/packages/amplify-e2e-core/src/utils/pinpoint.ts
index b9f6ec9aec8..eb40a64d1e9 100644
--- a/packages/amplify-e2e-core/src/utils/pinpoint.ts
+++ b/packages/amplify-e2e-core/src/utils/pinpoint.ts
@@ -1,5 +1,4 @@
import { Pinpoint } from 'aws-sdk';
-import _ from 'lodash';
import { EOL } from 'os';
import { getCLIPath, nspawn as spawn, singleSelect, amplifyRegions, addCircleCITags, KEY_DOWN_ARROW } from '..';
@@ -67,6 +66,10 @@ export function initProjectForPinpoint(cwd: string): Promise {
CLI_DEV_INTERNAL_DISABLE_AMPLIFY_APP_CREATION: '1',
},
})
+ .wait('Do you want to continue with Amplify Gen 1?')
+ .sendYes()
+ .wait('Why would you like to use Amplify Gen 1?')
+ .sendCarriageReturn()
.wait('Enter a name for the project')
.sendLine(settings.name)
.wait('Initialize the project with the above configuration?')
@@ -101,7 +104,7 @@ export function initProjectForPinpoint(cwd: string): Promise {
singleSelect(chain, settings.region, amplifyRegions);
chain
- .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures')
+ .wait('Help improve Amplify CLI by sharing non-sensitive project configurations on failures')
.sendYes()
.wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/)
.run((err: Error) => {
@@ -117,7 +120,7 @@ export function initProjectForPinpoint(cwd: string): Promise {
/**
* adds a pinpoint resource, you may specific a name for the resource
*/
-export function addPinpointAnalytics(cwd: string, testingWithLatestCodebase = true, pinPointResourceName?: string): Promise {
+export function addPinpointAnalytics(cwd: string, testingWithLatestCodebase = false, pinPointResourceName?: string): Promise {
const resourceName = pinPointResourceName || settings.pinpointResourceName;
return new Promise((resolve, reject) => {
spawn(getCLIPath(testingWithLatestCodebase), ['add', 'analytics'], { cwd, stripColors: true })
diff --git a/packages/amplify-e2e-core/src/utils/sdk-calls.ts b/packages/amplify-e2e-core/src/utils/sdk-calls.ts
index 0ebc0b24adf..5e0f5f0acf4 100644
--- a/packages/amplify-e2e-core/src/utils/sdk-calls.ts
+++ b/packages/amplify-e2e-core/src/utils/sdk-calls.ts
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable no-return-await */
import {
- config,
DynamoDB,
S3,
+ CognitoIdentity,
CognitoIdentityServiceProvider,
Lambda,
LexModelBuildingService,
@@ -134,22 +134,107 @@ export const deleteS3Bucket = async (bucket: string, providedS3Client: S3 | unde
};
export const getUserPool = async (userpoolId, region) => {
- config.update({ region });
let res;
try {
- res = await new CognitoIdentityServiceProvider().describeUserPool({ UserPoolId: userpoolId }).promise();
+ res = await new CognitoIdentityServiceProvider({ region }).describeUserPool({ UserPoolId: userpoolId }).promise();
} catch (e) {
console.log(e);
}
return res;
};
+export const deleteUserPoolDomain = async (domain: string, userpoolId: string, region: string) => {
+ let res;
+ try {
+ res = await new CognitoIdentityServiceProvider({ region }).deleteUserPoolDomain({ Domain: domain, UserPoolId: userpoolId }).promise();
+ } catch (e) {
+ console.log(e);
+ }
+ return res;
+};
+
+export const deleteSocialIdpProviders = async (providers: string[], userpoolId: string, region: string) => {
+ for (const provider of providers) {
+ try {
+ await new CognitoIdentityServiceProvider({ region })
+ .deleteIdentityProvider({ ProviderName: provider, UserPoolId: userpoolId })
+ .promise();
+ } catch (err) {
+ console.log(err);
+ }
+ }
+};
+
+export const listSocialIdpProviders = async (userpoolId: string, region: string) => {
+ let res;
+ try {
+ res = await new CognitoIdentityServiceProvider({ region }).listIdentityProviders({ UserPoolId: userpoolId }).promise();
+ } catch (err) {
+ console.log(err);
+ }
+ return res;
+};
+
+export const getSocialIdpProvider = async (
+ userpoolId: string,
+ providerName: 'Facebook' | 'Google' | 'LoginWithAmazon' | 'SignInWithApple',
+ region: string,
+) => {
+ let res;
+ try {
+ res = await new CognitoIdentityServiceProvider({ region })
+ .describeIdentityProvider({
+ UserPoolId: userpoolId,
+ ProviderName: providerName,
+ })
+ .promise();
+ } catch (err) {
+ console.log(err);
+ }
+ return res;
+};
+
+export const getUserPoolDomain = async (domain: string, region: string) => {
+ let res;
+ try {
+ res = await new CognitoIdentityServiceProvider({ region })
+ .describeUserPoolDomain({
+ Domain: domain,
+ })
+ .promise();
+ } catch (err) {
+ console.log(err);
+ }
+ return res;
+};
+
+export const getIdentityPoolRoles = async (identityPoolId: string, region: string) => {
+ let res;
+
+ try {
+ res = await new CognitoIdentity({ region }).getIdentityPoolRoles({ IdentityPoolId: identityPoolId }).promise();
+ } catch (e) {
+ console.log(e);
+ }
+
+ return res;
+};
+
+export const listUserPools = async (region, maxResults = 5) => {
+ let res;
+ try {
+ res = await new CognitoIdentityServiceProvider({ region }).listUserPools({ MaxResults: maxResults }).promise();
+ } catch (e) {
+ console.log(e);
+ }
+ return res?.UserPools ?? [];
+};
+
export const getMFAConfiguration = async (
userPoolId: string,
region: string,
): Promise => {
- config.update({ region });
- return await new CognitoIdentityServiceProvider().getUserPoolMfaConfig({ UserPoolId: userPoolId }).promise();
+ return await new CognitoIdentityServiceProvider({ region }).getUserPoolMfaConfig({ UserPoolId: userPoolId }).promise();
};
export const getLambdaFunction = async (functionName: string, region: string) => {
@@ -193,6 +278,18 @@ export const addUserToUserPool = async (userPoolId: string, region: string) => {
await provider.adminCreateUser(params).promise();
};
+/**
+ * list all users in a Cognito user pool
+ */
+export const listUsersInUserPool = async (userPoolId: string, region: string): Promise => {
+ const provider = new CognitoIdentityServiceProvider({ region });
+ const params = {
+ UserPoolId: userPoolId /* required */,
+ };
+ const { Users } = await provider.listUsers(params).promise();
+ return Users.map((u) => u.Username);
+};
+
/**
* list all userPool groups to which a user belongs to
*/
@@ -342,8 +439,7 @@ export const putKinesisRecords = async (data: string, partitionKey: string, stre
};
export const getCloudWatchEventRule = async (targetName: string, region: string) => {
- config.update({ region });
- const service = new CloudWatchEvents();
+ const service = new CloudWatchEvents({ region });
const params = {
TargetArn: targetName /* required */,
};
diff --git a/packages/amplify-e2e-tests/CHANGELOG.md b/packages/amplify-e2e-tests/CHANGELOG.md
index 995fbc83ff6..713da3c02e2 100644
--- a/packages/amplify-e2e-tests/CHANGELOG.md
+++ b/packages/amplify-e2e-tests/CHANGELOG.md
@@ -3,6 +3,386 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.11.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.11.1...amplify-e2e-tests@4.11.2) (2025-01-30)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.11.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.11.0...amplify-e2e-tests@4.11.1) (2025-01-16)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+# [4.11.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.10.1...amplify-e2e-tests@4.11.0) (2025-01-02)
+
+
+### Bug Fixes
+
+* UIBuilder test ([#14047](https://github.com/aws-amplify/amplify-cli/issues/14047)) ([c1d60c4](https://github.com/aws-amplify/amplify-cli/commit/c1d60c46617501dd408d4f78d16e8828886e23cb))
+
+
+### Features
+
+* lambda dotnet 8 support ([#14026](https://github.com/aws-amplify/amplify-cli/issues/14026)) ([540bfe1](https://github.com/aws-amplify/amplify-cli/commit/540bfe1187907609c3c813e1208c12b6a2a6ac6c))
+
+
+
+
+
+## [4.10.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.10.0...amplify-e2e-tests@4.10.1) (2024-11-18)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+# [4.10.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.11...amplify-e2e-tests@4.10.0) (2024-10-05)
+
+
+### Bug Fixes
+
+* update message when expecting s3 to throw ([de45143](https://github.com/aws-amplify/amplify-cli/commit/de45143f83b92781c6412da9a49257ab5f94eeab))
+
+
+### Features
+
+* add init prompts for Gen2 ([#13849](https://github.com/aws-amplify/amplify-cli/issues/13849)) ([7ab8fae](https://github.com/aws-amplify/amplify-cli/commit/7ab8faef1e2ce0c15db783d236aeee9d312ec135))
+
+
+
+
+
+## [4.9.11](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.10...amplify-e2e-tests@4.9.11) (2024-08-02)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.10](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.9...amplify-e2e-tests@4.9.10) (2024-06-27)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.9](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.8...amplify-e2e-tests@4.9.9) (2024-06-20)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.8](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.7...amplify-e2e-tests@4.9.8) (2024-06-06)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.7](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.6...amplify-e2e-tests@4.9.7) (2024-05-24)
+
+
+### Bug Fixes
+
+* don't create symlinks after extracting zip ([#13791](https://github.com/aws-amplify/amplify-cli/issues/13791)) ([08f358d](https://github.com/aws-amplify/amplify-cli/commit/08f358da33163fa70930ae6ef900e1d018672ef1))
+
+
+
+
+
+## [4.9.6](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.5...amplify-e2e-tests@4.9.6) (2024-05-07)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.5](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.4...amplify-e2e-tests@4.9.5) (2024-04-18)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.3...amplify-e2e-tests@4.9.4) (2024-04-15)
+
+
+### Bug Fixes
+
+* upgrade Go runtime and fix e2e ([#13671](https://github.com/aws-amplify/amplify-cli/issues/13671)) ([395f717](https://github.com/aws-amplify/amplify-cli/commit/395f717cf52e7beef76f00ee08d37877138b0c30))
+* yarn modern install workspace ([#13197](https://github.com/aws-amplify/amplify-cli/issues/13197)) ([3ca4aa9](https://github.com/aws-amplify/amplify-cli/commit/3ca4aa99457e54a89805f86e56b475aaef531d7e))
+
+
+
+
+
+## [4.9.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.2...amplify-e2e-tests@4.9.3) (2024-03-29)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.9.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.1...amplify-e2e-tests@4.9.2) (2024-03-06)
+
+
+### Bug Fixes
+
+* limit query parameter parsing in auth admin api ([#13512](https://github.com/aws-amplify/amplify-cli/issues/13512)) ([2480681](https://github.com/aws-amplify/amplify-cli/commit/24806814ce2275fe7d70e5484c3c485023b8041a))
+
+
+
+
+
+## [4.9.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.9.0...amplify-e2e-tests@4.9.1) (2023-12-16)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+# [4.9.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.8.5...amplify-e2e-tests@4.9.0) (2023-12-11)
+
+
+### Features
+
+* bump data dependencies to launch RDS feature ([#13409](https://github.com/aws-amplify/amplify-cli/issues/13409)) ([7fbf29f](https://github.com/aws-amplify/amplify-cli/commit/7fbf29f56eb7335d20de0b5526fbed7795a2af09))
+
+
+
+
+
+## [4.8.5](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.8.3...amplify-e2e-tests@4.8.5) (2023-11-08)
+
+
+### Bug Fixes
+
+* bump versions after unsuccessful release ([#13395](https://github.com/aws-amplify/amplify-cli/issues/13395)) ([7f43363](https://github.com/aws-amplify/amplify-cli/commit/7f433637b052d6dd33fcbf87f390a6b85e9de5b7))
+
+
+
+
+
+## [4.8.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.8.3...amplify-e2e-tests@4.8.4) (2023-11-08)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.8.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.8.2...amplify-e2e-tests@4.8.3) (2023-11-08)
+
+
+### Bug Fixes
+
+* parse cognito pools with service role ([#13365](https://github.com/aws-amplify/amplify-cli/issues/13365)) ([1513938](https://github.com/aws-amplify/amplify-cli/commit/1513938ed2808c407853daf291912c0e644158c9))
+
+
+
+
+
+## [4.8.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.8.1...amplify-e2e-tests@4.8.2) (2023-10-21)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.8.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.8.0...amplify-e2e-tests@4.8.1) (2023-10-12)
+
+
+### Bug Fixes
+
+* add retained secrets to syncSecretDeltas ([#13300](https://github.com/aws-amplify/amplify-cli/issues/13300)) ([f3c9c05](https://github.com/aws-amplify/amplify-cli/commit/f3c9c05617b55560ac78f824cf71d4001cb5c58b))
+* set awscloudformation flag to false in vscode settings after override ([#13310](https://github.com/aws-amplify/amplify-cli/issues/13310)) ([d60e505](https://github.com/aws-amplify/amplify-cli/commit/d60e505391b4f8fc58c2cc4d352698a6157f1b59))
+
+
+
+
+
+# [4.8.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.7.1...amplify-e2e-tests@4.8.0) (2023-10-05)
+
+
+### Bug Fixes
+
+* dependabot alert for openpgp ([#13282](https://github.com/aws-amplify/amplify-cli/issues/13282)) ([49314ad](https://github.com/aws-amplify/amplify-cli/commit/49314ad063cfb3111af2a5406028c5c73958cd24))
+* pulling with env append to local files ([#13227](https://github.com/aws-amplify/amplify-cli/issues/13227)) ([ef1c43f](https://github.com/aws-amplify/amplify-cli/commit/ef1c43fd955596366114e883b2db31fda55feaf8))
+
+
+### Features
+
+* **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
+
+
+
+
+
+## [4.7.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.7.0...amplify-e2e-tests@4.7.1) (2023-10-03)
+
+
+### Bug Fixes
+
+* update api category and codegen to capture high-priority bug-fixes ([3836b90](https://github.com/aws-amplify/amplify-cli/commit/3836b90b3f9ccd654d9c1b61a4b83c9c4712290c))
+
+
+
+
+
+# [4.7.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.6.0...amplify-e2e-tests@4.7.0) (2023-09-22)
+
+
+### Bug Fixes
+
+* remove stale data ([#13128](https://github.com/aws-amplify/amplify-cli/issues/13128)) ([9703223](https://github.com/aws-amplify/amplify-cli/commit/970322372278762fff88f7046b44574b611ad210))
+
+
+### Features
+
+* **amplify-frontend-javascript:** generate amplifyconfiguration.json for JS projects ([#13246](https://github.com/aws-amplify/amplify-cli/issues/13246)) ([49457b1](https://github.com/aws-amplify/amplify-cli/commit/49457b100a75dc2c6791780fdf67f76876bcf320))
+
+
+### Reverts
+
+* Revert "test: add function to run init with only yes option" ([08734a9](https://github.com/aws-amplify/amplify-cli/commit/08734a9d2d9dba671ed3cff59b84f4f456c03927))
+
+
+
+
+
+# [4.6.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.5.0...amplify-e2e-tests@4.6.0) (2023-08-31)
+
+
+### Features
+
+* add list all to lambda crud template ([#13116](https://github.com/aws-amplify/amplify-cli/issues/13116)) ([0fde28a](https://github.com/aws-amplify/amplify-cli/commit/0fde28a08a3d82b371cbbf858f462648376a318a))
+
+
+
+
+
+# [4.5.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.4.0...amplify-e2e-tests@4.5.0) (2023-08-17)
+
+
+### Features
+
+* generate components using graphql ([1568581](https://github.com/aws-amplify/amplify-cli/commit/15685810460881aa71e88724398b9be05ba53781))
+
+
+
+
+
+# [4.4.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.3.3...amplify-e2e-tests@4.4.0) (2023-08-09)
+
+
+### Bug Fixes
+
+* remove vm2 ([#12989](https://github.com/aws-amplify/amplify-cli/issues/12989)) ([7bc0b56](https://github.com/aws-amplify/amplify-cli/commit/7bc0b5654a585104a537c1a3f9615bd672435b58))
+* surface override build error if scripting features are disabled ([#13013](https://github.com/aws-amplify/amplify-cli/issues/13013)) ([fa80249](https://github.com/aws-amplify/amplify-cli/commit/fa802491f8767f50dc3636e190fb70eb492fa969))
+
+
+### Features
+
+* replace oauth and userpoolclient lambdas with cfn and sdk calls ([#12935](https://github.com/aws-amplify/amplify-cli/issues/12935)) ([b3ab512](https://github.com/aws-amplify/amplify-cli/commit/b3ab5125f2ec405afd1af9d2f77b8683d5914010))
+* replace role mapping lambda in auth category ([#13003](https://github.com/aws-amplify/amplify-cli/issues/13003)) ([4ce0329](https://github.com/aws-amplify/amplify-cli/commit/4ce032932702305b9f9564a77418855ceb0f0fca))
+
+
+
+
+
+## [4.3.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.3.2...amplify-e2e-tests@4.3.3) (2023-07-28)
+
+
+### Bug Fixes
+
+* surface override build error if scripting features are disabled ([#13013](https://github.com/aws-amplify/amplify-cli/issues/13013)) ([#13023](https://github.com/aws-amplify/amplify-cli/issues/13023)) ([9e99800](https://github.com/aws-amplify/amplify-cli/commit/9e998008c6aef13ee50e6ce88cc78d8e9367b66a))
+
+
+
+
+
+## [4.3.2](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.3.1...amplify-e2e-tests@4.3.2) (2023-07-27)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.3.1](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.3.0...amplify-e2e-tests@4.3.1) (2023-07-24)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+# [4.3.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.2.5...amplify-e2e-tests@4.3.0) (2023-07-20)
+
+
+### Bug Fixes
+
+* added Prepush after init and before deploy ([#12674](https://github.com/aws-amplify/amplify-cli/issues/12674)) ([a54f837](https://github.com/aws-amplify/amplify-cli/commit/a54f83743b5995317170c9b4f5a140e5a1aa57f3))
+* ensure AWS_REGION matches CLI_REGION in all tests ([#12837](https://github.com/aws-amplify/amplify-cli/issues/12837)) ([7be43e4](https://github.com/aws-amplify/amplify-cli/commit/7be43e41ded3bf09fd20cd9d9b95467491344cbe))
+* fetch deployment key from current-cloud-backend ([#12687](https://github.com/aws-amplify/amplify-cli/issues/12687)) ([af0bf82](https://github.com/aws-amplify/amplify-cli/commit/af0bf82d18b3a30d4cdac2cdd14b8534e0ffff1d))
+* fix yarn path ([#12769](https://github.com/aws-amplify/amplify-cli/issues/12769)) ([dca98aa](https://github.com/aws-amplify/amplify-cli/commit/dca98aa35e544dce4cf0ac9f340919b87041e65f))
+* smoke test flakynes ([#12760](https://github.com/aws-amplify/amplify-cli/issues/12760)) ([5654640](https://github.com/aws-amplify/amplify-cli/commit/56546401274820207bc2e64fb682bbe2ed1981f2))
+* update notification channel name lookup ([#12763](https://github.com/aws-amplify/amplify-cli/issues/12763)) ([92ca721](https://github.com/aws-amplify/amplify-cli/commit/92ca721134d59b68e85d4f92f4814d6717a3be3a))
+
+
+### Features
+
+* lambda support for yarn2/3 and pnpm package managers ([#12750](https://github.com/aws-amplify/amplify-cli/issues/12750)) ([fd18195](https://github.com/aws-amplify/amplify-cli/commit/fd181952672efb0479ca6955c0c7a45fe248d1b1))
+* uibuilder codegen service ([#12896](https://github.com/aws-amplify/amplify-cli/issues/12896)) ([3fe2f98](https://github.com/aws-amplify/amplify-cli/commit/3fe2f98a99a9daf22efccb23a031882ea2be899b))
+
+
+### Reverts
+
+* Revert "chore: cleanup stale resources in CodeBuild (#12779)" (#12853) ([d19d17e](https://github.com/aws-amplify/amplify-cli/commit/d19d17ebcace24c9db56331c0c2bd053f8ec0966)), closes [#12779](https://github.com/aws-amplify/amplify-cli/issues/12779) [#12853](https://github.com/aws-amplify/amplify-cli/issues/12853)
+* Revert "test: make test teardown resilient to failures (#12799)" (#12823) ([ec098ca](https://github.com/aws-amplify/amplify-cli/commit/ec098caa57174b928cf6b024a1bc419a65dd8aff)), closes [#12799](https://github.com/aws-amplify/amplify-cli/issues/12799) [#12823](https://github.com/aws-amplify/amplify-cli/issues/12823)
+
+
+
+
+
+## [4.2.5](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.2.4...amplify-e2e-tests@4.2.5) (2023-06-16)
+
+**Note:** Version bump only for package amplify-e2e-tests
+
+
+
+
+
+## [4.2.4](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.2.3...amplify-e2e-tests@4.2.4) (2023-06-13)
+
+
+### Bug Fixes
+
+* deploy category resources when calling amplify push ([#12587](https://github.com/aws-amplify/amplify-cli/issues/12587)) ([260723c](https://github.com/aws-amplify/amplify-cli/commit/260723cb67432308dd35a4ddbedacfbbc69c6c81))
+* do not throw when localEnvInfo is missing on pull (fixes 12492) ([#12528](https://github.com/aws-amplify/amplify-cli/issues/12528)) ([0ae8689](https://github.com/aws-amplify/amplify-cli/commit/0ae8689efbb3907393f493c8707ab025573fb487))
+* remove parameters when resource is deleted or unlinked ([#12544](https://github.com/aws-amplify/amplify-cli/issues/12544)) ([f78fb68](https://github.com/aws-amplify/amplify-cli/commit/f78fb686f4719ef8a487251ded8bf01b9df29dbd))
+
+
+
+
+
## [4.2.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-e2e-tests@4.2.1...amplify-e2e-tests@4.2.3) (2023-05-25)
diff --git a/packages/amplify-e2e-tests/Readme.md b/packages/amplify-e2e-tests/Readme.md
index 77e5daccbbf..eb780cc7401 100644
--- a/packages/amplify-e2e-tests/Readme.md
+++ b/packages/amplify-e2e-tests/Readme.md
@@ -4,27 +4,27 @@ This packages contains end to end tests that are run in CircleCI to ensure that
## Setup
-To run the tests locally, you need to have your AWS credentials stored in a `.env` file of this package. These values are used to configure the test projects.
+To run the tests locally, you need to have your personal AWS credentials stored in a `.env` file of this package. These values are used to configure the test projects.
-Please see sample.env for the keys that are expected in your `.env` file.
+Please see sample.env for the keys that are expected in your `.env` file. Or, for internal engineers, you can copy "Copy bash/zsh" directly from your personal account, and paste it in the terminal.
-The `.env` file does not get commited as its in the `.gitignore` file.
+The `.env` file does not get committed as its in the `.gitignore` file.
-Set `AMPLIFY_PATH` to point to `amplify-cli/bin/amplify`
+Set `AMPLIFY_PATH` to point to `amplify-cli/bin/amplify` or using absolute path `/packages/amplify-cli/bin/amplify`
## Running individual tests
-Amplify E2E tests use Jest. So all the standard Jest comnmads work.
+Amplify E2E tests use Jest. So all the standard Jest commands work.
You can run a single test while adding a new test by running
```bash
cd /packages/amplify-e2e-tests/
-npm run e2e src/__tests__/init.test.ts
+yarn e2e src/__tests__/init_a.test.ts
```
## Writing a new integration test
-E2E tests internally use a forked version of [nexpect](https://www.npmjs.com/package/nexpect) to run the CLI. There are helper methods that helps you to set up and delete project. The recommended pattern is to create a helper method that creates a resources as a helper method so these method could be used in other tests. For instance, `initJSProjectWithProfile` is a helper method that is used in `init` tests and also used in all the other tests to initalize a new Javascript project. The tests should have all the assertions to make sure the resource created by the helper method is setup correctly. We recommend using `aws-sdk` to make assert the resource configuration.
+E2E tests internally use a forked version of [nexpect](https://www.npmjs.com/package/nexpect) to run the CLI. There are helper methods that helps you to set up and delete project. The recommended pattern is to create a helper method that creates a resources as a helper method so these method could be used in other tests. For instance, `initJSProjectWithProfile` is a helper method that is used in `init` tests and also used in all the other tests to initialize a new Javascript project. The tests should have all the assertions to make sure the resource created by the helper method is setup correctly. We recommend using `aws-sdk` to make assert the resource configuration.
To configure the amount of time nexpect will wait for CLI responses, you can set the `AMPLIFY_TEST_TIMEOUT_SEC` environment variable. It is helpful to set this to a low value (10 seconds or so) when writing new tests so that you don't spend unnecessary time waiting for nexpect to error out on a misconfigured wait() block
diff --git a/packages/amplify-e2e-tests/functions/s3-list-objects.js b/packages/amplify-e2e-tests/functions/s3-list-objects.js
index 031a372761e..849e88491ce 100644
--- a/packages/amplify-e2e-tests/functions/s3-list-objects.js
+++ b/packages/amplify-e2e-tests/functions/s3-list-objects.js
@@ -3,7 +3,7 @@ const awsS3Client = new AWS.S3();
const bucketEnvVar = '{{bucketEnvVar}}'; // This value is replaced from test
exports.handler = async () => {
- let listObjects = await awsS3Client
+ const listObjects = await awsS3Client
.listObjectsV2({
Bucket: process.env[bucketEnvVar],
})
diff --git a/packages/amplify-e2e-tests/package.json b/packages/amplify-e2e-tests/package.json
index d3b41173dad..4e8d7b7f2de 100644
--- a/packages/amplify-e2e-tests/package.json
+++ b/packages/amplify-e2e-tests/package.json
@@ -1,6 +1,6 @@
{
"name": "amplify-e2e-tests",
- "version": "4.2.3",
+ "version": "4.11.2",
"description": "",
"repository": {
"type": "git",
@@ -22,38 +22,42 @@
"build-tests": "tsc --build tsconfig.tests.json",
"setup-profile": "ts-node ./src/configure_tests.ts",
"clean-e2e-resources": "ts-node ./src/cleanup-e2e-resources.ts",
- "smoketest": "jest --runInBand --testPathPattern='smoketest' --config=jest.config.js"
+ "smoketest": "yarn e2e --testPathPattern='src/__tests__/smoke-tests/.*.test.ts'"
},
"dependencies": {
- "@aws-amplify/amplify-category-auth": "3.2.3",
- "@aws-amplify/amplify-cli-core": "4.0.8",
- "@aws-amplify/amplify-e2e-core": "5.0.3",
- "@aws-amplify/amplify-opensearch-simulator": "1.4.3",
- "@aws-amplify/graphql-transformer-core": "^1.3.2",
- "@aws-sdk/client-appsync": "^3.303.0",
- "@aws-sdk/client-dynamodb": "^3.303.0",
- "@aws-sdk/client-ssm": "^3.303.0",
- "amplify-dynamodb-simulator": "2.7.3",
- "amplify-headless-interface": "1.17.3",
- "amplify-storage-simulator": "1.9.0",
- "aws-amplify": "^4.2.8",
+ "@aws-amplify/amplify-category-auth": "3.7.17",
+ "@aws-amplify/amplify-cli-core": "4.3.11",
+ "@aws-amplify/amplify-e2e-core": "5.7.1",
+ "@aws-amplify/amplify-opensearch-simulator": "1.7.16",
+ "@aws-amplify/graphql-transformer-core": "^2.9.4",
+ "@aws-sdk/client-appsync": "3.624.0",
+ "@aws-sdk/client-dynamodb": "3.624.0",
+ "@aws-sdk/client-s3": "3.624.0",
+ "@aws-sdk/client-ssm": "3.624.0",
+ "@babel/core": "^7.23.2",
+ "@babel/plugin-transform-modules-commonjs": "7.10.4",
+ "amplify-dynamodb-simulator": "2.9.20",
+ "amplify-headless-interface": "1.17.7",
+ "amplify-storage-simulator": "1.11.6",
+ "aws-amplify": "^5.3.16",
"aws-appsync": "^4.1.1",
- "aws-cdk-lib": "~2.68.0",
- "aws-sdk": "^2.1354.0",
- "axios": "^0.26.0",
- "circleci-api": "^4.1.4",
+ "aws-cdk-lib": "~2.177.0",
+ "aws-sdk": "^2.1464.0",
+ "axios": "^1.6.7",
"constructs": "^10.0.5",
"dotenv": "^8.2.0",
"esm": "^3.2.25",
"execa": "^5.1.1",
- "extract-zip": "^2.0.1",
"fs-extra": "^8.1.0",
+ "get-port": "^5.1.1",
"glob": "^8.0.3",
"graphql-tag": "^2.10.1",
- "graphql-transformer-core": "^8.1.2",
+ "graphql-transformer-core": "^8.2.13",
"isomorphic-fetch": "^3.0.0",
"lodash": "^4.17.21",
+ "moment": "^2.24.0",
"node-fetch": "^2.6.7",
+ "node-pty": "^1.0.0",
"rimraf": "^3.0.0",
"title-case": "^3.0.3",
"upper-case": "^2.0.2",
@@ -66,8 +70,10 @@
"@types/express": "^4.17.3",
"@types/lodash": "^4.14.149",
"@types/node": "^18.16.1",
+ "@types/openpgp": "^4.4.18",
"@types/ws": "^7.4.4",
"jest": "^29.5.0",
+ "openpgp": "^5.10.2",
"ts-jest": "^29.1.0",
"ts-node": "^10.4.0"
},
diff --git a/packages/amplify-e2e-tests/resources/example-ios-app/.gitignore b/packages/amplify-e2e-tests/resources/example-ios-app/.gitignore
new file mode 100644
index 00000000000..875d04b5e66
--- /dev/null
+++ b/packages/amplify-e2e-tests/resources/example-ios-app/.gitignore
@@ -0,0 +1,22 @@
+
+
+#amplify-do-not-edit-begin
+amplify/\#current-cloud-backend
+amplify/.config/local-*
+amplify/logs
+amplify/mock-data
+amplify/backend/amplify-meta.json
+amplify/backend/.temp
+build/
+dist/
+node_modules/
+aws-exports.js
+awsconfiguration.json
+amplifyconfiguration.json
+amplifyconfiguration.dart
+amplify-build-config.json
+amplify-gradle-config.json
+amplifytools.xcconfig
+.secret-*
+**.sample
+#amplify-do-not-edit-end
diff --git a/packages/amplify-e2e-tests/resources/example-ios-app/Gemfile b/packages/amplify-e2e-tests/resources/example-ios-app/Gemfile
new file mode 100644
index 00000000000..adc90d98cfc
--- /dev/null
+++ b/packages/amplify-e2e-tests/resources/example-ios-app/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem "fastlane"
\ No newline at end of file
diff --git a/packages/amplify-e2e-tests/resources/example-ios-app/Gemfile.lock b/packages/amplify-e2e-tests/resources/example-ios-app/Gemfile.lock
new file mode 100644
index 00000000000..f71d7604dbe
--- /dev/null
+++ b/packages/amplify-e2e-tests/resources/example-ios-app/Gemfile.lock
@@ -0,0 +1,221 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ CFPropertyList (3.0.5)
+ rexml
+ addressable (2.8.0)
+ public_suffix (>= 2.0.2, < 5.0)
+ artifactory (3.0.15)
+ atomos (0.1.3)
+ aws-eventstream (1.2.0)
+ aws-partitions (1.575.0)
+ aws-sdk-core (3.130.0)
+ aws-eventstream (~> 1, >= 1.0.2)
+ aws-partitions (~> 1, >= 1.525.0)
+ aws-sigv4 (~> 1.1)
+ jmespath (~> 1.0)
+ aws-sdk-kms (1.55.0)
+ aws-sdk-core (~> 3, >= 3.127.0)
+ aws-sigv4 (~> 1.1)
+ aws-sdk-s3 (1.113.0)
+ aws-sdk-core (~> 3, >= 3.127.0)
+ aws-sdk-kms (~> 1)
+ aws-sigv4 (~> 1.4)
+ aws-sigv4 (1.4.0)
+ aws-eventstream (~> 1, >= 1.0.2)
+ babosa (1.0.4)
+ claide (1.1.0)
+ colored (1.2)
+ colored2 (3.1.2)
+ commander (4.6.0)
+ highline (~> 2.0.0)
+ declarative (0.0.20)
+ digest-crc (0.6.4)
+ rake (>= 12.0.0, < 14.0.0)
+ domain_name (0.5.20190701)
+ unf (>= 0.0.5, < 1.0.0)
+ dotenv (2.7.6)
+ emoji_regex (3.2.3)
+ excon (0.92.2)
+ faraday (1.10.0)
+ faraday-em_http (~> 1.0)
+ faraday-em_synchrony (~> 1.0)
+ faraday-excon (~> 1.1)
+ faraday-httpclient (~> 1.0)
+ faraday-multipart (~> 1.0)
+ faraday-net_http (~> 1.0)
+ faraday-net_http_persistent (~> 1.0)
+ faraday-patron (~> 1.0)
+ faraday-rack (~> 1.0)
+ faraday-retry (~> 1.0)
+ ruby2_keywords (>= 0.0.4)
+ faraday-cookie_jar (0.0.7)
+ faraday (>= 0.8.0)
+ http-cookie (~> 1.0.0)
+ faraday-em_http (1.0.0)
+ faraday-em_synchrony (1.0.0)
+ faraday-excon (1.1.0)
+ faraday-httpclient (1.0.1)
+ faraday-multipart (1.0.3)
+ multipart-post (>= 1.2, < 3)
+ faraday-net_http (1.0.1)
+ faraday-net_http_persistent (1.2.0)
+ faraday-patron (1.0.0)
+ faraday-rack (1.0.0)
+ faraday-retry (1.0.3)
+ faraday_middleware (1.2.0)
+ faraday (~> 1.0)
+ fastimage (2.2.6)
+ fastlane (2.214.0)
+ CFPropertyList (>= 2.3, < 4.0.0)
+ addressable (>= 2.8, < 3.0.0)
+ artifactory (~> 3.0)
+ aws-sdk-s3 (~> 1.0)
+ babosa (>= 1.0.3, < 2.0.0)
+ bundler (>= 1.12.0, < 3.0.0)
+ colored
+ commander (~> 4.6)
+ dotenv (>= 2.1.1, < 3.0.0)
+ emoji_regex (>= 0.1, < 4.0)
+ excon (>= 0.71.0, < 1.0.0)
+ faraday (~> 1.0)
+ faraday-cookie_jar (~> 0.0.6)
+ faraday_middleware (~> 1.0)
+ fastimage (>= 2.1.0, < 3.0.0)
+ gh_inspector (>= 1.1.2, < 2.0.0)
+ google-apis-androidpublisher_v3 (~> 0.3)
+ google-apis-playcustomapp_v1 (~> 0.1)
+ google-cloud-storage (~> 1.31)
+ highline (~> 2.0)
+ json (< 3.0.0)
+ jwt (>= 2.1.0, < 3)
+ mini_magick (>= 4.9.4, < 5.0.0)
+ multipart-post (>= 2.0.0, < 3.0.0)
+ naturally (~> 2.2)
+ optparse (~> 0.1.1)
+ plist (>= 3.1.0, < 4.0.0)
+ rubyzip (>= 2.0.0, < 3.0.0)
+ security (= 0.1.3)
+ simctl (~> 1.6.3)
+ terminal-notifier (>= 2.0.0, < 3.0.0)
+ terminal-table (>= 1.4.5, < 2.0.0)
+ tty-screen (>= 0.6.3, < 1.0.0)
+ tty-spinner (>= 0.8.0, < 1.0.0)
+ word_wrap (~> 1.0.0)
+ xcodeproj (>= 1.13.0, < 2.0.0)
+ xcpretty (~> 0.3.0)
+ xcpretty-travis-formatter (>= 0.0.3)
+ gh_inspector (1.1.3)
+ google-apis-androidpublisher_v3 (0.18.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-apis-core (0.4.2)
+ addressable (~> 2.5, >= 2.5.1)
+ googleauth (>= 0.16.2, < 2.a)
+ httpclient (>= 2.8.1, < 3.a)
+ mini_mime (~> 1.0)
+ representable (~> 3.0)
+ retriable (>= 2.0, < 4.a)
+ rexml
+ webrick
+ google-apis-iamcredentials_v1 (0.10.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-apis-playcustomapp_v1 (0.7.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-apis-storage_v1 (0.13.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-cloud-core (1.6.0)
+ google-cloud-env (~> 1.0)
+ google-cloud-errors (~> 1.0)
+ google-cloud-env (1.6.0)
+ faraday (>= 0.17.3, < 3.0)
+ google-cloud-errors (1.2.0)
+ google-cloud-storage (1.36.1)
+ addressable (~> 2.8)
+ digest-crc (~> 0.4)
+ google-apis-iamcredentials_v1 (~> 0.1)
+ google-apis-storage_v1 (~> 0.1)
+ google-cloud-core (~> 1.6)
+ googleauth (>= 0.16.2, < 2.a)
+ mini_mime (~> 1.0)
+ googleauth (1.1.2)
+ faraday (>= 0.17.3, < 3.a)
+ jwt (>= 1.4, < 3.0)
+ memoist (~> 0.16)
+ multi_json (~> 1.11)
+ os (>= 0.9, < 2.0)
+ signet (>= 0.16, < 2.a)
+ highline (2.0.3)
+ http-cookie (1.0.4)
+ domain_name (~> 0.5)
+ httpclient (2.8.3)
+ jmespath (1.6.1)
+ json (2.6.1)
+ jwt (2.3.0)
+ memoist (0.16.2)
+ mini_magick (4.11.0)
+ mini_mime (1.1.2)
+ multi_json (1.15.0)
+ multipart-post (2.0.0)
+ nanaimo (0.3.0)
+ naturally (2.2.1)
+ optparse (0.1.1)
+ os (1.1.4)
+ plist (3.6.0)
+ public_suffix (4.0.7)
+ rake (13.0.6)
+ representable (3.1.1)
+ declarative (< 0.1.0)
+ trailblazer-option (>= 0.1.1, < 0.2.0)
+ uber (< 0.2.0)
+ retriable (3.1.2)
+ rexml (3.3.9)
+ rouge (2.0.7)
+ ruby2_keywords (0.0.5)
+ rubyzip (2.3.2)
+ security (0.1.3)
+ signet (0.16.1)
+ addressable (~> 2.8)
+ faraday (>= 0.17.5, < 3.0)
+ jwt (>= 1.5, < 3.0)
+ multi_json (~> 1.10)
+ simctl (1.6.8)
+ CFPropertyList
+ naturally
+ terminal-notifier (2.0.0)
+ terminal-table (1.8.0)
+ unicode-display_width (~> 1.1, >= 1.1.1)
+ trailblazer-option (0.1.2)
+ tty-cursor (0.7.1)
+ tty-screen (0.8.1)
+ tty-spinner (0.9.3)
+ tty-cursor (~> 0.7)
+ uber (0.1.0)
+ unf (0.1.4)
+ unf_ext
+ unf_ext (0.0.8.1)
+ unicode-display_width (1.8.0)
+ webrick (1.8.2)
+ word_wrap (1.0.0)
+ xcodeproj (1.19.0)
+ CFPropertyList (>= 2.3.3, < 4.0)
+ atomos (~> 0.1.3)
+ claide (>= 1.0.2, < 2.0)
+ colored2 (~> 3.1)
+ nanaimo (~> 0.3.0)
+ xcpretty (0.3.0)
+ rouge (~> 2.0.7)
+ xcpretty-travis-formatter (1.0.1)
+ xcpretty (~> 0.2, >= 0.0.7)
+
+PLATFORMS
+ arm64-darwin-21
+ universal-darwin-20
+ x86_64-darwin-19
+ x86_64-darwin-21
+ x86_64-linux
+
+DEPENDENCIES
+ fastlane
+
+BUNDLED WITH
+ 2.3.11
diff --git a/packages/amplify-e2e-tests/resources/example-ios-app/MyAmplifyApp.xcodeproj/project.pbxproj b/packages/amplify-e2e-tests/resources/example-ios-app/MyAmplifyApp.xcodeproj/project.pbxproj
new file mode 100644
index 00000000000..8a538c9f561
--- /dev/null
+++ b/packages/amplify-e2e-tests/resources/example-ios-app/MyAmplifyApp.xcodeproj/project.pbxproj
@@ -0,0 +1,525 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 52;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 3A136F0C28060295006292EF /* MyAmplifyAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A136F0B28060295006292EF /* MyAmplifyAppApp.swift */; };
+ 3A136F0E28060295006292EF /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A136F0D28060295006292EF /* ContentView.swift */; };
+ 3A136F102806029E006292EF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A136F0F2806029E006292EF /* Assets.xcassets */; };
+ 3A136F132806029E006292EF /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A136F122806029E006292EF /* Preview Assets.xcassets */; };
+ 3A136F292806029F006292EF /* MyAmplifyAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A136F282806029F006292EF /* MyAmplifyAppUITests.swift */; };
+ 4989DDE421F56C7AC37A85ED /* awsconfiguration.json in Resources */ = {isa = PBXBuildFile; fileRef = FC37E5EADB1509B0750F39D1 /* awsconfiguration.json */; };
+ 5A4FCDB558061CA7A37B9D2A /* amplifyconfiguration.json in Resources */ = {isa = PBXBuildFile; fileRef = 50B98813260A5C7896822AB0 /* amplifyconfiguration.json */; };
+ B41EF4282906F5C100DD6BD9 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = B41EF4272906F5C100DD6BD9 /* AWSAPIPlugin */; };
+ B41EF42A2906F5C100DD6BD9 /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = B41EF4292906F5C100DD6BD9 /* AWSDataStorePlugin */; };
+ B41EF42C2906F5C100DD6BD9 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = B41EF42B2906F5C100DD6BD9 /* Amplify */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 3A136F252806029F006292EF /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 3A136F0028060295006292EF /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 3A136F0728060295006292EF;
+ remoteInfo = MyAmplifyApp;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 3A136F0828060295006292EF /* MyAmplifyApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyAmplifyApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3A136F0B28060295006292EF /* MyAmplifyAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyAmplifyAppApp.swift; sourceTree = ""; };
+ 3A136F0D28060295006292EF /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
+ 3A136F0F2806029E006292EF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 3A136F122806029E006292EF /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
+ 3A136F142806029E006292EF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 3A136F242806029F006292EF /* MyAmplifyAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyAmplifyAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3A136F282806029F006292EF /* MyAmplifyAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyAmplifyAppUITests.swift; sourceTree = ""; };
+ 3A136F2A2806029F006292EF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 50B98813260A5C7896822AB0 /* amplifyconfiguration.json */ = {isa = PBXFileReference; explicitFileType = text.json; path = amplifyconfiguration.json; sourceTree = "