How can I integrate Amazon S3 with my Aurora PostgreSQL-Compatible DB cluster?
I want to turn on the Amazon Simple Storage Solution (Amazon S3) integration feature in my Amazon Aurora PostgreSQL-Compatible Edition DB cluster.
"I want to turn on the Amazon Simple Storage Solution (Amazon S3) integration feature in my Amazon Aurora PostgreSQL-Compatible Edition DB cluster.Short descriptionYou can import data that is stored in an Amazon S3 bucket into a table on an Aurora PostgreSQL-Compatible DB cluster. First, install the Aurora PostgreSQL-Compatible aws_s3 extension. This extension provides the functions that you need to import data from an S3 bucket. The data can be in a comma-separate value (CSV) file, a text file (txt), or a compressed (gzip) file. Your database must be running PostgreSQL version 10.7 or higher to import from Amazon S3 into Aurora PostgreSQL-Compatible.To integrate your Aurora DB cluster with an S3 bucket:Install the aws_s3 extensionSet up access to an S3 bucketAdd the option to the Aurora clusterUse a psql query to import or export the data from the databaseResolutionInstall the aws_s3 extensionTo install the aws_s3 extension that allows you to connect to the database, run this command:postgres=> CREATE EXTENSION aws_s3 CASCADE;To verify that aws_s3 is installed, use the psql \dx meta-command. Or you can use this query from any DB client tool:select * from pg_available_extensions where installed_version is not null;Set up access to an S3 bucketTo give your Aurora PostgreSQL-Compatible cluster access to Amazon S3, create an AWS Identity and Access Management (IAM) policy. This policy provides the bucket and object permissions that allow your DB cluster to access the S3 bucket.In the IAM policy that you create, include these required actions. These actions allow the transfer of files from the S3 bucket to your DB cluster:s3:GetObjects3:ListBuckets3:PutObjects3:AbordMultipartUploadFor more information, see Setting up access to an Amazon S3 bucket.Add the option to the Aurora clusterAdd an IAM role to your cluster using either the Amazon Relational Database Service (Amazon RDS) console or the AWS Command Line Interface (AWS CLI).Using the consoleLog in to the Amazon RDS console.From the navigation pane, choose the PostgreSQL cluster that you want to modifyChose the Connectivity & security tab.From the Manage IAM roles section, under Add IAM roles to this instance, choose the role that you want to add.Under Feature, choose s3Export, and then choose Add role.Import or export data from the databaseImport data to your PostgreSQL cluster from the S3 bucket or export data to your S3 bucket from your PostgreSQL cluster.For more information, see Export and import data from Amazon S3 to Amazon Aurora PostgreSQL.After you complete these steps, import data to an Aurora PostgreSQL-Compatible cluster from Amazon S3 using aws_s3.table_import_from_s3. You can export data from Aurora PostgreSQL-Compatible cluster to Amazon S3 using the aws_s3.query_export_to_s3 function.Follow"