MemoryDB / Client / create_subnet_group

create_subnet_group#

MemoryDB.Client.create_subnet_group(**kwargs)#

Creates a subnet group. A subnet group is a collection of subnets (typically private) that you can designate for your clusters running in an Amazon Virtual Private Cloud (VPC) environment. When you create a cluster in an Amazon VPC, you must specify a subnet group. MemoryDB uses that subnet group to choose a subnet and IP addresses within that subnet to associate with your nodes. For more information, see Subnets and subnet groups.

See also: AWS API Documentation

Request Syntax

response = client.create_subnet_group(
    SubnetGroupName='string',
    Description='string',
    SubnetIds=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters:
  • SubnetGroupName (string) –

    [REQUIRED]

    The name of the subnet group.

  • Description (string) – A description for the subnet group.

  • SubnetIds (list) –

    [REQUIRED]

    A list of VPC subnet IDs for the subnet group.

    • (string) –

  • Tags (list) –

    A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.

    • (dict) –

      A tag that can be added to an MemoryDB resource. Tags are composed of a Key/Value pair. You can use tags to categorize and track all your MemoryDB resources. When you add or remove tags on clusters, those actions will be replicated to all nodes in the cluster. A tag with a null Value is permitted. For more information, see Tagging your MemoryDB resources

      • Key (string) –

        The key for the tag. May not be null.

      • Value (string) –

        The tag’s value. May be null.

Return type:

dict

Returns:

Response Syntax

{
    'SubnetGroup': {
        'Name': 'string',
        'Description': 'string',
        'VpcId': 'string',
        'Subnets': [
            {
                'Identifier': 'string',
                'AvailabilityZone': {
                    'Name': 'string'
                }
            },
        ],
        'ARN': 'string'
    }
}

Response Structure

  • (dict) –

    • SubnetGroup (dict) –

      The newly-created subnet group

      • Name (string) –

        The name of the subnet group

      • Description (string) –

        A description of the subnet group

      • VpcId (string) –

        The Amazon Virtual Private Cloud identifier (VPC ID) of the subnet group.

      • Subnets (list) –

        A list of subnets associated with the subnet group.

        • (dict) –

          Represents the subnet associated with a cluster. This parameter refers to subnets defined in Amazon Virtual Private Cloud (Amazon VPC) and used with MemoryDB.

          • Identifier (string) –

            The unique identifier for the subnet.

          • AvailabilityZone (dict) –

            The Availability Zone where the subnet resides

            • Name (string) –

              The name of the Availability Zone.

      • ARN (string) –

        The ARN (Amazon Resource Name) of the subnet group.

Exceptions

  • MemoryDB.Client.exceptions.SubnetGroupAlreadyExistsFault

  • MemoryDB.Client.exceptions.SubnetGroupQuotaExceededFault

  • MemoryDB.Client.exceptions.SubnetQuotaExceededFault

  • MemoryDB.Client.exceptions.InvalidSubnet

  • MemoryDB.Client.exceptions.ServiceLinkedRoleNotFoundFault

  • MemoryDB.Client.exceptions.SubnetNotAllowedFault

  • MemoryDB.Client.exceptions.TagQuotaPerResourceExceeded