# Amazon RDS code examples for the SDK for Python ## Overview Shows how to use the AWS SDK for Python (Boto3) to work with Amazon Relational Database Service (Amazon RDS). *Amazon RDS is a web service that makes it easier to set up, operate, and scale a relational database in the cloud.* ## ⚠ Important * Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all). * Running the tests might result in charges to your AWS account. * We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). * This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). ## Code examples ### Prerequisites For prerequisites, see the [README](../../README.md#Prerequisites) in the `python` folder. Install the packages required by these examples by running the following in a virtual environment: ``` python -m pip install -r requirements.txt ``` ### Single actions Code excerpts that show you how to call individual service functions. * [Create a DB instance](instance_wrapper.py#L276) (`CreateDBInstance`) * [Create a DB parameter group](instance_wrapper.py#L62) (`CreateDBParameterGroup`) * [Create a snapshot of a DB instance](instance_wrapper.py#L158) (`CreateDBSnapshot`) * [Delete a DB instance](instance_wrapper.py#L317) (`DeleteDBInstance`) * [Delete a DB parameter group](instance_wrapper.py#L88) (`DeleteDBParameterGroup`) * [Describe DB instances](instance_wrapper.py#L252) (`DescribeDBInstances`) * [Describe DB parameter groups](instance_wrapper.py#L38) (`DescribeDBParameterGroups`) * [Describe database engine versions](instance_wrapper.py#L201) (`DescribeDBEngineVersions`) * [Describe options for DB instances](instance_wrapper.py#L228) (`DescribeOrderableDBInstanceOptions`) * [Describe parameters in a DB parameter group](instance_wrapper.py#L106) (`DescribeDBParameters`) * [Describe snapshots of DB instances](instance_wrapper.py#L180) (`DescribeDBSnapshots`) * [Update parameters in a DB parameter group](instance_wrapper.py#L137) (`ModifyDBParameterGroup`) ### Scenarios Code examples that show you how to accomplish a specific task by calling multiple functions within the same service. * [Get started with DB instances](scenario_get_started_instances.py) ### Cross-service examples Sample applications that work across multiple AWS services. * [Create an Aurora Serverless work item tracker](../../cross_service/aurora_item_tracker) ## Run the examples ### Instructions #### Get started with DB instances This example shows you how to do the following: * Create a custom DB parameter group and set parameter values. * Create a DB instance that's configured to use the parameter group. The DB instance also contains a database. * Take a snapshot of the instance. * Delete the instance and parameter group. Start the example by running the following at a command prompt: ``` python scenario_get_started_instances.py ``` ### Tests ⚠ Running tests might result in charges to your AWS account. To find instructions for running these tests, see the [README](../../README.md#Tests) in the `python` folder. ## Additional resources * [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html) * [Amazon RDS API Reference](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/Welcome.html) * [SDK for Python Amazon RDS reference](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html) --- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0