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

Represents the service source from a Github repository.

Extends: [Source](/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Source.html) › GithubSource
Obtainable from: [Source.fromGitHub](/cdk/api/v2/docs/@aws-cdk_aws-apprunner-alpha.Source.html#fromgithub)

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

## 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 gitHubConnection: apprunner_alpha.GitHubConnection;
declare const runtime: apprunner_alpha.Runtime;
declare const secret: apprunner_alpha.Secret;
const githubSource = new apprunner_alpha.GithubSource({
  configurationSource: apprunner_alpha.ConfigurationSourceType.REPOSITORY,
  connection: gitHubConnection,
  repositoryUrl: 'repositoryUrl',

  // the properties below are optional
  branch: 'branch',
  codeConfigurationValues: {
    runtime: runtime,

    // the properties below are optional
    buildCommand: 'buildCommand',
    environment: {
      environmentKey: 'environment',
    },
    environmentSecrets: {
      environmentSecretsKey: secret,
    },
    environmentVariables: {
      environmentVariablesKey: 'environmentVariables',
    },
    port: 'port',
    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

# git_hub_connection: apprunner_alpha.GitHubConnection
# runtime: apprunner_alpha.Runtime
# secret: apprunner_alpha.Secret

github_source = apprunner_alpha.GithubSource(
    configuration_source=apprunner_alpha.ConfigurationSourceType.REPOSITORY,
    connection=git_hub_connection,
    repository_url="repositoryUrl",

    # the properties below are optional
    branch="branch",
    code_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"
    )
)
```

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.*;

GitHubConnection gitHubConnection;
Runtime runtime;
Secret secret;

GithubSource githubSource = GithubSource.Builder.create()
        .configurationSource(ConfigurationSourceType.REPOSITORY)
        .connection(gitHubConnection)
        .repositoryUrl("repositoryUrl")

        // the properties below are optional
        .branch("branch")
        .codeConfigurationValues(CodeConfigurationValues.builder()
                .runtime(runtime)

                // the properties below are optional
                .buildCommand("buildCommand")
                .environment(Map.of(
                        "environmentKey", "environment"))
                .environmentSecrets(Map.of(
                        "environmentSecretsKey", secret))
                .environmentVariables(Map.of(
                        "environmentVariablesKey", "environmentVariables"))
                .port("port")
                .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;

GitHubConnection gitHubConnection;
Runtime runtime;
Secret secret;

var githubSource = new GithubSource(new GithubRepositoryProps {
    ConfigurationSource = ConfigurationSourceType.REPOSITORY,
    Connection = gitHubConnection,
    RepositoryUrl = "repositoryUrl",

    // the properties below are optional
    Branch = "branch",
    CodeConfigurationValues = new CodeConfigurationValues {
        Runtime = runtime,

        // the properties below are optional
        BuildCommand = "buildCommand",
        Environment = new Dictionary<string, string> {
            { "environmentKey", "environment" }
        },
        EnvironmentSecrets = new Dictionary<string, Secret> {
            { "environmentSecretsKey", secret }
        },
        EnvironmentVariables = new Dictionary<string, string> {
            { "environmentVariablesKey", "environmentVariables" }
        },
        Port = "port",
        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 "github.com/aws/aws-cdk-go/awscdkapprunneralpha"

var gitHubConnection GitHubConnection
var runtime Runtime
var secret Secret

githubSource := apprunner_alpha.NewGithubSource(&GithubRepositoryProps{
	ConfigurationSource: apprunner_alpha.ConfigurationSourceType_REPOSITORY,
	Connection: gitHubConnection,
	RepositoryUrl: jsii.String("repositoryUrl"),

	// the properties below are optional
	Branch: jsii.String("branch"),
	CodeConfigurationValues: &CodeConfigurationValues{
		Runtime: runtime,

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

## Initializer

TypeScript:

```ts
new GithubSource(props: GithubRepositoryProps)
```

Python:

```python
GithubSource(props: GithubRepositoryProps)
```

Java:

```java
new GithubSource(GithubRepositoryProps props)
```

C# / .NET:

```csharp
new GithubSource(GithubRepositoryProps props)
```

Golang:

```go
NewGithubSource(Props GithubRepositoryProps)
```

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

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