SourceConfig

class aws_cdk.aws_apprunner.SourceConfig(*, code_repository=None, ecr_repository=None, image_repository=None)

Bases: object

(experimental) Result of binding Source into a Service.

Parameters
  • code_repository (Optional[CodeRepositoryProps]) – (experimental) The code repository configuration (mutually exclusive with imageRepository). Default: - no code repository.

  • ecr_repository (Optional[IRepository]) – (experimental) The ECR repository (required to grant the pull privileges for the iam role). Default: - no ECR repository.

  • image_repository (Optional[ImageRepository]) – (experimental) The image repository configuration (mutually exclusive with codeRepository). Default: - no image repository.

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_ecr as ecr

# git_hub_connection is of type GitHubConnection
# repository is of type Repository
# runtime is of type Runtime

source_config = apprunner.SourceConfig(
    code_repository=apprunner.CodeRepositoryProps(
        code_configuration=apprunner.CodeConfiguration(
            configuration_source=apprunner.ConfigurationSourceType.REPOSITORY,

            # the properties below are optional
            configuration_values=apprunner.CodeConfigurationValues(
                runtime=runtime,

                # the properties below are optional
                build_command="buildCommand",
                environment={
                    "environment_key": "environment"
                },
                port="port",
                start_command="startCommand"
            )
        ),
        connection=git_hub_connection,
        repository_url="repositoryUrl",
        source_code_version=apprunner.SourceCodeVersion(
            type="type",
            value="value"
        )
    ),
    ecr_repository=repository,
    image_repository=apprunner.ImageRepository(
        image_identifier="imageIdentifier",
        image_repository_type=apprunner.ImageRepositoryType.ECR_PUBLIC,

        # the properties below are optional
        image_configuration=apprunner.ImageConfiguration(
            environment={
                "environment_key": "environment"
            },
            port=123,
            start_command="startCommand"
        )
    )
)

Attributes

code_repository

(experimental) The code repository configuration (mutually exclusive with imageRepository).

Default
  • no code repository.

Stability

experimental

Return type

Optional[CodeRepositoryProps]

ecr_repository

(experimental) The ECR repository (required to grant the pull privileges for the iam role).

Default
  • no ECR repository.

Stability

experimental

Return type

Optional[IRepository]

image_repository

(experimental) The image repository configuration (mutually exclusive with codeRepository).

Default
  • no image repository.

Stability

experimental

Return type

Optional[ImageRepository]