ServiceProps

class aws_cdk.aws_apprunner_alpha.ServiceProps(*, source, access_role=None, auto_deployments_enabled=None, auto_scaling_configuration=None, cpu=None, health_check=None, instance_role=None, ip_address_type=None, is_publicly_accessible=None, kms_key=None, memory=None, observability_configuration=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.

  • auto_scaling_configuration (Optional[IAutoScalingConfiguration]) – (experimental) Specifies an App Runner Auto Scaling Configuration. A default configuration is either the AWS recommended configuration, or the configuration you set as the default. Default: - the latest revision of a default auto scaling configuration is used.

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

  • ip_address_type (Optional[IpAddressType]) – (experimental) The IP address type for your incoming public network configuration. Default: - IpAddressType.IPV4

  • is_publicly_accessible (Optional[bool]) – (experimental) Specifies whether your App Runner service is publicly accessible. If you use VpcIngressConnection, you must set this property to false. Default: true

  • kms_key (Optional[IKey]) – (experimental) 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

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

  • observability_configuration (Optional[IObservabilityConfiguration]) – (experimental) Settings for an App Runner observability configuration. Default: - no observability configuration resource is associated with the service.

  • 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

auto_scaling_configuration

(experimental) Specifies an App Runner Auto Scaling Configuration.

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

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

See:

https://docs.aws.amazon.com/apprunner/latest/dg/manage-autoscaling.html

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

ip_address_type

(experimental) The IP address type for your incoming public network configuration.

Default:
  • IpAddressType.IPV4

Stability:

experimental

is_publicly_accessible

(experimental) Specifies whether your App Runner service is publicly accessible.

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

Default:

true

Stability:

experimental

kms_key

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

Stability:

experimental

memory

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

Default:

Memory.TWO_GB

Stability:

experimental

observability_configuration

(experimental) Settings for an App Runner observability configuration.

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

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