# AWS::AppRunner Construct Library

> Version 2.278.0-alpha.0

> **Separate package**
>
> `@aws-cdk/aws-apprunner-alpha` is not part of `aws-cdk-lib` — install it separately:
>
> ```sh
> npm install @aws-cdk/aws-apprunner-alpha
> pip install aws-cdk.aws-apprunner-alpha
> ```
>
> This module is [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha): its API may change in any release, without a major version bump.
---

![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development.
> They are subject to non-backward compatible changes or removal in any future version. These are
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes. This means that while you may use them, you may need to update
> your source code when upgrading to a newer version of this package.

---

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

TypeScript:

```ts
import * as apprunner from '@aws-cdk/aws-apprunner-alpha';
```

Python:

```python
import aws_cdk.aws_apprunner_alpha as apprunner
```

Java:

```java
import software.amazon.awscdk.services.apprunner.alpha.*;
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.AppRunner.Alpha;
```

Golang:

```go
import apprunner "github.com/aws/aws-cdk-go/awscdkapprunneralpha"
```

## Introduction

AWS App Runner is a fully managed service that makes it easy for developers to quickly deploy containerized web applications and APIs, at scale and with no prior infrastructure experience required. Start with your source code or a container image. App Runner automatically builds and deploys the web application and load balances traffic with encryption. App Runner also scales up or down automatically to meet your traffic needs. With App Runner, rather than thinking about servers or scaling, you have more time to focus on your applications.

## Service

The [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) construct allows you to create AWS App Runner services with `ECR Public`, `ECR` or `Github` with the `source` property in the following scenarios:

- `Source.fromEcr()` - To define the source repository from `ECR`.
- `Source.fromEcrPublic()` - To define the source repository from `ECR Public`.
- `Source.fromGitHub()` - To define the source repository from the `Github repository`.
- `Source.fromAsset()` - To define the source from local asset directory.

The [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) construct implements `IGrantable`.

## ECR Public

To create a [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) with ECR Public:

TypeScript:

```ts
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
});
```

Python:

```python
apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    )
)
```

Java:

```java
Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .build();
```

C# / .NET:

```csharp
new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    })
});
```

Golang:

```go
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
})
```

## ECR

To create a [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) from an existing ECR repository:

TypeScript:

```ts
import * as ecr from 'aws-cdk-lib/aws-ecr';

new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcr({
    imageConfiguration: { port: 80 },
    repository: ecr.Repository.fromRepositoryName(this, 'NginxRepository', 'nginx'),
    tagOrDigest: 'latest',
  }),
});
```

Python:

```python
import aws_cdk.aws_ecr as ecr

apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr(
        image_configuration=apprunner.ImageConfiguration(port=80),
        repository=ecr.Repository.from_repository_name(self, "NginxRepository", "nginx"),
        tag_or_digest="latest"
    )
)
```

Java:

```java
import software.amazon.awscdk.services.ecr.*;

Service.Builder.create(this, "Service")
        .source(Source.fromEcr(EcrProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(80).build())
                .repository(Repository.fromRepositoryName(this, "NginxRepository", "nginx"))
                .tagOrDigest("latest")
                .build()))
        .build();
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.ECR;

new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcr(new EcrProps {
        ImageConfiguration = new ImageConfiguration { Port = 80 },
        Repository = Repository.FromRepositoryName(this, "NginxRepository", "nginx"),
        TagOrDigest = "latest"
    })
});
```

Golang:

```go
import ecr "github.com/aws/aws-cdk-go/awscdk"

apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcr(&EcrProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(80),
		},
		Repository: ecr.Repository_FromRepositoryName(this, jsii.String("NginxRepository"), jsii.String("nginx")),
		TagOrDigest: jsii.String("latest"),
	}),
})
```

To create a [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) from local docker image asset directory built and pushed to Amazon ECR:

You can specify whether to enable continuous integration from the source repository with the `autoDeploymentsEnabled` flag.

TypeScript:

```ts
import * as assets from 'aws-cdk-lib/aws-ecr-assets';

const imageAsset = new assets.DockerImageAsset(this, 'ImageAssets', {
  directory: path.join(__dirname, 'docker.assets'),
});
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromAsset({
    imageConfiguration: { port: 8000 },
    asset: imageAsset,
  }),
  autoDeploymentsEnabled: true,
});
```

Python:

```python
import aws_cdk.aws_ecr_assets as assets

image_asset = assets.DockerImageAsset(self, "ImageAssets",
    directory=path.join(__dirname, "docker.assets")
)
apprunner.Service(self, "Service",
    source=apprunner.Source.from_asset(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        asset=image_asset
    ),
    auto_deployments_enabled=True
)
```

Java:

```java
import software.amazon.awscdk.services.ecr.assets.*;

DockerImageAsset imageAsset = DockerImageAsset.Builder.create(this, "ImageAssets")
        .directory(join(__dirname, "docker.assets"))
        .build();
Service.Builder.create(this, "Service")
        .source(Source.fromAsset(AssetProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .asset(imageAsset)
                .build()))
        .autoDeploymentsEnabled(true)
        .build();
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.Ecr.Assets;

var imageAsset = new DockerImageAsset(this, "ImageAssets", new DockerImageAssetProps {
    Directory = Join(__dirname, "docker.assets")
});
new Service(this, "Service", new ServiceProps {
    Source = Source.FromAsset(new AssetProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        Asset = imageAsset
    }),
    AutoDeploymentsEnabled = true
});
```

Golang:

```go
import assets "github.com/aws/aws-cdk-go/awscdk"

imageAsset := assets.NewDockerImageAsset(this, jsii.String("ImageAssets"), &DockerImageAssetProps{
	Directory: path.join(__dirname, jsii.String("docker.assets")),
})
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromAsset(&AssetProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		Asset: imageAsset,
	}),
	AutoDeploymentsEnabled: jsii.Boolean(true),
})
```

## GitHub

To create a [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) from the GitHub repository, you need to specify an existing App Runner `Connection`.

See [Managing App Runner connections](https://docs.aws.amazon.com/apprunner/latest/dg/manage-connections.html) for more details.

TypeScript:

```ts
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromGitHub({
    repositoryUrl: 'https://github.com/aws-containers/hello-app-runner',
    branch: 'main',
    configurationSource: apprunner.ConfigurationSourceType.REPOSITORY,
    connection: apprunner.GitHubConnection.fromConnectionArn('CONNECTION_ARN'),
  }),
});
```

Python:

```python
apprunner.Service(self, "Service",
    source=apprunner.Source.from_git_hub(
        repository_url="https://github.com/aws-containers/hello-app-runner",
        branch="main",
        configuration_source=apprunner.ConfigurationSourceType.REPOSITORY,
        connection=apprunner.GitHubConnection.from_connection_arn("CONNECTION_ARN")
    )
)
```

Java:

```java
Service.Builder.create(this, "Service")
        .source(Source.fromGitHub(GithubRepositoryProps.builder()
                .repositoryUrl("https://github.com/aws-containers/hello-app-runner")
                .branch("main")
                .configurationSource(ConfigurationSourceType.REPOSITORY)
                .connection(GitHubConnection.fromConnectionArn("CONNECTION_ARN"))
                .build()))
        .build();
```

C# / .NET:

```csharp
new Service(this, "Service", new ServiceProps {
    Source = Source.FromGitHub(new GithubRepositoryProps {
        RepositoryUrl = "https://github.com/aws-containers/hello-app-runner",
        Branch = "main",
        ConfigurationSource = ConfigurationSourceType.REPOSITORY,
        Connection = GitHubConnection.FromConnectionArn("CONNECTION_ARN")
    })
});
```

Golang:

```go
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromGitHub(&GithubRepositoryProps{
		RepositoryUrl: jsii.String("https://github.com/aws-containers/hello-app-runner"),
		Branch: jsii.String("main"),
		ConfigurationSource: apprunner.ConfigurationSourceType_REPOSITORY,
		Connection: apprunner.GitHubConnection_FromConnectionArn(jsii.String("CONNECTION_ARN")),
	}),
})
```

Use `codeConfigurationValues` to override configuration values with the `API` configuration source type.

TypeScript:

```ts
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromGitHub({
    repositoryUrl: 'https://github.com/aws-containers/hello-app-runner',
    branch: 'main',
    configurationSource: apprunner.ConfigurationSourceType.API,
    codeConfigurationValues: {
      runtime: apprunner.Runtime.PYTHON_3,
      port: '8000',
      startCommand: 'python app.py',
      buildCommand: 'yum install -y pycairo && pip install -r requirements.txt',
    },
    connection: apprunner.GitHubConnection.fromConnectionArn('CONNECTION_ARN'),
  }),
});
```

Python:

```python
apprunner.Service(self, "Service",
    source=apprunner.Source.from_git_hub(
        repository_url="https://github.com/aws-containers/hello-app-runner",
        branch="main",
        configuration_source=apprunner.ConfigurationSourceType.API,
        code_configuration_values=apprunner.CodeConfigurationValues(
            runtime=apprunner.Runtime.PYTHON_3,
            port="8000",
            start_command="python app.py",
            build_command="yum install -y pycairo && pip install -r requirements.txt"
        ),
        connection=apprunner.GitHubConnection.from_connection_arn("CONNECTION_ARN")
    )
)
```

Java:

```java
Service.Builder.create(this, "Service")
        .source(Source.fromGitHub(GithubRepositoryProps.builder()
                .repositoryUrl("https://github.com/aws-containers/hello-app-runner")
                .branch("main")
                .configurationSource(ConfigurationSourceType.API)
                .codeConfigurationValues(CodeConfigurationValues.builder()
                        .runtime(Runtime.PYTHON_3)
                        .port("8000")
                        .startCommand("python app.py")
                        .buildCommand("yum install -y pycairo && pip install -r requirements.txt")
                        .build())
                .connection(GitHubConnection.fromConnectionArn("CONNECTION_ARN"))
                .build()))
        .build();
```

C# / .NET:

```csharp
new Service(this, "Service", new ServiceProps {
    Source = Source.FromGitHub(new GithubRepositoryProps {
        RepositoryUrl = "https://github.com/aws-containers/hello-app-runner",
        Branch = "main",
        ConfigurationSource = ConfigurationSourceType.API,
        CodeConfigurationValues = new CodeConfigurationValues {
            Runtime = Runtime.PYTHON_3,
            Port = "8000",
            StartCommand = "python app.py",
            BuildCommand = "yum install -y pycairo && pip install -r requirements.txt"
        },
        Connection = GitHubConnection.FromConnectionArn("CONNECTION_ARN")
    })
});
```

Golang:

```go
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromGitHub(&GithubRepositoryProps{
		RepositoryUrl: jsii.String("https://github.com/aws-containers/hello-app-runner"),
		Branch: jsii.String("main"),
		ConfigurationSource: apprunner.ConfigurationSourceType_API,
		CodeConfigurationValues: &CodeConfigurationValues{
			Runtime: apprunner.Runtime_PYTHON_3(),
			Port: jsii.String("8000"),
			StartCommand: jsii.String("python app.py"),
			BuildCommand: jsii.String("yum install -y pycairo && pip install -r requirements.txt"),
		},
		Connection: apprunner.GitHubConnection_FromConnectionArn(jsii.String("CONNECTION_ARN")),
	}),
})
```

## IAM Roles

You are allowed to define `instanceRole` and `accessRole` for the [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html).

`instanceRole` - The IAM role that provides permissions to your App Runner service. These are permissions that
your code needs when it calls any AWS APIs. If not defined, a new instance role will be generated
when required.

To add IAM policy statements to this role, use `addToRolePolicy()`:

TypeScript:

```ts
import * as iam from 'aws-cdk-lib/aws-iam';

const service = new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
});

service.addToRolePolicy(new iam.PolicyStatement({
  effect: iam.Effect.ALLOW,
  actions: ['s3:GetObject'],
  resources: ['*'],
}))
```

Python:

```python
import aws_cdk.aws_iam as iam

service = apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    )
)

service.add_to_role_policy(iam.PolicyStatement(
    effect=iam.Effect.ALLOW,
    actions=["s3:GetObject"],
    resources=["*"]
))
```

Java:

```java
import software.amazon.awscdk.services.iam.*;

Service service = Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .build();

service.addToRolePolicy(PolicyStatement.Builder.create()
        .effect(Effect.ALLOW)
        .actions(List.of("s3:GetObject"))
        .resources(List.of("*"))
        .build());
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.IAM;

var service = new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    })
});

service.AddToRolePolicy(new PolicyStatement(new PolicyStatementProps {
    Effect = Effect.ALLOW,
    Actions = new [] { "s3:GetObject" },
    Resources = new [] { "*" }
}));
```

Golang:

```go
import "github.com/aws/aws-cdk-go/awscdk"

service := apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
})

service.AddToRolePolicy(iam.NewPolicyStatement(&PolicyStatementProps{
	Effect: iam.Effect_ALLOW,
	Actions: []*string{
		jsii.String("s3:GetObject"),
	},
	Resources: []*string{
		jsii.String("*"),
	},
}))
```

`accessRole` - The IAM role that grants the App Runner service access to a source repository. It's required for
ECR image repositories (but not for ECR Public repositories). If not defined, a new access role will be generated
when required.

See [App Runner IAM Roles](https://docs.aws.amazon.com/apprunner/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-roles) for more details.

## Auto Scaling Configuration

To associate an App Runner service with a custom Auto Scaling Configuration, define `autoScalingConfiguration` for the service.

TypeScript:

```ts
const autoScalingConfiguration = new apprunner.AutoScalingConfiguration(this, 'AutoScalingConfiguration', {
  autoScalingConfigurationName: 'MyAutoScalingConfiguration',
  maxConcurrency: 150,
  maxSize: 20,
  minSize: 5,
});

new apprunner.Service(this, 'DemoService', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  autoScalingConfiguration,
});
```

Python:

```python
auto_scaling_configuration = apprunner.AutoScalingConfiguration(self, "AutoScalingConfiguration",
    auto_scaling_configuration_name="MyAutoScalingConfiguration",
    max_concurrency=150,
    max_size=20,
    min_size=5
)

apprunner.Service(self, "DemoService",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    auto_scaling_configuration=auto_scaling_configuration
)
```

Java:

```java
AutoScalingConfiguration autoScalingConfiguration = AutoScalingConfiguration.Builder.create(this, "AutoScalingConfiguration")
        .autoScalingConfigurationName("MyAutoScalingConfiguration")
        .maxConcurrency(150)
        .maxSize(20)
        .minSize(5)
        .build();

Service.Builder.create(this, "DemoService")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .autoScalingConfiguration(autoScalingConfiguration)
        .build();
```

C# / .NET:

```csharp
var autoScalingConfiguration = new AutoScalingConfiguration(this, "AutoScalingConfiguration", new AutoScalingConfigurationProps {
    AutoScalingConfigurationName = "MyAutoScalingConfiguration",
    MaxConcurrency = 150,
    MaxSize = 20,
    MinSize = 5
});

new Service(this, "DemoService", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    AutoScalingConfiguration = autoScalingConfiguration
});
```

Golang:

```go
autoScalingConfiguration := apprunner.NewAutoScalingConfiguration(this, jsii.String("AutoScalingConfiguration"), &AutoScalingConfigurationProps{
	AutoScalingConfigurationName: jsii.String("MyAutoScalingConfiguration"),
	MaxConcurrency: jsii.Number(150),
	MaxSize: jsii.Number(20),
	MinSize: jsii.Number(5),
})

apprunner.NewService(this, jsii.String("DemoService"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	AutoScalingConfiguration: AutoScalingConfiguration,
})
```

## VPC Connector

To associate an App Runner service with a custom VPC, define `vpcConnector` for the service.

TypeScript:

```ts
import * as ec2 from 'aws-cdk-lib/aws-ec2';

const vpc = new ec2.Vpc(this, 'Vpc', {
  ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16')
});

const vpcConnector = new apprunner.VpcConnector(this, 'VpcConnector', {
  vpc,
  vpcSubnets: vpc.selectSubnets({ subnetType: ec2.SubnetType.PUBLIC }),
  vpcConnectorName: 'MyVpcConnector',
});

new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  vpcConnector,
});
```

Python:

```python
import aws_cdk.aws_ec2 as ec2

vpc = ec2.Vpc(self, "Vpc",
    ip_addresses=ec2.IpAddresses.cidr("10.0.0.0/16")
)

vpc_connector = apprunner.VpcConnector(self, "VpcConnector",
    vpc=vpc,
    vpc_subnets=vpc.select_subnets(subnet_type=ec2.SubnetType.PUBLIC),
    vpc_connector_name="MyVpcConnector"
)

apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    vpc_connector=vpc_connector
)
```

Java:

```java
import software.amazon.awscdk.services.ec2.*;

Vpc vpc = Vpc.Builder.create(this, "Vpc")
        .ipAddresses(IpAddresses.cidr("10.0.0.0/16"))
        .build();

VpcConnector vpcConnector = VpcConnector.Builder.create(this, "VpcConnector")
        .vpc(vpc)
        .vpcSubnets(vpc.selectSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build()))
        .vpcConnectorName("MyVpcConnector")
        .build();

Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .vpcConnector(vpcConnector)
        .build();
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.EC2;

var vpc = new Vpc(this, "Vpc", new VpcProps {
    IpAddresses = IpAddresses.Cidr("10.0.0.0/16")
});

var vpcConnector = new VpcConnector(this, "VpcConnector", new VpcConnectorProps {
    Vpc = vpc,
    VpcSubnets = vpc.SelectSubnets(new SubnetSelection { SubnetType = SubnetType.PUBLIC }),
    VpcConnectorName = "MyVpcConnector"
});

new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    VpcConnector = vpcConnector
});
```

Golang:

```go
import "github.com/aws/aws-cdk-go/awscdk"

vpc := ec2.NewVpc(this, jsii.String("Vpc"), &VpcProps{
	IpAddresses: ec2.IpAddresses_Cidr(jsii.String("10.0.0.0/16")),
})

vpcConnector := apprunner.NewVpcConnector(this, jsii.String("VpcConnector"), &VpcConnectorProps{
	Vpc: Vpc,
	VpcSubnets: vpc.selectSubnets(&SubnetSelection{
		SubnetType: ec2.SubnetType_PUBLIC,
	}),
	VpcConnectorName: jsii.String("MyVpcConnector"),
})

apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	VpcConnector: VpcConnector,
})
```

## VPC Ingress Connection

To make your App Runner service private and only accessible from within a VPC use the `isPubliclyAccessible` property and associate it to a [`VpcIngressConnection`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcIngressConnection.html) resource.

To set up a [`VpcIngressConnection`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcIngressConnection.html), specify a VPC, a VPC Interface Endpoint, and the App Runner service.
Also you must set `isPubliclyAccessible` property in ther [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) to `false`.

For more information, see [Enabling Private endpoint for incoming traffic](https://docs.aws.amazon.com/apprunner/latest/dg/network-pl.html).

TypeScript:

```ts
import * as ec2 from 'aws-cdk-lib/aws-ec2';

declare const vpc: ec2.Vpc;

const interfaceVpcEndpoint = new ec2.InterfaceVpcEndpoint(this, 'MyVpcEndpoint', {
  vpc,
  service: ec2.InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS,
  privateDnsEnabled: false,
});

const service = new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: {
      port: 8000,
    },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  isPubliclyAccessible: false, // set false
});

new apprunner.VpcIngressConnection(this, 'VpcIngressConnection', {
  vpc,
  interfaceVpcEndpoint,
  service,
});
```

Python:

```python
import aws_cdk.aws_ec2 as ec2

# vpc: ec2.Vpc

interface_vpc_endpoint = ec2.InterfaceVpcEndpoint(self, "MyVpcEndpoint",
    vpc=vpc,
    service=ec2.InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS,
    private_dns_enabled=False
)

service = apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(
            port=8000
        ),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    is_publicly_accessible=False
)

apprunner.VpcIngressConnection(self, "VpcIngressConnection",
    vpc=vpc,
    interface_vpc_endpoint=interface_vpc_endpoint,
    service=service
)
```

Java:

```java
import software.amazon.awscdk.services.ec2.*;

Vpc vpc;

InterfaceVpcEndpoint interfaceVpcEndpoint = InterfaceVpcEndpoint.Builder.create(this, "MyVpcEndpoint")
        .vpc(vpc)
        .service(InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS)
        .privateDnsEnabled(false)
        .build();

Service service = Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder()
                        .port(8000)
                        .build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .isPubliclyAccessible(false)
        .build();

VpcIngressConnection.Builder.create(this, "VpcIngressConnection")
        .vpc(vpc)
        .interfaceVpcEndpoint(interfaceVpcEndpoint)
        .service(service)
        .build();
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.EC2;

Vpc vpc;

var interfaceVpcEndpoint = new InterfaceVpcEndpoint(this, "MyVpcEndpoint", new InterfaceVpcEndpointProps {
    Vpc = vpc,
    Service = InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS,
    PrivateDnsEnabled = false
});

var service = new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration {
            Port = 8000
        },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    IsPubliclyAccessible = false
});

new VpcIngressConnection(this, "VpcIngressConnection", new VpcIngressConnectionProps {
    Vpc = vpc,
    InterfaceVpcEndpoint = interfaceVpcEndpoint,
    Service = service
});
```

Golang:

```go
import "github.com/aws/aws-cdk-go/awscdk"

var vpc Vpc

interfaceVpcEndpoint := ec2.NewInterfaceVpcEndpoint(this, jsii.String("MyVpcEndpoint"), &InterfaceVpcEndpointProps{
	Vpc: Vpc,
	Service: ec2.InterfaceVpcEndpointAwsService_APP_RUNNER_REQUESTS(),
	PrivateDnsEnabled: jsii.Boolean(false),
})

service := apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	IsPubliclyAccessible: jsii.Boolean(false),
})

apprunner.NewVpcIngressConnection(this, jsii.String("VpcIngressConnection"), &VpcIngressConnectionProps{
	Vpc: Vpc,
	InterfaceVpcEndpoint: InterfaceVpcEndpoint,
	Service: Service,
})
```

## Dual Stack

To use dual stack (IPv4 and IPv6) for your incoming public network configuration, set `ipAddressType` to `IpAddressType.DUAL_STACK`.

TypeScript:

```ts
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  ipAddressType: apprunner.IpAddressType.DUAL_STACK,
});
```

Python:

```python
apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    ip_address_type=apprunner.IpAddressType.DUAL_STACK
)
```

Java:

```java
Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .ipAddressType(IpAddressType.DUAL_STACK)
        .build();
```

C# / .NET:

```csharp
new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    IpAddressType = IpAddressType.DUAL_STACK
});
```

Golang:

```go
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	IpAddressType: apprunner.IpAddressType_DUAL_STACK,
})
```

**Note**: Currently, App Runner supports dual stack for only Public endpoint.
Only IPv4 is supported for Private endpoint.
If you update a service that's using dual-stack Public endpoint to a Private endpoint,
your App Runner service will default to support only IPv4 for Private endpoint and fail
to receive traffic originating from IPv6 endpoint.

## Secrets Manager

To include environment variables integrated with AWS Secrets Manager, use the `environmentSecrets` attribute.
You can use the `addSecret` method from the App Runner [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) class to include secrets from outside the
service definition.

TypeScript:

```ts
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
import * as ssm from 'aws-cdk-lib/aws-ssm';

declare const stack: Stack;

const secret = new secretsmanager.Secret(stack, 'Secret');
const parameter = ssm.StringParameter.fromSecureStringParameterAttributes(stack, 'Parameter', {
  parameterName: '/name',
  version: 1,
});

const service = new apprunner.Service(stack, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: {
      port: 8000,
      environmentSecrets: {
        SECRET: apprunner.Secret.fromSecretsManager(secret),
        PARAMETER: apprunner.Secret.fromSsmParameter(parameter),
        SECRET_ID: apprunner.Secret.fromSecretsManagerVersion(secret, { versionId: 'version-id' }),
        SECRET_STAGE: apprunner.Secret.fromSecretsManagerVersion(secret, { versionStage: 'version-stage' }),
      },
    },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  })
});

service.addSecret('LATER_SECRET', apprunner.Secret.fromSecretsManager(secret, 'field'));
```

Python:

```python
import aws_cdk.aws_secretsmanager as secretsmanager
import aws_cdk.aws_ssm as ssm

# stack: Stack

secret = secretsmanager.Secret(stack, "Secret")
parameter = ssm.StringParameter.from_secure_string_parameter_attributes(stack, "Parameter",
    parameter_name="/name",
    version=1
)

service = apprunner.Service(stack, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(
            port=8000,
            environment_secrets={
                "SECRET": apprunner.Secret.from_secrets_manager(secret),
                "PARAMETER": apprunner.Secret.from_ssm_parameter(parameter),
                "SECRET_ID": apprunner.Secret.from_secrets_manager_version(secret, version_id="version-id"),
                "SECRET_STAGE": apprunner.Secret.from_secrets_manager_version(secret, version_stage="version-stage")
            }
        ),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    )
)

service.add_secret("LATER_SECRET", apprunner.Secret.from_secrets_manager(secret, "field"))
```

Java:

```java
import software.amazon.awscdk.services.secretsmanager.*;
import software.amazon.awscdk.services.ssm.*;

Stack stack;

Secret secret = new Secret(stack, "Secret");
IStringParameter parameter = StringParameter.fromSecureStringParameterAttributes(stack, "Parameter", SecureStringParameterAttributes.builder()
        .parameterName("/name")
        .version(1)
        .build());

Service service = Service.Builder.create(stack, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder()
                        .port(8000)
                        .environmentSecrets(Map.of(
                                "SECRET", Secret.fromSecretsManager(secret),
                                "PARAMETER", Secret.fromSsmParameter(parameter),
                                "SECRET_ID", Secret.fromSecretsManagerVersion(secret, SecretVersionInfo.builder().versionId("version-id").build()),
                                "SECRET_STAGE", Secret.fromSecretsManagerVersion(secret, SecretVersionInfo.builder().versionStage("version-stage").build())))
                        .build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .build();

service.addSecret("LATER_SECRET", Secret.fromSecretsManager(secret, "field"));
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.SecretsManager;
using Amazon.CDK.AWS.SSM;

Stack stack;

var secret = new Secret(stack, "Secret");
var parameter = StringParameter.FromSecureStringParameterAttributes(stack, "Parameter", new SecureStringParameterAttributes {
    ParameterName = "/name",
    Version = 1
});

var service = new Service(stack, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration {
            Port = 8000,
            EnvironmentSecrets = new Dictionary<string, Secret> {
                { "SECRET", Secret.FromSecretsManager(secret) },
                { "PARAMETER", Secret.FromSsmParameter(parameter) },
                { "SECRET_ID", Secret.FromSecretsManagerVersion(secret, new SecretVersionInfo { VersionId = "version-id" }) },
                { "SECRET_STAGE", Secret.FromSecretsManagerVersion(secret, new SecretVersionInfo { VersionStage = "version-stage" }) }
            }
        },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    })
});

service.AddSecret("LATER_SECRET", Secret.FromSecretsManager(secret, "field"));
```

Golang:

```go
import secretsmanager "github.com/aws/aws-cdk-go/awscdk"
import ssm "github.com/aws/aws-cdk-go/awscdk"

var stack Stack

secret := secretsmanager.NewSecret(stack, jsii.String("Secret"))
parameter := ssm.StringParameter_FromSecureStringParameterAttributes(stack, jsii.String("Parameter"), &SecureStringParameterAttributes{
	ParameterName: jsii.String("/name"),
	Version: jsii.Number(1),
})

service := apprunner.NewService(stack, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
			EnvironmentSecrets: map[string]Secret{
				"SECRET": apprunner.Secret_fromSecretsManager(secret),
				"PARAMETER": apprunner.Secret_fromSsmParameter(parameter),
				"SECRET_ID": apprunner.Secret_fromSecretsManagerVersion(secret, &SecretVersionInfo{
					"versionId": jsii.String("version-id"),
				}),
				"SECRET_STAGE": apprunner.Secret_fromSecretsManagerVersion(secret, &SecretVersionInfo{
					"versionStage": jsii.String("version-stage"),
				}),
			},
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
})

service.AddSecret(jsii.String("LATER_SECRET"), apprunner.Secret_FromSecretsManager(secret, jsii.String("field")))
```

## Use a customer managed key

To use a customer managed key for your source encryption, use the `kmsKey` attribute.

TypeScript:

```ts
import * as kms from 'aws-cdk-lib/aws-kms';

declare const kmsKey: kms.IKey;

new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  kmsKey,
});
```

Python:

```python
import aws_cdk.aws_kms as kms

# kms_key: kms.IKey

apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    kms_key=kms_key
)
```

Java:

```java
import software.amazon.awscdk.services.kms.*;

IKey kmsKey;

Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .kmsKey(kmsKey)
        .build();
```

C# / .NET:

```csharp
using Amazon.CDK.AWS.KMS;

IKey kmsKey;

new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    KmsKey = kmsKey
});
```

Golang:

```go
import kms "github.com/aws/aws-cdk-go/awscdk"

var kmsKey IKey

apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	KmsKey: KmsKey,
})
```

## HealthCheck

To configure the health check for the service, use the `healthCheck` attribute.

You can specify it by static methods `HealthCheck.http` or `HealthCheck.tcp`.

TypeScript:

```ts
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  healthCheck: apprunner.HealthCheck.http({
    healthyThreshold: 5,
    interval: Duration.seconds(10),
    path: '/',
    timeout: Duration.seconds(10),
    unhealthyThreshold: 10,
  }),
});
```

Python:

```python
apprunner.Service(self, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    health_check=apprunner.HealthCheck.http(
        healthy_threshold=5,
        interval=Duration.seconds(10),
        path="/",
        timeout=Duration.seconds(10),
        unhealthy_threshold=10
    )
)
```

Java:

```java
Service.Builder.create(this, "Service")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .healthCheck(HealthCheck.http(HttpHealthCheckOptions.builder()
                .healthyThreshold(5)
                .interval(Duration.seconds(10))
                .path("/")
                .timeout(Duration.seconds(10))
                .unhealthyThreshold(10)
                .build()))
        .build();
```

C# / .NET:

```csharp
new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
        HealthyThreshold = 5,
        Interval = Duration.Seconds(10),
        Path = "/",
        Timeout = Duration.Seconds(10),
        UnhealthyThreshold = 10
    })
});
```

Golang:

```go
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	HealthCheck: apprunner.HealthCheck_Http(&HttpHealthCheckOptions{
		HealthyThreshold: jsii.Number(5),
		Interval: awscdk.Duration_Seconds(jsii.Number(10)),
		Path: jsii.String("/"),
		Timeout: awscdk.Duration_*Seconds(jsii.Number(10)),
		UnhealthyThreshold: jsii.Number(10),
	}),
})
```

## Observability Configuration

To associate an App Runner service with a custom observability configuration, use the `observabilityConfiguration` property.

TypeScript:

```ts
const observabilityConfiguration = new apprunner.ObservabilityConfiguration(this, 'ObservabilityConfiguration', {
  observabilityConfigurationName: 'MyObservabilityConfiguration',
  traceConfigurationVendor: apprunner.TraceConfigurationVendor.AWSXRAY,
});

new apprunner.Service(this, 'DemoService', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  observabilityConfiguration,
});
```

Python:

```python
observability_configuration = apprunner.ObservabilityConfiguration(self, "ObservabilityConfiguration",
    observability_configuration_name="MyObservabilityConfiguration",
    trace_configuration_vendor=apprunner.TraceConfigurationVendor.AWSXRAY
)

apprunner.Service(self, "DemoService",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    ),
    observability_configuration=observability_configuration
)
```

Java:

```java
ObservabilityConfiguration observabilityConfiguration = ObservabilityConfiguration.Builder.create(this, "ObservabilityConfiguration")
        .observabilityConfigurationName("MyObservabilityConfiguration")
        .traceConfigurationVendor(TraceConfigurationVendor.AWSXRAY)
        .build();

Service.Builder.create(this, "DemoService")
        .source(Source.fromEcrPublic(EcrPublicProps.builder()
                .imageConfiguration(ImageConfiguration.builder().port(8000).build())
                .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                .build()))
        .observabilityConfiguration(observabilityConfiguration)
        .build();
```

C# / .NET:

```csharp
var observabilityConfiguration = new ObservabilityConfiguration(this, "ObservabilityConfiguration", new ObservabilityConfigurationProps {
    ObservabilityConfigurationName = "MyObservabilityConfiguration",
    TraceConfigurationVendor = TraceConfigurationVendor.AWSXRAY
});

new Service(this, "DemoService", new ServiceProps {
    Source = Source.FromEcrPublic(new EcrPublicProps {
        ImageConfiguration = new ImageConfiguration { Port = 8000 },
        ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
    }),
    ObservabilityConfiguration = observabilityConfiguration
});
```

Golang:

```go
observabilityConfiguration := apprunner.NewObservabilityConfiguration(this, jsii.String("ObservabilityConfiguration"), &ObservabilityConfigurationProps{
	ObservabilityConfigurationName: jsii.String("MyObservabilityConfiguration"),
	TraceConfigurationVendor: apprunner.TraceConfigurationVendor_AWSXRAY,
})

apprunner.NewService(this, jsii.String("DemoService"), &ServiceProps{
	Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
		ImageConfiguration: &ImageConfiguration{
			Port: jsii.Number(8000),
		},
		ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
	}),
	ObservabilityConfiguration: ObservabilityConfiguration,
})
```

## Types

### Constructs (L2)

- [`AutoScalingConfiguration`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.AutoScalingConfiguration.html) Construct (L2) The App Runner Auto Scaling Configuration.
- [`ObservabilityConfiguration`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ObservabilityConfiguration.html) Construct (L2) The App Runner Observability configuration.
- [`Service`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Service.html) Construct (L2) The App Runner Service.
- [`VpcConnector`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcConnector.html) Construct (L2) The App Runner VPC Connector.
- [`VpcIngressConnection`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcIngressConnection.html) Construct (L2) The App Runner VPC Ingress Connection.

### Structs

- [`AssetProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.AssetProps.html) Struct Properties of the image repository for `Source.fromAsset()`.
- [`AutoScalingConfigurationAttributes`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.AutoScalingConfigurationAttributes.html) Struct Attributes for the App Runner Auto Scaling Configuration.
- [`AutoScalingConfigurationProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.AutoScalingConfigurationProps.html) Struct Properties of the App Runner Auto Scaling Configuration.
- [`CodeConfiguration`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.CodeConfiguration.html) Struct Describes the configuration that AWS App Runner uses to build and run an App Runner service from a source code repository.
- [`CodeConfigurationValues`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.CodeConfigurationValues.html) Struct Describes the basic configuration needed for building and running an AWS App Runner service.
- [`CodeRepositoryProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.CodeRepositoryProps.html) Struct Properties of the CodeRepository.
- [`EcrProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.EcrProps.html) Struct Properties of the image repository for `Source.fromEcr()`.
- [`EcrPublicProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.EcrPublicProps.html) Struct Properties of the image repository for `Source.fromEcrPublic()`.
- [`GithubRepositoryProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.GithubRepositoryProps.html) Struct Properties of the Github repository for `Source.fromGitHub()`.
- [`HttpHealthCheckOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.HttpHealthCheckOptions.html) Struct Properties used to define HTTP Based healthchecks.
- [`ImageConfiguration`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ImageConfiguration.html) Struct Describes the configuration that AWS App Runner uses to run an App Runner service using an image pulled from a source image repository.
- [`ImageRepository`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ImageRepository.html) Struct Describes a source image repository.
- [`ObservabilityConfigurationAttributes`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ObservabilityConfigurationAttributes.html) Struct Attributes for the App Runner Observability configuration.
- [`ObservabilityConfigurationProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ObservabilityConfigurationProps.html) Struct Properties of the AppRunner Observability configuration.
- [`SecretVersionInfo`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.SecretVersionInfo.html) Struct Specify the secret's version id or version stage.
- [`ServiceAttributes`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ServiceAttributes.html) Struct Attributes for the App Runner Service.
- [`ServiceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ServiceProps.html) Struct Properties of the AppRunner Service.
- [`SourceCodeVersion`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.SourceCodeVersion.html) Struct Identifies a version of code that AWS App Runner refers to within a source code repository.
- [`SourceConfig`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.SourceConfig.html) Struct Result of binding `Source` into a `Service`.
- [`TcpHealthCheckOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.TcpHealthCheckOptions.html) Struct Properties used to define TCP Based healthchecks.
- [`VpcConnectorAttributes`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcConnectorAttributes.html) Struct Attributes for the App Runner VPC Connector.
- [`VpcConnectorProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcConnectorProps.html) Struct Properties of the AppRunner VPC Connector.
- [`VpcIngressConnectionAttributes`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcIngressConnectionAttributes.html) Struct Attributes for the App Runner VPC Ingress Connection.
- [`VpcIngressConnectionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.VpcIngressConnectionProps.html) Struct Properties of the AppRunner VPC Ingress Connection.

### Classes

- [`AssetSource`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.AssetSource.html) Class Represents the source from local assets.
- [`Cpu`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Cpu.html) Class The number of CPU units reserved for each instance of your App Runner service.
- [`EcrPublicSource`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.EcrPublicSource.html) Class Represents the service source from ECR Public.
- [`EcrSource`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.EcrSource.html) Class Represents the service source from ECR.
- [`GitHubConnection`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.GitHubConnection.html) Class Represents the App Runner connection that enables the App Runner service to connect to a source repository.
- [`GithubSource`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.GithubSource.html) Class Represents the service source from a Github repository.
- [`HealthCheck`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.HealthCheck.html) Class Contains static factory methods for creating health checks for different protocols.
- [`Memory`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Memory.html) Class The amount of memory reserved for each instance of your App Runner service.
- [`Runtime`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Runtime.html) Class The code runtimes.
- [`Secret`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Secret.html) Class A secret environment variable.
- [`Source`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Source.html) Class Represents the App Runner service source.

### Enums

- [`ConfigurationSourceType`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ConfigurationSourceType.html) Enum The source of the App Runner configuration.
- [`HealthCheckProtocolType`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.HealthCheckProtocolType.html) Enum The health check protocol type.
- [`ImageRepositoryType`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ImageRepositoryType.html) Enum The image repository types.
- [`IpAddressType`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.IpAddressType.html) Enum The IP address type for your incoming public network configuration.
- [`TraceConfigurationVendor`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.TraceConfigurationVendor.html) Enum The implementation provider chosen for tracing App Runner services.

### Interfaces

- [`IAutoScalingConfiguration`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.IAutoScalingConfiguration.html) Interface Represents the App Runner Auto Scaling Configuration.
- [`IObservabilityConfiguration`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.IObservabilityConfiguration.html) Interface Represents the App Runner Observability configuration.
- [`IService`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.IService.html) Interface Represents the App Runner Service.
- [`IVpcConnector`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.IVpcConnector.html) Interface Represents the App Runner VPC Connector.
- [`IVpcIngressConnection`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.IVpcIngressConnection.html) Interface Represents the App Runner VPC Ingress Connection.
