ElastiCache / Client / modify_cache_subnet_group

modify_cache_subnet_group#

ElastiCache.Client.modify_cache_subnet_group(**kwargs)#

Modifies an existing cache subnet group.

See also: AWS API Documentation

Request Syntax

response = client.modify_cache_subnet_group(
    CacheSubnetGroupName='string',
    CacheSubnetGroupDescription='string',
    SubnetIds=[
        'string',
    ]
)
Parameters:
  • CacheSubnetGroupName (string) –

    [REQUIRED]

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

    Constraints: Must contain no more than 255 alphanumeric characters or hyphens.

    Example: mysubnetgroup

  • CacheSubnetGroupDescription (string) – A description of the cache subnet group.

  • SubnetIds (list) –

    The EC2 subnet IDs for the cache subnet group.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'CacheSubnetGroup': {
        'CacheSubnetGroupName': 'string',
        'CacheSubnetGroupDescription': 'string',
        'VpcId': 'string',
        'Subnets': [
            {
                'SubnetIdentifier': 'string',
                'SubnetAvailabilityZone': {
                    'Name': 'string'
                },
                'SubnetOutpost': {
                    'SubnetOutpostArn': 'string'
                },
                'SupportedNetworkTypes': [
                    'ipv4'|'ipv6'|'dual_stack',
                ]
            },
        ],
        'ARN': 'string',
        'SupportedNetworkTypes': [
            'ipv4'|'ipv6'|'dual_stack',
        ]
    }
}

Response Structure

  • (dict) –

    • CacheSubnetGroup (dict) –

      Represents the output of one of the following operations:

      • CreateCacheSubnetGroup

      • ModifyCacheSubnetGroup

      • CacheSubnetGroupName (string) –

        The name of the cache subnet group.

      • CacheSubnetGroupDescription (string) –

        The description of the cache subnet group.

      • VpcId (string) –

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

      • Subnets (list) –

        A list of subnets associated with the cache 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 ElastiCache.

          • SubnetIdentifier (string) –

            The unique identifier for the subnet.

          • SubnetAvailabilityZone (dict) –

            The Availability Zone associated with the subnet.

            • Name (string) –

              The name of the Availability Zone.

          • SubnetOutpost (dict) –

            The outpost ARN of the subnet.

            • SubnetOutpostArn (string) –

              The outpost ARN of the subnet.

          • SupportedNetworkTypes (list) –

            Either ipv4 | ipv6 | dual_stack. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 and above or Memcached engine version 1.6.6 and above on all instances built on the Nitro system.

            • (string) –

      • ARN (string) –

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

      • SupportedNetworkTypes (list) –

        Either ipv4 | ipv6 | dual_stack. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 and above or Memcached engine version 1.6.6 and above on all instances built on the Nitro system.

        • (string) –

Exceptions

Examples

Modifies an existing ElastiCache subnet group.

response = client.modify_cache_subnet_group(
    CacheSubnetGroupName='my-sn-grp',
    SubnetIds=[
        'subnet-bcde2345',
    ],
)

print(response)

Expected Output:

{
    'CacheSubnetGroup': {
        'CacheSubnetGroupDescription': 'My subnet group.',
        'CacheSubnetGroupName': 'my-sn-grp',
        'Subnets': [
            {
                'SubnetAvailabilityZone': {
                    'Name': 'us-east-1c',
                },
                'SubnetIdentifier': 'subnet-a1b2c3d4',
            },
            {
                'SubnetAvailabilityZone': {
                    'Name': 'us-east-1e',
                },
                'SubnetIdentifier': 'subnet-1a2b3c4d',
            },
            {
                'SubnetAvailabilityZone': {
                    'Name': 'us-east-1e',
                },
                'SubnetIdentifier': 'subnet-bcde2345',
            },
            {
                'SubnetAvailabilityZone': {
                    'Name': 'us-east-1c',
                },
                'SubnetIdentifier': 'subnet-1234abcd',
            },
            {
                'SubnetAvailabilityZone': {
                    'Name': 'us-east-1b',
                },
                'SubnetIdentifier': 'subnet-abcd1234',
            },
        ],
        'VpcId': 'vpc-91280df6',
    },
    'ResponseMetadata': {
        '...': '...',
    },
}