OMERO-cloudformation-templates/OMEROonECS_RW_S3FG.yml [222:323]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  RDSDatabaseSecret:
    Type: AWS::SecretsManager::Secret
    Properties:
      Name: !Sub ${AWS::StackName}-RDSDatabaseSecret
      Description: !Join ['', ['RDS Database Master User Secret ', 'for CloudFormation Stack ', !Ref 'AWS::StackName']]
      Tags:
        - Key: project
          Value: omero-on-aws
      GenerateSecretString:
        SecretStringTemplate: !Join ['', ['{"username": "', !Ref DBUser, '"}']]
        GenerateStringKey: "password"
        ExcludeCharacters: '"@/\'
        PasswordLength: 16
  SMSecretRDSDBAttachment:
    Type: AWS::SecretsManager::SecretTargetAttachment
    Properties:
      SecretId: !Ref RDSDatabaseSecret
      TargetId: !Ref RDSInstance
      TargetType: AWS::RDS::DBInstance
  LBSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Load Balancer Security Group
      GroupName: !Sub ${AWS::StackName}-LBSecurityGroup
      SecurityGroupIngress:
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroweb:4080/tcp
          FromPort: 80
          IpProtocol: TCP
          ToPort: 80
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroweb:443/https
          FromPort: 443
          IpProtocol: TCP
          ToPort: 443
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: network
          Value: loadbalancer
      VpcId: !Ref VPCID
  OmeroSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: OMERO Security Group
      GroupName: !Sub ${AWS::StackName}-OmeroSecurityGroup
      SecurityGroupIngress:
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroserver:4063/tcp
          FromPort: 4063
          IpProtocol: TCP
          ToPort: 4063
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroserver:4064/tcp
          FromPort: 4064
          IpProtocol: TCP
          ToPort: 4064
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroserver:14064/tcp
          FromPort: 14064
          IpProtocol: TCP
          ToPort: 14064
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: ssh
          FromPort: 22
          IpProtocol: TCP
          ToPort: 22
        - SourceSecurityGroupId: !Ref LBSecurityGroup
          Description: omeroweb:4080/tcp
          FromPort: 4080
          IpProtocol: TCP
          ToPort: 4080
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: network
          Value: omero
      VpcId: !Ref VPCID
  OmeroSecurityGroupIngress:
    Type: AWS::EC2::SecurityGroupIngress
    Properties:
      Description: Allow communication within omero network
      GroupId: !Ref OmeroSecurityGroup
      IpProtocol: '-1'
      SourceSecurityGroupId: !Ref OmeroSecurityGroup
  RDSSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: RDS Security Group
      GroupName: !Sub ${AWS::StackName}-RDSSecurityGroup
      SecurityGroupIngress:
        - SourceSecurityGroupId: !Ref OmeroSecurityGroup
          Description: postgres:5432/tcp
          FromPort: 5432
          IpProtocol: TCP
          ToPort: 5432
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: network
          Value: rds
      VpcId: !Ref VPCID
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



OMERO-cloudformation-templates/OMEROstorage.yaml [77:178]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  RDSDatabaseSecret:
    Type: AWS::SecretsManager::Secret
    Properties:
      Name: !Sub ${AWS::StackName}-RDSDatabaseSecret
      Description: !Join ['', ['RDS Database Master User Secret ', 'for CloudFormation Stack ', !Ref 'AWS::StackName']]
      Tags:
        - Key: project
          Value: omero-on-aws
      GenerateSecretString:
        SecretStringTemplate: !Join ['', ['{"username": "', !Ref DBUser, '"}']]
        GenerateStringKey: "password"
        ExcludeCharacters: '"@/\'
        PasswordLength: 16
  SMSecretRDSDBAttachment:
    Type: AWS::SecretsManager::SecretTargetAttachment
    Properties:
      SecretId: !Ref RDSDatabaseSecret
      TargetId: !Ref RDSInstance
      TargetType: AWS::RDS::DBInstance
  LBSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Load Balancer Security Group
      GroupName: !Sub ${AWS::StackName}-LBSecurityGroup
      SecurityGroupIngress:
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroweb:4080/tcp
          FromPort: 80
          IpProtocol: TCP
          ToPort: 80
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroweb:443/https
          FromPort: 443
          IpProtocol: TCP
          ToPort: 443
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: network
          Value: loadbalancer
      VpcId: !Ref VPCID
  OmeroSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: OMERO Security Group
      GroupName: !Sub ${AWS::StackName}-OmeroSecurityGroup
      SecurityGroupIngress:
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroserver:4063/tcp
          FromPort: 4063
          IpProtocol: TCP
          ToPort: 4063
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroserver:4064/tcp
          FromPort: 4064
          IpProtocol: TCP
          ToPort: 4064
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: omeroserver:14064/tcp
          FromPort: 14064
          IpProtocol: TCP
          ToPort: 14064
        - CidrIp: !Ref CIDRblock4OMEROSecurityGroup
          Description: ssh
          FromPort: 22
          IpProtocol: TCP
          ToPort: 22
        - SourceSecurityGroupId: !Ref LBSecurityGroup
          Description: omeroweb:4080/tcp
          FromPort: 4080
          IpProtocol: TCP
          ToPort: 4080
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: network
          Value: omero
      VpcId: !Ref VPCID
  OmeroSecurityGroupIngress:
    Type: AWS::EC2::SecurityGroupIngress
    Properties:
      Description: Allow communication within omero network
      GroupId: !Ref OmeroSecurityGroup
      IpProtocol: '-1'
      SourceSecurityGroupId: !Ref OmeroSecurityGroup
  RDSSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: RDS Security Group
      GroupName: !Sub ${AWS::StackName}-RDSSecurityGroup
      SecurityGroupIngress:
        - SourceSecurityGroupId: !Ref OmeroSecurityGroup
          Description: postgres:5432/tcp
          FromPort: 5432
          IpProtocol: TCP
          ToPort: 5432
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: network
          Value: rds
      VpcId: !Ref VPCID
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



