ServiceProps

class aws_cdk.aws_apprunner_alpha.ServiceProps(*, source, access_role=None, auto_deployments_enabled=None, cpu=None, health_check=None, instance_role=None, memory=None, service_name=None, vpc_connector=None)

Bases: object

(experimental) Properties of the AppRunner Service.

Parameters:
  • source (Source) – (experimental) The source of the repository for the service.

  • access_role (Optional[IRole]) – (experimental) 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. Default: - generate a new access role.

  • auto_deployments_enabled (Optional[bool]) – (experimental) 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). Default: - no value will be passed.

  • cpu (Optional[Cpu]) – (experimental) The number of CPU units reserved for each instance of your App Runner service. Default: Cpu.ONE_VCPU

  • health_check (Optional[HealthCheck]) – (experimental) 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. Default: - no health check configuration

  • instance_role (Optional[IRole]) – (experimental) 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. Default: - generate a new instance role.

  • memory (Optional[Memory]) – (experimental) The amount of memory reserved for each instance of your App Runner service. Default: Memory.TWO_GB

  • service_name (Optional[str]) – (experimental) Name of the service. Default: - auto-generated if undefined.

  • vpc_connector (Optional[IVpcConnector]) – (experimental) Settings for an App Runner VPC connector to associate with the service. Default: - no VPC connector, uses the DEFAULT egress type instead

Stability:

experimental

ExampleMetadata:

infused

Example:

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=["*"]
))

Attributes

access_role

(experimental) 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.

Default:
  • generate a new access role.

See:

https://docs.aws.amazon.com/apprunner/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-roles-service.access

Stability:

experimental

auto_deployments_enabled

(experimental) 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).

Default:
  • no value will be passed.

Stability:

experimental

cpu

(experimental) The number of CPU units reserved for each instance of your App Runner service.

Default:

Cpu.ONE_VCPU

Stability:

experimental

health_check

(experimental) 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.

Default:
  • no health check configuration

Stability:

experimental

instance_role

(experimental) 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.

Default:
  • generate a new instance role.

See:

https://docs.aws.amazon.com/apprunner/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-roles-service.instance

Stability:

experimental

memory

(experimental) The amount of memory reserved for each instance of your App Runner service.

Default:

Memory.TWO_GB

Stability:

experimental

service_name

(experimental) Name of the service.

Default:
  • auto-generated if undefined.

Stability:

experimental

source

(experimental) The source of the repository for the service.

Stability:

experimental

vpc_connector

(experimental) Settings for an App Runner VPC connector to associate with the service.

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

Stability:

experimental