Skip to content

create_endpoint_access async

create_endpoint_access(
    endpoint_name: str,
    subnet_ids: SubnetIdList,
    workgroup_name: str,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
    owner_account: Optional[OwnerAccount] = None,
) -> CreateEndpointAccessResponse

Creates an Amazon Redshift Serverless managed VPC endpoint.

Parameters:

  • endpoint_name (str) –

    The name of the VPC endpoint. 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_ids (SubnetIdList) –

    The unique identifers of subnets from which Amazon Redshift Serverless chooses one to deploy a VPC endpoint.

  • workgroup_name (str) –

    The name of the workgroup to associate with the VPC endpoint.

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

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

  • owner_account (Optional[OwnerAccount], default: None ) –

    The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
async def create_endpoint_access(
    self,
    endpoint_name: str,
    subnet_ids: "capo_redshift_serverless.types.subnet_id_list.SubnetIdList",
    workgroup_name: str,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    vpc_security_group_ids: Optional[
        "capo_redshift_serverless.types.vpc_security_group_id_list.VpcSecurityGroupIdList"
    ] = None,
    owner_account: Optional[
        "capo_redshift_serverless.types.owner_account.OwnerAccount"
    ] = None,
) -> "capo_redshift_serverless.types.create_endpoint_access_response.CreateEndpointAccessResponse":
    """<p>Creates an Amazon Redshift Serverless managed VPC endpoint.</p>

    Args:
        endpoint_name: <p>The name of the VPC endpoint. 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_ids: <p>The unique identifers of subnets from which Amazon Redshift Serverless chooses one to deploy a VPC endpoint.</p>
        workgroup_name: <p>The name of the workgroup to associate with the VPC endpoint.</p>
        vpc_security_group_ids: <p>The unique identifiers of the security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.</p>
        owner_account: <p>The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.</p>

    Raises:
        capo_redshift_serverless.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_redshift_serverless.errors.conflict_exception.ConflictException: <p>The submitted action has conflicts.</p>
        capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_redshift_serverless.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service limit was exceeded.</p>
        capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift_serverless.types.create_endpoint_access_request.CreateEndpointAccessRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift_serverless.types.create_endpoint_access_response.CreateEndpointAccessResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.create_endpoint_access

        (
            output,
            http_response,
        ) = await capo_redshift_serverless._operations.redshift_serverless.create_endpoint_access.async_create_endpoint_access(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEndpointAccess")
    )
    input_: capo_redshift_serverless.types.create_endpoint_access_request.CreateEndpointAccessRequest = {
        "endpoint_name": endpoint_name,
        "subnet_ids": subnet_ids,
        "workgroup_name": workgroup_name,
    }
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids
    if owner_account is not None:
        input_["owner_account"] = owner_account

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output