---
AWSTemplateFormatVersion: "2010-09-09"
Description: "SSM document to install subnet and chain"
Parameters:
DocumentName:
Type: String
Default: InstallSubnetChainV0
Description: SSM document Name.
Resources:
InstallSubnetChain:
Type: AWS::SSM::Document
Properties:
DocumentType: Command
Name: !Ref DocumentName
Tags:
- Key: DocumentName
Value: !Ref DocumentName
- Key: DocumentVersion
Value: "v1"
Content:
schemaVersion: "2.2"
description: installSubnetChain
parameters:
executionTimeout:
type: String
description: "timeout for run on all instances"
default: "50000"
scriptTimeout:
type: String
description: "timeout for script on individual instance"
default: "3600"
avalanchedArgs:
type: String
description: New blockchain id to move configuration to.
mainSteps:
- action: aws:runShellScript
name: installSubnetChain
inputs:
timeoutSeconds: "{{ scriptTimeout }}"
runCommand:
- |
#!/bin/bash
set -xeu
/usr/local/bin/avalanched --version
# to download vm binary, write/update subnet/chain config
/usr/local/bin/avalanched {{ avalanchedArgs }}
# to reload updated configs
sudo systemctl restart avalanche
sleep 7
sudo tail -50 /var/log/avalanche/avalanche.log || true
# to check the status
# sudo find /var/log/avalanche/
# sudo tail /var/log/avalanche/avalanche.log