Creates a connection that can then be given to other Amazon Web Services 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.
Parameters:
-
provider_type
(Optional[ProviderType], default:
None
)
–
The name of the external provider where your third-party code repository is configured.
-
connection_name
(ConnectionName)
–
The name of the connection to be created.
-
tags
(Optional[TagList], default:
None
)
–
The key-value pair to use when tagging the resource.
-
host_arn
(Optional[HostArn], default:
None
)
–
The Amazon Resource Name (ARN) of the host associated with the connection to be created.
Raises:
Source code in docs_src/capo_codeconnections/_services/async_code_connections.py
| async def create_connection(
self,
connection_name: "capo_codeconnections.types.connection_name.ConnectionName",
*,
config_overrides: Optional[AsyncCodeConnectionsClientConfig] = None,
provider_type: Optional[
"capo_codeconnections.types.provider_type.ProviderType"
] = None,
tags: Optional["capo_codeconnections.types.tag_list.TagList"] = None,
host_arn: Optional["capo_codeconnections.types.host_arn.HostArn"] = None,
) -> "capo_codeconnections.types.create_connection_output.CreateConnectionOutput":
"""<p>Creates a connection that can then be given to other Amazon Web Services 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.</p>
Args:
provider_type: <p>The name of the external provider where your third-party code repository is configured.</p>
connection_name: <p>The name of the connection to be created.</p>
tags: <p>The key-value pair to use when tagging the resource.</p>
host_arn: <p>The Amazon Resource Name (ARN) of the host associated with the connection to be created.</p>
Raises:
capo_codeconnections.errors.limit_exceeded_exception.LimitExceededException: <p>Exceeded the maximum limit for connections.</p>
capo_codeconnections.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found. Verify the connection resource ARN and try again.</p>
capo_codeconnections.errors.resource_unavailable_exception.ResourceUnavailableException: <p>Resource not found. Verify the ARN for the host resource and try again.</p>
capo_codeconnections.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_codeconnections.types.create_connection_input.CreateConnectionInput]",
) -> AsyncOperationResponse[
"capo_codeconnections.types.create_connection_output.CreateConnectionOutput"
]:
import capo_codeconnections._operations.code_connections_20231201.create_connection
(
output,
http_response,
) = await capo_codeconnections._operations.code_connections_20231201.create_connection.async_create_connection(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateConnection")
)
input_: capo_codeconnections.types.create_connection_input.CreateConnectionInput = {
"connection_name": connection_name
}
if provider_type is not None:
input_["provider_type"] = provider_type
if tags is not None:
input_["tags"] = tags
if host_arn is not None:
input_["host_arn"] = host_arn
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|