SourceConfig

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

Bases: object

(experimental) Result of binding Source into a Service.

Parameters:
  • code_repository (Union[CodeRepositoryProps, Dict[str, Any], None]) – (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 (Union[ImageRepository, Dict[str, Any], None]) – (experimental) The image repository configuration (mutually exclusive with codeRepository). Default: - no image repository.

Stability:

experimental

ExampleMetadata:

fixture=_generated

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_alpha as apprunner_alpha
from aws_cdk import aws_ecr as ecr

# git_hub_connection: apprunner_alpha.GitHubConnection
# repository: ecr.Repository
# runtime: apprunner_alpha.Runtime
# secret: apprunner_alpha.Secret

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

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

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

        # the properties below are optional
        image_configuration=apprunner_alpha.ImageConfiguration(
            environment={
                "environment_key": "environment"
            },
            environment_secrets={
                "environment_secrets_key": secret
            },
            environment_variables={
                "environment_variables_key": "environmentVariables"
            },
            port=123,
            start_command="startCommand"
        )
    )
)

Attributes

code_repository

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

Default:
  • no code repository.

Stability:

experimental

ecr_repository

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

Default:
  • no ECR repository.

Stability:

experimental

image_repository

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

Default:
  • no image repository.

Stability:

experimental