代码之家  ›  专栏  ›  技术社区  ›  Niklas Rosencrantz

模板中的NoEcho无效

  •  0
  • Niklas Rosencrantz  · 技术社区  · 7 年前

    我收到以下错误消息:

    $ cfn_nag database/gitlab-rds-psql.cf.yml
    {
      "failure_count": 3,
      "violations": [
        {
          "id": "F23",
          "type": "FAIL",
          "message": "RDS instance master user password must be Ref to NoEcho Parameter. Default credentials are not recommended",
          "logical_resource_ids": [
            "GitLabDB"
          ]
        },
        {
          "id": "F24",
          "type": "FAIL",
          "message": "RDS instance master username must be Ref to NoEcho Parameter. Default credentials are not recommended",
          "logical_resource_ids": [
            "GitLabDB"
          ]
        },
        {
          "id": "F22",
          "type": "FAIL",
          "message": "RDS instance should not be publicly accessible",
          "logical_resource_ids": [
            "GitLabDB"
          ]
        }
      ]
    }
    

    但我试着在模板中将它设置为NoEcho:true:

      GitLabDB:
        Type: AWS::RDS::DBInstance
        Properties:
          DBInstanceIdentifier: gitlab
          AllocatedStorage: !Ref 'DBAllocatedStorage'
          StorageType: gp2
          DBInstanceClass: !Ref 'DBClass'
          Engine: postgres
          EngineVersion: 9.6.3
          AutoMinorVersionUpgrade: true
          BackupRetentionPeriod: 20
          StorageEncrypted: !Ref EncryptData
          DBName: gitlabhq_production
          MasterUsername: gitlab
          MasterUserPassword: 
            - !GetAtt DBPassword.RandomString
            - NoEcho: true
          DBSubnetGroupName: !Ref GitLabDBSubnetGroup
          DBParameterGroupName: default.postgres9.6
          MultiAZ: !Ref MultiAZ
          VPCSecurityGroups:
            - !Ref GitLabDBEC2SecurityGroup
          Tags:
            - Key: AlwaysOn
              Value: true
            - Key: Name
              Value: GitLabDB
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   sin    7 年前

    Parameters 部分,不在 Properties 部分。 我想应该是这样。

    Properties:
      MasterUserPassword: !Ref DBPassword
    Parameters:
      DBPassword:
        NoEcho: true