如何为 Postgres 10.6 设置 DBParameterGroup Family 属性

How to set DBParameterGroup Family property for Postgres 10.6

我正在使用带有 RDS 的 Postgres 10.6。我正在尝试设置一个 DBParameterGroup 来设置一些自定义参数,但我不确定在 CloudFormation 中为姓氏添加什么。该文档有一个示例:Family: aurora5.6。我试过 Family: postgres10.6 但没有用。有人有这方面的经验吗?

这是我的 CloudFormation RDS 堆栈中的内容:

  RDSPostgres:
    Type: 'AWS::RDS::DBInstance'
    DeletionPolicy: Delete
    Properties:
      AllocatedStorage: "100"
      DBInstanceClass: db.m4.large
      DBParameterGroupName: RDSDBParameterGroup
      EnablePerformanceInsights: true
      Engine: "postgres"
      EngineVersion: "10.6"
      MasterUsername: !Ref PGUsername
      MasterUserPassword: !Ref PGPassword
      Port: "5432"
      PubliclyAccessible: true
      StorageType: gp2
      DBSubnetGroupName: !Ref DBSubnetGroup
      VPCSecurityGroups:
        - !GetAtt DatabaseSecurityGroup.GroupId

  RDSDBParameterGroup:
    Type: AWS::RDS::DBParameterGroup
    Properties:
      Description: Postgres custom parameters
      Family: postgres10.6
      Parameters:
        shared_preload_libraries: 'pg_stat_statements'
        pg_stat_statements.max: '10000'
        pg_stat_statements.track: 'all'
        log_min_duration_statement: '1000'
        log_duration: 'on'
        random_page_cost: '1.1'
        checkpoint_completion_target: '0.9'
        min_wal_size: '80'
        effective_io_concurrency: '200'
        log_statement: 'all'

我正在尝试使用这些设置创建一个新数据库,而 CloudFormation 告诉我 postgres10.6 不是有效参数。 DBParameterGroup docs 没有 postgres 的例子,我很难找到这个值应该是多少。

您应该将 Family 属性 设置为 postgres10

这是 PostgreSQL 的可用系列列表:

您可以在创建参数组时在控制台中找到该列表。或者,您可以使用以下 AWS CLI 命令查找列表(包含重复项):

aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily"

这是因为 postgres10.6 不是参数组系列部分中可用的有效选项。
要获取所有可用参数组系列的列表,请使用以下 AWS CLI 命令:

aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily"

您还可以通过浏览 AWS RDS 中的参数组来检查 AWS 控制台,然后在参数组系列中,您将在下拉菜单中列出所有可用的组系列。