CreateConnection - AWS CodeStar Connections

CreateConnection

Creates a connection that can then be given to other AWS services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.

Request Syntax

{ "ConnectionName": "string", "HostArn": "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

The name of the connection to be created. The name must be unique in the calling AWS account.

Type: String

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

Pattern: [\s\S]*

Required: Yes

HostArn

The Amazon Resource Name (ARN) of the host associated with the connection to be created.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 256.

Pattern: arn:aws(-[\w]+)*:codestar-connections:.+:[0-9]{12}:host\/.+

Required: No

ProviderType

The name of the external provider where your third-party code repository is configured.

Type: String

Valid Values: Bitbucket | GitHub | GitHubEnterpriseServer

Required: No

Tags

The key-value pair to use when tagging the resource.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 200 items.

Required: No

Response Syntax

{ "ConnectionArn": "string", "Tags": [ { "Key": "string", "Value": "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.

ConnectionArn

The Amazon Resource Name (ARN) of the connection to be created. The ARN is used as the connection reference when the connection is shared between AWS services.

Note

The ARN is never reused if the connection is deleted.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 256.

Pattern: arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+

Tags

Specifies the tags applied to the resource.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 200 items.

Errors

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

LimitExceededException

Exceeded the maximum limit for connections.

HTTP Status Code: 400

ResourceNotFoundException

Resource not found. Verify the connection resource ARN and try again.

HTTP Status Code: 400

ResourceUnavailableException

Resource not found. Verify the ARN for the host resource and try again.

HTTP Status Code: 400

See Also

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