Skip to content

A script to update/upgrade the EC2. Run custom commands remotely.

License

Notifications You must be signed in to change notification settings

Jkarage/EC2update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EC2Update

A script to run remote scripts in amazon ec2 instance.

Prerequistes

  • Get the instanceid of the machine
  • Get the AWS_ACCESS_KEY_ID AND AWS_SECRET_KEY values

How to get started

Write your scripts in internal/scripts.txt file, comma separated commands. Like the example below:

    touch /home/ubuntu/a.txt,
    echo 'Hello from SSM command!' > /home/ubuntu/a.txt,
    pwd,
    ls -lah /home/ubuntu

Add your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment.

    export AWS_SECRET_ACCESS_KEY=**************
    export AWS_ACCESS_KEY_ID=******************

Installing Requirements

    git clone https://github.com/Jkarage/EC2update.git

Usage

    go run cmd/ec2/main.go --region eu-west-3 --instance-id i-04493d3e5d3001e32

Providing Custom Script file

   go run cmd/ec2/main.go --region eu-west-3 --instance-id i-04493d3e5d3001e32 --script a.txt

About

A script to update/upgrade the EC2. Run custom commands remotely.

Resources

License

Stars

Watchers

Forks

Packages