Skip to content
v2.273.0

Experimental

@aws-cdk/aws-apprunner-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

GitHubConnection Class ​

Represents the App Runner connection that enables the App Runner service to connect to a source repository.

It's required for GitHub code repositories.

Example ​

ts
new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromGitHub({
    repositoryUrl: 'https://github.com/aws-containers/hello-app-runner',
    branch: 'main',
    configurationSource: apprunner.ConfigurationSourceType.REPOSITORY,
    connection: apprunner.GitHubConnection.fromConnectionArn('CONNECTION_ARN'),
  }),
});
python
apprunner.Service(self, "Service",
    source=apprunner.Source.from_git_hub(
        repository_url="https://github.com/aws-containers/hello-app-runner",
        branch="main",
        configuration_source=apprunner.ConfigurationSourceType.REPOSITORY,
        connection=apprunner.GitHubConnection.from_connection_arn("CONNECTION_ARN")
    )
)
java
Service.Builder.create(this, "Service")
        .source(Source.fromGitHub(GithubRepositoryProps.builder()
                .repositoryUrl("https://github.com/aws-containers/hello-app-runner")
                .branch("main")
                .configurationSource(ConfigurationSourceType.REPOSITORY)
                .connection(GitHubConnection.fromConnectionArn("CONNECTION_ARN"))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.AppRunner.Alpha
new Service(this, "Service", new ServiceProps {
    Source = Source.FromGitHub(new GithubRepositoryProps {
        RepositoryUrl = "https://github.com/aws-containers/hello-app-runner",
        Branch = "main",
        ConfigurationSource = ConfigurationSourceType.REPOSITORY,
        Connection = GitHubConnection.FromConnectionArn("CONNECTION_ARN")
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkapprunneralpha/v2
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
	Source: apprunner.Source_FromGitHub(&GithubRepositoryProps{
		RepositoryUrl: jsii.String("https://github.com/aws-containers/hello-app-runner"),
		Branch: jsii.String("main"),
		ConfigurationSource: apprunner.ConfigurationSourceType_REPOSITORY,
		Connection: apprunner.GitHubConnection_FromConnectionArn(jsii.String("CONNECTION_ARN")),
	}),
})

Initializer ​

ts
new GitHubConnection(arn: string)
python
GitHubConnection(arn: str)
java
new GitHubConnection(String arn)
csharp
new GitHubConnection(string arn)
go
NewGitHubConnection(Arn *string)

Properties ​

connectionArnstringconnection_arnstrconnectionArnStringConnectionArnstringConnectionArn*stringrequired#
The ARN of the Connection for App Runner service to connect to the repository.

Methods ​

fromConnectionArn(arn: string): GitHubConnection // chainable@staticmethod def from_connection_arn(arn: str) -> GitHubConnectionpublic static GitHubConnection fromConnectionArn(String arn)public static GitHubConnection FromConnectionArn(string arn)func FromConnectionArn(Arn *string) GitHubConnectionstatic#
Using existing App Runner connection by specifying the connection ARN.
1 parameter · returns

Parameters

  • arnarnarnarnArn — connection ARN.

Returns: Connection