cookbook:
  environment:
    public:
    - INSTANCE_TYPE=t3.medium
    - AWS_REGION=us-west-2
    - AVAILABILITY_ZONE=us-west-2a
    - ROOT_DOMAIN=example.com
    - HOSTED_ZONE_ID=replace-me
    - AMI=ami-0775c09d015da3f73
    - PORT_FROM=3000
    - BACKEND_TIMEOUT_SECONDS=7200
    - EXISTING_SSL_CERTIFICATE_ARN=
    - AMI_SHARE_ACCOUNTS=
    secrets:
    - AWS_ACCESS_KEY_ID
    - AWS_SECRET_ACCESS_KEY
  pages:
  - page: 1
    name: AWS Virtual Machine Provisioning
    recipes:
    - recipe: provision-aws-vm-via-script
      description: Provisions a new AWS Virtual Machine with the maintained Terraform
        workflow.
      form:
      - variable: CUSTOM_AMI
        description: Custom AMI ID (optional - leave empty to use dropdown selection
          below)
        type: text
        placeholder: ami-xxxxxxxxxxxxxxxxx
      - variable: OPERATING_SYSTEM
        description: Select Operating System (used if Custom AMI is empty)
        type: select
        options:
        - label: "\U0001F427 Debian 11 (Linux)"
          value: ami-050ecda74263d792c
        - label: "\U0001F427 Debian 12 (Linux)"
          value: ami-0c04d57c7d5472be9
        - label: "\U0001FA9F Windows Server 2022"
          value: ami-0b91c4400195d38cc
        - label: "\U0001FA9F Windows Server 2025"
          value: ami-077d884fe0477d60d
      - variable: INSTANCE_TYPE
        description: Select Machine Type (RAM-based sizing)
        type: select
        options:
        - label: "\U0001F4BB Small (2GB RAM, 2 vCPU) - t3.small"
          value: t3.small
        - label: "\U0001F4BC Medium (4GB RAM, 2 vCPU) - t3.medium"
          value: t3.medium
        - label: "\U0001F5A5️ Large (8GB RAM, 2 vCPU) - t3.large"
          value: t3.large
        - label: "\U0001F3E2 Extra Large (16GB RAM, 4 vCPU) - m5.xlarge"
          value: m5.xlarge
        - label: "\U0001F3ED 2X Large (32GB RAM, 8 vCPU) - m5.2xlarge"
          value: m5.2xlarge
      canonical_name: provision-aws-vm-via-script
      now:
        steps:
        - step: 1
          name: provision aws vm
          image: lemc-aws-terraform-vm:dev
          timeout: 10.minutes
          environment:
          - TERRAFORM_FUNCTION=apply
      in:
        duration: 12.hours
        steps:
        - step: 2
          name: destroy aws vm after 12 hours
          image: lemc-aws-terraform-vm:dev
          timeout: 10.minutes
          environment:
          - TERRAFORM_FUNCTION=destroy
    - recipe: create-ami-from-instance
      description: Creates a custom AMI from the current running instance with LEMC
        tags.
      form:
      - variable: AMI_NAME
        description: Name for the new AMI.
        type: text
      canonical_name: create-ami-from-instance
      now:
        steps:
        - step: 1
          name: create ami from instance
          image: lemc-aws-terraform-vm:dev
          environment:
          - TERRAFORM_FUNCTION=ami
          timeout: 45.minutes
    - recipe: destroy-aws-vm-via-script
      description: Destroys the current Terraform-managed AWS Virtual Machine.
      form: []
      canonical_name: destroy-aws-vm-via-script
      now:
        steps:
        - step: 1
          name: destroy aws vm
          image: lemc-aws-terraform-vm:dev
          timeout: 10.minutes
          environment:
          - TERRAFORM_FUNCTION=destroy
  name: AWS Terraform VM
  canonical_name: lemc-aws-terraform-vm
