-
-
Save iam-j/ea936dcdd5922b76e2cd720895899a08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Metadata: | |
AWS::CloudFormation::Interface: | |
ParameterGroups: | |
- Label: | |
default: Networking | |
Parameters: | |
- VPC | |
- InternalSubnets | |
- TargetSecurityGroup | |
ParameterLabels: | |
InternalSubnets: | |
default: Internal subnets * | |
TargetSecurityGroup: | |
default: SG for the instances and RDS * | |
VPC: | |
default: VPC * | |
Parameters: | |
InternalSubnets: | |
ConstraintDescription: Must be a list of two or more Subnet ID's within the selected | |
VPC. | |
Description: Subnets (two or more) where your cluster nodes and other internal | |
infrastructure will be deployed. MUST be within the selected VPC. Specify the | |
ExternalSubnets again here if you wish to deploy the whole stack into the same | |
subnets. | |
Type: List<AWS::EC2::Subnet::Id> | |
TargetSecurityGroup: | |
ConstraintDescription: A security group ID beginning with sg- | |
Description: The security group ID into which to put the EC2 and RDS instances | |
Type: AWS::EC2::SecurityGroup::Id | |
VPC: | |
ConstraintDescription: Must be the ID of a VPC. | |
Description: Virtual Private Cloud | |
Type: AWS::EC2::VPC::Id | |
Resources: | |
InternalApplicationLoadBalancer: | |
Type: AWS::ElasticLoadBalancingV2::LoadBalancer | |
Properties: | |
IpAddressType: ipv4 | |
Scheme: internet-facing | |
Subnets: | |
Ref: InternalSubnets | |
SecurityGroups: | |
- Ref: TargetSecurityGroup | |
Type: application | |
InternalApplicationLoadBalancerTargetGroup: | |
Type: AWS::ElasticLoadBalancingV2::TargetGroup | |
Properties: | |
Port: 80 | |
Protocol: HTTP | |
VpcId: !Ref VPC | |
HealthCheckIntervalSeconds: 30 | |
HealthCheckTimeoutSeconds: 10 | |
HealthyThresholdCount: 3 | |
Matcher: | |
HttpCode: '200-399' | |
HealthCheckPath: '/SamplePage.php' | |
HealthCheckPort: '80' | |
HealthCheckProtocol: HTTP | |
TargetType: instance | |
Targets: | |
- Id: 'i-0b43ca35b6d2076ef' | |
InternalApplicationLoadBalancerListener: | |
Type: AWS::ElasticLoadBalancingV2::Listener | |
Properties: | |
DefaultActions: | |
- Type: forward | |
TargetGroupArn: !Ref InternalApplicationLoadBalancerTargetGroup | |
LoadBalancerArn: !Ref InternalApplicationLoadBalancer | |
Port: 80 | |
Protocol: HTTP | |
Outputs: | |
NewURL: | |
Description: The URL of the Sample App | |
Value: | |
Fn::Join: | |
- '' | |
- | |
- http | |
- :// | |
- Fn::GetAtt: | |
- InternalApplicationLoadBalancer | |
- DNSName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment