> **Experimental**
>
> `@aws-cdk/aws-apprunner-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# SourceConfig

Result of binding `Source` into a `Service`.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/service.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts#L273)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as apprunner_alpha from '@aws-cdk/aws-apprunner-alpha';
import { aws_ecr as ecr } from 'aws-cdk-lib';

declare const gitHubConnection: apprunner_alpha.GitHubConnection;
declare const repository: ecr.Repository;
declare const runtime: apprunner_alpha.Runtime;
declare const secret: apprunner_alpha.Secret;
const sourceConfig: apprunner_alpha.SourceConfig = {
  codeRepository: {
    codeConfiguration: {
      configurationSource: apprunner_alpha.ConfigurationSourceType.REPOSITORY,

      // the properties below are optional
      configurationValues: {
        runtime: runtime,

        // the properties below are optional
        buildCommand: 'buildCommand',
        environment: {
          environmentKey: 'environment',
        },
        environmentSecrets: {
          environmentSecretsKey: secret,
        },
        environmentVariables: {
          environmentVariablesKey: 'environmentVariables',
        },
        port: 'port',
        startCommand: 'startCommand',
      },
    },
    connection: gitHubConnection,
    repositoryUrl: 'repositoryUrl',
    sourceCodeVersion: {
      type: 'type',
      value: 'value',
    },
  },
  ecrRepository: repository,
  imageRepository: {
    imageIdentifier: 'imageIdentifier',
    imageRepositoryType: apprunner_alpha.ImageRepositoryType.ECR_PUBLIC,

    // the properties below are optional
    imageConfiguration: {
      environment: {
        environmentKey: 'environment',
      },
      environmentSecrets: {
        environmentSecretsKey: secret,
      },
      environmentVariables: {
        environmentVariablesKey: 'environmentVariables',
      },
      port: 123,
      startCommand: 'startCommand',
    },
  },
};
```

## Properties

- `codeRepository`: [CodeRepositoryProps](/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.CodeRepositoryProps.html) — The code repository configuration (mutually exclusive with `imageRepository`).

  **Default:** no code repository.

- `ecrRepository`: [IRepository](/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.IRepository.html) — The ECR repository (required to grant the pull privileges for the iam role).

  **Default:** no ECR repository.

- `imageRepository`: [ImageRepository](/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.ImageRepository.html) — The image repository configuration (mutually exclusive with `codeRepository`).

  **Default:** no image repository.
