Source

class aws_cdk.aws_apprunner.Source

Bases: object

(experimental) Represents the App Runner service source.

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_ecr_assets as assets


image_asset = assets.DockerImageAsset(self, "ImageAssets",
    directory=path.join(__dirname, "./docker.assets")
)
apprunner.Service(self, "Service",
    source=apprunner.Source.from_asset(
        image_configuration=apprunner.ImageConfiguration(port=8000),
        asset=image_asset
    )
)
Stability:

experimental

Methods

abstract bind(scope)

(experimental) Called when the Job is initialized to allow this object to bind.

Parameters:

scope (Construct) –

Stability:

experimental

Return type:

SourceConfig

Static Methods

classmethod from_asset(*, asset, image_configuration=None)

(experimental) Source from local assets.

Parameters:
  • asset (DockerImageAsset) – (experimental) Represents the docker image asset.

  • image_configuration (Union[ImageConfiguration, Dict[str, Any], None]) – (experimental) The image configuration for the image built from the asset. Default: - no image configuration will be passed. The default port will be 8080.

Stability:

experimental

Return type:

AssetSource

classmethod from_ecr(*, repository, image_configuration=None, tag=None, tag_or_digest=None)

(experimental) Source from the ECR repository.

Parameters:
  • repository (IRepository) – (experimental) Represents the ECR repository.

  • image_configuration (Union[ImageConfiguration, Dict[str, Any], None]) – (experimental) The image configuration for the image from ECR. Default: - no image configuration will be passed. The default port will be 8080.

  • tag (Optional[str]) – (deprecated) Image tag. Default: - ‘latest’

  • tag_or_digest (Optional[str]) – (experimental) Image tag or digest (digests must start with sha256:). Default: - ‘latest’

Stability:

experimental

Return type:

EcrSource

classmethod from_ecr_public(*, image_identifier, image_configuration=None)

(experimental) Source from the ECR Public repository.

Parameters:
  • image_identifier (str) – (experimental) The ECR Public image URI.

  • image_configuration (Union[ImageConfiguration, Dict[str, Any], None]) – (experimental) The image configuration for the image from ECR Public. Default: - no image configuration will be passed. The default port will be 8080.

Stability:

experimental

Return type:

EcrPublicSource

classmethod from_git_hub(*, configuration_source, connection, repository_url, branch=None, code_configuration_values=None)

(experimental) Source from the GitHub repository.

Parameters:
  • configuration_source (ConfigurationSourceType) – (experimental) The source of the App Runner configuration.

  • connection (GitHubConnection) – (experimental) ARN of the connection to Github. Only required for Github source.

  • repository_url (str) – (experimental) The location of the repository that contains the source code.

  • branch (Optional[str]) – (experimental) The branch name that represents a specific version for the repository. Default: main

  • code_configuration_values (Union[CodeConfigurationValues, Dict[str, Any], None]) – (experimental) The code configuration values. Will be ignored if configurationSource is REPOSITORY. Default: - no values will be passed. The apprunner.yaml from the github reopsitory will be used instead.

Stability:

experimental

Return type:

GithubSource