github.com/FusionFoundation/efsn/v4@v4.2.0/QuickNodeSetup/fsn.yml (about) 1 AWSTemplateFormatVersion: '2010-09-09' 2 Description: 'AWS CloudFormation to launch Fusion AMI' 3 Parameters: 4 KeyName: 5 Description: Name of an existing EC2 KeyPair to enable SSH access to the instance 6 Type: AWS::EC2::KeyPair::KeyName 7 ConstraintDescription: Must be the name of an existing EC2 KeyPair. 8 InstanceType: 9 Description: WebServer EC2 instance type 10 Type: String 11 Default: t2.medium 12 AllowedValues: 13 - t2.medium 14 ConstraintDescription: must be a valid EC2 instance type. 15 SSHLocation: 16 Description: The IP address range that can be used to SSH to the EC2 instances. 17 Type: String 18 MinLength: '9' 19 MaxLength: '18' 20 Default: 0.0.0.0/0 21 AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})" 22 ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x. 23 Mappings: 24 AWSInstanceType2Arch: 25 t2.medium: 26 Arch: HVM64 27 AWSInstanceType2NATArch: 28 t2.medium: 29 Arch: NATHVM64 30 AWSRegionArch2AMI: 31 us-east-1: 32 PV64: NOT_SUPPORTED 33 HVM64: ami-024a64a6685d05041 34 HVMG2: NOT_SUPPORTED 35 us-east-2: 36 PV64: NOT_SUPPORTED 37 HVM64: ami-0c55b159cbfafe1f0 38 HVMG2: NOT_SUPPORTED 39 us-west-1: 40 PV64: NOT_SUPPORTED 41 HVM64: ami-06397100adf427136 42 HVMG2: NOT_SUPPORTED 43 us-west-2: 44 PV64: NOT_SUPPORTED 45 HVM64: ami-005bdb005fb00e791 46 HVMG2: NOT_SUPPORTED 47 ap-east-1: 48 PV64: NOT_SUPPORTED 49 HVM64: NOT_SUPPORTED 50 HVMG2: NOT_SUPPORTED 51 ap-south-1: 52 PV64: NOT_SUPPORTED 53 HVM64: ami-06832d84cd1dbb448 54 HVMG2: NOT_SUPPORTED 55 ap-northeast-2: 56 PV64: NOT_SUPPORTED 57 HVM64: ami-02c9728b733d27242 58 HVMG2: NOT_SUPPORTED 59 ap-southeast-1: 60 PV64: NOT_SUPPORTED 61 HVM64: ami-0dad20bd1b9c8c004 62 HVMG2: NOT_SUPPORTED 63 ap-southeast-2: 64 PV64: NOT_SUPPORTED 65 HVM64: ami-0b76c3b150c6b1423 66 HVMG2: NOT_SUPPORTED 67 ap-northeast-1: 68 PV64: NOT_SUPPORTED 69 HVM64: ami-09c81ecf1c2b2ef70 70 HVMG2: NOT_SUPPORTED 71 ca-central-1: 72 PV64: NOT_SUPPORTED 73 HVM64: ami-01b60a3259250381b 74 HVMG2: NOT_SUPPORTED 75 cn-north-1: 76 PV64: NOT_SUPPORTED 77 HVM64: NOT_SUPPORTED 78 HVMG2: NOT_SUPPORTED 79 cn-northwest-1: 80 PV64: NOT_SUPPORTED 81 HVM64: NOT_SUPPORTED 82 HVMG2: NOT_SUPPORTED 83 eu-central-1: 84 PV64: NOT_SUPPORTED 85 HVM64: ami-090f10efc254eaf55 86 HVMG2: NOT_SUPPORTED 87 eu-west-1: 88 PV64: NOT_SUPPORTED 89 HVM64: ami-08d658f84a6d84a80 90 HVMG2: NOT_SUPPORTED 91 eu-west-2: 92 PV64: NOT_SUPPORTED 93 HVM64: ami-07dc734dc14746eab 94 HVMG2: NOT_SUPPORTED 95 eu-west-3: 96 PV64: NOT_SUPPORTED 97 HVM64: ami-03bca18cb3dc173c9 98 HVMG2: NOT_SUPPORTED 99 eu-north-1: 100 PV64: NOT_SUPPORTED 101 HVM64: ami-5e9c1520 102 HVMG2: NOT_SUPPORTED 103 sa-east-1: 104 PV64: NOT_SUPPORTED 105 HVM64: ami-09f4cd7c0b533b081 106 HVMG2: NOT_SUPPORTED 107 Resources: 108 FusionEC2Instance: 109 Type: AWS::EC2::Instance 110 Properties: 111 InstanceType: 112 Ref: InstanceType 113 SecurityGroupIds: 114 - Ref: FusionSecurityGroup 115 KeyName: 116 Ref: KeyName 117 ImageId: 118 Fn::FindInMap: 119 - AWSRegionArch2AMI 120 - Ref: AWS::Region 121 - Fn::FindInMap: 122 - AWSInstanceType2Arch 123 - Ref: InstanceType 124 - Arch 125 BlockDeviceMappings: 126 - DeviceName: "/dev/sdh" 127 Ebs: 128 VolumeType: "gp2" 129 DeleteOnTermination: "true" 130 VolumeSize: "300" 131 UserData: 132 "Fn::Base64": 133 !Sub | 134 Content-Type: multipart/mixed; boundary="==BOUNDARY==" 135 MIME-Version: 1.0 136 --==BOUNDARY== 137 Content-Type: text/x-shellscript; charset="us-ascii" 138 #!/bin/bash 139 mkfs.ext4 /dev/xvdh 140 echo "/dev/xvdh /home ext4 defaults,discard,noatime,nodiratime 0 0" >> /etc/fstab 141 mv /home /home_old 142 mkdir /home 143 mount /home 144 # dotglob makes sure that hidden (dot) files are included 145 shopt -s dotglob 146 mv /home_old/* /home 147 rmdir /home_old 148 mkdir -p /fusion-nodes/keystore 149 # echo "password val" >> /fusion-nodes/password.txt 150 # echo "keystore val" >> /fusion-nodes/keystore/UTC.txt 151 cd /fusion-nodes 152 curl -O https://raw.githubusercontent.com/FUSIONFoundation/efsn/master/QuickNodeSetup/fsnNode.sh 153 sudo chmod +x fsnNode.sh 154 ln -s /fusion-nodes/fsnNode.sh /usr/local/bin/fsnNode.sh 155 --==BOUNDARY==-- 156 157 FusionSecurityGroup: 158 Type: AWS::EC2::SecurityGroup 159 Properties: 160 GroupDescription: Security group for Fusion Node 161 SecurityGroupIngress: 162 # - IpProtocol: tcp 163 # FromPort: 9000 164 # ToPort: 9001 165 # CidrIp: 166 # Ref: SSHLocation 167 # - IpProtocol: udp 168 # FromPort: 9000 169 # ToPort: 9001 170 # CidrIp: 171 # Ref: SSHLocation 172 - IpProtocol: tcp 173 FromPort: 40408 174 ToPort: 40408 175 CidrIp: 0.0.0.0/0 176 - IpProtocol: udp 177 FromPort: 40408 178 ToPort: 40408 179 CidrIp: 0.0.0.0/0 180 - IpProtocol: tcp 181 FromPort: 22 182 ToPort: 22 183 CidrIp: 184 Ref: SSHLocation 185 186 Outputs: 187 InstanceId: 188 Description: InstanceId of the Fusion node instance 189 Value: 190 Ref: FusionEC2Instance 191 AZ: 192 Description: Availability Zone of the Fusion node instance 193 Value: 194 Fn::GetAtt: 195 - FusionEC2Instance 196 - AvailabilityZone 197 PublicDNS: 198 Description: Public DNSName of the Fusion node instance 199 Value: 200 Fn::GetAtt: 201 - FusionEC2Instance 202 - PublicDnsName 203 PublicIP: 204 Description: Public IP address of the Fusion node instance 205 Value: 206 Fn::GetAtt: 207 - FusionEC2Instance 208 - PublicIp