interface ServiceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppRunner.Alpha.ServiceProps |
Go | github.com/aws/aws-cdk-go/awscdkapprunneralpha/v2#ServiceProps |
Java | software.amazon.awscdk.services.apprunner.alpha.ServiceProps |
Python | aws_cdk.aws_apprunner_alpha.ServiceProps |
TypeScript (source) | @aws-cdk/aws-apprunner-alpha ยป ServiceProps |
Properties of the AppRunner Service.
Example
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
Name | Type | Description |
---|---|---|
source | Source | The source of the repository for the service. |
access | IRole | The IAM role that grants the App Runner service access to a source repository. |
auto | boolean | Specifies whether to enable continuous integration from the source repository. |
cpu? | Cpu | The number of CPU units reserved for each instance of your App Runner service. |
health | Health | Settings for the health check that AWS App Runner performs to monitor the health of a service. |
instance | IRole | The IAM role that provides permissions to your App Runner service. |
memory? | Memory | The amount of memory reserved for each instance of your App Runner service. |
service | string | Name of the service. |
vpc | IVpc | Settings for an App Runner VPC connector to associate with the service. |
source
Type:
Source
The source of the repository for the service.
accessRole?
Type:
IRole
(optional, default: generate a new access role.)
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).
The role must be assumable by the 'build.apprunner.amazonaws.com' service principal.
autoDeploymentsEnabled?
Type:
boolean
(optional, default: no value will be passed.)
Specifies whether to enable continuous integration from the source repository.
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).
cpu?
Type:
Cpu
(optional, default: Cpu.ONE_VCPU)
The number of CPU units reserved for each instance of your App Runner service.
healthCheck?
Type:
Health
(optional, default: no health check configuration)
Settings for the health check that AWS App Runner performs to monitor the health of a service.
You can specify it by static methods HealthCheck.http
or HealthCheck.tcp
.
instanceRole?
Type:
IRole
(optional, default: generate a new instance role.)
The IAM role that provides permissions to your App Runner service.
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.
memory?
Type:
Memory
(optional, default: Memory.TWO_GB)
The amount of memory reserved for each instance of your App Runner service.
serviceName?
Type:
string
(optional, default: auto-generated if undefined.)
Name of the service.
vpcConnector?
Type:
IVpc
(optional, default: no VPC connector, uses the DEFAULT egress type instead)
Settings for an App Runner VPC connector to associate with the service.