dcm4chee/dcm4chee-arc-ec2-psql-acmdns.yml [410:489]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Description: !Join ['', ['RDS Database Master User Secret ', 'for CloudFormation Stack ', !Ref 'AWS::StackName']]
      Tags:
        - Key: project
          Value: dcm4chee-on-aws
      GenerateSecretString:
        SecretStringTemplate: !Join ['', ['{"username": "', postgres, '"}']]
        GenerateStringKey: "password"
        ExcludeCharacters: '"@/\'
        PasswordLength: 16
  SMSecretRDSDBAttachment:
    Type: AWS::SecretsManager::SecretTargetAttachment
    Properties:
      SecretId: !Ref RDSDatabaseSecret
      TargetId: !Ref RDSInstance
      TargetType: AWS::RDS::DBInstance
  DataBaseSubnetGroup:
    Type: AWS::RDS::DBSubnetGroup
    Properties:
      DBSubnetGroupDescription: DBSubnetGroup for Aurora RDS instances
      SubnetIds:
        - !Ref PrivateSubnet1Id
        - !Ref PrivateSubnet2Id
  RDSInstance:
    Type: AWS::RDS::DBInstance
    DeletionPolicy: Retain        ## or Delete/Snapshot
    Properties:
      DBInstanceIdentifier: dcm4chee-instance
      DBInstanceClass: !Ref RDSDBInstanceClass
      StorageType: !Ref RDSDBStorageType
      StorageEncrypted: True
      AllocatedStorage: !Ref RDSDBAllocatedStorage
      Engine: postgres
      EngineVersion: 11
      DBName: pacsdb
      MasterUsername: !Ref RDSDBUserName
      MasterUserPassword: !Join ['', ['{{resolve:secretsmanager:', !Ref RDSDatabaseSecret, ':SecretString:password}}' ]]
      PubliclyAccessible: False
      MultiAZ: !Ref IsDBMultiAZ
      Tags:
        - Key: project
          Value: dcm4chee-on-aws
      VPCSecurityGroups: 
        - !Ref RDSSecurityGroup
      DBSubnetGroupName: !Ref DataBaseSubnetGroup
      BackupRetentionPeriod: !Ref RDSDBBackupRetentionDays

  FileSystem:
    Type: AWS::EFS::FileSystem
    DeletionPolicy: Retain       ## or Delete/Snapshot
    Properties:
      Encrypted: True
      BackupPolicy: 
        Status: !Ref EnableEFSBackup
      LifecyclePolicies:
        - TransitionToIA: !Ref EFSStorageInfrequentAcessAfter
      FileSystemTags:
        - Key: Name
          Value: !Ref 'EFSNameTag'
  StorageAccessPoint:
    Type: AWS::EFS::AccessPoint
    Properties:
      FileSystemId: !Ref FileSystem
      PosixUser:
        Gid: "0"
        Uid: "0"
      RootDirectory:
        Path: "/"
      AccessPointTags:
        - Key: project
          Value: dcm4chee-arc-psql
        - Key: volume
          Value: storage
        - Key: Name
          Value: dcm4chee-arc-psql_storage
  StorageNFSMountTarget1:
    Type: AWS::EFS::MountTarget
    Properties:
      FileSystemId: !Ref FileSystem
      SecurityGroups:
        - !Ref EFSSecurityGroup
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



dcm4chee/dcm4chee-arc-ec2-psql-keycloak.yml [497:576]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Description: !Join ['', ['RDS Database Master User Secret ', 'for CloudFormation Stack ', !Ref 'AWS::StackName']]
      Tags:
        - Key: project
          Value: dcm4chee-on-aws
      GenerateSecretString:
        SecretStringTemplate: !Join ['', ['{"username": "', postgres, '"}']]
        GenerateStringKey: "password"
        ExcludeCharacters: '"@/\'
        PasswordLength: 16
  SMSecretRDSDBAttachment:
    Type: AWS::SecretsManager::SecretTargetAttachment
    Properties:
      SecretId: !Ref RDSDatabaseSecret
      TargetId: !Ref RDSInstance
      TargetType: AWS::RDS::DBInstance
  DataBaseSubnetGroup:
    Type: AWS::RDS::DBSubnetGroup
    Properties:
      DBSubnetGroupDescription: DBSubnetGroup for Aurora RDS instances
      SubnetIds:
        - !Ref PrivateSubnet1Id
        - !Ref PrivateSubnet2Id
  RDSInstance:
    Type: AWS::RDS::DBInstance
    DeletionPolicy: Retain        ## or Delete/Snapshot
    Properties:
      DBInstanceIdentifier: dcm4chee-instance
      DBInstanceClass: !Ref RDSDBInstanceClass
      StorageType: !Ref RDSDBStorageType
      StorageEncrypted: True
      AllocatedStorage: !Ref RDSDBAllocatedStorage
      Engine: postgres
      EngineVersion: 11
      DBName: pacsdb
      MasterUsername: !Ref RDSDBUserName
      MasterUserPassword: !Join ['', ['{{resolve:secretsmanager:', !Ref RDSDatabaseSecret, ':SecretString:password}}' ]]
      PubliclyAccessible: False
      MultiAZ: !Ref IsDBMultiAZ
      Tags:
        - Key: project
          Value: dcm4chee-on-aws
      VPCSecurityGroups: 
        - !Ref RDSSecurityGroup
      DBSubnetGroupName: !Ref DataBaseSubnetGroup
      BackupRetentionPeriod: !Ref RDSDBBackupRetentionDays

  FileSystem:
    Type: AWS::EFS::FileSystem
    DeletionPolicy: Retain       ## or Delete/Snapshot
    Properties:
      Encrypted: True
      BackupPolicy: 
        Status: !Ref EnableEFSBackup
      LifecyclePolicies:
        - TransitionToIA: !Ref EFSStorageInfrequentAcessAfter
      FileSystemTags:
        - Key: Name
          Value: !Ref 'EFSNameTag'
  StorageAccessPoint:
    Type: AWS::EFS::AccessPoint
    Properties:
      FileSystemId: !Ref FileSystem
      PosixUser:
        Gid: "0"
        Uid: "0"
      RootDirectory:
        Path: "/"
      AccessPointTags:
        - Key: project
          Value: dcm4chee-arc-psql
        - Key: volume
          Value: storage
        - Key: Name
          Value: dcm4chee-arc-psql_storage
  StorageNFSMountTarget1:
    Type: AWS::EFS::MountTarget
    Properties:
      FileSystemId: !Ref FileSystem
      SecurityGroups:
        - !Ref EFSSecurityGroup
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



