Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 201 additions & 0 deletions Installation/cil_cloudformation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation CIL template. Creates an EC2 centos instance and installs necessary software to run a CIL website. This template provides ssh access to the machine created. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
},
"InstanceType": {
"Description": "EC2 instance type",
"Type": "String",
"Default": "t2.large",
"AllowedValues": [
"t2.large",
"t2.xlarge",
"t2.2xlarge",
"t2.medium"
],
"ConstraintDescription": "must be a valid EC2 instance type."
},
"DiskSize": {
"Description": "Size of EC2 instance disk in gigabytes",
"Type": "Number",
"Default": "50",
"MinValue": "50",
"ConstraintDescription": "must be a whole number 50 or larger"
},
"SSHLocation": {
"Description": "The IP address range that can be used to SSH to the EC2 instance",
"Type": "String",
"MinLength": "9",
"MaxLength": "18",
"Default": "0.0.0.0/0",
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
}
},
"Mappings" : {
"RegionMap" : {
"us-west-2" : { "AMI" : "ami-3ecc8f46"}
}
},
"Resources": {
"Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": {
"Ref": "InstanceType"
},
"SecurityGroups": [
{
"Ref": "InstanceSecurityGroup"
}
],
"KeyName": {
"Ref": "KeyName"
},
"ImageId": "ami-3ecc8f46",
"BlockDeviceMappings" : [
{
"DeviceName" : "/dev/sda1",
"Ebs" : {
"VolumeSize" : { "Ref": "DiskSize" },
"VolumeType" : "gp2"
}
}
],
"Tags" : [
{
"Key" : "Name", "Value" : { "Ref": "AWS::StackName" }
}
],
"UserData" : { "Fn::Base64" : { "Fn::Join" : [ "", [
"#!/bin/bash\n\n",
"yum -y install wget\n",
"cd /home/centos\n",
"wget https://raw.githubusercontent.com/CRBS/CIL_PHP_Website/master/Installation/cil_install.sh\n",
"chmod +x cil_install.sh\n",
"sh cil_install.sh\n"
]]}}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "4ad8b7df-e9a7-4256-9ab2-9f548d4bb695"
}
}
},
"InstanceSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Enable Access to CIL Services",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": {
"Ref": "SSHLocation"
}
},
{
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "8080",
"ToPort": "8080",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "443",
"ToPort": "443",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "9200",
"ToPort": "9200",
"CidrIp": "0.0.0.0/0"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "85d8cb29-8b24-41c8-bca9-498f219d2b6e"
}
}
}
},
"Outputs": {
"InstanceId": {
"Description": "InstanceId of the newly created EC2 instance",
"Value": {
"Ref": "Instance"
}
},
"AZ": {
"Description": "Availability Zone of the newly created EC2 instance",
"Value": {
"Fn::GetAtt": [
"Instance",
"AvailabilityZone"
]
}
},
"PublicDNS": {
"Description": "Public DNSName of the newly created EC2 instance",
"Value": {
"Fn::GetAtt": [
"Instance",
"PublicDnsName"
]
}
},
"PublicIP": {
"Description": "Public IP address of the newly created EC2 instance",
"Value": {
"Fn::GetAtt": [
"Instance",
"PublicIp"
]
}
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"85d8cb29-8b24-41c8-bca9-498f219d2b6e": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 60,
"y": 90
},
"z": 1,
"embeds": []
},
"4ad8b7df-e9a7-4256-9ab2-9f548d4bb695": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 180,
"y": 90
},
"z": 1,
"embeds": [],
"isassociatedwith": [
"85d8cb29-8b24-41c8-bca9-498f219d2b6e"
]
}
}
}
}