Coder Social home page Coder Social logo

lightsailctl's Introduction

Amazon Lightsail CLI Extensions

This project is the source code of lightsailctl, a tool that augments Amazon Lightsail features in AWS CLI.

Usage

lightsailctl is executed automatically by AWS CLI when certain subcommands are used, such as aws lightsail push-container-image.

$ lightsailctl --plugin -h

Usage of `lightsailctl --plugin`:
  --input payload
        plugin payload
  --input-stdin
        receive plugin payload on stdin

Installing

Homebrew ๐Ÿป

brew install aws/tap/lightsailctl

From Source

lightsailctl is written in Go, so please install Go.

If all you want is to install lightsailctl binary, then do the following:

go install github.com/aws/lightsailctl@latest

Note: the executable is installed in the directory named by the GOBIN environment variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH environment variable is not set (on Windows that is %GOPATH%\bin or %USERPROFILE%\go\bin respectively).

Keep reading if you want to work with lightsailctl source code locally.

After you clone this repo and open your terminal app in it, you'll be able to test and build this code like so:

go test ./...
go install ./...

Under The Hood

Let's consider this command and see what actually happens:

aws lightsail push-container-image \
 --service-name hello \
 --image hello-world:latest \
 --label www

The above command pushes a local container image with tag hello-world:latest to make it available in Lightsail container service deployments for service hello.

This container image pushing logic requires a number of steps that are outsourced from AWS CLI to lightsailctl.

Here's a shell invocation of ligtsailctl that approximates what AWS CLI does when the command above is invoked:

$ echo '{
  "inputVersion": "1",
  "operation": "PushContainerImage",
  "payload": {
    "service": "hello",
    "label":   "www",
    "image":   "hello-world:latest"
  }
}' | lightsailctl --plugin --input-stdin

85fcec7ef3ef: Layer already exists 
3e5288f7a70f: Layer already exists 
56bc37de0858: Layer already exists 
1c91bf69a08b: Layer already exists 
cb42413394c4: Layer already exists 
Digest: sha256:0b159cd1ee1203dad901967ac55eee18c24da84ba3be384690304be93538bea8
Image "hello-world:latest" registered.
Refer to this image as ":hello.www.73" in deployments.

Security Disclosures

See CONTRIBUTING.md for more information.

Giving Feedback and Contributing

Aside from the security feedback covered above, do you have any feedback, bug reports, questions or feature ideas?

You are welcome to write up an issue for us.

Please read about Contributing Guidelines.

License

This project is licensed under the Apache-2.0 License.

lightsailctl's People

Contributors

paxan avatar alexanderrichey avatar amazon-auto avatar yaotashan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.