Skip to content
v2.274.0

Experimental

@aws-cdk/aws-apprunner-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

ServiceProps Struct ​

Properties of the AppRunner Service.

Example ​

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: ['*'],
}))

Properties ​

accessRoleIRoleaccess_roleIRoleaccessRoleIRoleAccessRoleIRoleAccessRoleIRole#
The IAM role that grants the App Runner service access to a source repository.

Default: generate a new access role.

It's required for ECR image repositories (but not for ECR Public repositories).

The role must be assumable by the 'build.apprunner.amazonaws.com' service principal.

autoDeploymentsEnabledbooleanauto_deployments_enabledboolautoDeploymentsEnabledBooleanAutoDeploymentsEnabledboolAutoDeploymentsEnabled*bool#
Specifies whether to enable continuous integration from the source repository.

Default: no value will be passed.

notes

If true, continuous integration from the source repository is enabled for the App Runner service. Each repository change (including any source code commit or new image version) starts a deployment. By default, App Runner sets to false for a source image that uses an ECR Public repository or an ECR repository that's in an AWS account other than the one that the service is in. App Runner sets to true in all other cases (which currently include a source code repository or a source image using a same-account ECR repository).

autoScalingConfigurationIAutoScalingConfigurationauto_scaling_configurationIAutoScalingConfigurationautoScalingConfigurationIAutoScalingConfigurationAutoScalingConfigurationIAutoScalingConfigurationAutoScalingConfigurationIAutoScalingConfiguration#
Specifies an App Runner Auto Scaling Configuration.

Default: the latest revision of a default auto scaling configuration is used.

A default configuration is either the AWS recommended configuration, or the configuration you set as the default.

cpuCpucpuCpucpuCpuCpuCpuCpuCpu= Cpu.ONE_VCPU#
The number of CPU units reserved for each instance of your App Runner service.
healthCheckHealthCheckhealth_checkHealthCheckhealthCheckHealthCheckHealthCheckHealthCheckHealthCheckHealthCheck#
Settings for the health check that AWS App Runner performs to monitor the health of a service.

Default: no health check configuration

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

instanceRoleIRoleinstance_roleIRoleinstanceRoleIRoleInstanceRoleIRoleInstanceRoleIRole#
The IAM role that provides permissions to your App Runner service.

Default: generate a new instance role.

These are permissions that your code needs when it calls any AWS APIs.

The role must be assumable by the 'tasks.apprunner.amazonaws.com' service principal.

ipAddressTypeIpAddressTypeip_address_typeIpAddressTypeipAddressTypeIpAddressTypeIpAddressTypeIpAddressTypeIpAddressTypeIpAddressType= IpAddressType.IPV4#
The IP address type for your incoming public network configuration.
isPubliclyAccessiblebooleanis_publicly_accessibleboolisPubliclyAccessibleBooleanIsPubliclyAccessibleboolIsPubliclyAccessible*bool= true#
Specifies whether your App Runner service is publicly accessible.

If you use VpcIngressConnection, you must set this property to false.

kmsKeyIKeyRefkms_keyIKeyRefkmsKeyIKeyRefKmsKeyIKeyRefKmsKeyIKeyRef#
The customer managed key that AWS App Runner uses to encrypt copies of the source repository and service logs.

Default: Use an AWS managed key

memoryMemorymemoryMemorymemoryMemoryMemoryMemoryMemoryMemory= Memory.TWO_GB#
The amount of memory reserved for each instance of your App Runner service.
observabilityConfigurationIObservabilityConfigurationobservability_configurationIObservabilityConfigurationobservabilityConfigurationIObservabilityConfigurationObservabilityConfigurationIObservabilityConfigurationObservabilityConfigurationIObservabilityConfiguration#
Settings for an App Runner observability configuration.

Default: no observability configuration resource is associated with the service.

serviceNamestringservice_namestrserviceNameStringServiceNamestringServiceName*string#
Name of the service.

Default: auto-generated if undefined.

sourceSourcesourceSourcesourceSourceSourceSourceSourceSourcerequired#
The source of the repository for the service.
vpcConnectorIVpcConnectorvpc_connectorIVpcConnectorvpcConnectorIVpcConnectorVpcConnectorIVpcConnectorVpcConnectorIVpcConnector#
Settings for an App Runner VPC connector to associate with the service.

Default: no VPC connector, uses the DEFAULT egress type instead