Skip to content

modify_db_subnet_group async

modify_db_subnet_group(
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    db_subnet_group_name: Optional[String] = None,
    db_subnet_group_description: Optional[String] = None,
    subnet_ids: Optional[SubnetIdentifierList] = None,
) -> ModifyDBSubnetGroupResult

Modifies an existing DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Region.

Parameters:

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

    The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.

    Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.

    Example: mySubnetgroup

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

    The description for the DB subnet group.

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

    The EC2 subnet IDs for the DB subnet group.

Raises:

Source code in docs_src/capo_neptune/_services/async_neptune.py
async def modify_db_subnet_group(
    self,
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    db_subnet_group_name: Optional["capo_neptune.types.string.String"] = None,
    db_subnet_group_description: Optional[
        "capo_neptune.types.string.String"
    ] = None,
    subnet_ids: Optional[
        "capo_neptune.types.subnet_identifier_list.SubnetIdentifierList"
    ] = None,
) -> "capo_neptune.types.modify_db_subnet_group_result.ModifyDBSubnetGroupResult":
    """<p>Modifies an existing DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Region.</p>

    Args:
        db_subnet_group_name: <p>The name for the DB subnet group. This value is stored as a lowercase string. You can't modify the default subnet group.</p> <p>Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.</p> <p>Example: <code>mySubnetgroup</code> </p>
        db_subnet_group_description: <p>The description for the DB subnet group.</p>
        subnet_ids: <p>The EC2 subnet IDs for the DB subnet group.</p>

    Raises:
        capo_neptune.errors.db_subnet_group_does_not_cover_enough_a_zs.DBSubnetGroupDoesNotCoverEnoughAZs: <p>Subnets in the DB subnet group should cover at least two Availability Zones unless there is only one Availability Zone.</p>
        capo_neptune.errors.db_subnet_group_not_found_fault.DBSubnetGroupNotFoundFault: <p> <i>DBSubnetGroupName</i> does not refer to an existing DB subnet group.</p>
        capo_neptune.errors.db_subnet_quota_exceeded_fault.DBSubnetQuotaExceededFault: <p>Request would result in user exceeding the allowed number of subnets in a DB subnet groups.</p>
        capo_neptune.errors.invalid_subnet.InvalidSubnet: <p>The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.</p>
        capo_neptune.errors.subnet_already_in_use.SubnetAlreadyInUse: <p>The DB subnet is already in use in the Availability Zone.</p>
        capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptune.types.modify_db_subnet_group_message.ModifyDBSubnetGroupMessage]",
    ) -> AsyncOperationResponse[
        "capo_neptune.types.modify_db_subnet_group_result.ModifyDBSubnetGroupResult"
    ]:
        import capo_neptune._operations.amazon_rd_sv19.modify_db_subnet_group

        (
            output,
            http_response,
        ) = await capo_neptune._operations.amazon_rd_sv19.modify_db_subnet_group.async_modify_db_subnet_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyDBSubnetGroup")
    )
    input_: capo_neptune.types.modify_db_subnet_group_message.ModifyDBSubnetGroupMessage = {}
    if db_subnet_group_name is not None:
        input_["db_subnet_group_name"] = db_subnet_group_name
    if db_subnet_group_description is not None:
        input_["db_subnet_group_description"] = db_subnet_group_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