Skip to content

Instantly share code, notes, and snippets.

@maximmi
Created June 3, 2019 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximmi/6891e3714c4be035ebad32705a1e4c6b to your computer and use it in GitHub Desktop.
Save maximmi/6891e3714c4be035ebad32705a1e4c6b to your computer and use it in GitHub Desktop.
Access to AWS ECS Atlantis container
...
workflows:
make:
plan:
steps:
- run: '$DIR/run-tmate.sh'
# - run: "make reset deps"
# - run: "set -o pipefail; make plan | tfmask | scenery --no-color"
apply:
steps:
- run: "set -o pipefail; make apply | tfmask"
...
#!/bin/bash
tmate -S /tmp/tmate.sock new-session -d
tmate -S /tmp/tmate.sock wait tmate-ready
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
tmate -S /tmp/tmate.sock display -p '#{tmate_web}'
@maximmi
Copy link
Author

maximmi commented Jun 3, 2019

  • make a separate branch/PR for tmate (we might include tmate into base geodesic at some point, so we can avoid first three steps)
  • add this to Dockerfile RUN apk add tmate@testing
  • make a git release with this changes (wait a moment, so ECS will use it, should be new version of task definition)
  • Then go back to your working branch, place run-tmate.sh to your module folder, for example conf/vpc/
  • then do atlantis plan -p vpc or it can go automatically
  • wait for response from atlantis and use ssh or web endpoints to connect to container

NOTE: might fail to run again, because of sock already in use (just remove run: '$DIR/run-tmate.sh' from Atlantis)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment