Procházet zdrojové kódy

rename CloudFormation/vpc+role.yaml to CloudFormation/vpc+role+elb.yaml.

xdc před 5 roky
rodič
revize
9b01193fc6
1 změnil soubory, kde provedl 53 přidání a 0 odebrání
  1. 53 0
      CloudFormation/vpc+role+elb.yaml

+ 53 - 0
CloudFormation/vpc+role.yaml → CloudFormation/vpc+role+elb.yaml

@@ -1,5 +1,58 @@
 AWSTemplateFormatVersion: 2010-09-09
 Resources:
+  ApplicationLoadBalancer:
+    Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
+    Properties:
+      Subnets:
+        - !Ref pubnet1
+        - !Ref pubnet2
+      SecurityGroups:
+        - !Ref elbgroup
+    Metadata:
+      'AWS::CloudFormation::Designer':
+        id: 01cf8a1b-c08c-4410-b833-5bab98a4cc0d
+  ALBListener:
+    Type: 'AWS::ElasticLoadBalancingV2::Listener'
+    Properties:
+      DefaultActions:
+        - Type: forward
+          TargetGroupArn: !Ref ALBTargetGroup
+      LoadBalancerArn: !Ref ApplicationLoadBalancer
+      Port: '81'
+      Protocol: HTTP
+    Metadata:
+      'AWS::CloudFormation::Designer':
+        id: cf883cbd-fd01-45a1-b42e-3cc732475a48
+  ALBListenerRule:
+    Type: 'AWS::ElasticLoadBalancingV2::ListenerRule'
+    Properties:
+      Actions:
+        - Type: forward
+          TargetGroupArn: !Ref ALBTargetGroup
+      Conditions:
+        - Field: path-pattern
+          Values:
+            - /
+      ListenerArn: !Ref ALBListener
+      Priority: 1
+    Metadata:
+      'AWS::CloudFormation::Designer':
+        id: bfa5c894-73f0-40e1-a0ad-7a6d83d61f84
+  ALBTargetGroup:
+    Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
+    Properties:
+      HealthCheckIntervalSeconds: 30
+      HealthCheckPath: /
+      HealthCheckProtocol: HTTP
+      HealthCheckTimeoutSeconds: 5
+      HealthyThresholdCount: 3
+      Port: 7777
+      Protocol: HTTP
+      UnhealthyThresholdCount: 5
+      VpcId: !Ref vpc1
+    Metadata:
+      'AWS::CloudFormation::Designer':
+        id: da90ade6-53eb-497d-a36a-b4ab683f9948
   RootRole:
     Type: 'AWS::IAM::Role'
     Properties: