3

는 기본적으로 나는 100 % 확실하지 않다 AWS 데이터 파이프 라인을 사용하여 S3 내 RDS 데이터베이스,AWS Data Pipeline을 사용하여 RDS 데이터베이스를 S3에 덤프 할 수 있습니까? 이 내가 <code>SqlDataNode</code>가 <code>selectQuery</code> 궁금하고있는 시점에서 원하는 단계까지있어 가능한 경우

pg_dump 싶은 할 것. 난 당신이 테이블 만이 아니라 pg_dump에와 같이 전체 DB를 덤프 수 있다고 생각

AWSTemplateFormatVersion: "2010-05-15" 

Description: RDS to S3 Dump 

Parameters: 
    RDSInstanceID: 
    Description: "Instance ID of RDS to Dump from" 
    DatabaseName: 
    Description: "Name of the Database to Dump" 
    Type: String 
    Username: 
    Description: "Database Username" 
    Type: String 
    Password: 
    Description: "Database password" 
    Type: String 
    NoEcho: true 

RDSToS3Dump: 
    Type: "AWS::DataPipeline::Pipeline" 
    Properties: 
    Name: "RDSToS3Dump" 
    Description: "Pipeline to backup RDS data to S3" 
    Activate: true 
    ParameterObjects: 
     - 
     name: "SourceRDSTable" 
     type: "SqlDataNode" 
     Database: !Ref DatabaseName 
     - 
     name: !Ref DatabaseName 
     type: "RdsDatabase" 
     databaseName: !Ref DatabaseName 
     username: !Ref Username 
     password: !Ref Password 
     rdsInstanceId: !Ref RDSInstanceID 
     - 
     name: "S3OutputLocation" 
     type: "S3DataNode" 
     filePath: #TODO: S3 Bucket here parameterized? Will actually need to create one. 
     - 
     name: "RDStoS3CopyActivity" 
     type: "CopyActivity" 
     input: "SourceRDSTable" 
     output: "S3OutputLocation" 
     #TODO: do we need a runsOn? 

답변

3

AWS 데이터 파이프 라인은 당신이 테이블이 아닌 전체 DB를 덤프 할 수 있습니다. pg_dump을 사용하여 AWS CloudFormation을 사용하여 S3의 전체 DB 내용을 덤프하려면 Lambda-backed custom resources을 사용할 수 있습니다. 그 길 추락, 당신은 람다 함수를 작성해야 :

  • 는 DB
  • 에 연결하는 것은
S3에 pg_dump
  • 업로드에게 그것을 사용하여 DB의 덤프를 취
  • 1

    데이터 파이프 라인을 사용 :

    다음은 지금까지 내 템플릿입니다.

    selectQuery는 덤프 할 항목 (예 : "select * from mytable")에 대한 SQL 문만 필요로 했습니까? 아마 이것은 도움이 될 것입니다. 다른 답변에서 언급 한 바와 같이 http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-object-sqldatanode.html

    - 
        name: "SourceRDSTable" 
        type: "SqlDataNode" 
        Database: !Ref DatabaseName 
        table: "mytable" 
        selectQuery: "select * from #{table}"