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

Represents the service source from ECR.

Extends: Source › EcrSource

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

## 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 repository: ecr.Repository;
declare const secret: apprunner_alpha.Secret;
const ecrSource = new apprunner_alpha.EcrSource({
  repository: repository,

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

## Initializer

```ts
new EcrSource(props: EcrProps)
```

## Methods

- `bind(_scope: Construct): SourceConfig` — Called when the Job is initialized to allow this object to bind.

- `fromAsset(props: AssetProps): AssetSource` (static) — Source from local assets.

- `fromEcr(props: EcrProps): EcrSource // chainable` (static) — Source from the ECR repository.

- `fromEcrPublic(props: EcrPublicProps): EcrPublicSource` (static) — Source from the ECR Public repository.

- `fromGitHub(props: GithubRepositoryProps): GithubSource` (static) — Source from the GitHub repository.
