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",
"ProviderEndpoint": "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.
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|codeconnections):.+:[0-9]{12}:host\/.+Required: No
- ProviderEndpoint
-
The endpoint of the ghe.com tenant where your organization resides. Provide this parameter only when
ProviderTypeisGitHubEnterpriseCloudDataResidency. Leave this parameter empty for all other provider types.Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
.*Required: No
- ProviderType
-
The name of the external provider where your third-party code repository is configured.
Type: String
Valid Values:
Bitbucket | GitHub | GitHubEnterpriseServer | GitLab | GitLabSelfManaged | AzureDevOps | GitHubEnterpriseCloudDataResidencyRequired: 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.
NoteThe 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]+)*:(codestar-connections|codeconnections):[a-z0-9\-]+:[0-9]{12}:connection\/[\w\-]+ - 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 Error Types.
- InvalidInputException
-
The input is not valid. Verify that the action is typed correctly.
HTTP Status Code: 400
- LimitExceededException
-
Exceeded the maximum limit for connections.
HTTP Status Code: 429
- ResourceNotFoundException
-
Resource not found. Verify the connection resource ARN and try again.
HTTP Status Code: 404
- ResourceUnavailableException
-
Resource not found. Verify the ARN for the host resource and try again.
HTTP Status Code: 400
- UnsupportedProviderTypeException
-
The specified provider type is not supported for connections.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: