modify_db_subnet_group

modify_db_subnet_group(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.modify_db_subnet_group(
    DBSubnetGroupName='string',
    DBSubnetGroupDescription='string',
    SubnetIds=[
        'string',
    ]
)
Parameters
  • DBSubnetGroupName (string) --

    [REQUIRED]

    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: mydbsubnetgroup

  • DBSubnetGroupDescription (string) -- The description for the DB subnet group.
  • SubnetIds (list) --

    [REQUIRED]

    The EC2 subnet IDs for the DB subnet group.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'DBSubnetGroup': {
        'DBSubnetGroupName': 'string',
        'DBSubnetGroupDescription': 'string',
        'VpcId': 'string',
        'SubnetGroupStatus': 'string',
        'Subnets': [
            {
                'SubnetIdentifier': 'string',
                'SubnetAvailabilityZone': {
                    'Name': 'string'
                },
                'SubnetOutpost': {
                    'Arn': 'string'
                },
                'SubnetStatus': 'string'
            },
        ],
        'DBSubnetGroupArn': 'string',
        'SupportedNetworkTypes': [
            'string',
        ]
    }
}

Response Structure

  • (dict) --

    • DBSubnetGroup (dict) --

      Contains the details of an Amazon RDS DB subnet group.

      This data type is used as a response element in the DescribeDBSubnetGroups action.

      • DBSubnetGroupName (string) --

        The name of the DB subnet group.

      • DBSubnetGroupDescription (string) --

        Provides the description of the DB subnet group.

      • VpcId (string) --

        Provides the VpcId of the DB subnet group.

      • SubnetGroupStatus (string) --

        Provides the status of the DB subnet group.

      • Subnets (list) --

        Contains a list of Subnet elements.

        • (dict) --

          This data type is used as a response element for the DescribeDBSubnetGroups operation.

          • SubnetIdentifier (string) --

            The identifier of the subnet.

          • SubnetAvailabilityZone (dict) --

            Contains Availability Zone information.

            This data type is used as an element in the OrderableDBInstanceOption data type.

            • Name (string) --

              The name of the Availability Zone.

          • SubnetOutpost (dict) --

            If the subnet is associated with an Outpost, this value specifies the Outpost.

            For more information about RDS on Outposts, see Amazon RDS on Amazon Web Services Outposts in the Amazon RDS User Guide.

            • Arn (string) --

              The Amazon Resource Name (ARN) of the Outpost.

          • SubnetStatus (string) --

            The status of the subnet.

      • DBSubnetGroupArn (string) --

        The Amazon Resource Name (ARN) for the DB subnet group.

      • SupportedNetworkTypes (list) --

        The network type of the DB subnet group.

        Valid values:

        • IPV4
        • DUAL

        A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 protocols ( DUAL ).

        For more information, see Working with a DB instance in a VPC in the Amazon RDS User Guide.

        • (string) --

Exceptions

  • RDS.Client.exceptions.DBSubnetGroupNotFoundFault
  • RDS.Client.exceptions.DBSubnetQuotaExceededFault
  • RDS.Client.exceptions.SubnetAlreadyInUse
  • RDS.Client.exceptions.DBSubnetGroupDoesNotCoverEnoughAZs
  • RDS.Client.exceptions.InvalidSubnet

Examples

This example changes the specified setting for the specified DB subnet group.

response = client.modify_db_subnet_group(
    DBSubnetGroupName='mydbsubnetgroup',
    SubnetIds=[
        'subnet-70e1975a',
        'subnet-747a5c49',
    ],
)

print(response)

Expected Output:

{
    'DBSubnetGroup': {
    },
    'ResponseMetadata': {
        '...': '...',
    },
}