OMERO-cloudformation-templates/OMEROonECS_RW_S3FG.yml [706:815]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      LoadBalancerArn: !Ref 'OMEROLoadBalancer'
      Port: 80
      Protocol: HTTP
  OmerowebTCP4080TargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      Port: 4080
      Protocol: HTTP
      TargetType: ip
      VpcId: !Ref VPCID
      HealthCheckEnabled: true
      HealthCheckProtocol: HTTP
      HealthCheckPort: 4080
      HealthCheckPath: /index/
      Matcher:
        HttpCode: 200-302
      TargetGroupAttributes:
        - Key: stickiness.enabled
          Value: true
        - Key: stickiness.type
          Value: lb_cookie
        - Key: stickiness.lb_cookie.duration_seconds
          Value: 86500
      Tags:
        - Key: project
          Value: omero-on-aws
  OmerowebTaskDefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      ContainerDefinitions:
        - Environment:
            - Name: OMEROHOST
              Value: !Sub omeroserver.${AWS::StackName}.ecscloudmap.org
            - Name: LOCALDOMAIN
              Value: !Join
                - ''
                - - !Ref 'AWS::Region'
                  - .compute.internal
                  - 'omero.local'
          Essential: true
          Image: !Ref OMEROWebContainerImage
          LinuxParameters: { InitProcessEnabled: true }
          LogConfiguration:
            LogDriver: awslogs
            Options:
              awslogs-group: !Ref 'LogGroup'
              awslogs-region: !Ref 'AWS::Region'
              awslogs-stream-prefix: omeroweb
          Name: omeroweb
          PortMappings:
            - ContainerPort: 4080
              HostPort: 4080
              Protocol: tcp
      Cpu: !Ref OMEROWebContainerCPU
      Memory: !Ref OMEROWebContainerMemory
      ExecutionRoleArn: !Ref 'OmerowebTaskExecutionRole'
      TaskRoleArn: !Ref OmerowebTaskRole
      Family: omero-web
      NetworkMode: awsvpc
      RequiresCompatibilities:
        - 'FARGATE'
  OmerowebTaskExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - sts:AssumeRole
            Effect: Allow
            Principal:
              Service: ecs-tasks.amazonaws.com
        Version: '2012-10-17'
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
        - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: service
          Value: omeroweb
  OmerowebTaskRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - sts:AssumeRole
            Effect: Allow
            Principal:
              Service: ecs-tasks.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyName: OmerowebSSMPolicy
          PolicyDocument:
            Statement:
              - Action:
                  - ssmmessages:CreateControlChannel
                  - ssmmessages:CreateDataChannel
                  - ssmmessages:OpenControlChannel
                  - ssmmessages:OpenDataChannel
                Effect: Allow
                Resource: "*"
    
Outputs:
  OMEROLoadBalancerHTTPEnpoint:
    Description: The HTTP endpoint of the OMEROLoadBalancer
    Value: !Join
      - ''
      - - 'http://'
        - !GetAtt OMEROLoadBalancer.DNSName
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



OMERO-cloudformation-templates/OMEROonECS_RW_TLS_S3FG.yml [777:886]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      LoadBalancerArn: !Ref 'OMEROLoadBalancer'
      Port: 80
      Protocol: HTTP
  OmerowebTCP4080TargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      Port: 4080
      Protocol: HTTP
      TargetType: ip
      VpcId: !Ref VPCID
      HealthCheckEnabled: true
      HealthCheckProtocol: HTTP
      HealthCheckPort: 4080
      HealthCheckPath: /index/
      Matcher:
        HttpCode: 200-302
      TargetGroupAttributes:
        - Key: stickiness.enabled
          Value: true
        - Key: stickiness.type
          Value: lb_cookie
        - Key: stickiness.lb_cookie.duration_seconds
          Value: 86500
      Tags:
        - Key: project
          Value: omero-on-aws
  OmerowebTaskDefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      ContainerDefinitions:
        - Environment:
            - Name: OMEROHOST
              Value: !Sub omeroserver.${AWS::StackName}.ecscloudmap.org
            - Name: LOCALDOMAIN
              Value: !Join
                - ''
                - - !Ref 'AWS::Region'
                  - .compute.internal
                  - 'omero.local'
          Essential: true
          Image: !Ref OMEROWebContainerImage
          LinuxParameters: { InitProcessEnabled: true }
          LogConfiguration:
            LogDriver: awslogs
            Options:
              awslogs-group: !Ref 'LogGroup'
              awslogs-region: !Ref 'AWS::Region'
              awslogs-stream-prefix: omeroweb
          Name: omeroweb
          PortMappings:
            - ContainerPort: 4080
              HostPort: 4080
              Protocol: tcp
      Cpu: !Ref OMEROWebContainerCPU
      Memory: !Ref OMEROWebContainerMemory
      ExecutionRoleArn: !Ref 'OmerowebTaskExecutionRole'
      TaskRoleArn: !Ref OmerowebTaskRole
      Family: omero-web
      NetworkMode: awsvpc
      RequiresCompatibilities:
        - 'FARGATE'
  OmerowebTaskExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - sts:AssumeRole
            Effect: Allow
            Principal:
              Service: ecs-tasks.amazonaws.com
        Version: '2012-10-17'
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
        - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
      Tags:
        - Key: project
          Value: omero-on-aws
        - Key: service
          Value: omeroweb
  OmerowebTaskRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - sts:AssumeRole
            Effect: Allow
            Principal:
              Service: ecs-tasks.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyName: OmerowebSSMPolicy
          PolicyDocument:
            Statement:
              - Action:
                  - ssmmessages:CreateControlChannel
                  - ssmmessages:CreateDataChannel
                  - ssmmessages:OpenControlChannel
                  - ssmmessages:OpenDataChannel
                Effect: Allow
                Resource: "*"
    
Outputs:
  OMEROLoadBalancerHTTPEnpoint:
    Description: The HTTP endpoint of the OMEROLoadBalancer
    Value: !Join
      - ''
      - - 'http://'
        - !GetAtt OMEROLoadBalancer.DNSName
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



