Private
Server IP : 195.201.23.43  /  Your IP : 3.142.131.16
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/awscli/examples/rds/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/awscli/examples/rds/create-db-cluster.rst
**Example 1: To create a MySQL 5.7--compatible DB cluster**

The following ``create-db-cluster`` example create a MySQL 5.7-compatible DB cluster. Replace the sample password ``secret99`` with a secure password. The writer DB instance is the first instance that is created in a DB cluster. When you use the console to create a DB cluster, Amazon RDS automatically creates the writer DB instance for your DB cluster. However, when you use the AWS CLI to create a DB cluster, you must explicitly create the writer DB instance for your DB cluster using the ``create-db-instance`` AWS CLI command. ::

    aws rds create-db-cluster \
        --db-cluster-identifier sample-cluster \
        --engine aurora-mysql \
        --engine-version 5.7.12 \
        --master-username master \
        --master-user-password secret99 \
        --db-subnet-group-name default \
        --vpc-security-group-ids sg-0b9130572daf3dc16

Output::

    {
        "DBCluster": {
            "DBSubnetGroup": "default",
            "VpcSecurityGroups": [
                {
                    "VpcSecurityGroupId": "sg-0b9130572daf3dc16",
                    "Status": "active"
                }
            ],
            "AllocatedStorage": 1,
            "AssociatedRoles": [],
            "PreferredBackupWindow": "09:12-09:42",
            "ClusterCreateTime": "2019-06-07T23:21:33.048Z",
            "DeletionProtection": false,
            "IAMDatabaseAuthenticationEnabled": false,
            "ReadReplicaIdentifiers": [],
            "EngineMode": "provisioned",
            "Engine": "aurora-mysql",
            "StorageEncrypted": false,
            "MultiAZ": false,
            "PreferredMaintenanceWindow": "mon:04:31-mon:05:01",
            "HttpEndpointEnabled": false,
            "BackupRetentionPeriod": 1,
            "DbClusterResourceId": "cluster-ANPAJ4AE5446DAEXAMPLE",
            "DBClusterIdentifier": "sample-cluster",
            "AvailabilityZones": [
                "us-east-1a",
                "us-east-1b",
                "us-east-1e"
            ],
            "MasterUsername": "master",
            "EngineVersion": "5.7.12",
            "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-cluster",
            "DBClusterMembers": [],
            "Port": 3306,
            "Status": "creating",
            "Endpoint": "sample-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
            "DBClusterParameterGroup": "default.aurora-mysql5.7",
            "HostedZoneId": "Z2R2ITUGPM61AM",
            "ReaderEndpoint": "sample-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com",
            "CopyTagsToSnapshot": false
        }
    }

**Example 2: To create a PostgreSQL--compatible DB cluster**

The following ``create-db-cluster`` example creates a PostgreSQL-compatible DB cluster. Replace the example password ``secret99`` with a secure password. The writer DB instance is the first instance that is created in a DB cluster. When you use the console to create a DB cluster, Amazon RDS automatically creates the writer DB instance for your DB cluster. However, when you use the AWS CLI to create a DB cluster, you must explicitly create the writer DB instance for your DB cluster using the ``create-db-instance`` AWS CLI command. ::

    aws rds create-db-cluster \
        --db-cluster-identifier sample-pg-cluster \
        --engine aurora-postgresql \
        --master-username master \
        --master-user-password secret99 \
        --db-subnet-group-name default \
        --vpc-security-group-ids sg-0b9130572daf3dc16

Output::

    {
        "DBCluster": {
            "Endpoint": "sample-pg-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
            "HttpEndpointEnabled": false,
            "DBClusterMembers": [],
            "EngineMode": "provisioned",
            "CopyTagsToSnapshot": false,
            "HostedZoneId": "Z2R2ITUGPM61AM",
            "IAMDatabaseAuthenticationEnabled": false,
            "AllocatedStorage": 1,
            "VpcSecurityGroups": [
                {
                    "VpcSecurityGroupId": "sg-0b9130572daf3dc16",
                    "Status": "active"
                }
            ],
            "DeletionProtection": false,
            "StorageEncrypted": false,
            "BackupRetentionPeriod": 1,
            "PreferredBackupWindow": "09:56-10:26",
            "ClusterCreateTime": "2019-06-07T23:26:08.371Z",
            "DBClusterParameterGroup": "default.aurora-postgresql9.6",
            "EngineVersion": "9.6.9",
            "Engine": "aurora-postgresql",
            "Status": "creating",
            "DBClusterIdentifier": "sample-pg-cluster",
            "MultiAZ": false,
            "Port": 5432,
            "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-pg-cluster",
            "AssociatedRoles": [],
            "DbClusterResourceId": "cluster-ANPAJ4AE5446DAEXAMPLE",
            "PreferredMaintenanceWindow": "wed:03:33-wed:04:03",
            "ReaderEndpoint": "sample-pg-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com",
            "MasterUsername": "master",
            "AvailabilityZones": [
                "us-east-1a",
                "us-east-1b",
                "us-east-1c"
            ],
            "ReadReplicaIdentifiers": [],
            "DBSubnetGroup": "default"
        }
    }

For more information, see `Creating an Amazon Aurora DB Cluster <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.CreateInstance.html>`__ in the *Amazon Aurora Users Guide*.
Private