Skip to content

Commit

Permalink
Update tenant onboarding cft to expose grpc port (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tieujason330 committed Mar 3, 2022
1 parent 9d5872a commit a0e8b97
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions resources/tenant-onboarding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ Resources:
Memory: !If [WindowsOS, !Ref TaskMemory, !Ref 'AWS::NoValue']
PortMappings:
- ContainerPort: !Ref ContainerPort
- ContainerPort: 50051
LogConfiguration:
LogDriver: awslogs
Options:
Expand Down Expand Up @@ -753,6 +754,10 @@ Resources:
IpProtocol: tcp
FromPort: 443
ToPort: 443
- CidrIp: 0.0.0.0/0
IpProtocol: tcp
FromPort: 50051
ToPort: 50051
ECSSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
Expand Down Expand Up @@ -1076,6 +1081,46 @@ Resources:
Value: lb_cookie
- Key: stickiness.lb_cookie.duration_seconds
Value: '86400'
ALBTargetGroupGrpc:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Name:
Fn::Join: ['', ['tenant-', !Select [0, !Split ['-', !Ref TenantId ]], "-grpc"]]
HealthCheckProtocol: HTTP
HealthCheckPath: "/AWS.ALB/healthcheck"
HealthCheckIntervalSeconds: 30
HealthCheckTimeoutSeconds: 10
HealthyThresholdCount: 2
UnhealthyThresholdCount: 2
Port: 50051
Protocol: HTTP
ProtocolVersion: GRPC
TargetType: !If [ WindowsOS, instance, ip ]
VpcId: !Ref VPC
TargetGroupAttributes:
- Key: stickiness.enabled
Value: 'true'
- Key: stickiness.type
Value: lb_cookie
- Key: stickiness.lb_cookie.duration_seconds
Value: '86400'
ALBListenerGrpc:
Condition: HasCertificate
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
LoadBalancerArn: !Ref ECSLoadBalancer
DefaultActions:
- TargetGroupArn: !Ref ALBTargetGroupGrpc
Type: forward
Port: 50051
Protocol: HTTPS
Certificates:
- CertificateArn:
Fn::Join:
- ''
- - '{{resolve:ssm:'
- !Ref SSLCertArnParam
- '}}'
ALBListenerSSL:
Condition: HasCertificate
Type: AWS::ElasticLoadBalancingV2::Listener
Expand Down Expand Up @@ -1191,6 +1236,10 @@ Resources:
Fn::Join: ['', ['tenant-', !Select [0, !Split ['-', !Ref TenantId]]]]
ContainerPort: !Ref ContainerPort
TargetGroupArn: !Ref ALBTargetGroup
- ContainerName:
Fn::Join: [ '', ['tenant-', !Select [0, !Split ['-', !Ref TenantId ]]]]
ContainerPort: 50051
TargetGroupArn: !Ref ALBTargetGroupGrpc
CapacityProviderStrategy:
!If
- WindowsOS
Expand Down

0 comments on commit a0e8b97

Please sign in to comment.