| **To create a DB instance** | |
| The following ``create-db-instance`` example uses the required options to launch a new DB instance. :: | |
| aws rds create-db-instance \ | |
| --db-instance-identifier test-mysql-instance \ | |
| --db-instance-class db.t3.micro \ | |
| --engine mysql \ | |
| --master-username admin \ | |
| --master-user-password secret99 \ | |
| --allocated-storage 20 | |
| Output:: | |
| { | |
| "DBInstance": { | |
| "DBInstanceIdentifier": "test-mysql-instance", | |
| "DBInstanceClass": "db.t3.micro", | |
| "Engine": "mysql", | |
| "DBInstanceStatus": "creating", | |
| "MasterUsername": "admin", | |
| "AllocatedStorage": 20, | |
| "PreferredBackupWindow": "12:55-13:25", | |
| "BackupRetentionPeriod": 1, | |
| "DBSecurityGroups": [], | |
| "VpcSecurityGroups": [ | |
| { | |
| "VpcSecurityGroupId": "sg-12345abc", | |
| "Status": "active" | |
| } | |
| ], | |
| "DBParameterGroups": [ | |
| { | |
| "DBParameterGroupName": "default.mysql5.7", | |
| "ParameterApplyStatus": "in-sync" | |
| } | |
| ], | |
| "DBSubnetGroup": { | |
| "DBSubnetGroupName": "default", | |
| "DBSubnetGroupDescription": "default", | |
| "VpcId": "vpc-2ff2ff2f", | |
| "SubnetGroupStatus": "Complete", | |
| "Subnets": [ | |
| { | |
| "SubnetIdentifier": "subnet-########", | |
| "SubnetAvailabilityZone": { | |
| "Name": "us-west-2c" | |
| }, | |
| "SubnetStatus": "Active" | |
| }, | |
| { | |
| "SubnetIdentifier": "subnet-########", | |
| "SubnetAvailabilityZone": { | |
| "Name": "us-west-2d" | |
| }, | |
| "SubnetStatus": "Active" | |
| }, | |
| { | |
| "SubnetIdentifier": "subnet-########", | |
| "SubnetAvailabilityZone": { | |
| "Name": "us-west-2a" | |
| }, | |
| "SubnetStatus": "Active" | |
| }, | |
| { | |
| "SubnetIdentifier": "subnet-########", | |
| "SubnetAvailabilityZone": { | |
| "Name": "us-west-2b" | |
| }, | |
| "SubnetStatus": "Active" | |
| } | |
| ] | |
| }, | |
| "PreferredMaintenanceWindow": "sun:08:07-sun:08:37", | |
| "PendingModifiedValues": { | |
| "MasterUserPassword": "****" | |
| }, | |
| "MultiAZ": false, | |
| "EngineVersion": "5.7.22", | |
| "AutoMinorVersionUpgrade": true, | |
| "ReadReplicaDBInstanceIdentifiers": [], | |
| "LicenseModel": "general-public-license", | |
| "OptionGroupMemberships": [ | |
| { | |
| "OptionGroupName": "default:mysql-5-7", | |
| "Status": "in-sync" | |
| } | |
| ], | |
| "PubliclyAccessible": true, | |
| "StorageType": "gp2", | |
| "DbInstancePort": 0, | |
| "StorageEncrypted": false, | |
| "DbiResourceId": "db-5555EXAMPLE44444444EXAMPLE", | |
| "CACertificateIdentifier": "rds-ca-2019", | |
| "DomainMemberships": [], | |
| "CopyTagsToSnapshot": false, | |
| "MonitoringInterval": 0, | |
| "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:test-mysql-instance", | |
| "IAMDatabaseAuthenticationEnabled": false, | |
| "PerformanceInsightsEnabled": false, | |
| "DeletionProtection": false, | |
| "AssociatedRoles": [] | |
| } | |
| } | |
| For more information, see `Creating an Amazon RDS DB Instance <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html>`__ in the *Amazon RDS User Guide*. | |