Skip to content

modify_cluster_subnet_group async

modify_cluster_subnet_group(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    cluster_subnet_group_name: Optional[String] = None,
    description: Optional[String] = None,
    subnet_ids: Optional[SubnetIdentifierList] = None,
) -> ModifyClusterSubnetGroupResult

Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets with the new list of subnets.

VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a subnet group for a provisioned cluster is in an account with VPC BPA turned on, the following capabilities are blocked:

  • Creating a public cluster

  • Restoring a public cluster

  • Modifying a private cluster to be public

  • Adding a subnet with VPC BPA turned on to the subnet group when there's at least one public cluster within the group

For more information about VPC BPA, see Block public access to VPCs and subnets in the Amazon VPC User Guide.

Parameters:

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

    The name of the subnet group to be modified.

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

    A text description of the subnet group to be modified.

  • subnet_ids (Optional[SubnetIdentifierList], default: None ) –

    An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a single request.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def modify_cluster_subnet_group(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    cluster_subnet_group_name: Optional["capo_redshift.types.string.String"] = None,
    description: Optional["capo_redshift.types.string.String"] = None,
    subnet_ids: Optional[
        "capo_redshift.types.subnet_identifier_list.SubnetIdentifierList"
    ] = None,
) -> "capo_redshift.types.modify_cluster_subnet_group_result.ModifyClusterSubnetGroupResult":
    """<p>Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets with the new list of subnets.</p> <p>VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a subnet group for a provisioned cluster is in an account with VPC BPA turned on, the following capabilities are blocked:</p> <ul> <li> <p>Creating a public cluster</p> </li> <li> <p>Restoring a public cluster</p> </li> <li> <p>Modifying a private cluster to be public</p> </li> <li> <p>Adding a subnet with VPC BPA turned on to the subnet group when there's at least one public cluster within the group</p> </li> </ul> <p>For more information about VPC BPA, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html">Block public access to VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p>

    Args:
        cluster_subnet_group_name: <p>The name of the subnet group to be modified.</p>
        description: <p>A text description of the subnet group to be modified.</p>
        subnet_ids: <p>An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a single request.</p>

    Raises:
        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.cluster_subnet_quota_exceeded_fault.ClusterSubnetQuotaExceededFault: <p>The request would result in user exceeding the allowed number of subnets in a cluster subnet groups. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>. </p>
        capo_redshift.errors.dependent_service_request_throttling_fault.DependentServiceRequestThrottlingFault: <p>The request cannot be completed because a dependent service is throttling requests made by Amazon Redshift on your behalf. Wait and retry the request.</p>
        capo_redshift.errors.invalid_subnet.InvalidSubnet: <p>The requested subnet is not valid, or not all of the subnets are in the same VPC.</p>
        capo_redshift.errors.subnet_already_in_use.SubnetAlreadyInUse: <p>A specified subnet is already in use by another cluster.</p>
        capo_redshift.errors.unauthorized_operation.UnauthorizedOperation: <p>Your account is not authorized to perform the requested operation.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.modify_cluster_subnet_group_message.ModifyClusterSubnetGroupMessage]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.modify_cluster_subnet_group_result.ModifyClusterSubnetGroupResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.modify_cluster_subnet_group

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.modify_cluster_subnet_group.async_modify_cluster_subnet_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyClusterSubnetGroup")
    )
    input_: capo_redshift.types.modify_cluster_subnet_group_message.ModifyClusterSubnetGroupMessage = {}
    if cluster_subnet_group_name is not None:
        input_["cluster_subnet_group_name"] = cluster_subnet_group_name
    if description is not None:
        input_["description"] = description
    if subnet_ids is not None:
        input_["subnet_ids"] = subnet_ids

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