createEndpointAccess method

Future<EndpointAccess> createEndpointAccess({
  1. required String endpointName,
  2. required String subnetGroupName,
  3. String? clusterIdentifier,
  4. String? resourceOwner,
  5. List<String>? vpcSecurityGroupIds,
})

Creates a Redshift-managed VPC endpoint.

May throw AccessToClusterDeniedFault. May throw ClusterNotFoundFault. May throw ClusterSubnetGroupNotFoundFault. May throw EndpointAlreadyExistsFault. May throw EndpointsPerAuthorizationLimitExceededFault. May throw EndpointsPerClusterLimitExceededFault. May throw InvalidClusterSecurityGroupStateFault. May throw InvalidClusterStateFault. May throw UnauthorizedOperation. May throw UnsupportedOperationFault.

Parameter endpointName : 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.

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

Parameter clusterIdentifier : The cluster identifier of the cluster to access.

Parameter resourceOwner : 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.

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

Implementation

Future<EndpointAccess> createEndpointAccess({
  required String endpointName,
  required String subnetGroupName,
  String? clusterIdentifier,
  String? resourceOwner,
  List<String>? vpcSecurityGroupIds,
}) async {
  final $request = <String, String>{
    'EndpointName': endpointName,
    'SubnetGroupName': subnetGroupName,
    if (clusterIdentifier != null) 'ClusterIdentifier': clusterIdentifier,
    if (resourceOwner != null) 'ResourceOwner': resourceOwner,
    if (vpcSecurityGroupIds != null)
      if (vpcSecurityGroupIds.isEmpty)
        'VpcSecurityGroupIds': ''
      else
        for (var i1 = 0; i1 < vpcSecurityGroupIds.length; i1++)
          'VpcSecurityGroupIds.VpcSecurityGroupId.${i1 + 1}':
              vpcSecurityGroupIds[i1],
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateEndpointAccess',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateEndpointAccessResult',
  );
  return EndpointAccess.fromXml($result);
}