From 135de172c555e6ab3e80207fcb5e884ad64e8324 Mon Sep 17 00:00:00 2001 From: Caleb Pollman Date: Wed, 15 Jan 2025 17:04:25 -0800 Subject: [PATCH 1/5] chore: add callout with link to external IdP configuration in signInWithRedirect (#8203) Co-authored-by: josef --- .../auth/connect-your-frontend/sign-in/index.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx b/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx index 78262044ba2..d8efe532254 100644 --- a/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx +++ b/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/sign-in/index.mdx @@ -812,6 +812,12 @@ func confirmSignIn() -> AnyCancellable { To sign in using an external identity provider such as Google, use the `signInWithRedirect` function. + + +For guidance on configuring an external Identity Provider with Amplify see [External Identity Providers](/[platform]/build-a-backend/auth/concepts/external-identity-providers/) + + + ```ts import { signInWithRedirect } from "aws-amplify/auth" From f8190a5a6f47684f2b7248afb8e583c680897745 Mon Sep 17 00:00:00 2001 From: Kamil Sobol <5849952+sobolk@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:38:20 -0800 Subject: [PATCH 2/5] fix build (#8207) --- .github/workflows/accessibility_scan.yml | 4 ++-- .github/workflows/check_for_console_errors.yml | 2 +- .github/workflows/check_pr_for_broken_links.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/accessibility_scan.yml b/.github/workflows/accessibility_scan.yml index 793b0471cf6..343e95365ee 100644 --- a/.github/workflows/accessibility_scan.yml +++ b/.github/workflows/accessibility_scan.yml @@ -8,7 +8,7 @@ env: jobs: accessibility: name: Runs accessibility scan on changed pages - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout branch uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 @@ -32,7 +32,7 @@ jobs: const buildDir = process.env.BUILD_DIR; return getChangedPages({github, context, buildDir}); - name: Run site - run: | + run: | python -m http.server 3000 -d ${{ env.BUILD_DIR }} & sleep 5 - name: Run accessibility tests on changed/new MDX pages diff --git a/.github/workflows/check_for_console_errors.yml b/.github/workflows/check_for_console_errors.yml index d103ab66a73..ec2ad2c6d29 100644 --- a/.github/workflows/check_for_console_errors.yml +++ b/.github/workflows/check_for_console_errors.yml @@ -9,7 +9,7 @@ permissions: contents: read jobs: CheckConsoleErrors: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 diff --git a/.github/workflows/check_pr_for_broken_links.yml b/.github/workflows/check_pr_for_broken_links.yml index 766801b41da..cc4d3ae6c62 100644 --- a/.github/workflows/check_pr_for_broken_links.yml +++ b/.github/workflows/check_pr_for_broken_links.yml @@ -7,7 +7,7 @@ env: BUILD_DIR: 'client/www/next-build' jobs: CheckPRLinks: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 From 6fc26e477142060e60d102726b245ea8c6c38cda Mon Sep 17 00:00:00 2001 From: Kamil Sobol <5849952+sobolk@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:06:18 -0800 Subject: [PATCH 3/5] Describe docker support state (#8206) * Describe docker support state * amazonlinux * Update src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx Co-authored-by: josef * Update src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx Co-authored-by: josef --------- Co-authored-by: josef --- cspell.json | 1 + .../functions/custom-functions/index.mdx | 25 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/cspell.json b/cspell.json index 7dcc2cc6dd3..ef3e3d53619 100644 --- a/cspell.json +++ b/cspell.json @@ -68,6 +68,7 @@ "amazonaws", "amazonaws", "amazoncognito", + "amazonlinux", "AmazonPersonalizeProvider", "AmazonS3Client", "Amplif", diff --git a/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx b/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx index e6c2a0d0d23..b16fd6fbe92 100644 --- a/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx @@ -34,7 +34,7 @@ AWS Amplify Gen 2 functions are AWS Lambda functions that can be used to perform -**Note:** [Fullstack Git-based environments](https://docs.amplify.aws/react/how-amplify-works/concepts/#fullstack-git-based-environments) do not support Docker for functions bundling out of the box. +**Note:** [Fullstack Git-based environments](https://docs.amplify.aws/react/how-amplify-works/concepts/#fullstack-git-based-environments) do not support Docker for functions bundling out of the box. To learn more [skip to the Docker section](#Docker). @@ -81,7 +81,7 @@ Next, create the corresponding handler file at `amplify/functions/say-hello/inde ```ts title="amplify/functions/say-hello/index.py" import json - + def handler(event, context): return { "statusCode": 200, @@ -104,7 +104,7 @@ some-other-package>=1.0.0 You're now ready to deploy your python function. Next is the same process as the Node.js/TypeScript function. Go to [Common steps for all languages](#common-steps-for-all-languages) to continue. ## Go -To get started, Create a new directory and a resource file, `amplify/functions/say-hello/resource.ts`. Then, define the function with `defineFunction`: +To get started, Create a new directory and a resource file, `amplify/functions/say-hello/resource.ts`. Then, define the function with `defineFunction`: ```ts title="amplify/functions/say-hello/resource.ts" import { execSync } from "node:child_process"; @@ -187,7 +187,7 @@ go mod tidy You're now ready to deploy your golang function. Next is the same process as the Node.js/TypeScript function. -## Common steps for all languages +## Common steps for all languages Regardless of the language used, your function needs to be added to your backend. ```ts title="amplify/backend.ts" @@ -228,3 +228,20 @@ export const data = defineData({ }, }) ``` + +## Docker + +Custom function may require [Docker](https://www.docker.com/) in order to build and bundle function's code. A deployment failing with `CustomFunctionProviderDockerError` error indicates that a custom function requires Docker but the Docker daemon was not found. In that case you need to provide a working Docker installation at runtime. + +### Personal sandboxes + +Ensure that Docker is installed on your computer and that Docker daemon is running. You can check if Docker daemon is running using the following command: +```bash title="terminal" showLineNumbers={false} +docker info +``` + +### Fullstack Git-based environments + +Amplify does not provide Docker daemon out of the box in branch deployments. However, you have an option to provide [your own image that meets Amplify requirements](https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html) and includes a Docker installation. + +For example, the `aws/codebuild/amazonlinux-x86_64-standard:5.0` image ([see definition](https://github.com/aws/aws-codebuild-docker-images)) meets Amplify requirements and includes Docker installation. From 386358a335594ebc815e0ba82c87f3fd54e82303 Mon Sep 17 00:00:00 2001 From: Kamil Sobol <5849952+sobolk@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:12:45 -0800 Subject: [PATCH 4/5] fix link (#8208) --- .../build-a-backend/functions/custom-functions/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx b/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx index b16fd6fbe92..caf7792f488 100644 --- a/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx @@ -34,7 +34,7 @@ AWS Amplify Gen 2 functions are AWS Lambda functions that can be used to perform -**Note:** [Fullstack Git-based environments](https://docs.amplify.aws/react/how-amplify-works/concepts/#fullstack-git-based-environments) do not support Docker for functions bundling out of the box. To learn more [skip to the Docker section](#Docker). +**Note:** [Fullstack Git-based environments](https://docs.amplify.aws/react/how-amplify-works/concepts/#fullstack-git-based-environments) do not support Docker for functions bundling out of the box. To learn more [skip to the Docker section](#docker). From 19b650125417c2d1716a668d7a92c63a57d44dfe Mon Sep 17 00:00:00 2001 From: Tyler Roach Date: Tue, 21 Jan 2025 08:32:42 -0500 Subject: [PATCH 5/5] [Android] Document how to map AppSync Scalars to Kotlin types (#8205) * document how to map appsync scalars to kotlin types --- .../data/aws-appsync-apollo-extensions/index.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/[platform]/build-a-backend/data/aws-appsync-apollo-extensions/index.mdx b/src/pages/[platform]/build-a-backend/data/aws-appsync-apollo-extensions/index.mdx index b7068f5ad97..53327933062 100644 --- a/src/pages/[platform]/build-a-backend/data/aws-appsync-apollo-extensions/index.mdx +++ b/src/pages/[platform]/build-a-backend/data/aws-appsync-apollo-extensions/index.mdx @@ -320,6 +320,19 @@ You can alternatively download the introspection schema using the [`fetch-schema 2. On the left side, select Schema 3. When viewing your schema, there should a “Export schema” drop down. Select this and download the `schema.json` file. 4. Add this file to your project as directed by [Apollo documentation](https://www.apollographql.com/docs/kotlin/advanced/plugin-recipes#specifying-the-schema-location) + +### Type Mapping AppSync Scalars +By default, [AWS AppSync Scalars](https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html#graph-ql-aws-appsync-scalars) will default to the `Any` type. You can map these scalars to more explicit types by editing the `apollo` block in your `app/build.gradle[.kts]` file. In the example below, we are now mapping a few of our AppSync scalar types to `String` instead of `Any`. Additional improvements could be made by writing [custom class adapters](https://www.apollographql.com/docs/kotlin/essentials/custom-scalars#define-class-mapping) to convert date/time scalars into Kotlin date/time class types. + +```kotlin +apollo { + service("{serviceName}") { + packageName.set("{packageName}") + mapScalarToKotlinString("AWSDateTime") + mapScalarToKotlinString("AWSEmail") + } +} +``` ### Performing Queries, Mutations, and Subscriptions with Apollo client