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

Represents the service source from ECR Public.

Extends: [Source](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Source.html) › EcrPublicSource
Obtainable from: [Source.fromEcrPublic](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Source.html#fromecrpublic)

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

## Example

TypeScript:

```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';

declare const secret: apprunner_alpha.Secret;
const ecrPublicSource = new apprunner_alpha.EcrPublicSource({
  imageIdentifier: 'imageIdentifier',

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

Python:

```python
# 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

# secret: apprunner_alpha.Secret

ecr_public_source = apprunner_alpha.EcrPublicSource(
    image_identifier="imageIdentifier",

    # 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"
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apprunner.alpha.*;

Secret secret;

EcrPublicSource ecrPublicSource = EcrPublicSource.Builder.create()
        .imageIdentifier("imageIdentifier")

        // the properties below are optional
        .imageConfiguration(ImageConfiguration.builder()
                .environment(Map.of(
                        "environmentKey", "environment"))
                .environmentSecrets(Map.of(
                        "environmentSecretsKey", secret))
                .environmentVariables(Map.of(
                        "environmentVariablesKey", "environmentVariables"))
                .port(123)
                .startCommand("startCommand")
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.AppRunner.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppRunner.Alpha;

Secret secret;

var ecrPublicSource = new EcrPublicSource(new EcrPublicProps {
    ImageIdentifier = "imageIdentifier",

    // the properties below are optional
    ImageConfiguration = new ImageConfiguration {
        Environment = new Dictionary<string, string> {
            { "environmentKey", "environment" }
        },
        EnvironmentSecrets = new Dictionary<string, Secret> {
            { "environmentSecretsKey", secret }
        },
        EnvironmentVariables = new Dictionary<string, string> {
            { "environmentVariablesKey", "environmentVariables" }
        },
        Port = 123,
        StartCommand = "startCommand"
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkapprunneralpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import apprunner_alpha "github.com/aws/aws-cdk-go/awscdkapprunneralpha"

var secret Secret

ecrPublicSource := apprunner_alpha.NewEcrPublicSource(&EcrPublicProps{
	ImageIdentifier: jsii.String("imageIdentifier"),

	// the properties below are optional
	ImageConfiguration: &ImageConfiguration{
		Environment: map[string]*string{
			"environmentKey": jsii.String("environment"),
		},
		EnvironmentSecrets: map[string]Secret{
			"environmentSecretsKey": secret,
		},
		EnvironmentVariables: map[string]*string{
			"environmentVariablesKey": jsii.String("environmentVariables"),
		},
		Port: jsii.Number(123),
		StartCommand: jsii.String("startCommand"),
	},
})
```

## Initializer

TypeScript:

```ts
new EcrPublicSource(props: EcrPublicProps)
```

Python:

```python
EcrPublicSource(props: EcrPublicProps)
```

Java:

```java
new EcrPublicSource(EcrPublicProps props)
```

C# / .NET:

```csharp
new EcrPublicSource(EcrPublicProps props)
```

Golang:

```go
NewEcrPublicSource(Props EcrPublicProps)
```

## 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` (static) — Source from the ECR repository.

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

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