Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Creating a DB Instance Running the PostgreSQL Database Engine

The basic building block of Amazon RDS is the DB instance. This is the environment in which you will run your PostgreSQL databases.


You must complete the tasks in the Setting Up for Amazon RDS section before you can create or connect to a DB instance.

AWS Management Console

To launch a PostgreSQL DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at

  2. In the top right corner of the AWS Management Console, select the AWS Region where you want to create the DB instance.

  3. In the navigation pane, click Instances.

  4. Click Launch DB Instance to start the Launch DB Instance Wizard.

    The wizard opens on the Select Engine page.

								Engine selection
  5. On the Select Engine page, click the PostgreSQL icon and then click the Select button for the PostgreSQL DB engine.

  6. Next, the Production? page asks if you are planning to use the DB instance you are creating for production. If you are, select Yes. By selecting Yes, the failover option Multi-AZ and the Provisioned IOPS storage option are preselected in the following step. Click Next when you are finished.

  7. On the Specify DB Details page, specify your DB instance information. Click Next when you are finished.

    For this parameter... ...Do this:

    License Model

    PostgreSQL has only one license model. Select the default, postgresql-license, to use the general license agreement for PostgreSQL.

    DB Engine Version

    Select the version of PostgreSQL that you want to work with.

    DB Instance Class

    Select a DB instance class that defines the processing and memory requirements for the DB instance. For more information about all the DB instance class options, see DB Instance Class.

    Multi-AZ Deployment

    Determine if you want to create a standby replica of your DB instance in another Availability Zone for failover support. For more information about multiple Availability Zones, see Regions and Availability Zones.

    Allocated Storage

    Type a value to allocate storage for your database (in gigabytes). In some cases, allocating a higher amount of storage for your DB instance than the size of your database can improve I/O performance. The minimum and maximum storage allowed depends on the storage type. For more information, see Storage for Amazon RDS.

    Storage Type

    Select the storage type you want to use. For more information about storage, see Storage for Amazon RDS.

    DB Instance Identifier

    Type a name for the DB instance that is unique for your account in the AWS Region you selected. You might choose to add some intelligence to the name such as including the AWS Region and DB engine you selected, for example postgresql-instance1.

    Master Username

    Type a name using alphanumeric characters that you will use as the master user name to log on to your DB instance. For information on the default privileges granted to the master user name, see Amazon RDS PostgreSQL Planning Information

    Master Password and Confirm Password

    Type a password that contains from 8 to 128 printable ASCII characters (excluding /,", and @) for your master user password. Retype the password in the Confirm Password text box.

					DB instance details
  8. On the Configure Advanced Settings page, provide additional information that Amazon RDS needs to launch the PostgreSQL DB instance. The table shows settings for an example DB instance. Specify your DB instance information, then click Launch DB Instance.

    For this parameter... ...Do this:


    This setting depends on the platform you are on. If you are a new customer to AWS, select the default VPC shown. If you are creating a DB instance on the previous E2-Classic platform that does not use a VPC, select Not in VPC. For more information about VPC, see Amazon Virtual Private Cloud (VPCs) and Amazon RDS.

    DB Subnet Group

    This setting depends on the platform you are on. If you are a new customer to AWS, select default, which is the default DB subnet group that was created for your account. If you are creating a DB instance on the previous E2-Classic platform and you want your DB instance in a specific VPC, select the DB subnet group you created for that VPC. For more information about VPC, see Amazon Virtual Private Cloud (VPCs) and Amazon RDS.

    Publicly Accessible

    Select Yes to give the DB instance a public IP address, meaning that it is accessible outside the VPC (the DB instance also needs to be in a public subnet in the VPC); otherwise, select No, so the DB instance will only be accessible from inside the VPC. For more information about hiding DB instances from public access, see Hiding a DB Instance in a VPC from the Internet.

    Availability Zone

    Use the default value of No Preference unless you want to specify an Availability Zone.

    VPC Security Group

    If you are a new customer to AWS, select the default VPC. If you created a VPC security group, select the VPC security group you previously created.

    Database Name

    If you want to specify a database name for the default database, type a name for your database of up to 63 alpha-numeric characters. If you do not provide a name, the default "postgres" database is created.

    To create additional databases, connect to the DB instance and use the SQL command CREATE DATABASE. For more information about connecting to the DB instance, see Connecting to a DB Instance Running the PostgreSQL Database Engine.

    Database Port

    Specify a port you want to use to access the database. PostgreSQL installations default to port 5432 .

    Parameter Group

    Select a parameter group. Each PostgreSQL version has a default parameter group you can use, or you can create your own parameter group. For more information about parameter groups, see Working with DB Parameter Groups.

    Option Group

    Option groups are currently not used with PostgreSQL DB instances. For more information about option groups, see Working with Option Groups.

    Copy Tags To Snapshots

    Choose this option to have any DB instance tags copied to a DB snapshot when you create a snapshot. For more information, see Tagging Amazon RDS Resources.

    Enable Encryption

    Select Yes to enable encryption at rest for this DB instance. For more information, see Encrypting Amazon RDS Resources.

    Backup Retention Period

    Set the number of days you want automatic backups of your database to be retained. For non-trivial instances set this value to 1 or greater.

    Backup Window

    Unless you have a specific time that you want to have your database backup, use the default of No Preference.

    Auto Minor Version Upgrade

    Select Yes to enable your DB instance to receive minor DB engine version upgrades automatically when they become available.

    Maintenance Window

    Select the 30 minute window in which pending modifications to your DB instance are applied. If you the time period doesn't matter, select No Preference.

								Additional Configuration panel
  9. On the final page of the wizard, click Close.

  10. On the Amazon RDS console, the new DB instance appears in the list of DB instances. The DB instance will have a status of creating until the DB instance is created and ready for use. When the state changes to available, you can connect to the DB instance. Depending on the DB instance class and store allocated, it could take several minutes for the new instance to be available.

						My DB instances list


To create a PostgreSQL DB instance, use the AWS CLI create-db-instance command with the following parameters:

  • --db-instance-identifier

  • --allocated-storage

  • --db-instance-class

  • --engine

  • --master-username

  • --master-user-password

For Linux, OS X, or Unix:

aws rds create-db-instance --db-instance-identifier pgdbinstance \ --allocated-storage 20 \ --db-instance-class db.t2.small \ --engine postgres \ --master-username masterawsuser \ --master-user-password masteruserpassword

For Windows:

aws rds create-db-instance --db-instance-identifier pgdbinstance ^ --allocated-storage 20 ^ --db-instance-class db.t2.small ^ --engine postgres ^ --master-username masterawsuser ^ --master-user-password masteruserpassword

This command should produce output similar to the following:

DBINSTANCE pgdbinstance db.t2.small postgres 20 sa creating 3 **** n 9.3 SECGROUP default active PARAMGRP default.PostgreSQL9.3 in-sync


To create a PostgreSQL DB instance, use the Amazon RDS APICreateDBInstance command with the following parameters:

  • Engine = postgres

  • DBInstanceIdentifier = pgdbinstance

  • DBInstanceClass = db.t2.small

  • AllocatedStorage = 20

  • BackupRetentionPeriod = 3

  • MasterUsername = masterawsuser

  • MasterUserPassword = masteruserpassword

Example ?Action=CreateDBInstance &AllocatedStorage=20 &BackupRetentionPeriod=3 &DBInstanceClass=db.t2.small &DBInstanceIdentifier=pgdbinstance &DBName=mydatabase &DBSecurityGroups.member.1=mysecuritygroup &DBSubnetGroup=mydbsubnetgroup &Engine=postgres &MasterUserPassword=<masteruserpassword> &MasterUsername=<masterawsuser> &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140212/us-west-2/rds/aws4_request &X-Amz-Date=20140212T190137Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=60d520ca0576c191b9eac8dbfe5617ebb6a6a9f3994d96437a102c0c2c80f88d

Related Topics