Skip to content

create_subnet_group async

create_subnet_group(
    subnet_group_name: String,
    subnet_ids: SubnetIdentifierList,
    *,
    config_overrides: Optional[AsyncDAXClientConfig] = None,
    description: Optional[String] = None,
) -> CreateSubnetGroupResponse

Creates a new subnet group.

Parameters:

  • subnet_group_name (String) –

    A name for the subnet group. This value is stored as a lowercase string.

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

    A description for the subnet group

  • subnet_ids (SubnetIdentifierList) –

    A list of VPC subnet IDs for the subnet group.

Raises:

  • InvalidSubnet –

    An invalid subnet identifier was specified.

  • ServiceLinkedRoleNotFoundFault –

    The specified service linked role (SLR) was not found.

  • SubnetGroupAlreadyExistsFault –

    The specified subnet group already exists.

  • SubnetGroupQuotaExceededFault –

    The request cannot be processed because it would exceed the allowed number of subnets in a subnet group.

  • SubnetNotAllowedFault –

    The specified subnet can't be used for the requested network type. This error occurs when either there aren't enough subnets of the required network type to create the cluster, or when you try to use a subnet that doesn't support the requested network type (for example, trying to create a dual-stack cluster with a subnet that doesn't have IPv6 CIDR).

  • SubnetQuotaExceededFault –

    The request cannot be processed because it would exceed the allowed number of subnets in a subnet group.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_dax/_services/async_dax.py
async def create_subnet_group(
    self,
    subnet_group_name: "capo_dax.types.string.String",
    subnet_ids: "capo_dax.types.subnet_identifier_list.SubnetIdentifierList",
    *,
    config_overrides: Optional[AsyncDAXClientConfig] = None,
    description: Optional["capo_dax.types.string.String"] = None,
) -> "capo_dax.types.create_subnet_group_response.CreateSubnetGroupResponse":
    """<p>Creates a new subnet group.</p>

    Args:
        subnet_group_name: <p>A name for the subnet group. This value is stored as a lowercase string. </p>
        description: <p>A description for the subnet group</p>
        subnet_ids: <p>A list of VPC subnet IDs for the subnet group.</p>

    Raises:
        capo_dax.errors.invalid_subnet.InvalidSubnet: <p>An invalid subnet identifier was specified.</p>
        capo_dax.errors.service_linked_role_not_found_fault.ServiceLinkedRoleNotFoundFault: <p>The specified service linked role (SLR) was not found.</p>
        capo_dax.errors.subnet_group_already_exists_fault.SubnetGroupAlreadyExistsFault: <p>The specified subnet group already exists.</p>
        capo_dax.errors.subnet_group_quota_exceeded_fault.SubnetGroupQuotaExceededFault: <p>The request cannot be processed because it would exceed the allowed number of subnets in a subnet group.</p>
        capo_dax.errors.subnet_not_allowed_fault.SubnetNotAllowedFault: <p>The specified subnet can't be used for the requested network type. This error occurs when either there aren't enough subnets of the required network type to create the cluster, or when you try to use a subnet that doesn't support the requested network type (for example, trying to create a dual-stack cluster with a subnet that doesn't have IPv6 CIDR). </p>
        capo_dax.errors.subnet_quota_exceeded_fault.SubnetQuotaExceededFault: <p>The request cannot be processed because it would exceed the allowed number of subnets in a subnet group.</p>
        capo_dax.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_dax.types.create_subnet_group_request.CreateSubnetGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_dax.types.create_subnet_group_response.CreateSubnetGroupResponse"
    ]:
        import capo_dax._operations.amazon_daxv3.create_subnet_group

        (
            output,
            http_response,
        ) = await capo_dax._operations.amazon_daxv3.create_subnet_group.async_create_subnet_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSubnetGroup")
    )
    input_: capo_dax.types.create_subnet_group_request.CreateSubnetGroupRequest = {
        "subnet_group_name": subnet_group_name,
        "subnet_ids": subnet_ids,
    }
    if description is not None:
        input_["description"] = description

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