Skip to content

delete_environment_connection

delete_environment_connection(
    environment_arn: EnvironmentArn,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    connection_id: Optional[ConnectionId] = None,
    provider_config: Optional[ConnectionProviderKey] = None,
) -> DeleteEnvironmentConnectionOutput

Deletes a connection from a governance environment. Specify the connection in providerConfig. Deleting a connection doesn't delete any evidence.

If the connection doesn't exist, the operation succeeds without returning an error.

Parameters:

  • environment_arn (EnvironmentArn) –

    The ARN of this governance environment.

  • connection_id (Optional[ConnectionId], default: None ) –

    The ID of the GitHub or SharePoint connection to delete, as returned by ListEnvironmentConnections. An Amazon S3 connection has no ID. To delete one, use providerConfig.

    Specify either connectionId or providerConfig, but not both.

  • provider_config (Optional[ConnectionProviderKey], default: None ) –

    The connection to delete, identified by the source that it connects to.

Raises:

Examples:

Delete an S3 evidence connection Removes the Amazon S3 evidence connection from the payments team's governance environment.

>>> client.delete_environment_connection(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', provider_config={'s3': {'sourceUri': 's3://payments-prod-evidence/pci-dss/'}})
Source code in docs_src/capo_assurance/_services/assurance.py
def delete_environment_connection(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    connection_id: Optional[
        "capo_assurance.types.connection_id.ConnectionId"
    ] = None,
    provider_config: Optional[
        "capo_assurance.types.connection_provider_key.ConnectionProviderKey"
    ] = None,
) -> "capo_assurance.types.delete_environment_connection_output.DeleteEnvironmentConnectionOutput":
    """<p>Deletes a connection from a governance environment. Specify the connection in <code>providerConfig</code>. Deleting a connection doesn't delete any evidence.</p> <p>If the connection doesn't exist, the operation succeeds without returning an error.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        connection_id: <p>The ID of the GitHub or SharePoint connection to delete, as returned by <code>ListEnvironmentConnections</code>. An Amazon S3 connection has no ID. To delete one, use <code>providerConfig</code>.</p> <p>Specify either <code>connectionId</code> or <code>providerConfig</code>, but not both.</p>
        provider_config: <p>The connection to delete, identified by the source that it connects to.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Delete an S3 evidence connection
        Removes the Amazon S3 evidence connection from the payments team's governance environment.

        >>> client.delete_environment_connection(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', provider_config={'s3': {'sourceUri': 's3://payments-prod-evidence/pci-dss/'}})
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.delete_environment_connection_input.DeleteEnvironmentConnectionInput]",
    ) -> OperationResponse[
        "capo_assurance.types.delete_environment_connection_output.DeleteEnvironmentConnectionOutput"
    ]:
        import capo_assurance._operations.assurance.delete_environment_connection

        output, http_response = (
            capo_assurance._operations.assurance.delete_environment_connection.delete_environment_connection(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteEnvironmentConnection")
    )
    input_: capo_assurance.types.delete_environment_connection_input.DeleteEnvironmentConnectionInput = {
        "environment_arn": environment_arn
    }
    if connection_id is not None:
        input_["connection_id"] = connection_id
    if provider_config is not None:
        input_["provider_config"] = provider_config

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output