elb.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. AWSTemplateFormatVersion: 2010-09-09
  2. Resources:
  3. ApplicationLoadBalancer:
  4. Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
  5. Properties:
  6. Subnets:
  7. - !Ref pubnet1id
  8. - !Ref pubnet2id
  9. SecurityGroups:
  10. - !Ref elbgroupid
  11. Metadata:
  12. 'AWS::CloudFormation::Designer':
  13. id: 01cf8a1b-c08c-4410-b833-5bab98a4cc0d
  14. ALBListener:
  15. Type: 'AWS::ElasticLoadBalancingV2::Listener'
  16. Properties:
  17. DefaultActions:
  18. - Type: forward
  19. TargetGroupArn: !Ref ALBTargetGroup
  20. LoadBalancerArn: !Ref ApplicationLoadBalancer
  21. Port: '80'
  22. Protocol: HTTP
  23. Metadata:
  24. 'AWS::CloudFormation::Designer':
  25. id: cf883cbd-fd01-45a1-b42e-3cc732475a48
  26. ALBListenerRule:
  27. Type: 'AWS::ElasticLoadBalancingV2::ListenerRule'
  28. Properties:
  29. Actions:
  30. - Type: forward
  31. TargetGroupArn: !Ref ALBTargetGroup
  32. Conditions:
  33. - Field: path-pattern
  34. Values:
  35. - /
  36. ListenerArn: !Ref ALBListener
  37. Priority: 1
  38. Metadata:
  39. 'AWS::CloudFormation::Designer':
  40. id: bfa5c894-73f0-40e1-a0ad-7a6d83d61f84
  41. ALBTargetGroup:
  42. Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
  43. Properties:
  44. HealthCheckIntervalSeconds: 30
  45. HealthCheckPath: /
  46. HealthCheckProtocol: HTTP
  47. HealthCheckTimeoutSeconds: 5
  48. HealthyThresholdCount: 3
  49. Port: 80
  50. Protocol: HTTP
  51. UnhealthyThresholdCount: 5
  52. VpcId: !Ref vpc1id
  53. Metadata:
  54. 'AWS::CloudFormation::Designer':
  55. id: da90ade6-53eb-497d-a36a-b4ab683f9948
  56. Parameters:
  57. vpc1id:
  58. Type: String
  59. elbgroupid:
  60. Type: String
  61. pubnet1id:
  62. Type: String
  63. pubnet2id:
  64. Type: String