#atlantis - October 2019

atlantisArchived
42 messages

Discuss the Atlantis (runatlantis.io)
Archive: https://archive.sweetops.com/atlantis/

October 2019
joshmyers
joshmyersabout 7 years ago
What was the thing that was like Atlantis, but not?
joshmyers
joshmyersabout 7 years ago
Can't find it in the archives
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
yea, i know what you mean.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
it had a horrible name
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
erik
erikabout 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
@joshmyers ☝️
joshmyers
joshmyersabout 7 years ago
Awesome, thanks @Erik Osterman (Cloud Posse)
joshmyers
joshmyersabout 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
Oh... thought it was
oscar
oscarabout 7 years ago
Am I right in saying the Atlantis workflow is to deploy before the code is merged? Isn’t that a bit sketchy?
Igor
Igorabout 7 years ago
@oscar You can require the PR to be approved before changes can be applied, and I believe you can also adjust a setting to have Atlantis merge the code when planning/applying (locally on its side).
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
we open a PR and request reviews, atlantis runs plan automatically, the author and the reviewers review the plan, the reviewers approve the PR, we run atlantis apply, if everything is ok, merge to master
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
we want the master to reflect what is deployed, so we merge to master only if everything is ok
oscar
oscarabout 7 years ago
Thanks guys.
So really the workflow isnt to actually comment Atlantis apply until it has been merged?
Is there a way to enforce this?
oscar
oscarabout 7 years ago
So that someone cant comment and trigger the apply of the plan before merge etc
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
Yes Atlantis uses a planfile so even if you tried to apply before plan it would fail
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
With Atlantis you run apply before merge
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
I think there is also an option to auto merge on apply
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
So if apply fails it doesn’t merge
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
when you deploy atlantis, you provide a global atlantis-repo-config.yaml
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
where you can specify what users in the repo that atlantis provisions can do
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
# allowed_overrides specifies which keys can be overridden by this repo in
    # its atlantis.yaml file
    allowed_overrides: [apply_requirements, workflow]

    # allow_custom_workflows defines whether this repo can define its own
    # workflows. If false (default), the repo can only use server-side defined workflows
    allow_custom_workflows: true
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago(edited)
(sure if atlantis-repo-config.yaml is in the same repo (as we have in testing), it does not solve the issue. But if the atlantis repo is different from the repo it operates on, then you can safely restrict)
Andrew Jeffree
Andrew Jeffreeabout 7 years ago
You can also configure branch protection if you're using GitHub to ensure that the atlantis/plan and apply checks have passed before it'll allow someone to merge things.
Brij S
Brij Sabout 7 years ago
Hey all, Im considering using atlantis but I've got a few questions(coming from a TFE environment triggered by jenkins).
1. How can you differentiate workspaces and credentials? For example, if I commit some changes to git, the terraform plan runs. How can I make the terraform plan and apply against a 'dev aws environment' and then have the terraform applied to a prod aws env? How would atlantis differentiate workspaces/secrets?
Brij S
Brij Sabout 7 years ago
Id like to use a single repo for all modules/configurations but im a bit hazy on how that would look, for example

git-repo/
  module1/
  module2/

where would I store configurations for awsdev and awsprod accounts which call those modules? In seperate folders?
Brij S
Brij Sabout 7 years ago
basically, im not sure how to setup atlantis/git for a multi-environment configuration
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
we deploy atlantis on ECS in each account (staging, prod, testing) https://github.com/cloudposse/terraform-aws-ecs-atlantis
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
we have a catalog of common modules which we use in all environments https://github.com/cloudposse/terraform-root-modules/tree/master/aws
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
in each particular environment, e.g. https://github.com/cloudposse/testing.cloudposse.co, we specify what the atlantis deployed in testing could do https://github.com/cloudposse/testing.cloudposse.co/blob/master/atlantis.yaml
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
so we open a PR, for example in staging, run atlantis plan, review and approve the PR, run atlantis apply and then merge the PR to master at <http://staging.cloudposse.co|staging.cloudposse.co>
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
then do the same for <http://prod.cloudposse.co|prod.cloudposse.co>
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago(edited)
all secrets we store in SSM param store, and then atlantis in each environment reads it from SSM using chamber https://github.com/cloudposse/geodesic/blob/master/rootfs/etc/init.d/atlantis.sh#L44
Brij S
Brij Sabout 7 years ago
when you say in staging you mean staging branch?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
we have separate repos for each account
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
Brij S
Brij Sabout 7 years ago
oh so you have all your modules in a repo, then a repo for staging, prod etc?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
but just provide settings related to the environment
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
so we separate code (logic) from settings/secrets