ServiceProps

class aws_cdk.aws_apprunner.ServiceProps(*, access_role=None, cpu=None, instance_role=None, memory=None, service_name=None, source)

Bases: object

(experimental) Properties of the AppRunner Service.

Parameters
  • 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). Default: - generate a new access role.

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

  • 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. Default: - no instance role attached.

  • 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.

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

Stability

experimental

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_apprunner as apprunner
import aws_cdk.aws_iam as iam

# cpu is of type Cpu
# memory is of type Memory
# role is of type Role
# source is of type Source

service_props = apprunner.ServiceProps(
    source=source,

    # the properties below are optional
    access_role=role,
    cpu=cpu,
    instance_role=role,
    memory=memory,
    service_name="serviceName"
)

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

Default
  • generate a new access role.

Stability

experimental

Return type

Optional[IRole]

cpu

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

Default

Cpu.ONE_VCPU

Stability

experimental

Return type

Optional[Cpu]

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.

Default
  • no instance role attached.

Stability

experimental

Return type

Optional[IRole]

memory

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

Default

Memory.TWO_GB

Stability

experimental

Return type

Optional[Memory]

service_name

(experimental) Name of the service.

Default
  • auto-generated if undefined.

Stability

experimental

Return type

Optional[str]

source

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

Stability

experimental

Return type

Source