1. Using aws apprunner with amplify

    TypeScript

    AWS App Runner and AWS Amplify are two AWS services that serve different but complementary purposes. AWS Amplify is primarily used to build, deploy, and host web applications with a set of tools and services designed around web and mobile applications, whereas AWS App Runner is a service designed to easily deploy containerized web applications and APIs at scale without dealing with infrastructure management.

    Given this understanding, integrating App Runner with Amplify generally doesn't fit the typical use cases for these services, as Amplify is already equipped to handle the web hosting with global CDN, backend deployments, and more. Instead, you might want to use App Runner separately to deploy additional API services that your Amplify-hosted front-end might consume.

    If you're looking to deploy a containerized web application or API with AWS App Runner, I can show you how to define an App Runner service using Pulumi. However, if you're looking to deploy a static web app with AWS Amplify, then you would use Pulumi's Amplify resources.

    Here, I'll show you how to define an AWS App Runner service in Pulumi which can serve as the backend for your application:

    import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; // Create an AWS App Runner service. const service = new aws.apprunner.Service("exampleService", { sourceConfiguration: { autoDeploymentsEnabled: true, imageRepository: { imageIdentifier: "public.ecr.aws/aws-containers/hello-app-runner:latest", imageRepositoryType: "ECR_PUBLIC", }, }, // Defines the instance and concurrency configuration for the App Runner service. // As an example, using the defaults. instanceConfiguration: { cpu: "1024", // 1 vCPU memory: "2048", // 2 GB }, }); // Exports the service URL once the service is up and running export const serviceUrl = service.serviceUrl;

    This program sets up a very basic AWS App Runner service. It references a public ECR image and does not specify much in the way of configuration - it uses the defaults provided by AWS for instance configuration.

    For more information on each of these properties and what they control in your App Runner service, you can consult the AWS App Runner Service documentation.

    Now, if you instead wanted to deploy a static web app using AWS Amplify, we would look into using Pulumi's Amplify resources.

    Please specify whether you'd like to continue setting up an App Runner service, or if you're aiming to use AWS Amplify to host a static web site, and we can provide a program tailored to that use case.