CLI::AWS::EC2-Simple

Simple AWS EC2 CLI command

THIS MODULE IS EXPERIMENTAL AND SUBJECT TO CHANGE WITHOUT NOTICE

PLEASE EXERCISE CAUTION USING AWSCLI SINCE IT WILL CREATE BILLABLE AWS SERVICES IN YOUR ACCOUNT AND MAY NOT TERMINATE THEM AUTOMATICALLY

Raku CLI::AWS::EC2-Simple

Getting Started

  • apt-get update && apt-get install aws-cli

  • aws configure [enter your config here]

  • zef install CLI::AWS::EC2-Simple

  • racl-aws-ec2 [enter your commands here]

Usage

./racl-aws-ec2 [--id=<Str>] [--nsu] [--eip] [-y] <cmd>

    <cmd>         One of <list launch setup connect state terminate nuke>
    --id=<Str>    Running InstanceId of form 'i-0785d8bd98b5f458b'
    --nsu         No setup (suppress launch from running setup)
    --eip         Allocates (if needed) and Associates Elastic IP
    -y            Silence confirmation <nuke> cmd only

Will make an (e.g.) MyKeyPair1672164025.pem from your credentials in your $*HOME dir

Config

launch reads aws-ec2-launch.yaml which is preloaded with the standard AWS Canonical, Ubuntu, 22.04 LTS, amd64 jammy image build on 2022-12-01. Edit this yaml file to meet your needs...

  • cat .racl-config/aws-ec2-launch.yaml

instance:
    image: 'ami-0f540e9f488cfa27d'
    type: 't2.micro'
    security-group:
        name: 'MySG'
        rules:
            - inbound:
                port: 80
                cidr: '0.0.0.0/0'
            - inbound:
                port: 443
                cidr: '0.0.0.0/0'

Setup

setup deploys docker, docker-compose, raku and zef to the launchee...

  • cat .racl-config/launch.pl

#!/usr/bin/perl
`sudo apt-get update -y`;

`sudo apt-get install rakudo -y`;
`sudo git clone https://github.com/ugexe/zef.git`;
`sudo raku -I./zef zef/bin/zef install ./zef --/test`;

`sudo apt-get install docker -y`;
`sudo apt-get install docker-compose -y`;

Wordpress Deploy & Control

[This section will probably go into raku-CLI-WP-Simple]

viz. digital ocean howto

  • client script 'raku-wp --launch'

NOTES

  • unassigned Elastic IPs are chargeable ($5 per month ish), may be better to run one free tier instance

  • rules about rules

    • will always open port 22 (SSH) inbound from this client IP

    • will re-use the existing named Security Group (or create if not present)

    • only inbound are supported for now

    • if you want to keep the name and change the rules, then delete via the aws console

Copyright

copyright(c) 2022 Henley Cloud Consulting Ltd.

CLI::AWS::EC2-Simple v0.0.1

Simple AWS EC2 CLI command

Authors

  • p6steve

License

Artistic-2.0

Dependencies

YAMLishJSON::Fast

Test Dependencies

Provides

  • CLI::AWS::EC2-Simple

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.