:doc:`ElastiCache <../../elasticache>` / Client / modify_cache_subnet_group

*************************
modify_cache_subnet_group
*************************



.. py:method:: ElastiCache.Client.modify_cache_subnet_group(**kwargs)

  

  Modifies an existing cache subnet group.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroup>`_  


  **Request Syntax**
  ::

    response = client.modify_cache_subnet_group(
        CacheSubnetGroupName='string',
        CacheSubnetGroupDescription='string',
        SubnetIds=[
            'string',
        ]
    )
    
  :type CacheSubnetGroupName: string
  :param CacheSubnetGroupName: **[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``

    

  
  :type CacheSubnetGroupDescription: string
  :param CacheSubnetGroupDescription: 

    A description of the cache subnet group.

    

  
  :type SubnetIds: list
  :param SubnetIds: 

    The EC2 subnet IDs for the cache subnet group.

    

  
    - *(string) --* 

    

  
  :rtype: 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 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the `Nitro system <http://aws.amazon.com/ec2/nitro/>`__.

              
              

              - *(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 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the `Nitro system <http://aws.amazon.com/ec2/nitro/>`__.

          
          

          - *(string) --* 
      
    
  
  **Exceptions**
  
  *   :py:class:`ElastiCache.Client.exceptions.CacheSubnetGroupNotFoundFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.CacheSubnetQuotaExceededFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.SubnetInUse`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidSubnet`

  
  *   :py:class:`ElastiCache.Client.exceptions.SubnetNotAllowedFault`

  

  **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': {
            '...': '...',
        },
    }

  