RDS

 RDS

Amazon Relational Database Service (RDS) is a managed database service that makes it easy to set up, operate, and scale a relational database in the cloud. Here is an example of how to create an RDS MySQL instance using the AWS SDK for Python (boto3):


python


import boto3


rds_client = boto3.client('rds')


db_instance_identifier = 'my-db-instance'

db_engine = 'mysql'

db_instance_class = 'db.t2.micro'

db_master_username = 'my-username'

db_master_password = 'my-password'


response = rds_client.create_db_instance(

    DBInstanceIdentifier=db_instance_identifier,

    Engine=db_engine,

    DBInstanceClass=db_instance_class,

    MasterUsername=db_master_username,

    MasterUserPassword=db_master_password,

    AllocatedStorage=20,

)


db_instance_arn = response['DBInstance']['DBInstanceArn']


print(f"RDS instance created with ARN {db_instance_arn}")

This code creates an RDS MySQL instance with the specified configuration, including the instance identifier, engine, instance class, master username, and master password. The instance ARN is printed to the console.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...