avalanche-ops 0.7.6

avalanche-ops spec
---
AWSTemplateFormatVersion: "2010-09-09"
Description: "SSM document to install subnet and chain"

Parameters:
  DocumentName:
    Type: String
    Default: InstallSubnetChainV0
    Description: SSM document Name.

Resources:
  InstallSubnetChain:
    # https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateDocument.html
    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-aws --version

                  # to download vm binary, write/update subnet/chain config
                  /usr/local/bin/avalanched-aws {{ avalanchedArgs }}

                  # to reload updated configs
                  sudo systemctl restart --no-block avalanchego.service
                  sleep 7
                  sudo tail -50 /var/log/avalanchego/avalanchego.log || true

                  # to check the status
                  # sudo find /var/log/avalanchego/
                  # sudo tail /var/log/avalanchego/avalanchego.log