Skip to content

create_endpoint_access

create_endpoint_access(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional[String] = None,
    resource_owner: Optional[String] = None,
    endpoint_name: Optional[String] = None,
    subnet_group_name: Optional[String] = None,
    vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
) -> EndpointAccess

Creates a Redshift-managed VPC endpoint.

Parameters:

  • cluster_identifier (Optional[String], default: None ) –

    The cluster identifier of the cluster to access.

  • resource_owner (Optional[String], default: None ) –

    The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account.

  • endpoint_name (Optional[String], default: None ) –

    The Redshift-managed VPC endpoint name.

    An endpoint name must contain 1-30 characters. Valid characters are A-Z, a-z, 0-9, and hyphen(-). The first character must be a letter. The name can't contain two consecutive hyphens or end with a hyphen.

  • subnet_group_name (Optional[String], default: None ) –

    The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint.

  • vpc_security_group_ids (Optional[VpcSecurityGroupIdList], default: None ) –

    The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def create_endpoint_access(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
    resource_owner: Optional["capo_redshift.types.string.String"] = None,
    endpoint_name: Optional["capo_redshift.types.string.String"] = None,
    subnet_group_name: Optional["capo_redshift.types.string.String"] = None,
    vpc_security_group_ids: Optional[
        "capo_redshift.types.vpc_security_group_id_list.VpcSecurityGroupIdList"
    ] = None,
) -> "capo_redshift.types.endpoint_access.EndpointAccess":
    """<p>Creates a Redshift-managed VPC endpoint.</p>

    Args:
        cluster_identifier: <p>The cluster identifier of the cluster to access.</p>
        resource_owner: <p>The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account.</p>
        endpoint_name: <p>The Redshift-managed VPC endpoint name.</p> <p>An endpoint name must contain 1-30 characters. Valid characters are A-Z, a-z, 0-9, and hyphen(-). The first character must be a letter. The name can't contain two consecutive hyphens or end with a hyphen.</p>
        subnet_group_name: <p>The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint.</p>
        vpc_security_group_ids: <p>The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.</p>

    Raises:
        capo_redshift.errors.access_to_cluster_denied_fault.AccessToClusterDeniedFault: <p>You are not authorized to access the cluster.</p>
        capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
        capo_redshift.errors.cluster_subnet_group_not_found_fault.ClusterSubnetGroupNotFoundFault: <p>The cluster subnet group name does not refer to an existing cluster subnet group.</p>
        capo_redshift.errors.endpoint_already_exists_fault.EndpointAlreadyExistsFault: <p>The account already has a Redshift-managed VPC endpoint with the given identifier.</p>
        capo_redshift.errors.endpoints_per_authorization_limit_exceeded_fault.EndpointsPerAuthorizationLimitExceededFault: <p>The number of Redshift-managed VPC endpoints per authorization has exceeded its limit.</p>
        capo_redshift.errors.endpoints_per_cluster_limit_exceeded_fault.EndpointsPerClusterLimitExceededFault: <p>The number of Redshift-managed VPC endpoints per cluster has exceeded its limit.</p>
        capo_redshift.errors.invalid_cluster_security_group_state_fault.InvalidClusterSecurityGroupStateFault: <p>The state of the cluster security group is not <code>available</code>. </p>
        capo_redshift.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The specified cluster is not in the <code>available</code> state. </p>
        capo_redshift.errors.unauthorized_operation.UnauthorizedOperation: <p>Your account is not authorized to perform the requested operation.</p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.create_endpoint_access_message.CreateEndpointAccessMessage]",
    ) -> OperationResponse["capo_redshift.types.endpoint_access.EndpointAccess"]:
        import capo_redshift._operations.redshift_service_version20121201.create_endpoint_access

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.create_endpoint_access.create_endpoint_access(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEndpointAccess")
    )
    input_: capo_redshift.types.create_endpoint_access_message.CreateEndpointAccessMessage = {}
    if cluster_identifier is not None:
        input_["cluster_identifier"] = cluster_identifier
    if resource_owner is not None:
        input_["resource_owner"] = resource_owner
    if endpoint_name is not None:
        input_["endpoint_name"] = endpoint_name
    if subnet_group_name is not None:
        input_["subnet_group_name"] = subnet_group_name
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids

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