CreateConnection - AWS App Runner

CreateConnection

Create an AWS App Runner connection resource. App Runner requires a connection resource when you create App Runner services that access private repositories from certain third-party providers. You can share a connection across multiple services.

A connection resource is needed to access GitHub and Bitbucket repositories. Both require a user interface approval process through the App Runner console before you can use the connection.

Request Syntax

{ "ConnectionName": "string", "ProviderType": "string", "Tags": [ { "Key": "string", "Value": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ConnectionName

A name for the new connection. It must be unique across all App Runner connections for the AWS account in the AWS Region.

Type: String

Length Constraints: Minimum length of 4. Maximum length of 32.

Pattern: [A-Za-z0-9][A-Za-z0-9\-_]{3,31}

Required: Yes

ProviderType

The source repository provider.

Type: String

Valid Values: GITHUB | BITBUCKET

Required: Yes

Tags

A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.

Type: Array of Tag objects

Required: No

Response Syntax

{ "Connection": { "ConnectionArn": "string", "ConnectionName": "string", "CreatedAt": number, "ProviderType": "string", "Status": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Connection

A description of the App Runner connection that's created by this request.

Type: Connection object

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServiceErrorException

An unexpected service exception occurred.

HTTP Status Code: 500

InvalidRequestException

One or more input parameters aren't valid. Refer to the API action's document page, correct the input parameters, and try the action again.

HTTP Status Code: 400

ServiceQuotaExceededException

App Runner can't create this resource. You've reached your account quota for this resource type.

For App Runner per-resource quotas, see AWS App Runner endpoints and quotas in the AWS General Reference.

HTTP Status Code: 400

Examples

Create a GitHub connection

This example illustrates how to create a connection to a private GitHub code repository. The connection status after a successful call is PENDING_HANDSHAKE. This is because an authentication handshake with the provider still hasn't happened. Complete the handshake using the App Runner console. For more information, see Managing App Runner connections in the AWS App Runner Developer Guide.

Sample Request

$ aws apprunner create-connection --cli-input-json "`cat`" { "ConnectionName": "my-github-connection", "ProviderType": "GITHUB" }

Sample Response

{ "Connection": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection", "ConnectionName": "my-github-connection", "Status": "PENDING_HANDSHAKE", "CreatedAt": "2020-11-03T00:32:51Z", "ProviderType": "GITHUB" } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: