Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 1222 lines (1163 sloc) 47.9 KB
{
"Description" : "MyHPCCCloudFormationTemplate.json: Launches instances for fast executing HPCC on AWS. Plus, it sets up and starts HPCC System.",
"Metadata" : {
"AWS::CloudFormation::Interface" : {
"ParameterGroups" : [
{
"Label" : { "default":"HPCC Systems Configuration" },
"Parameters" : [ "HPCCPlatform", "NumberOfSlaveInstances", "NumberOfRoxieInstances", "NumberOfSlavesPerInstance", "NumberOfSupportInstances", "ClusterInventoryFile" ]
},
{
"Label" : { "default":"Other Needed Parameters" },
"Parameters" : [ "UserNameAndPassword", "KeyPair", "InstallCassandra", "ScriptsS3BucketFolder", "SSHUserName", "EBSVolumesMaster", "EBSVolumesSlaves", "EBSVolumesRoxie", "MasterInstanceType", "SlaveInstanceType", "RoxieInstanceType", "AdminCIDR" ]
}
],
}
},
"Parameters" : {
"SSHUserName" : {
"Description" : "The user name used to ssh into an instance",
"AllowedValues" : [
"centos",
"ec2-user",
"ubuntu"
],
"Type" : "String",
"Default" : "ec2-user"
},
"HPCCPlatform" : {
"Description" : "The version of the HPCC Platform to install.",
"AllowedValues" : [
"HPCC-Platform-5.0.0-3",
"HPCC-Platform-5.0.16-1",
"HPCC-Platform-5.2.2-1",
"HPCC-Platform-5.2.4-1",
"HPCC-Platform-5.4.0-1",
"HPCC-Platform-5.6.0-1",
"HPCC-Platform-5.6.4-1",
"HPCC-Platform-6.2.22-1",
"HPCC-Platform-6.4.10-1"
],
"Default" : "HPCC-Platform-6.4.10-1",
"Type" : "String"
},
"KeyPair" : {
"Description" : "The EC2 Key Pair to allow SSH access to the instances.",
"Type" : "AWS::EC2::KeyPair::KeyName",
"Default" : ""
},
"EBSVolumesMaster" : {
"Description" : "Size in GBs of EBS Volume for Master(optional)",
"Type" : "String",
"Default" : ""
},
"EBSVolumesSlaves" : {
"Description" : "Size in GBs of EBS Volume for Slaves(optional)",
"Type" : "String",
"Default" : ""
},
"EBSVolumesRoxie" : {
"Description" : "Size in GBs of EBS Volume for Roxie(optional)",
"Type" : "String",
"Default" : ""
},
"InstallCassandra" : {
"Description" : "(Optional) YES or NO to install Cassandra",
"AllowedValues" : [
"NO",
"YES"
],
"Type" : "String",
"Default" : "NO"
},
"UserNameAndPassword" : {
"Description" : "(Optional) Enter like: username/password Used to log into ECL Watch and ECL IDE.",
"Type" : "String",
"Default" : ""
},
"NumberOfSlaveInstances" : {
"Description" : "Number of Slave instances to be launched",
"Type" : "Number",
"Default" : "2"
},
"NumberOfRoxieInstances" : {
"Description" : "Number of Roxie nodes in deployed HPCC System",
"Type" : "Number",
"Default" : "0"
},
"NumberOfSlavesPerInstance" : {
"Description" : "Number of THOR slave nodes per slave instance",
"Type" : "Number",
"Default" : "2"
},
"MasterInstanceType" : {
"Description" : "HPCC Thor Master EC2 instance type",
"AllowedValues" : [
"r3.xlarge",
"r3.2xlarge",
"r3.4xlarge",
"d2.xlarge",
"d2.2xlarge",
"d2.4xlarge",
"d2.8xlarge",
"i2.2xlarge",
"i2.4xlarge",
"i2.8xlarge"
],
"Default" : "r3.xlarge",
"Type" : "String"
},
"SlaveInstanceType" : {
"Description" : "HPCC Thor Slave EC2 instance type",
"AllowedValues" : [
"r3.xlarge",
"r3.2xlarge",
"r3.4xlarge",
"d2.xlarge",
"d2.2xlarge",
"d2.4xlarge",
"d2.8xlarge",
"i2.2xlarge",
"i2.4xlarge",
"i2.8xlarge"
],
"Default" : "r3.xlarge",
"Type" : "String"
},
"RoxieInstanceType" : {
"Description" : "HPCC Roxie EC2 instance type",
"AllowedValues" : [
"r3.xlarge",
"r3.2xlarge",
"r3.4xlarge",
"d2.xlarge",
"d2.2xlarge",
"d2.4xlarge",
"d2.8xlarge",
"i2.2xlarge",
"i2.4xlarge",
"i2.8xlarge"
],
"Default" : "r3.xlarge",
"Type" : "String"
},
"AdminCIDR" : {
"AllowedPattern" : "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription" : "Used for ssh and port 8010. Must be a valid CIDR range of the form x.x.x.x/x.",
"Default" : "0.0.0.0/0",
"Description" : "CIDR block used for ssh and port 8010.",
"MaxLength" : "18",
"MinLength" : "9",
"Type" : "String"
},
"ScriptsS3BucketFolder" : {
"Type" : "String",
"Description" : "S3 bucket folder that contains the scripts that are executed in the UserData section.",
"Default" : ""
}
},
"Mappings" : {
"RegionMap" : {
"us-east-1" : { "64" : "ami-1ecae776" },
"us-east-2" : { "64" : "ami-c55673a0" },
"us-west-2" : { "64" : "ami-e7527ed7" },
"us-west-1" : { "64" : "ami-d114f295" },
"eu-west-1" : { "64" : "ami-a10897d6" },
"eu-central-1" : { "64" : "ami-a8221fb5" },
"ap-southeast-1" : { "64" : "ami-68d8e93a" },
"ap-southeast-2" : { "64" : "ami-cbf90ecb" },
"ap-northeast-1" : { "64" : "ami-fd9cecc7" },
"sa-east-1" : { "64" : "ami-b52890a8" }
}
},
"Conditions" : {
"CassandraIsInstalled" : {
"Fn::Equals": [
{"Ref": "InstallCassandra"},
"YES"
]
}
},
"Resources" : {
"HPCCPlacementGroup" : {
"Type" : "AWS::EC2::PlacementGroup",
"Properties" : {
"Strategy" : "cluster"
}
},
"HPCCInstanceRoles": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version" : "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Principal": {
"Service": [ "ec2.amazonaws.com" ]
},
"Action": [ "sts:AssumeRole" ]
} ]
},
"Path": "/",
"Policies": [ {
"PolicyName": "root",
"PolicyDocument": {
"Version" : "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Action": "*",
"Resource": "*"
} ]
}
} ]
}
},
"HPCCInstanceProfile" : {
"Type": "AWS::IAM::InstanceProfile",
"Properties": {
"Path": "/",
"Roles": [ { "Ref" : "HPCCInstanceRoles" } ]
}
},
"HPCCVpc" : {
"Type" : "AWS::EC2::VPC",
"Properties" : {
"CidrBlock": "10.0.0.0/16"
}
},
"InternetGateway" : {
"Type" : "AWS::EC2::InternetGateway"
},
"PublicInternetRoute" : {
"Type" : "AWS::EC2::Route",
"DependsOn" : [ "InternetGateway", "PublicInternetRouteTable" ] ,
"Properties" : {
"DestinationCidrBlock" : "0.0.0.0/0",
"GatewayId" : { "Ref" : "InternetGateway" },
"RouteTableId" : { "Ref" : "PublicInternetRouteTable" }
}
},
"VPCGatewayAttachment" : {
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"InternetGatewayId" : { "Ref" : "InternetGateway" },
"VpcId" : { "Ref" : "HPCCVpc" }
}
},
"PublicInternetRouteTable" : {
"Type" : "AWS::EC2::RouteTable",
"Properties" : {
"VpcId" : { "Ref" : "HPCCVpc" }
}
},
"HPCCSubnet" : {
"Type" : "AWS::EC2::Subnet",
"Properties" : {
"CidrBlock": "10.0.0.0/24",
"VpcId": { "Ref" : "HPCCVpc" },
"Tags": [{ "Value": "HPCC-Public-subnet","Key": "Name"}]
}
},
"SubnetRouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"RouteTableId" : { "Ref" : "PublicInternetRouteTable" },
"SubnetId" : { "Ref" : "HPCCSubnet" }
}
},
"HPCCSecurityGroups": {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "The following properities are the ports that an HPCC System needs",
"SecurityGroupEgress": [
{
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
],
"SecurityGroupIngress": [
{
"ToPort": 8888,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8888
},
{
"ToPort": 9042,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 9042
},
{
"ToPort": 7000,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 7000
},
{
"ToPort": 7001,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 7001
},
{
"ToPort": 7199,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 7199
},
{
"ToPort": 9160,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 9160
},
{
"ToPort": 61620,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 61620
},
{
"ToPort": 61621,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 61621
},
{
"ToPort": 8002,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8002
},
{
"ToPort": 8015,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8015
},
{
"ToPort": 8010,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8010
},
{
"ToPort": 8010,
"IpProtocol": "tcp",
"CidrIp": { "Ref" : "AdminCIDR" },
"FromPort": 8010
},
{
"ToPort": 8145,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8145
},
{
"ToPort": 22,
"IpProtocol": "tcp",
"CidrIp": { "Ref" : "AdminCIDR" },
"FromPort": 22
},
{
"ToPort": 22,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 22
},
{
"ToPort": 65535,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 0
},
{
"ToPort": 8050,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8050
},
{
"ToPort": 65535,
"IpProtocol": "udp",
"CidrIp": "10.0.0.0/16",
"FromPort": 0
},
{
"ToPort": 8008,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 8008
},
{
"ToPort": 9876,
"IpProtocol": "tcp",
"CidrIp": "10.0.0.0/16",
"FromPort": 9876
},
{
"ToPort": -1,
"IpProtocol": "icmp",
"CidrIp": "10.0.0.0/16",
"FromPort": -1
}
],
"VpcId": { "Ref": "HPCCVpc" }
}
},
"SlaveASG" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"VPCZoneIdentifier" : [{ "Ref" : "HPCCSubnet" }],
"Cooldown" : "300",
"PlacementGroup" : {"Ref" : "HPCCPlacementGroup" },
"DesiredCapacity" : {"Ref" : "NumberOfSlaveInstances" },
"HealthCheckGracePeriod" : "300",
"HealthCheckType" : "EC2",
"LaunchConfigurationName" : {"Ref" : "SlaveLaunchCfg" },
"MaxSize" : "10",
"MinSize" : {"Ref" : "NumberOfSlaveInstances" },
"Tags" : [
{
"Key" : "StackName",
"Value" : {"Ref" : "AWS::StackName" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "pem",
"Value" : {"Ref" : "KeyPair" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "slavesPerNode",
"Value" : {"Ref" : "NumberOfSlavesPerInstance" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "roxienodes",
"Value" : {"Ref" : "NumberOfRoxieInstances" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "UserNameAndPassword",
"Value" : {"Ref" : "UserNameAndPassword" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "HPCCPlatform",
"Value" : {"Ref" : "HPCCPlatform" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "Name",
"Value" : {
"Fn::Join" : ["-",
[{
"Ref" : "AWS::StackName"
},
"-Slave"
]]
},
"PropagateAtLaunch" : "true"
}
]
}
},
"SlaveLaunchCfg" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "64"]},
"InstanceType" : {"Ref" : "SlaveInstanceType" },
"AssociatePublicIpAddress" : "true",
"KeyName" : {"Ref" : "KeyPair" },
"SecurityGroups" : [ { "Ref" : "HPCCSecurityGroups" } ],
"BlockDeviceMappings" : [
{
"DeviceName": "/dev/sdb",
"VirtualName": "ephemeral0"
},
{
"DeviceName": "/dev/sdc",
"VirtualName": "ephemeral1"
},
{
"DeviceName": "/dev/sdd",
"VirtualName": "ephemeral2"
},
{
"DeviceName": "/dev/sde",
"VirtualName": "ephemeral3"
},
{
"DeviceName": "/dev/sdf",
"VirtualName": "ephemeral4"
},
{
"DeviceName": "/dev/sdg",
"VirtualName": "ephemeral5"
},
{
"DeviceName": "/dev/sdh",
"VirtualName": "ephemeral6"
},
{
"DeviceName": "/dev/sdi",
"VirtualName": "ephemeral7"
},
{
"DeviceName": "/dev/sdj",
"VirtualName": "ephemeral8"
},
{
"DeviceName": "/dev/sdk",
"VirtualName": "ephemeral9"
},
{
"DeviceName": "/dev/sdl",
"VirtualName": "ephemeral10"
},
{
"DeviceName": "/dev/sdm",
"VirtualName": "ephemeral11"
},
{
"DeviceName": "/dev/sdn",
"VirtualName": "ephemeral12"
},
{
"DeviceName": "/dev/sdo",
"VirtualName": "ephemeral13"
},
{
"DeviceName": "/dev/sdp",
"VirtualName": "ephemeral14"
},
{
"DeviceName": "/dev/sdq",
"VirtualName": "ephemeral15"
},
{
"DeviceName": "/dev/sdr",
"VirtualName": "ephemeral16"
},
{
"DeviceName": "/dev/sds",
"VirtualName": "ephemeral17"
},
{
"DeviceName": "/dev/sdt",
"VirtualName": "ephemeral18"
},
{
"DeviceName": "/dev/sdu",
"VirtualName": "ephemeral19"
},
{
"DeviceName": "/dev/sdv",
"VirtualName": "ephemeral20"
},
{
"DeviceName": "/dev/sdw",
"VirtualName": "ephemeral21"
},
{
"DeviceName": "/dev/sdx",
"VirtualName": "ephemeral22"
},
{
"DeviceName": "/dev/sdy",
"VirtualName": "ephemeral23"
}
],
"IamInstanceProfile" : {"Ref" : "HPCCInstanceProfile" },
"UserData" : {
"Fn::Base64" : {
"Fn::Join" : ["\n",
["#!/bin/bash",
"exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1",
"yum -y clean all\n",
"yum-config-manager --enable epel\n",
"yum -y update --security\n",
"yum -y update aws-cfn-bootstrap\n",
"yum -y install aws-cli",
{
"Fn::Join" : [
"",
[
"user=",
{ "Ref" : "SSHUserName" }
]
]
},
"echo TLH: user=\"$user\"",
{
"Fn::Join" : [
" ",
[
"aws s3 cp",
{ "Ref" : "ScriptsS3BucketFolder" },
"/home/$user --recursive"
]
]
},
"chown $user:$user /home/$user/*",
"chmod 755 /home/$user/*.sh",
"chmod 755 /home/$user/*.pl",
"echo SCRIPT: starting setupCfgFileVariables.pl",
{
"Fn::Join" : [
" ",
[
"/home/$user/setupCfgFileVariables.pl",
{ "Ref": "AWS::StackName" },
{ "Ref" : "AWS::Region" }
]
]
},
"echo SCRIPT: completed setupCfgFileVariables.pl",
"echo SCRIPT: starting setup_zz_zNxlarge_disks.pl",
{
"Fn::Join" : [
" ",
[
"/home/$user/setup_zz_zNxlarge_disks.pl",
{ "Ref" : "EBSVolumesSlaves" },
"Slave"
]
]
},
"echo SCRIPT: completed setup_zz_zNxlarge_disks.pl",
"echo SCRIPT: starting install_hpcc.sh",
{
"Fn::Join" : [
" ",
[
"/home/$user/install_hpcc.sh",
{ "Ref" : "InstallCassandra" }
]
]
},
"echo SCRIPT: completed install_hpcc.sh"
]
]
}
}
}
},
"RoxieASG" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"VPCZoneIdentifier" : [{ "Ref" : "HPCCSubnet" }],
"Cooldown" : "300",
"PlacementGroup" : {"Ref" : "HPCCPlacementGroup" },
"DesiredCapacity" : {"Ref" : "NumberOfRoxieInstances" },
"HealthCheckGracePeriod" : "300",
"HealthCheckType" : "EC2",
"LaunchConfigurationName" : {"Ref" : "RoxieLaunchCfg" },
"MaxSize" : "10",
"MinSize" : {"Ref" : "NumberOfRoxieInstances" },
"Tags" : [
{
"Key" : "StackName",
"Value" : {"Ref" : "AWS::StackName" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "pem",
"Value" : {"Ref" : "KeyPair" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "slavesPerNode",
"Value" : {"Ref" : "NumberOfSlavesPerInstance" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "roxienodes",
"Value" : {"Ref" : "NumberOfRoxieInstances" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "UserNameAndPassword",
"Value" : {"Ref" : "UserNameAndPassword" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "HPCCPlatform",
"Value" : {"Ref" : "HPCCPlatform" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "Name",
"Value" : {
"Fn::Join" : ["-",
[{
"Ref" : "AWS::StackName"
},
"-Roxie"
]]
},
"PropagateAtLaunch" : "true"
}
]
}
},
"RoxieLaunchCfg" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "64"]},
"InstanceType" : {"Ref" : "RoxieInstanceType" },
"AssociatePublicIpAddress" : "true",
"KeyName" : {"Ref" : "KeyPair" },
"SecurityGroups" : [ { "Ref" : "HPCCSecurityGroups" } ],
"BlockDeviceMappings" : [
{
"DeviceName": "/dev/sdb",
"VirtualName": "ephemeral0"
},
{
"DeviceName": "/dev/sdc",
"VirtualName": "ephemeral1"
},
{
"DeviceName": "/dev/sdd",
"VirtualName": "ephemeral2"
},
{
"DeviceName": "/dev/sde",
"VirtualName": "ephemeral3"
},
{
"DeviceName": "/dev/sdf",
"VirtualName": "ephemeral4"
},
{
"DeviceName": "/dev/sdg",
"VirtualName": "ephemeral5"
},
{
"DeviceName": "/dev/sdh",
"VirtualName": "ephemeral6"
},
{
"DeviceName": "/dev/sdi",
"VirtualName": "ephemeral7"
},
{
"DeviceName": "/dev/sdj",
"VirtualName": "ephemeral8"
},
{
"DeviceName": "/dev/sdk",
"VirtualName": "ephemeral9"
},
{
"DeviceName": "/dev/sdl",
"VirtualName": "ephemeral10"
},
{
"DeviceName": "/dev/sdm",
"VirtualName": "ephemeral11"
},
{
"DeviceName": "/dev/sdn",
"VirtualName": "ephemeral12"
},
{
"DeviceName": "/dev/sdo",
"VirtualName": "ephemeral13"
},
{
"DeviceName": "/dev/sdp",
"VirtualName": "ephemeral14"
},
{
"DeviceName": "/dev/sdq",
"VirtualName": "ephemeral15"
},
{
"DeviceName": "/dev/sdr",
"VirtualName": "ephemeral16"
},
{
"DeviceName": "/dev/sds",
"VirtualName": "ephemeral17"
},
{
"DeviceName": "/dev/sdt",
"VirtualName": "ephemeral18"
},
{
"DeviceName": "/dev/sdu",
"VirtualName": "ephemeral19"
},
{
"DeviceName": "/dev/sdv",
"VirtualName": "ephemeral20"
},
{
"DeviceName": "/dev/sdw",
"VirtualName": "ephemeral21"
},
{
"DeviceName": "/dev/sdx",
"VirtualName": "ephemeral22"
},
{
"DeviceName": "/dev/sdy",
"VirtualName": "ephemeral23"
}
],
"IamInstanceProfile" : {"Ref" : "HPCCInstanceProfile" },
"UserData" : {
"Fn::Base64" : {
"Fn::Join" : ["\n",
["#!/bin/bash",
"exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1",
"yum -y clean all\n",
"yum-config-manager --enable epel\n",
"yum -y update --security\n",
"yum -y update aws-cfn-bootstrap\n",
"yum -y install aws-cli",
{
"Fn::Join" : [
"",
[
"user=",
{ "Ref" : "SSHUserName" }
]
]
},
"echo TLH: user=\"$user\"",
{
"Fn::Join" : [
" ",
[
"aws s3 cp",
{ "Ref" : "ScriptsS3BucketFolder" },
"/home/$user --recursive"
]
]
},
"chown $user:$user /home/$user/*",
"chmod 755 /home/$user/*.sh",
"chmod 755 /home/$user/*.pl",
"echo SCRIPT: starting setupCfgFileVariables.pl",
{
"Fn::Join" : [
" ",
[
"/home/$user/setupCfgFileVariables.pl",
{ "Ref": "AWS::StackName" },
{ "Ref" : "AWS::Region" }
]
]
},
"echo SCRIPT: completed setupCfgFileVariables.pl",
"echo SCRIPT: starting setup_zz_zNxlarge_disks.pl",
{
"Fn::Join" : [
" ",
[
"/home/$user/setup_zz_zNxlarge_disks.pl",
{ "Ref" : "EBSVolumesRoxie" },
"Roxie"
]
]
},
"echo SCRIPT: completed setup_zz_zNxlarge_disks.pl",
"echo SCRIPT: starting install_hpcc.sh",
{
"Fn::Join" : [
" ",
[
"/home/$user/install_hpcc.sh",
{ "Ref" : "InstallCassandra" }
]
]
},
"echo SCRIPT: completed install_hpcc.sh"
]
]
}
}
}
},
"MasterASG" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"VPCZoneIdentifier" : [{ "Ref" : "HPCCSubnet" }],
"Cooldown" : "300",
"PlacementGroup" : {"Ref" : "HPCCPlacementGroup" },
"DesiredCapacity" : "1",
"HealthCheckGracePeriod" : "300",
"HealthCheckType" : "EC2",
"LaunchConfigurationName" : {"Ref" : "MasterLaunchCfg" },
"MaxSize" : "1",
"MinSize" : "0",
"Tags" : [
{
"Key" : "StackName",
"Value" : {"Ref" : "AWS::StackName" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "pem",
"Value" : {"Ref" : "KeyPair" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "slavesPerNode",
"Value" : {"Ref" : "NumberOfSlavesPerInstance" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "roxienodes",
"Value" : {"Ref" : "NumberOfRoxieInstances" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "UserNameAndPassword",
"Value" : {"Ref" : "UserNameAndPassword" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "HPCCPlatform",
"Value" : {"Ref" : "HPCCPlatform" },
"PropagateAtLaunch" : "true"
},
{
"Key" : "Name",
"Value" : {
"Fn::Join" : ["-",
[{
"Ref" : "AWS::StackName"
},
"-Master"
]]
},
"PropagateAtLaunch" : "true"
}
]
},
"CreationPolicy": {
"ResourceSignal": {
"Count": "1",
"Timeout": "PT15M"
}
}
},
"MasterLaunchCfg" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"DependsOn" : ["RoxieASG"],
"Properties" : {
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "64"]},
"InstanceType" : {"Ref" : "MasterInstanceType" },
"AssociatePublicIpAddress" : "true",
"KeyName" : {"Ref" : "KeyPair" },
"SecurityGroups" : [ { "Ref" : "HPCCSecurityGroups" } ],
"BlockDeviceMappings" : [
{
"DeviceName": "/dev/sdb",
"VirtualName": "ephemeral0"
},
{
"DeviceName": "/dev/sdc",
"VirtualName": "ephemeral1"
},
{
"DeviceName": "/dev/sdd",
"VirtualName": "ephemeral2"
},
{
"DeviceName": "/dev/sde",
"VirtualName": "ephemeral3"
},
{
"DeviceName": "/dev/sdf",
"VirtualName": "ephemeral4"
},
{
"DeviceName": "/dev/sdg",
"VirtualName": "ephemeral5"
},
{
"DeviceName": "/dev/sdh",
"VirtualName": "ephemeral6"
},
{
"DeviceName": "/dev/sdi",
"VirtualName": "ephemeral7"
},
{
"DeviceName": "/dev/sdj",
"VirtualName": "ephemeral8"
},
{
"DeviceName": "/dev/sdk",
"VirtualName": "ephemeral9"
},
{
"DeviceName": "/dev/sdl",
"VirtualName": "ephemeral10"
},
{
"DeviceName": "/dev/sdm",
"VirtualName": "ephemeral11"
},
{
"DeviceName": "/dev/sdn",
"VirtualName": "ephemeral12"
},
{
"DeviceName": "/dev/sdo",
"VirtualName": "ephemeral13"
},
{
"DeviceName": "/dev/sdp",
"VirtualName": "ephemeral14"
},
{
"DeviceName": "/dev/sdq",
"VirtualName": "ephemeral15"
},
{
"DeviceName": "/dev/sdr",
"VirtualName": "ephemeral16"
},
{
"DeviceName": "/dev/sds",
"VirtualName": "ephemeral17"
},
{
"DeviceName": "/dev/sdt",
"VirtualName": "ephemeral18"
},
{
"DeviceName": "/dev/sdu",
"VirtualName": "ephemeral19"
},
{
"DeviceName": "/dev/sdv",
"VirtualName": "ephemeral20"
},
{
"DeviceName": "/dev/sdw",
"VirtualName": "ephemeral21"
},
{
"DeviceName": "/dev/sdx",
"VirtualName": "ephemeral22"
},
{
"DeviceName": "/dev/sdy",
"VirtualName": "ephemeral23"
}
],
"IamInstanceProfile" : {"Ref" : "HPCCInstanceProfile" },
"UserData" : {
"Fn::Base64" : {
"Fn::Join" : ["\n",
["#!/bin/bash",
"exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1",
"yum -y clean all\n",
"yum-config-manager --enable epel\n",
"yum -y update --security\n",
"yum -y update aws-cfn-bootstrap\n",
"yum -y install aws-cli",
{
"Fn::Join" : [
"",
[
"user=",
{ "Ref" : "SSHUserName" }
]
]
},
"echo TLH: user=\"$user\"",
{
"Fn::Join" : [
" ",
[
"aws s3 cp",
{ "Ref" : "ScriptsS3BucketFolder" },
"/home/$user --recursive"
]
]
},
"chown $user:$user /home/$user/*",
"chmod 755 /home/$user/*.sh",
"chmod 755 /home/$user/*.pl",
"echo SCRIPT: starting setupCfgFileVariables.pl",
{
"Fn::Join" : [
" ",
[
"/home/$user/setupCfgFileVariables.pl",
{ "Ref": "AWS::StackName" },
{ "Ref" : "AWS::Region" }
]
]
},
"echo SCRIPT: completed setupCfgFileVariables.pl",
"echo SCRIPT: starting setup_zz_zNxlarge_disks.pl",
{
"Fn::Join" : [
" ",
[
"/home/$user/setup_zz_zNxlarge_disks.pl",
{ "Ref" : "EBSVolumesMaster" },
"Master"
]
]
},
"echo SCRIPT: completed setup_zz_zNxlarge_disks.pl",
"echo SCRIPT: starting install_hpcc.sh",
{
"Fn::Join" : [
" ",
[
"/home/$user/install_hpcc.sh",
{ "Ref" : "InstallCassandra" }
]
]
},
"echo SCRIPT: completed install_hpcc.sh",
"echo SCRIPT: starting final_configureHPCC.sh",
"/home/$user/final_configureHPCC.sh",
"echo SCRIPT: completed final_configureHPCC.sh",
"echo SCRIPT: starting startHPCCOnAllInstances.pl",
"/home/$user/startHPCCOnAllInstances.pl",
"echo SCRIPT: completed startHPCCOnAllInstances.pl",
"echo SCRIPT: starting cassandra if installed",
{
"Fn::If": [
"CassandraIsInstalled",
"/home/$user/startCassandraOnAllInstances.pl",
"echo NOT INSTALLING Cassandra"
]
},
"echo SCRIPT: completed cassandra if installed",
"echo SCRIPT: 'Signal stack that setup of HPCC System is complete.'",
{
"Fn::Join" : [
" ",
[
"/opt/aws/bin/cfn-signal -e 0 --stack ",
{ "Ref": "AWS::StackName" },
"--resource MasterASG ",
"--region ",
{ "Ref" : "AWS::Region" }
]
]
},
"echo SCRIPT: 'Done signaling stack that setup of HPCC System has completed.'"
]
]
}
}
}
}
}
}