ImageConfiguration

class aws_cdk.aws_apprunner_alpha.ImageConfiguration(*, environment=None, environment_secrets=None, environment_variables=None, port=None, start_command=None)

Bases: object

(experimental) Describes the configuration that AWS App Runner uses to run an App Runner service using an image pulled from a source image repository.

Parameters:
  • environment (Optional[Mapping[str, str]]) – (deprecated) Environment variables that are available to your running App Runner service. Default: - no environment variables

  • environment_secrets (Optional[Mapping[str, Secret]]) – (experimental) Environment secrets that are available to your running App Runner service. Default: - no environment secrets

  • environment_variables (Optional[Mapping[str, str]]) – (experimental) Environment variables that are available to your running App Runner service. Default: - no environment variables

  • port (Union[int, float, None]) – (experimental) The port that your application listens to in the container. Default: 8080

  • start_command (Optional[str]) – (experimental) An optional command that App Runner runs to start the application in the source image. If specified, this command overrides the Docker image’s default start command. Default: - no start command

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imageconfiguration.html

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

environment

(deprecated) Environment variables that are available to your running App Runner service.

Default:
  • no environment variables

Deprecated:

use environmentVariables.

Stability:

deprecated

environment_secrets

(experimental) Environment secrets that are available to your running App Runner service.

Default:
  • no environment secrets

Stability:

experimental

environment_variables

(experimental) Environment variables that are available to your running App Runner service.

Default:
  • no environment variables

Stability:

experimental

port

(experimental) The port that your application listens to in the container.

Default:

8080

Stability:

experimental

start_command

(experimental) An optional command that App Runner runs to start the application in the source image.

If specified, this command overrides the Docker image’s default start command.

Default:
  • no start command

Stability:

experimental