diff --git a/deploy/deploy.yml b/deploy/deploy.yml index f48cab9..6852edf 100644 --- a/deploy/deploy.yml +++ b/deploy/deploy.yml @@ -12,10 +12,43 @@ Parameters: VPCID: Description: The ID of the VPC in which to create the resources Type: 'AWS::EC2::VPC::Id' - - LatestAmiId: - Type: 'AWS::SSM::Parameter::Value' - Default: '/aws/service/canonical/ubuntu/server/jammy/stable/current/amd64/hvm/ebs-gp2/ami-id' + +Mappings: + AMIRegionMap: + ap-northeast-1: + AMIID: ami-0deffe25fb08894f5 + ap-northeast-2: + AMIID: ami-097243fad67b35a40 + ap-northeast-3: + AMIID: ami-03ad2f651aaddff3a + ap-south-1: + AMIID: ami-0361008010558ea2d + ap-southeast-1: + AMIID: ami-07bf64b7ca62c96ee + ap-southeast-2: + AMIID: ami-0cc8e61f3957442b8 + ca-central-1: + AMIID: ami-0cfe1aac5d0b881ff + eu-central-1: + AMIID: ami-0042e6537994c4181 + eu-north-1: + AMIID: ami-00347e40213620217 + eu-west-1: + AMIID: ami-04620cb5b85309067 + eu-west-2: + AMIID: ami-0315c69b482426e70 + eu-west-3: + AMIID: ami-0dcc6ef9e7a6e70f2 + sa-east-1: + AMIID: ami-027ba68d27297f530 + us-east-1: + AMIID: ami-01e8fbda99c153c6b + us-east-2: + AMIID: ami-0ef27e70f95b439e8 + us-west-1: + AMIID: ami-09d529cbaf5cc7e6f + us-west-2: + AMIID: ami-0acfc42b227d0b719 Resources: # EC2 Instance @@ -23,10 +56,10 @@ Resources: Type: 'AWS::EC2::Instance' Properties: InstanceType: m6a.xlarge - ImageId: !Ref LatestAmiId + ImageId: !FindInMap [AMIRegionMap, !Ref "AWS::Region", AMIID] KeyName: !Ref KeyName - BlockDeviceMappings: - - DeviceName: "/dev/sda1" + BlockDeviceMappings: # resize root volume to 1TB + - DeviceName: "/dev/xvda" Ebs: VolumeSize: 1024 VolumeType: gp2 @@ -130,11 +163,10 @@ Resources: After=network.target [Service] WorkingDirectory=/var/lib/bitcoind - ExecStart=bitcoind -daemon -pid=/run/bitcoind/bitcoind.pid -conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -startupnotify='systemd-notify --ready' -shutdownnotify='systemd-notify --stopping' + ExecStart=bitcoind -pid=/run/bitcoind/bitcoind.pid -conf=/etc/bitcoin/bitcoin.conf PermissionsStartOnly=true ExecStartPre=/bin/chgrp bitcoin /var/lib/bitcoind - Type=notify - NotifyAccess=all + Type=forking PIDFile=/run/bitcoind/bitcoind.pid Restart=on-failure TimeoutStartSec=infinity @@ -159,21 +191,26 @@ Resources: # cat to a bitcoin.conf file RPCPASSWORD=$(> "$CREDENTIALS" - echo "rpcuser: lnd" >> "$CREDENTIALS" + echo "rpcuser: cln" >> "$CREDENTIALS" echo "rpcpassword: $RPCPASSWORD" >> "$CREDENTIALS" sudo mkdir /etc/bitcoin/ sudo touch /etc/bitcoin/bitcoin.conf cat <> "$CREDENTIALS" -echo "rpcuser: lnd" >> "$CREDENTIALS" +echo "rpcuser: cln" >> "$CREDENTIALS" echo "rpcpassword: $RPCPASSWORD" >> "$CREDENTIALS" sudo mkdir /etc/bitcoin/ sudo touch /etc/bitcoin/bitcoin.conf cat <