+ In April 2024, the Core Atlantis Team launched an anonymous survey to better understand our community's needs and help prioritize our roadmap, see the results here!
+
+
+ Exciting news! The Atlantis project is now in the CNCF TOC voteâshow your support and cast your vote here.
+
Bring the benefits of code review to your operations
- workflow.
-
-
Catch errors in
- the Terraform plan output before it's applied.
-
-
Ensure that you
- apply changes before merging to main.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Put the Dev back into DevOps
-
Empower your developers to write Terraform. Safely.
-
-
Developers can
- submit Terraform pull requests without needing credentials.
-
-
Operators can
- require approvals prior to allowing an apply.
-
-
-
-
-
-
-
-
-
-
-
Instant Audit Logs And Compliance
-
Pass audits without compromising your workflow.
-
-
Each pull request now holds a detailed log of what infrastructure changes were made and when; along with who made the change and who approved it.
-
-
Atlantis can be configured to require approvals on every production change.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Proven at Scale
-
-
-
-
-
-
-
-
-
-
Used by one of the world's top companies to manage over 600 Terraform repos with 300 developers.
-
-
In production use since 2017.
-
-
-
-
-
-
-
-
-
-
How It Works
-
-
-
-
-
Atlantis is
- self-hosted. Your credentials don't leave your infrastructure.
-
-
Runs as a Golang
- binary or Docker image and can be deployed on VMs, Kubernetes,
- Fargate, etc.
-
-
Listens for
- webhooks from GitHub/GitLab/Bitbucket/Azure DevOps.
-
-
Runs terraform
- commands remotely and comments back with their output.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/runatlantis.io/.vuepress/theme/index.js b/runatlantis.io/.vuepress/theme/index.js
deleted file mode 100644
index 85ad504429..0000000000
--- a/runatlantis.io/.vuepress/theme/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// introduce custom home with navbar
-// https://stackoverflow.com/a/60220684
-// https://vuepress.vuejs.org/theme/inheritance.html#usage
-module.exports = {
- extend: '@vuepress/theme-default'
-}
diff --git a/runatlantis.io/README.md b/runatlantis.io/README.md
deleted file mode 100644
index 5772c9faf7..0000000000
--- a/runatlantis.io/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-home: true
-pageClass: home-custom
-heroImage: /hero.png
-heroText: Atlantis
-actionText: Get Started â
-actionLink: /guide/
-title: Terraform Pull Request Automation
----
diff --git a/runatlantis.io/blog.md b/runatlantis.io/blog.md
new file mode 100644
index 0000000000..6ad783293c
--- /dev/null
+++ b/runatlantis.io/blog.md
@@ -0,0 +1,28 @@
+---
+title: Welcome to Our Blog
+aside: false
+---
+
+# Welcome to Our Blog
+
+We are thrilled to have you here! Our blog is a collection of insightful articles, tips, and updates from our team. Whether you're new or have been following us for a while, there's always something new to learn and explore.
+
+### Explore Our Popular Posts
+
+We have a rich history of blog posts dating back to 2017-2019. Here are some of our popular posts:
+
+- [4 Reasons To Try HashiCorp's (New) Free Terraform Remote State Storage](/blog/2019/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage)
+- [I'm Joining HashiCorp!](/blog/2018/joining-hashicorp)
+- [Putting The Dev Into DevOps: Why Your Developers Should Write Terraform Too](/blog/2018/putting-the-dev-into-devops-why-your-developers-should-write-terraform-too)
+- [Atlantis 0.4.4 Now Supports Bitbucket](/blog/2018/atlantis-0-4-4-now-supports-bitbucket)
+- [Terraform And The Dangers Of Applying Locally](/blog/2018/terraform-and-the-dangers-of-applying-locally)
+- [Hosting Our Static Site over SSL with S3, ACM, CloudFront and Terraform](/blog/2018/hosting-our-static-site-over-ssl-with-s3-acm-cloudfront-and-terraform)
+- [Introducing Atlantis](/blog/2017/introducing-atlantis)
+
+### Welcoming New Blog Authors
+
+We are excited to welcome new authors to our blog. Our diverse team brings a wealth of knowledge and experience to share with our readers. Stay tuned for fresh perspectives and in-depth articles on the latest trends and technologies.
+
+If you have any questions or topics you would like us to cover, feel free to reach out [on Slack](https://join.slack.com/t/atlantis-community/shared_invite/zt-9xlxtxtc-CUSKB1ATt_sQy6um~LDPNw). We are always looking to engage with our community and provide valuable content.
+
+Happy reading!
diff --git a/runatlantis.io/blog/2017/introducing-atlantis.md b/runatlantis.io/blog/2017/introducing-atlantis.md
new file mode 100644
index 0000000000..2957d994e7
--- /dev/null
+++ b/runatlantis.io/blog/2017/introducing-atlantis.md
@@ -0,0 +1,113 @@
+---
+title: Introducing Atlantis
+lang: en-US
+---
+
+# Introducing Atlantis
+
+::: info
+This post was originally written on September 11th, 2017
+
+Original post:
+:::
+
+We're very excited to announce the open source release of Atlantis! Atlantis is a tool for
+collaborating on Terraform that's been in use at Hootsuite for over a year. The core
+functionality of Atlantis enables developers and operators to run `terraform plan` and
+`apply` directly from Terraform pull requests. Atlantis then comments back on the pull
+request with the output of the commands:
+
+![](/blog/intro/intro1.gif)
+
+This is a simple feature, however it has had a massive effect on how our team writes Terraform.
+By bringing a Terraform workflow to pull requests, Atlantis helped our Ops team collaborate
+better on Terraform and also enabled our entire development team to write and execute Terraform safely.
+
+Atlantis was built to solve two problems that arose at Hootsuite as we adopted Terraform:
+
+### 1. Effective Collaboration
+
+What's the best way to collaborate on Terraform in a team setting?
+
+### 2. Developers Writing Terraform
+
+How can we enable our developers to write and apply Terraform safely?
+
+## Effective Collaboration
+
+When writing Terraform, there are a number of workflows you can follow. The simplest workflow is just using `master`:
+
+![](/blog/intro/intro2.webp)
+
+In this workflow, you work on `master` and run `terraform` locally.
+The problem with this workflow is that there is no collaboration or code review.
+So we start to use pull requests:
+
+![](/blog/intro/intro3.webp)
+
+We still run `terraform plan` locally, but once we're satisfied with the changes we create a pull request for review. When the pull request is approved, we run `apply` locally.
+
+This workflow is an improvement, but there are still problems. The first problem is that it's hard to review just the diff on the pull request. To properly review a change, you really need to see the output from `terraform plan`.
+
+![](/blog/intro/intro4.webp)
+
+What looks like a small change...
+
+![](/blog/intro/intro5.webp)
+
+...can have a big plan
+
+The second problem is that now it's easy for `master` to get out of sync with what's actually been applied. This can happen if you merge a pull request without running `apply` or if the `apply` has an error halfway through, you forget to fix it and then you merge to `master`. Now what's in `master` isn't actually what's running on production. At best, this causes confusion the next time someone runs `terraform plan`. At worst, it causes an outage when someone assumes that what's in `master` is actually running, and depends on it.
+
+With the Atlantis workflow, these problems are solved:
+
+![](/blog/intro/intro6.webp)
+
+Now it's easy to review changes because you see the `terraform plan` output on the pull request.
+
+![](/blog/intro/intro7.webp)
+
+Pull requests are easy to review since you can see the plan
+
+It's also easy to ensure that the pull request is `terraform apply`'d before merging to master because you can see the actual `apply` output on the pull request.
+
+![](/blog/intro/intro8.webp)
+
+So, Atlantis makes working on Terraform within an operations team much easier, but how does it help with getting your whole team to write Terraform?
+
+## Developers Writing Terraform
+
+Terraform usually starts out being used by the Ops team. As a result of using Terraform, the Ops team becomes much faster at making infrastructure changes, but the way developers request those changes remains the same: they use a ticketing system or chat to ask operations for help, the request goes into a queue and later Ops responds that the task is complete.
+
+Soon however, the Ops team starts to realize that it's possible for developers to make some of these Terraform changes themselves! There are some problems that arise though:
+
+- Developers don't have the credentials to actually run Terraform commands
+- If you give them credentials, it's hard to review what is actually being applied
+
+With Atlantis, these problems are solved. All `terraform plan` and `apply` commands are run from the pull request. This means developers don't need to have any credentials to run Terraform locally. Of course, this can be dangerous: how can you ensure developers (who might be new to Terraform) aren't applying things they shouldn't? The answer is code reviews and approvals.
+
+Since Atlantis comments back with the `plan` output directly on the pull request, it's easy for an operations engineer to review exactly what changes will be applied. And Atlantis can run in `require-approval` mode, that will require a GitHub pull request approval before allowing `apply` to be run:
+
+![](/blog/intro/intro9.webp)
+
+With Atlantis, developers are able to write and apply Terraform safely. They submit pull requests, can run `atlantis plan` until their change looks good and then get approval from Ops to `apply`.
+
+Since the introduction of Atlantis at Hootsuite, we've had **78** contributors to our Terraform repositories, **58** of whom are developers (**75%**).
+
+## Where we are now
+
+Since the introduction of Atlantis at Hootsuite we've grown to 144 Terraform repositories [^1] that manage thousands of Amazon resources. Atlantis is used for every single Terraform change throughout our organization.
+
+## Getting started with Atlantis
+
+If you'd like to try out Atlantis for your team you can download the latest release from . If you run `atlantis testdrive` you can get started in less than 5 minutes. To read more about Atlantis go to .
+
+Check out our video for more information:
+
+
+
+[^1]: We split our Terraform up into multiple states, each with its own repository (see [1], [2], [3]).
+
+[1]: https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa
+[2]: https://charity.wtf/2016/03/30/terraform-vpc-and-why-you-want-a-tfstate-file-per-env/
+[3]: https://www.nclouds.com/blog/terraform-multi-state-management/
diff --git a/runatlantis.io/blog/2018/atlantis-0-4-4-now-supports-bitbucket.md b/runatlantis.io/blog/2018/atlantis-0-4-4-now-supports-bitbucket.md
new file mode 100644
index 0000000000..ce6e39f0cb
--- /dev/null
+++ b/runatlantis.io/blog/2018/atlantis-0-4-4-now-supports-bitbucket.md
@@ -0,0 +1,102 @@
+---
+title: Atlantis 0.4.4 Now Supports Bitbucket
+lang: en-US
+---
+
+# Atlantis 0.4.4 Now Supports Bitbucket
+
+::: info
+This post was originally written on July 25th, 2018
+
+Original post:
+:::
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic1.webp)
+
+Atlantis is an [open source](https://github.com/runatlantis/atlantis) platform for using Terraform in teams. I'm happy to announce that the [latest release](https://github.com/runatlantis/atlantis/releases) of Atlantis (0.4.4) now supports both Bitbucket Cloud (bitbucket.org) **and** Bitbucket Server (aka Stash).
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic2.gif)
+
+Atlantis now supports the three major Git hosts: GitHub, GitLab and Bitbucket. The rest of this post will talk about how to use Atlantis with Bitbucket.
+
+## What is Atlantis?
+
+Atlantis is a self-hosted application that listens for Terraform pull request events via webhooks. It runs `terraform plan` and `apply` remotely and comments back on the pull request with the output.
+
+With Atlantis, you collaborate on the Terraform pull request itself instead of running `terraform apply` from your own computers which can be dangerous:
+
+Check out for more information.
+
+## Getting Started
+
+The easiest way to try out Atlantis with Bitbucket is to run Atlantis locally on your own computer. Eventually you'll want to deploy it as a standalone app but this is the easiest way to try it out. Follow [these instructions](https://www.runatlantis.io/guide/getting-started.html) to get Atlantis running locally.
+
+Create a Pull Request
+If you've got the Atlantis webhook configured for your repository and Atlantis is running, it's time to create a new pull request. I recommend adding a `null_resource` to one of your Terraform files for the the test pull request. It won't actually create anything so it's safe to use as a test.
+
+Using the web editor, open up one of your Terraform files and add:
+
+```tf
+resource "null_resource" "example" {}
+```
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic3.webp)
+
+Click Commit and select **Create a pull request for this change**.
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic4.webp)
+
+Wait a few seconds and then refresh. Atlantis should have automatically run `terraform plan` and commented back on the pull request:
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic5.webp)
+
+Now it's easier for your colleagues to review the pull request because they can see the `terraform plan` output.
+
+### Terraform Apply
+
+Since all we're doing is adding a null resource, I think it's safe to run `terraform apply`. To do so, I add a comment to the pull request: `atlantis apply`:
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic6.webp)
+
+Atlantis is listening for pull request comments and will run `terraform apply` remotely and comment back with the output:
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic7.webp)
+
+### Pull Request Approvals
+
+If you don't want anyone to be able to `terraform apply`, you can run Atlantis with `--require-approval` or add that setting to your [atlantis.yaml file](https://www.runatlantis.io/docs/command-requirements.html#approved).
+
+This will ensure that the pull request has been approved before someone can run `apply`.
+
+## Other Features
+
+### Customizable Commands
+
+Apart from being able to `plan` and `apply` from the pull request, Atlantis also enables you to customize the exact commands that are run via an `atlantis.yaml` config file. For example to use the `-var-file` flag:
+
+```yaml{14}
+# atlantis.yaml
+version: 2
+projects:
+- name: staging
+ dir: "."
+ workflow: staging
+
+workflows:
+ staging:
+ plan:
+ steps:
+ - init
+ - plan:
+ extra_args: ["-var-file", "staging.tfvars"]
+```
+
+### Locking For Coordination
+
+![](/blog/atlantis-0-4-4-now-supports-bitbucket/pic8.webp)
+
+Atlantis will prevent other pull requests from running against the same directory as an open pull request so that each plan is applied atomically. Once the first pull request is merged, other pull requests are unlocked.
+
+## Next Steps
+
+If you're interested in using Atlantis with Bitbucket, check out our Getting Started docs. Happy Terraforming!
diff --git a/runatlantis.io/blog/2018/hosting-our-static-site-over-ssl-with-s3-acm-cloudfront-and-terraform.md b/runatlantis.io/blog/2018/hosting-our-static-site-over-ssl-with-s3-acm-cloudfront-and-terraform.md
new file mode 100644
index 0000000000..a9506073f3
--- /dev/null
+++ b/runatlantis.io/blog/2018/hosting-our-static-site-over-ssl-with-s3-acm-cloudfront-and-terraform.md
@@ -0,0 +1,174 @@
+---
+title: Hosting Our Static Site over SSL with S3, ACM, CloudFront and Terraform
+lang: en-US
+---
+
+# Hosting Our Static Site over SSL with S3, ACM, CloudFront and Terraform
+
+::: info
+This post was originally written on March 4, 2018
+
+Original post:
+:::
+
+In this post I cover how I hosted using
+
+- S3 â for storing the static site
+- CloudFront â for serving the static site over SSL
+- AWS Certificate Manager â for generating the SSL certificates
+- Route53 â for routing the domain name to the correct location
+
+I chose Terraform in this case because Atlantis is a tool for automating and collaborating on Terraform in a team (see github.com/runatlantis/atlantis)âand so obviously it made sense to host our homepage using Terraformâbut also because it's now much easier to manage. I don't have to go into the AWS console and click around to find what settings I want to change. Instead I can just look at ~100 lines of code, make a change, and run `terraform apply`.
+
+::: info
+NOTE: 4 months after this writing, I moved the site to [Netlify](https://www.netlify.com/) because it automatically builds from my master branch on any change, updates faster since I don't need to wait for the Cloudfront cache to expire and gives me [deploy previews](https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/) of changes. The DNS records are still hosted on AWS.
+:::
+
+# Overview
+
+There's a surprising number of components required to get all this working so I'm going to start with an overview of what they're all needed for. Here's what the final architecture looks like:
+
+![](/blog/hosting-our-static-site/pic1.webp)
+
+That's what the final product looks like, but lets start with the steps required to get there.
+
+## Step 1 â Generate The Site
+
+The first step is to have a site generated. Our site uses [Hugo](https://gohugo.io/), a Golang site generator. Once it's set up, you just need to run `hugo` and it will generate a directory with HTML and all your content ready to host.
+
+## Step 2 â Host The Content
+
+Once you've got a website, you need it to be accessible on the internet. I used S3 for this because it's dirt cheap and it integrates well with all the other necessary components. I simply upload my website folder to the S3 bucket.
+
+## Step 3 â Generate an SSL Certificate
+
+I needed to generate an SSL certificate for . I used the AWS Certificate Manager for this because it's free and is easily integrated with the rest of the system.
+
+## Step 4 â Set up DNS
+
+Because I'm going to host the site on AWS services, I need requests to to be routed to those services. Route53 is the obvious solution.
+
+## Step 5 â Host with CloudFront
+
+At this point, we've generated an SSL certificate for and our website is available on the internet via its S3 url so can't we just CNAME to the S3 bucket and call it a day? Unfortunately not.
+
+Since we generated our own certificate, we would need S3 to sign its responses using our certificiate. S3 doesn't support this and thus we need CloudFront. CloudFront supports using our own SSL cert and will just pull its data from the S3 bucket.
+
+# Terraform Time
+
+Now that we know what our architecture should look like, it's simply a matter of writing the Terraform.
+
+## Initial Setup
+
+Create a new file `main.tf`:
+
+<<< @/public/blog/hosting-our-static-site/code/main.tf
+
+## S3 Bucket
+
+Assuming we've generated our site content already, we need to create an S3 bucket to host the content.
+
+<<< @/public/blog/hosting-our-static-site/code/s3-bucket.tf
+
+We should be able to run Terraform now to create the S3 bucket
+
+```sh
+terraform init
+`terraform apply`
+```
+
+![](/blog/hosting-our-static-site/pic2.webp)
+
+Now we want to upload our content to the S3 bucket:
+
+```sh
+$ cd dir/with/website
+# generate the HTML
+$ hugo -d generated
+$ cd generated
+# send it to our S3 bucket
+$ aws s3 sync . s3://www.runatlantis.io/ # change this to your bucket
+```
+
+Now we need the S3 url to see our content:
+
+```sh
+$ terraform state show aws_s3_bucket.www | grep website_endpoint
+website_endpoint = www.runatlantis.io.s3-website-us-east-1.amazonaws.com
+```
+
+You should see your site hosted at that url!
+
+## SSL Certificate
+
+Let's use the AWS Certificate Manager to create our SSL certificate.
+
+<<< @/public/blog/hosting-our-static-site/code/ssl-cert.tf
+
+Before you run `terraform apply`, ensure you're forwarding any of
+
+- `administrator@your_domain_name`
+- `hostmaster@your_domain_name`
+- `postmaster@your_domain_name`
+- `webmaster@your_domain_name`
+- `admin@your_domain_name`
+
+To an email address you can access. Then, run `terraform apply` and you should get an email from AWS to confirm you own this domain where you'll need to click on the link.
+
+## CloudFront
+
+Now we're ready for CloudFront to host our website using the S3 bucket for the content and using our SSL certificate. Warning! There's a lot of code ahead but most of it is just defaults.
+
+<<< @/public/blog/hosting-our-static-site/code/cloudfront.tf
+
+Apply the changes with `terraform apply` and then find the domain name that CloudFront gives us:
+
+```sh
+$ terraform state show aws_cloudfront_distribution.www_distribution | grep ^domain_name
+domain_name = d1l8j8yicxhafq.cloudfront.net
+```
+
+You'll probably get an error if you go to that URL right away. You need to wait a couple minutes for CloudFront to set itself up. It took me 10 minutes. You can view its progress in the console:
+
+## DNS
+
+We're almost done! We've got CloudFront hosting our site, now we need to point our DNS at it.
+
+<<< @/public/blog/hosting-our-static-site/code/dns.tf
+
+If you bought your domain from somewhere else like Namecheap, you'll need to point your DNS at the nameservers listed in the state for the Route53 zone you created. First `terraform apply` (which may take a while), then find out your nameservers.
+
+```sh
+$ terraform state show aws_route53_zone.zone
+id = Z2FNAJGFW912JG
+comment = Managed by Terraform
+force_destroy = false
+name = runatlantis.io
+name_servers.# = 4
+name_servers.0 = ns-1349.awsdns-40.org
+name_servers.1 = ns-1604.awsdns-08.co.uk
+name_servers.2 = ns-412.awsdns-51.com
+name_servers.3 = ns-938.awsdns-53.net
+tags.% = 0
+zone_id = Z2FNAJGFW912JG
+```
+
+Then look at your domain's docs for how to change your nameservers to all 4 listed.
+
+## That's it...?
+
+Once the DNS propagates you should see your site at `https://www.yourdomain`! But what about `https://yourdomain`? i.e. without the `www.`? Shouldn't this redirect to `https://www.yourdomain`?
+
+## Root Domain
+
+It turns out, we need to create a whole new S3 bucket, CloudFront distribution and Route53 record just to get this to happen. That's because although S3 can serve up a redirect to the www version of your site, it can't host SSL certs and so you need CloudFront. I've included all the terraform necessary for that below.
+
+Congrats! You're done!
+
+
+
+If you're using Terraform in a team, check out Atlantis: for automation and collaboration to make your team happier!
+
+Here's the Terraform needed to redirect your root domain:
+
+<<< @/public/blog/hosting-our-static-site/code/full.tf
diff --git a/runatlantis.io/blog/2018/joining-hashicorp.md b/runatlantis.io/blog/2018/joining-hashicorp.md
new file mode 100644
index 0000000000..69ab04cda8
--- /dev/null
+++ b/runatlantis.io/blog/2018/joining-hashicorp.md
@@ -0,0 +1,50 @@
+---
+title: I'm Joining HashiCorp!
+lang: en-US
+---
+
+# I'm Joining HashiCorp
+
+::: info
+This post was originally written on October 23th, 2018
+
+Original post:
+:::
+
+Dear Atlantis Community,
+
+My name is Luke and I'm the maintainer of [Atlantis](https://www.runatlantis.io/), an open source tool for Terraform collaboration. Today I'm excited to announce that I'm joining HashiCorp!
+
+![](/blog/joining-hashicorp/pic1.webp)
+
+## What Does This Mean For Atlantis?
+
+In the near term, nothing will change for Atlantis and its users. As a HashiCorp employee I will continue to maintain Atlantis, review pull requests, triage issues, and write code.
+
+In the long term, HashiCorp and I want to address collaboration workflows for all users of Terraform. We are still working out the details of how Atlantis will fit into the longer term plan, but whatever direction we take, we're committed to keeping Atlantis free and open source.
+
+## HashiCorp and Atlantis
+
+Why does HashiCorp want to support Atlantis?
+
+Today HashiCorp [announced their commitment to provide collaboration solutions to the whole Terraform community](https://www.hashicorp.com/blog/terraform-collaboration-for-everyone). They see the Atlantis project as one manifestation of this vision and understand its importance to many in the Terraform community. They believe that by working together, we can create a solution that will scale from a single user to hundreds of collaborators in a large organization.
+
+## Why am I joining?
+
+Those of you who know me, may wonder why I made this decision. It came down to wanting to continue working on Atlantisâand the larger story of Terraform collaborationâand finding a way to support myself.
+
+In January, 9 months ago, I quit my job at Hootsuite to work **full time** on Atlantis (Atlantis was originally created at Hootsuite by my friend [Anubhav Mishra](https://twitter.com/anubhavm)). I left because I knew that the Terraform community was in need of a solution for collaboration and that with full time development, Atlantis could be that solution.
+
+During the last 9 months, Atlantis matured into a fully fledged collaboration solution and gained many new users. It has been an amazing time, but I've been working for free! I've always known that for Atlantis to be successful in the long term, I would need to find a way to support myself.
+
+A couple of weeks ago, as I was playing around with Atlantis monetization strategies, HashiCorp contacted me. I learned that they shared a vision of building Terraform collaboration solutions for the broader community and that they were interested in combining forces. They also assured me that they wanted to do right by the Atlantis community.
+
+This was a compelling offer versus solo-founding a company around Atlantis: I would be able to focus on coding and product instead of business and sales and I could spend all of my time on Atlantis and the larger story of Terraform collaboration. As a result, I came to the conclusion that joining HashiCorp was the right decision for me and the community.
+
+## Conclusion
+
+Atlantis has been a passion of mine for almost two years now. I deeply care about the future of the project and its community and I know that this move will ensure that that future is bright.
+
+There are probably some questions I haven't answered in this post so please don't hesitate to reach out, either via [Twitter](https://twitter.com/lkysow) or on the [Atlantis Slack](https://join.slack.com/t/atlantis-community/shared_invite/zt-9xlxtxtc-CUSKB1ATt_sQy6um~LDPNw).
+
+I'm excited for the future of Atlantis and Terraform collaboration and I hope you are too.
diff --git a/runatlantis.io/blog/2018/putting-the-dev-into-devops-why-your-developers-should-write-terraform-too.md b/runatlantis.io/blog/2018/putting-the-dev-into-devops-why-your-developers-should-write-terraform-too.md
new file mode 100644
index 0000000000..88b28a1b16
--- /dev/null
+++ b/runatlantis.io/blog/2018/putting-the-dev-into-devops-why-your-developers-should-write-terraform-too.md
@@ -0,0 +1,244 @@
+---
+title: "Putting The Dev Into DevOps: Why Your Developers Should Write Terraform Too"
+lang: en-US
+---
+
+# Putting The Dev Into DevOps: Why Your Developers Should Write Terraform Too
+
+::: info
+This post was originally written on August 29th, 2018
+
+Original post:
+:::
+
+[Terraform](https://www.terraform.io/) is an amazing tool for provisioning infrastructure. Terraform enables your operators to perform their work faster and more reliably.
+
+**But if only your ops team is writing Terraform, you're missing out.**
+
+Terraform is not just a tool that makes ops teams more effective. Adopting Terraform is an opportunity to turn all of your developers into operators (at least for smaller tasks). This can make your entire engineering team more effective and create a better relationship between developers and operators.
+
+### Quick Aside â What is Terraform?
+
+Terraform is two things. It's a language for describing infrastructure:
+
+```tf
+resource "aws_instance" "example" {
+ ami = "ami-2757f631"
+ instance_type = "t2.micro"
+}
+```
+
+And it's a CLI tool that reads Terraform code and makes API calls to AWS (or any other cloud provider) to provision that infrastructure.
+
+In this example, we're using the CLI to run `terraform apply` which will create an EC2 instance:
+
+```sh
+$ terraform apply
+
+Terraform will perform the following actions:
+
+ # aws_instance.example
+ + aws_instance.example
+ ami: "ami-2757f631"
+ instance_type: "t2.micro"
+ ...
+
+Plan: 1 to add, 0 to change, 0 to destroy.
+
+Do you want to perform these actions?
+ Terraform will perform the actions described above.
+ Only 'yes' will be accepted to approve.
+
+ Enter a value: yes
+
+aws_instance.example: Creating...
+ ami: "" => "ami-2757f631"
+ instance_type: "" => "t2.micro"
+ ...
+
+aws_instance.example: Still creating... (10s elapsed)
+aws_instance.example: Creation complete
+
+Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
+```
+
+## Terraform Adoption From A Dev's Perspective
+
+Adopting Terraform is great for your operations team's effectiveness but it doesn't change much for devs. Before Terraform adoption, devs typically interacted with an ops team like this:
+
+![](/blog/putting-the-dev-into-devops/pic1.webp)
+
+1. **Dev: Creates ticket asking for some ops work**
+2. **Dev: Waits**
+3. _Ops: Looks at ticket when in queue_
+4. _Ops: Does work_
+5. _Ops: Updates ticket_
+6. **Dev: Continues their work**
+
+After the Ops team adopts Terraform, the workflow from a dev's perspective is the same!
+
+![](/blog/putting-the-dev-into-devops/pic2.webp)
+
+1. **Dev: Creates ticket asking for some ops work**
+2. **Dev: Waits**
+3. _Ops: Looks at ticket when in queue_
+4. _Ops: Does work. This time using Terraform (TF)_
+5. _Ops: Updates ticket_
+6. **Dev: Continues their work**
+
+With Terraform, there's less of Step 2 (Dev: Waits) but apart from that, not much has changed.
+
+> If only ops is writing Terraform, your developers' experience is the same.
+
+## Devs Want To Help
+
+Developers would love to help out with operations work. They know that for small changes they should be able to do the work themselves (with a review from ops). For example:
+
+- Adding a new security group rule
+- Increasing the size of an autoscaling group
+- Using a larger instance because their app needs more memory
+
+Developers could make all of these changes because they're small and well defined. Also, previous examples of doing the same thing can guide them.
+
+## ...But Often They're Not Allowed
+
+In many organizations, devs are locked out of the cloud console.
+
+![](/blog/putting-the-dev-into-devops/pic3.webp)
+
+They might be locked out for good reasons:
+
+- Security â You can do a lot of damage with full access to a cloud console
+- Compliance â Maybe your compliance requires only certain groups to have access
+- Cost â Devs might spin up some expensive resources and then forget about them
+
+Even if they have access, operations can be complicated:
+
+- It's often difficult to do seemingly simple things (think adding a security group rule that also requires peering VPCs). This means that just having access sometimes isn't enough. Devs might need help from an expert to get things done.
+
+## Enter Terraform
+
+With Terraform, everything changes. Or at least it can.
+
+Now Devs can see in code how infrastructure is built. They can see the exact spot where security group rules are configured:
+
+```tf
+resource "aws_security_group_rule" "allow_all" {
+ type = "ingress"
+ from_port = 0
+ to_port = 65535
+ protocol = "tcp"
+ cidr_blocks = ["0.0.0.0/0"]
+ security_group_id = "sg-123456"
+}
+
+resource "aws_security_group_rule" "allow_office" {
+ ...
+}
+```
+
+Or where the size of the autoscaling group is set:
+
+```tf
+resource "aws_autoscaling_group" "asg" {
+ name = "my-asg"
+ max_size = 5
+ desired_capacity = 4
+ min_size = 2
+ ...
+}
+```
+
+Devs understand code (surprise!) so it's a lot easier for them to make those small changes.
+
+Here's the new workflow:
+
+![](/blog/putting-the-dev-into-devops/pic4.webp)
+
+1. **Dev: Writes Terraform code**
+2. **Dev: Creates pull request**
+3. _Ops: Reviews pull request_
+4. **Dev: Applies the change with Terraform (TF)**
+5. **Dev: Continues their work**
+
+Now:
+
+- Devs are making small changes themselves. This saves time and increases the speed of the whole engineering organization.
+- Devs can see exactly what is required to make the change. This means there's less back and forth over a ticket: âOkay so I know you need the security group opened between server A and B, but on which ports and with which protocol?â
+- Devs start to see how infrastructure is built. This increases cooperation between dev and ops because they can understand each other's work.
+
+Great! But there's another problem.
+
+## Devs Are Locked Out Of Terraform Too
+
+In order to execute Terraform you need to have cloud credentials! It's really hard to write Terraform without being able to run `terraform init` and `terraform plan`, for the same reason it would be hard to write code if you could never run it locally!
+
+So are we back at square one?
+
+## Enter Atlantis
+
+[Atlantis](https://www.runatlantis.io/) is an [open source](https://github.com/runatlantis/atlantis) tool for running Terraform from pull requests. With Atlantis, Terraform is run on a separate server (Atlantis is self-hosted) so you don't need to give out credentials to everyone. Access is controlled through pull request approvals.
+
+Here's what the workflow looks like:
+
+### Step 1 â Create a Pull Request
+
+A developer creates a pull request with their change to add a security group rule.
+
+![](/blog/putting-the-dev-into-devops/pic5.webp)
+
+### Step 2 â Atlantis Runs Terraform Plan
+
+Atlantis automatically runs `terraform plan` and comments back on the pull request with the output. Now developers can fix their Terraform errors before asking for a review.
+
+![](/blog/putting-the-dev-into-devops/pic6.webp)
+
+### Step 3 â Fix The Terraform
+
+The developer pushes a new commit that fixes their error and Atlantis comments back with the valid `terraform plan` output. Now the developer can verify that the plan output looks good.
+
+![](/blog/putting-the-dev-into-devops/pic7.webp)
+
+### Step 4 â Get Approval
+
+You'll probably want to run Atlantis with the --require-approval flag that requires pull requests to be Approved before running atlantis apply.
+
+![](/blog/putting-the-dev-into-devops/pic8.webp)
+
+### Step 4a â Actually Get Approval
+
+An operator can now come along and review the changes and the output of `terraform plan`. This is much faster than doing the change themselves.
+
+![](/blog/putting-the-dev-into-devops/pic9.webp)
+
+### Step 5 â Apply
+
+To apply the changes, the developer or operator comments âatlantis applyâ.
+
+![](/blog/putting-the-dev-into-devops/pic10.webp)
+
+## Success
+
+Now we've got a workflow that makes everyone happy:
+
+- Devs can write Terraform and iterate on the pull request until the `terraform plan` looks good
+- Operators can review pull requests and approve the changes before they're applied
+
+Now developers can make small operations changes and learn more about how infrastructure is built. Everyone can work more effectively and with a shared understanding that enhances collaboration.
+
+## Does It Work In Practice?
+
+Atlantis has been used by my previous company, Hootsuite, for over 2 years. It's used daily by 20 operators but it's also used occasionally by over 60 developers!
+Another company uses Atlantis to manage 600+ Terraform repos collaborated on by over 300 developers and operators.
+
+## Next Steps
+
+- If you'd like to learn more about Terraform, check out HashiCorp's [Introduction to Terraform](https://developer.hashicorp.com/terraform/intro)
+- If you'd like to try out Atlantis, go to
+- If you have any questions, reach out to me on Twitter ([at]lkysow) or in the comments below.
+
+## Credits
+
+- Thanks to [Seth Vargo](https://medium.com/@sethvargo) for his talk [Version-Controlled Infrastructure with GitHub](https://www.youtube.com/watch?v=2TWqi7dLSro) that inspired a lot of this post.
+- Thanks to Isha for reading drafts of this post.
+- Icons in graphics from made by [Freepik](http://freepik.com/) from [Flaticon](https://www.flaticon.com/) and licensed by [CC 3.0](https://creativecommons.org/licenses/by/3.0/)
diff --git a/runatlantis.io/blog/2018/terraform-and-the-dangers-of-applying-locally.md b/runatlantis.io/blog/2018/terraform-and-the-dangers-of-applying-locally.md
new file mode 100644
index 0000000000..081d2f1154
--- /dev/null
+++ b/runatlantis.io/blog/2018/terraform-and-the-dangers-of-applying-locally.md
@@ -0,0 +1,120 @@
+---
+title: Terraform And The Dangers Of Applying Locally
+lang: en-US
+---
+
+# Terraform And The Dangers Of Applying Locally
+
+::: info
+This post was originally written on July 13th, 2018
+
+Original post:
+:::
+
+If you're using Terraform then at some point you've likely ran a `terraform apply` that reverted someone else's change!
+
+Here's how that tends to happen:
+
+## The Setup
+
+Say we have two developers: Alice and Bob. Alice needs to add a new security group rule. She checks out a new branch, adds her rule and creates a pull request:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic1.webp)
+
+When she runs `terraform plan` locally she sees what she expects.
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic2.webp)
+
+Meanwhile, Bob is working on an emergency fix. He checks out a new branch and adds a different security group rule called `emergency`:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic3.webp)
+
+And, because it's an emergency, he **immediately runs apply**:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic4.webp)
+
+Now back to Alice. She's just gotten approval on her pull request change and so she runs `terraform apply`:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic5.webp)
+
+Did you catch what happened? Did you notice that the `apply` deleted Bob's rule?
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic6.webp)
+
+In this example, it wasn't too hard to see. However if the plan is much longer, or if the change is less obvious then it can be easy to miss.
+
+## Possible Solutions
+
+There are some ways to avoid this:
+
+### Use terraform plan `-out`
+
+If Alice had run `terraform plan -out plan.tfplan` then when she ran `terraform apply plan.tfplan` she would see:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic7.webp)
+
+The problem with this solution is that few people run `terraform plan` anymore, much less `terraform plan -out`!
+
+
+
+It's easier to just run `terraform apply` and humans will take the easier path most of the time.
+
+### Wrap `terraform apply` to ensure up to date with `master`
+
+Another possible solution is to write a wrapper script that ensures our branch is up to date with `master`. But this doesn't solve the problem of Bob running `apply` locally and not yet merging to `master`. In this case, Alice's branch would have been up to date with `master` but not the latest apply'd state.
+
+### Be more disciplined
+
+What if everyone:
+
+- ALWAYS created a branch, got a pull request review, merged to `master` and then ran apply. And also everyone
+- ALWAYS checked to ensure their branch was rebased from `master`. And also everyone
+- ALWAYS carefully inspected the `terraform plan` output and made sure it was exactly what they expected
+
+...then we wouldn't have a problem!
+
+Unfortunately this is not a real solution. We're all human and we're all going to make mistakes. Relying on people to follow a complicated process 100% of the time is not a solution because it doesn't work.
+
+## Core Problem
+
+The core problem is that everyone is applying from their own workstations and it's up to them to ensure that they're up to date and that they keep `master` up to date. This is like developers deploying to production from their laptops.
+
+### What if, instead of applying locally, a remote system did the apply's?
+
+This is why we built [Atlantis](https://www.runatlantis.io/) â an open source project for Terraform automation by pull request. You could also accomplished this with your own CI system or with [Terraform Enterprise](https://www.hashicorp.com/products/terraform). Here's how Atlantis solves this issue:
+
+When Alice makes her change, she creates a pull request and Atlantis automatically runs `terraform plan` and comments on the pull request.
+
+When Bob makes his change, he creates a pull request and Atlantis automatically runs `terraform plan` and comments on the pull request.
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic8.webp)
+
+Atlantis also **locks the directory** to ensure that no one else can run `plan` or `apply` until Alice's plan has been intentionally deleted or she merges the pull request.
+
+If Bob creates a pull request for his emergency change he'd see this error:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic9.webp)
+
+Alice can then comment `atlantis apply` and Atlantis will run the apply itself:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic10.webp)
+
+Finally, she merges the pull request and unlocks Bob's branch:
+
+![](/blog/terraform-and-the-dangers-of-applying-locally/pic11.webp)
+
+### But what if Bob ran `apply` locally?
+
+In that case, Alice is still okay because when Atlantis ran `terraform plan` it used `-out`. If Alice tries to apply that plan, Terraform will give an error because the plan was generated against an old state.
+
+### Why does Atlantis run `apply` on the branch and not after a merge to `master`?
+
+We do this because `terraform apply` fails quite often, despite `terraform plan` succeeding. Usually it's because of a dependency issue between resources or because the cloud provider requires a certain format or a certain field to be set. Regardless, in practice we've found that `apply` fails a lot.
+
+By locking the directory, we're essentially ensuring that the branch being `apply`'d is `"master"` since no one else can modify that state. We then get the benefit of being able to iterate on the pull request and push small fixes until we're sure that the changeset is `apply`'d. If `apply` failed after merging to `master`, we'd have to open new pull requests over and over again. There is definitely a tradeoff here, however we believe it's the right tradeoff.
+
+## Conclusion
+
+In conclusion, running `terraform apply` when you're working with a team of operators can be dangerous. Look to solutions like your own CI, Atlantis or Terraform Enterprise to ensure you're always working off the latest code that was `apply`'d.
+
+If you'd like to try Atlantis, you can get started here:
diff --git a/runatlantis.io/blog/2019/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage.md b/runatlantis.io/blog/2019/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage.md
new file mode 100644
index 0000000000..07bfd8ccf9
--- /dev/null
+++ b/runatlantis.io/blog/2019/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage.md
@@ -0,0 +1,157 @@
+---
+title: 4 Reasons To Try HashiCorp's (New) Free Terraform Remote State Storage
+lang: en-US
+---
+
+# 4 Reasons To Try HashiCorp's (New) Free Terraform Remote State Storage
+
+::: info
+This post was originally written on April 2nd, 2019
+
+Original post:
+:::
+
+Update (May 20/19) â Free State Storage is now called Terraform Cloud and is out of Beta, meaning anyone can sign up!
+
+HashiCorp is planning to offer free Terraform Remote State Storage and they have a beta version available now. In this article, I talk about 4 reasons you should try it (Disclosure: I work at HashiCorp).
+
+> _Sign up for Terraform Cloud [here](https://goo.gl/X5t5EM)._
+
+## What is Terraform State?
+
+Before I get into why you should use the new remote state storage, let's talk about what exactly we mean by state in Terraform.
+
+Terraform uses _state_ to map your Terraform code to the real-world resources that it provisions. For example, if I have Terraform code to create an AWS EC2 instance:
+
+```tf
+resource "aws_instance" "web" {
+ ami = "ami-e6d9d68c"
+ instance_type = "t2.micro"
+}
+```
+
+When I run `terraform apply`, Terraform will make a âcreate EC2 instanceâ API call to AWS and AWS will return the unique ID of that instance (ex. `i-0ad17607e5ee026d0`). Terraform needs to record that ID somewhere so that later, it can make API calls to change or delete the instance.
+
+To store this information, Terraform uses a state file. For the above code, the state file will look something like:
+
+```json{4,7}
+{
+ ...
+ "resources": {
+ "aws_instance.web": {
+ "type": "aws_instance",
+ "primary": {
+ "id": "i-0ad17607e5ee026d0",
+ ...
+}
+```
+
+Here you can see that the resource `aws_instance.web` from our Terraform code is mapped to the instance ID `i-0ad17607e5ee026d0`.
+
+So if Terraform state is just a file, then what is remote state?
+
+## Remote State
+
+By default, Terraform writes its state file to your local filesystem. This is okay for personal projects, but once you start working with a team, things get messy. In a team, you need to make sure everyone has an up to date version of the state file **and** ensure that two people aren't making concurrent changes.
+
+Enter remote state! Remote state is just storing the state file remotely, rather than on your filesystem. With remote state, there's only one copy so Terraform can ensure you're always up to date. To prevent team members from modifying state at the same time, Terraform can lock the remote state.
+
+> Remote state is just storing the state file remotely, rather than on your filesystem.
+
+Alright, so remote state is great, but unfortunately setting it up can be a bit tricky. In AWS, you can store it in an S3 bucket, but you need to create the bucket, configure it properly, set up its permissions properly, create a DynamoDB table for locking and then ensure everyone has proper credentials to write to it. It's much the same story in the other clouds.
+
+As a result, setting up remote state can be an annoying stumbling block as teams adopt Terraform.
+
+This brings us to the first reason to try HashiCorp's Free Remote State Storage...
+
+## Reason #1 â Easy To Set Up
+
+Unlike other remote state solutions that require complicated setup to get right, setting up free remote state storage is easy.
+
+> Setting up HashiCorp's free remote state storage is easy
+
+Step 1 â Sign up for your [free Terraform Cloud](https://app.terraform.io/signup) account
+
+Step 2 â When you log in, you'll land on this page where you'll create your organization:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic1.webp)
+
+Step 3 â Next, go into User Settings and generate a token:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic2.webp)
+
+Step 4 â Take this token and create a local ~/.terraformrc file:
+
+```tf
+credentials "app.terraform.io" {
+ token = "mhVn15hHLylFvQ.atlasv1.jAH..."
+}
+```
+
+Step 5 â That's it! Now you're ready to store your state.
+
+In your Terraform project, add a `terraform` block:
+
+```tf{3,5}
+terraform {
+ backend "remote" {
+ organization = "my-org" # org name from step 2.
+ workspaces {
+ name = "my-app" # name for your app's state.
+ }
+ }
+}
+```
+
+Run `terraform init` and tada! Your state is now being stored in Terraform Enterprise. You can see the state in the UI:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic3.webp)
+
+Speaking of seeing state in a UI...
+
+## Reason #2 â Fully Featured State Viewer
+
+The second reason to try Terraform Cloud is its fully featured state viewer:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic4.webp)
+
+If you've ever messed up your Terraform state and needed to download an old version or wanted an audit log to know who changed what, then you'll love this feature.
+
+You can view the full state file at each point in time:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic5.webp)
+
+You can also see the diff of what changed:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic6.webp)
+
+Of course, you can find a way to get this information from some of the other state backends, but it's difficult. With HashiCorp's remote state storage, you get it for free.
+
+## Reason #3 â Manual Locking
+
+The third reason to try Terraform Cloud is the ability to manually lock your state.
+
+Ever been working on a piece of infrastructure and wanted to ensure that no one could make any changes to it at the same time?
+
+Terraform Cloud comes with the ability to lock and unlock states from the UI:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic7.webp)
+
+While the state is locked, `terraform` operations will receive an error:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic8.webp)
+
+This saves you a lot of these:
+
+![](/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic9.webp)
+
+## Reason #4 â Works With Atlantis
+
+The final reason to try out Terraform Cloud is that it works flawlessly with [Atlantis](https://www.runatlantis.io/)!
+
+Set a `ATLANTIS_TFE_TOKEN` environment variable to a TFE token and you're ready to go. Head over to to learn more.
+
+Conclusion
+I highly encourage you to try out the new free Remote State Storage backend. It's a compelling offering over other state backends thanks to its ease of set up, fully featured state viewer and locking capabilities.
+
+If you're not on the waitlist, sign up here: .
diff --git a/runatlantis.io/blog/2024/april-2024-survey-results.md b/runatlantis.io/blog/2024/april-2024-survey-results.md
new file mode 100644
index 0000000000..d4c92fa9df
--- /dev/null
+++ b/runatlantis.io/blog/2024/april-2024-survey-results.md
@@ -0,0 +1,56 @@
+---
+title: Atlantis User Survey Results
+lang: en-US
+---
+
+# Atlantis User Survey Results
+
+In April 2024, the Core Atlantis Team launched an anonymous survey of our users. Over the two months the survey was open we received 354 responses, which we will use to better understand our community's needs and help prioritize our roadmap.
+
+Overall, the results below show that we have a diverse set of enthusiastic users, and that though many are still the classic Atlantis setup (a handful of repos running terraform against AWS in GitHub), there are many different use cases and directions the community are going and would like to see Atlantis support.
+
+We are grateful for everyone who took the time to share their experiences with Atlantis. We plan to run this kind of survey on a semi-regular basis, stay tuned!
+
+## Anonymized Results
+
+### How do you interact with Atlantis?
+
+![](/blog/april-2024-survey-results/interact.webp)
+
+Unsurprisingly, most users of Atlantis wear multiple hats, involved throughout the development process.
+
+### How do you/your organization deploy Atlantis
+
+![](/blog/april-2024-survey-results/deploy.webp)
+
+Most users of terraform deploy using Kubernetes and/or AWS. "Other Docker" use docker but do not use EKS or Helm directly, while a minority use some other combination of technologies.
+
+### What Infrastructure as Code (IaC) tool(s) do you use with Atlantis?
+
+![](/blog/april-2024-survey-results/iac.webp)
+
+The vast majority of Atlantis users are still using terraform as some part of their deployment. About half of them are in addition using Terragrunt, and OpenTofu seems to be gaining some ground.
+
+### How many repositories does your Atlantis manage?
+
+![](/blog/april-2024-survey-results/repos.webp)
+
+Most users have relatively modest footprints to managed with Atlantis (though a few large monorepos could be obscured in the numbers).
+
+### Which Version Control Systems (VCSs) do you use?
+
+![](/blog/april-2024-survey-results/vcs.webp)
+
+Most users of Atlantis are using GitHub, with a sizeable chunk on GitLab, followed by Bitbucket and others. This is analogous to the support and feature requests that the maintainers see for the various VCSs in the codebase.
+
+### What is the most important feature you find missing from Atlantis?
+
+![](/blog/april-2024-survey-results/features.webp)
+
+This being a free form question, there was a long tail of responses, so the above only shows answers after normalizing that had three or more instances.
+
+Drift Detection as well as infrastructure improvements were the obvious winners here. After that, users focused on various integrations and improvements to the UI.
+
+## Conclusion
+
+It is always interesting and exciting for the core team to see the breadth of the use of Atlantis, and we look forward to using this information to understand the needs of the community. Atlantis has always been a community led effort, and we hope to continue to carry that spirit forward!
diff --git a/runatlantis.io/blog/2024/integrating-atlantis-with-opentofu.md b/runatlantis.io/blog/2024/integrating-atlantis-with-opentofu.md
new file mode 100644
index 0000000000..574017fb71
--- /dev/null
+++ b/runatlantis.io/blog/2024/integrating-atlantis-with-opentofu.md
@@ -0,0 +1,200 @@
+---
+title: Integrating Atlantis with Opentofu
+lang: en-US
+---
+
+# Integrating Atlantis with Opentofu
+
+::: info
+This post was originally written on May 27nd, 2024
+Original post:
+:::
+
+## What was our motivation?
+
+Due to the Terraform license change, many companies are migrating their IAC processes to OpenTofu, with this in mind and knowing that many of them use Atlantis and Terraform as infrastructure delivery automation, I created this documentation showing what to do to integrate Atlantis with OpenTofu.
+
+Stack: Atlantis, Terragrunt, OpenTofu, Github, ALB, EKS.
+
+We will implement it with your [Helm chart](https://www.runatlantis.io/docs/deployment.html#kubernetes-helm-chart):
+
+**1** - Add the runatlantis repository.
+
+```sh
+helm repo add runatlantis https://runatlantis.github.io/helm-charts
+```
+
+**2** - Create file values.yaml and run:
+
+```sh
+helm inspect values runatlantis/atlantis > values.yaml
+```
+
+**3** - Edit the file values.yaml and add your credentials access and secret which will be used in the Atlantis webhook configuration:
+See as create a [GitHubApp](https://docs.github.com/pt/apps/creating-github-apps/about-creating-github-apps).
+
+```yaml
+githubApp:
+ id: "CHANGE ME"
+ key: |
+ -----BEGIN RSA PRIVATE KEY-----
+ "CHANGE ME"
+ -----END RSA PRIVATE KEY-----
+ slug: atlantis
+# secret webhook Atlantis
+ secret: "CHANGE ME"
+```
+
+**4** - Enter the org and repository from github that Atlantis will interact in orgAllowlist:
+
+```yaml
+# All repositories the org
+orgAllowlist: github.com/MY-ORG/*
+
+or
+# Just one repository
+orgAllowlist: github.com/MY-ORG/MY-REPO-IAC
+
+or
+# All repositories that start with MY-REPO-IAC-
+orgAllowlist: github.com/MY-ORG/MY-REPO-IAC-*
+```
+
+**5** - Now letâs configure the script that will be executed upon startup of the Atlantis init pod. In this step we download and install Terragrunt and OpenTofu, as well as include their binaries in the shared dir ```/plugins```.
+
+```yaml
+initConfig:
+ enabled: true
+ image: alpine:latest
+ imagePullPolicy: IfNotPresent
+ # sharedDir is set as env var INIT_SHARED_DIR
+ sharedDir: /plugins
+ workDir: /tmp
+ sizeLimit: 250Mi
+ # example of how the script can be configured to install tools/providers required by the atlantis pod
+ script: |
+ #!/bin/sh
+ set -eoux pipefail# terragrunt
+ TG_VERSION="0.55.10"
+ TG_SHA256_SUM="1ad609399352348a41bb5ea96fdff5c7a18ac223742f60603a557a54fc8c6cff"
+ TG_FILE="${INIT_SHARED_DIR}/terragrunt"
+ wget https://github.com/gruntwork-io/terragrunt/releases/download/v${TG_VERSION}/terragrunt_linux_amd64 -O "${TG_FILE}"
+ echo "${TG_SHA256_SUM} ${TG_FILE}" | sha256sum -c
+ chmod 755 "${TG_FILE}"
+ terragrunt -v
+
+ # OpenTofu
+ TF_VERSION="1.6.2"
+ TF_FILE="${INIT_SHARED_DIR}/tofu"
+ wget https://github.com/opentofu/opentofu/releases/download/v${TF_VERSION}/tofu_${TF_VERSION}_linux_amd64.zip
+ unzip tofu_${TF_VERSION}_linux_amd64.zip
+ mv tofu ${INIT_SHARED_DIR}
+ chmod 755 "${TF_FILE}"
+ tofu -v
+```
+
+**6** - Here we configure the envs to avoid downloading alternative versions of Terraform and indicate to Terragrunt where it should fetch the OpenTofu binary.
+
+```yaml
+# envs
+environment:
+ ATLANTIS_TF_DOWNLOAD: false
+ TERRAGRUNT_TFPATH: /plugins/tofu
+```
+
+**7** - Last but not least, here we specify which Atlantis-side configurations we will have for the repositories.
+
+```yaml
+# repository config
+repoConfig: |
+ ---
+ repos:
+ - id: /.*/
+ apply_requirements: [approved, mergeable]
+ allow_custom_workflows: true
+ allowed_overrides: [workflow, apply_requirements, delete_source_branch_on_merge]
+```
+
+**8** - Configure Atlantis webhook ingress, in the example below we are using the AWS ALB.
+
+```yaml
+# ingress config
+ingress:
+ annotations:
+ alb.ingress.kubernetes.io/backend-protocol: HTTP
+ alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:certificate
+ alb.ingress.kubernetes.io/group.name: external-atlantis
+ alb.ingress.kubernetes.io/healthcheck-path: /healthz
+ alb.ingress.kubernetes.io/healthcheck-port: "80"
+ alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
+ alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
+ alb.ingress.kubernetes.io/scheme: internet-facing
+ alb.ingress.kubernetes.io/ssl-redirect: "443"
+ alb.ingress.kubernetes.io/success-codes: "200"
+ alb.ingress.kubernetes.io/target-type: ip
+ apiVersion: networking.k8s.io/v1
+ enabled: true
+ host: atlantis.your.domain
+ ingressClassName: aws-ingress-class-name
+ path: /*
+ pathType: ImplementationSpecific
+```
+
+Save all changes made to ```values.yaml```
+
+**9** - Using one of the Atlantis options custom workflows, we can create a file ```atlantis.yaml``` in the root folder of your repository, the example below should meet most scenarios, adapt as needed.
+
+```yaml
+version: 3
+automerge: true
+parallel_plan: true
+parallel_apply: false
+projects:
+- name: terragrunt
+ dir: .
+ workspace: terragrunt
+ delete_source_branch_on_merge: true
+ autoplan:
+ enabled: false
+ apply_requirements: [mergeable, approved]
+ workflow: terragrunt
+workflows:
+ terragrunt:
+ plan:
+ steps:
+ - env:
+ name: TF_IN_AUTOMATION
+ value: 'true'
+ - run: find . -name '.terragrunt-cache' | xargs rm -rf
+ - run: terragrunt init -reconfigure
+ - run:
+ command: terragrunt plan -input=false -out=$PLANFILE
+ output: strip_refreshing
+ apply:
+ steps:
+ - run: terragrunt apply $PLANFILE
+```
+
+**10** - Now letâs go to the installation itself, search for the available versions of Atlantis:
+
+```sh
+helm search repo runatlantis
+```
+
+Replace ```CHART-VERSION``` with the version you want to install and run the command below:
+
+```sh
+helm upgrade -i atlantis runatlantis/atlantis --version CHART-VERSION -f values.yaml --create-namespace atlantis
+```
+
+Now, see as configure Atlantis [webhook on github](../../docs/configuring-webhooks.md) repository.
+
+See as Atlantis [work](../../docs/using-atlantis.md).
+
+Find out more at:
+
+- .
+- .
+- .
+
+Share it with your friends =)
diff --git a/runatlantis.io/contributing.md b/runatlantis.io/contributing.md
new file mode 100644
index 0000000000..3d8e24de16
--- /dev/null
+++ b/runatlantis.io/contributing.md
@@ -0,0 +1,17 @@
+---
+aside: false
+---
+# Atlantis Contributing Documentation
+
+These docs are for users who want to contribute to the Atlantis project. This
+can vary from writing documentation, helping the community on Slack, discussing
+issues, or writing code.
+
+:::tip Looking to get started or use Atlantis?
+If you're new, check out the [Guide](./guide.md) or the
+[Documentation](./docs.md).
+:::
+
+## Next Steps
+
+- [Events Controller](./contributing/events-controller.md) â How do the events work?
diff --git a/runatlantis.io/contributing/events-controller.md b/runatlantis.io/contributing/events-controller.md
new file mode 100644
index 0000000000..9827aa5cdb
--- /dev/null
+++ b/runatlantis.io/contributing/events-controller.md
@@ -0,0 +1,108 @@
+# Events Controller
+
+Webhooks are the primary interaction between the Version Control System (VCS)
+and Atlantis. Each VCS sends the requests to the `/events` endpoint. The
+implementation of this endpoint can be found in the
+[events_controller.go](https://github.com/runatlantis/atlantis/blob/main/server/controllers/events/events_controller.go)
+file. This file contains the Post function `func (e *VCSEventsController)
+Post(w http.ResponseWriter, r *http.Request`)` that parses the request
+according to the configured VCS.
+
+Atlantis currently handles one of the following events:
+
+- Comment Event
+- Pull Request Event
+
+All the other events are ignored.
+
+```mermaid
+---
+title: events controller flowchart
+---
+flowchart LR
+ events(/events - Endpoint) --> Comment_Event(Comment - Event)
+ events --> Pull_Request_Event(Pull Request - Event)
+
+ Comment_Event --> pre_workflow(pre-workflow - Hook)
+ pre_workflow --> plan(plan - command)
+ pre_workflow --> apply(apply - command)
+ pre_workflow --> approve_policies(approve policies - command)
+ pre_workflow --> unlock(unlock - command)
+ pre_workflow --> version(version - command)
+ pre_workflow --> import(import - command)
+ pre_workflow --> state(state - command)
+
+ plan --> post_workflow(post-workflow - Hook)
+ apply --> post_workflow
+ approve_policies --> post_workflow
+ unlock --> post_workflow
+ version --> post_workflow
+ import --> post_workflow
+ state --> post_workflow
+
+ Pull_Request_Event --> Open_Update_PR(Open / Update Pull Request)
+ Pull_Request_Event --> Close_PR(Close Pull Request)
+
+ Open_Update_PR --> pre_workflow(pre-workflow - Hook)
+ Close_PR --> plan(plan - command)
+
+ pre_workflow --> plan
+ plan --> post_workflow(post-workflow - Hook)
+
+ Close_PR --> CleanUpPull(CleanUpPull)
+ CleanUpPull --> post_workflow(post-workflow - Hook)
+```
+
+## Comment Event
+
+This event is triggered whenever a user enters a comment on the Pull Request,
+Merge Request, or whatever it's called for the respective VCS. After parsing the
+VCS-specific request, the code calls the `handleCommentEvent` function, which
+then passes the processing to the `handleCommentEvent` function in the
+[command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/command_runner.go)
+file. This function first calls the pre-workflow hooks, then executes one of the
+below-listed commands and, at last, the post-workflow hooks.
+
+- [plan_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/plan_command_runner.go)
+- [apply_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/apply_command_runner.go)
+- [approve_policies_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/approve_policies_command_runner.go)
+- [unlock_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/unlock_command_runner.go)
+- [version_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/version_command_runner.go)
+- [import_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/import_command_runner.go)
+- [state_command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/state_command_runner.go)
+
+## Pull Request Event
+
+To handle comment events on Pull Requests, they must be created first. Atlantis
+also allows the running of commands for certain Pull Requests events.
+
+
+ Pull Request Webhooks
+
+The list below links to the supported VCSs and their Pull Request Webhook
+documentation.
+
+- [Azure DevOps Pull Request Created](https://learn.microsoft.com/en-us/azure/devops/service-hooks/events?view=azure-devops#pull-request-created)
+- [BitBucket Pull Request](https://support.atlassian.com/bitbucket-cloud/docs/event-payloads/#Pull-request-events)
+- [GitHub Pull Request](https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request)
+- [GitLab Merge Request](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events)
+- [Gitea Webhooks](https://docs.gitea.com/next/usage/webhooks)
+
+
+
+The following list shows the supported events:
+
+- Opened Pull Request
+- Updated Pull Request
+- Closed Pull Request
+- Other Pull Request event
+
+The `RunAutoPlanCommand` function in the
+[command_runner.go](https://github.com/runatlantis/atlantis/blob/main/server/events/command_runner.go)
+file is called for the _Open_ and _Update_ Pull Request events. When enabled on
+the project, this automatically runs the `plan` for the specific repository.
+
+Whenever a Pull Request is closed, the `CleanUpPull` function in the
+[instrumented_pull_closed_executor.go](https://github.com/runatlantis/atlantis/blob/main/server/events/instrumented_pull_closed_executor.go)
+file is called. This function cleans up all the closed Pull Request files,
+locks, and other related information.
diff --git a/runatlantis.io/contributing/glossary.md b/runatlantis.io/contributing/glossary.md
new file mode 100644
index 0000000000..99c1e73287
--- /dev/null
+++ b/runatlantis.io/contributing/glossary.md
@@ -0,0 +1,26 @@
+# Glossary
+
+The Atlantis community uses many words and phrases to work more efficiently.
+You will find the most common ones and their meaning on this page.
+
+## Pull / Merge Request Event
+
+The different VCSs have different names for merging changes. Atlantis uses the
+name Pull Request as the abstraction. The VCS provider implements this
+abstraction and forwards the call to the respective function.
+
+## VCS
+
+VCS stands for Version Control System.
+
+Atlantis supports only git as a Version Control System. However, there is
+support for multiple VCS Providers. Currently, it supports the following
+providers:
+
+- [Azure DevOps](https://azure.microsoft.com/en-us/products/devops)
+- [BitBucket](https://bitbucket.org/)
+- [GitHub](https://github.com/)
+- [GitLab](https://gitlab.com/)
+- [Gitea](https://gitea.com/)
+
+The term VCS is used for both git and the different VCS providers.
diff --git a/runatlantis.io/docs.md b/runatlantis.io/docs.md
new file mode 100644
index 0000000000..23b27f1c32
--- /dev/null
+++ b/runatlantis.io/docs.md
@@ -0,0 +1,18 @@
+---
+aside: false
+---
+# Atlantis Documentation
+
+These docs are for users that are ready to get Atlantis installed and start using it.
+
+:::tip Looking to get started?
+If you're new here, check out the [Guide](./guide.md)
+where you can try our [Test Drive](./guide/test-drive.md) or [Run Atlantis Locally](./guide/testing-locally.md).
+:::
+
+## Next Steps
+
+* [Installing Atlantis](./docs/installation-guide.md) â Get Atlantis up and running
+* [Configuring Atlantis](./docs/configuring-atlantis.md) â Configure how Atlantis works for your specific use-cases
+* [Using Atlantis](./docs/using-atlantis.md) â How do you use Atlantis?
+* [How Atlantis Works](./docs/how-atlantis-works.md) â Internals of what Atlantis is doing
diff --git a/runatlantis.io/docs/README.md b/runatlantis.io/docs/README.md
deleted file mode 100644
index 5527692cf5..0000000000
--- a/runatlantis.io/docs/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Atlantis Documentation
-
-These docs are for users that are ready to get Atlantis installed and start using it.
-
-:::tip Looking to get started?
-If you're new here, check out the [Guide](/guide/)
-where you can try our [Test Drive](/guide/test-drive.html) or [Run Atlantis Locally](/guide/testing-locally.html).
-:::
-
-### Next Steps
-* [Installing Atlantis](/docs/installation-guide.html) â Get Atlantis up and running
-* [Configuring Atlantis](configuring-atlantis.html) â Configure how Atlantis works for your specific use-cases
-* [Using Atlantis](using-atlantis.html) â How do you use Atlantis?
-* [How Atlantis Works](how-atlantis-works.html) â Internals of what Atlantis is doing
diff --git a/runatlantis.io/docs/access-credentials.md b/runatlantis.io/docs/access-credentials.md
index 9cd514fb70..7d7410ee03 100644
--- a/runatlantis.io/docs/access-credentials.md
+++ b/runatlantis.io/docs/access-credentials.md
@@ -1,10 +1,11 @@
# Git Host Access Credentials
-This page describes how to create credentials for your Git host (GitHub, GitLab, Bitbucket, or Azure DevOps)
+
+This page describes how to create credentials for your Git host (GitHub, GitLab, Gitea, Bitbucket, or Azure DevOps)
that Atlantis will use to make API calls.
-[[toc]]
## Create an Atlantis user (optional)
+
We recommend creating a new user named **@atlantis** (or something close) or using a dedicated CI user.
This isn't required (you can use an existing user or github app credentials), however all the comments that Atlantis writes
@@ -14,19 +15,23 @@ will come from that user so it might be confusing if its coming from a personal
An example comment coming from the @atlantisbot user
## Generating an Access Token
+
Once you've created a new user (or decided to use an existing one), you need to
generate an access token. Read on for the instructions for your specific Git host:
+
* [GitHub](#github-user)
* [GitHub app](#github-app)
* [GitLab](#gitlab)
+* [Gitea](#gitea)
* [Bitbucket Cloud (bitbucket.org)](#bitbucket-cloud-bitbucket-org)
* [Bitbucket Server (aka Stash)](#bitbucket-server-aka-stash)
* [Azure DevOps](#azure-devops)
### GitHub user
-- Create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token)
-- Create the token with **repo** scope
-- Record the access token
+
+* Create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token)
+* Create the token with **repo** scope
+* Record the access token
::: warning
Your Atlantis user must also have "Write permissions" (for repos in an organization) or be a "Collaborator" (for repos in a user account) to be able to set commit statuses:
![Atlantis status](./images/status.png)
@@ -35,18 +40,18 @@ Your Atlantis user must also have "Write permissions" (for repos in an organizat
### GitHub app
#### Create the GitHub App Using Atlantis
+
::: warning
Available in Atlantis versions **newer** than 0.13.0.
:::
+* Start Atlantis with fake github username and token (`atlantis server --gh-user fake --gh-token fake --repo-allowlist 'github.com/your-org/*' --atlantis-url https://$ATLANTIS_HOST`). If installing as an **Organization**, remember to add `--gh-org your-github-org` to this command.
+* Visit `https://$ATLANTIS_HOST/github-app/setup` and click on **Setup** to create the app on GitHub. You'll be redirected back to Atlantis
+* A link to install your app, along with its secrets, will be shown on the screen. Record your app's credentials and install your app for your user/org by following said link.
+* Create a file with the contents of the GitHub App Key, e.g. `atlantis-app-key.pem`
+* Restart Atlantis with new flags: `atlantis server --gh-app-id --gh-app-key-file atlantis-app-key.pem --gh-webhook-secret --write-git-creds --repo-allowlist 'github.com/your-org/*' --atlantis-url https://$ATLANTIS_HOST`.
-- Start Atlantis with fake github username and token (`atlantis server --gh-user fake --gh-token fake --repo-allowlist 'github.com/your-org/*' --atlantis-url https://$ATLANTIS_HOST`). If installing as an **Organization**, remember to add `--gh-org your-github-org` to this command.
-- Visit `https://$ATLANTIS_HOST/github-app/setup` and click on **Setup** to create the app on GitHub. You'll be redirected back to Atlantis
-- A link to install your app, along with its secrets, will be shown on the screen. Record your app's credentials and install your app for your user/org by following said link.
-- Create a file with the contents of the GitHub App Key, e.g. `atlantis-app-key.pem`
-- Restart Atlantis with new flags: `atlantis server --gh-app-id --gh-app-key-file atlantis-app-key.pem --gh-webhook-secret --write-git-creds --repo-allowlist 'github.com/your-org/*' --atlantis-url https://$ATLANTIS_HOST`.
-
- NOTE: Instead of using a file for the GitHub App Key you can also pass the key value directly using `--gh-app-key`. You can also create a config file instead of using flags. See [Server Configuration](/docs/server-configuration.html#config-file).
+ NOTE: Instead of using a file for the GitHub App Key you can also pass the key value directly using `--gh-app-key`. You can also create a config file instead of using flags. See [Server Configuration](server-configuration.md#config-file).
::: warning
Only a single installation per GitHub App is supported at the moment.
@@ -58,13 +63,13 @@ GitHub App handles the webhook calls by itself, hence there is no need to create
#### Manually Creating the GitHub app
-- Create the GitHub app as an Administrator
- - Ensure the app is registered / installed with the organization / user
- - See the GitHub app [documentation](https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps)
-- Create a file with the contents of the GitHub App Key, e.g. `atlantis-app-key.pem`
-- Start Atlantis with the following flags: `atlantis server --gh-app-id --gh-installation-id --gh-app-key-file atlantis-app-key.pem --gh-webhook-secret --write-git-creds --repo-allowlist 'github.com/your-org/*' --atlantis-url https://$ATLANTIS_HOST`.
+* Create the GitHub app as an Administrator
+ * Ensure the app is registered / installed with the organization / user
+ * See the GitHub app [documentation](https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps)
+* Create a file with the contents of the GitHub App Key, e.g. `atlantis-app-key.pem`
+* Start Atlantis with the following flags: `atlantis server --gh-app-id --gh-installation-id --gh-app-key-file atlantis-app-key.pem --gh-webhook-secret --write-git-creds --repo-allowlist 'github.com/your-org/*' --atlantis-url https://$ATLANTIS_HOST`.
- NOTE: Instead of using a file for the GitHub App Key you can also pass the key value directly using `--gh-app-key`. You can also create a config file instead of using flags. See [Server Configuration](/docs/server-configuration.html#config-file).
+ NOTE: Instead of using a file for the GitHub App Key you can also pass the key value directly using `--gh-app-key`. You can also create a config file instead of using flags. See [Server Configuration](server-configuration.md#config-file).
::: tip NOTE
Manually installing the GitHub app means that the credentials can be shared by many Atlantis installations. This has the benefit of centralizing repository access for shared modules / code.
@@ -92,47 +97,62 @@ Since v0.19.7, a new permission for `Administration` has been added. If you have
Since v0.22.3, a new permission for `Members` has been added, which is required for features that apply permissions to an organizations team members rather than individual users. Like the `Administration` permission above, updating Atlantis will not automatically add this permission, so if you wish to use features that rely on checking team membership you will need to add this manually.
:::
-| Type | Access |
-| --------------- | ------------------- |
-| Administration | Read-only |
-| Checks | Read and write |
-| Commit statuses | Read and write |
-| Contents | Read and write |
-| Issues | Read and write |
-| Metadata | Read-only (default) |
-| Pull requests | Read and write |
-| Webhooks | Read and write |
-| Members | Read-only |
+| Type | Access |
+| --------------- | ------------------- |
+| Administration | Read-only |
+| Checks | Read and write |
+| Commit statuses | Read and write |
+| Contents | Read and write |
+| Issues | Read and write |
+| Metadata | Read-only (default) |
+| Pull requests | Read and write |
+| Webhooks | Read and write |
+| Members | Read-only |
### GitLab
-- Follow: [https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html#create-a-personal-access-token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html#create-a-personal-access-token)
-- Create a token with **api** scope
-- Record the access token
+
+* Follow: [GitLab: Create a personal access token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html#create-a-personal-access-token)
+* Create a token with **api** scope
+* Record the access token
+
+### Gitea
+
+* Go to "Profile and Settings" > "Settings" in Gitea (top-right)
+* Go to "Applications" under "User Settings" in Gitea
+* Create a token under the "Manage Access Tokens" with the following permissions:
+ * issue: Read and Write
+ * repository: Read and Write
+ * user: Read
+* Record the access token
### Bitbucket Cloud (bitbucket.org)
-- Create an App Password by following [https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/)
-- Label the password "atlantis"
-- Select **Pull requests**: **Read** and **Write** so that Atlantis can read your pull requests and write comments to them
-- Record the access token
+
+* Create an App Password by following [BitBucket Cloud: Create an app password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/)
+* Label the password "atlantis"
+* Select **Pull requests**: **Read** and **Write** so that Atlantis can read your pull requests and write comments to them
+* Record the access token
### Bitbucket Server (aka Stash)
-- Click on your avatar in the top right and select **Manage account**
-- Click **Personal access tokens** in the sidebar
-- Click **Create a token**
-- Name the token **atlantis**
-- Give the token **Read** Project permissions and **Write** Pull request permissions
-- Click **Create** and record the access token
+
+* Click on your avatar in the top right and select **Manage account**
+* Click **Personal access tokens** in the sidebar
+* Click **Create a token**
+* Name the token **atlantis**
+* Give the token **Read** Project permissions and **Write** Pull request permissions
+* Click **Create** and record the access token
NOTE: Atlantis will send the token as a [Bearer Auth to the Bitbucket API](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html#HTTPaccesstokens-UsingHTTPaccesstokens) instead of using Basic Auth.
### Azure DevOps
-- Create a Personal access token by following [https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops)
-- Label the password "atlantis"
-- The minimum scopes required for this token are:
- - Code (Read & Write)
- - Code (Status)
- - Member Entitlement Management (Read)
-- Record the access token
+
+* Create a Personal access token by following [Azure DevOps: Use personal access tokens to authenticate](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops)
+* Label the password "atlantis"
+* The minimum scopes required for this token are:
+ * Code (Read & Write)
+ * Code (Status)
+ * Member Entitlement Management (Read)
+* Record the access token
## Next Steps
-Once you've got your user and access token, you're ready to create a webhook secret. See [Creating a Webhook Secret](webhook-secrets.html).
+
+Once you've got your user and access token, you're ready to create a webhook secret. See [Creating a Webhook Secret](webhook-secrets.md).
diff --git a/runatlantis.io/docs/api-endpoints.md b/runatlantis.io/docs/api-endpoints.md
index 96dd6d0b51..ce622979da 100644
--- a/runatlantis.io/docs/api-endpoints.md
+++ b/runatlantis.io/docs/api-endpoints.md
@@ -9,7 +9,7 @@ To enable the API endpoints, `api-secret` should be configured.
:::tip Prerequisites
-* Set `api-secret` as part of the [Server Configuration](server-configuration.html#api-secret)
+* Set `api-secret` as part of the [Server Configuration](server-configuration.md#api-secret)
* Pass `X-Atlantis-Token` with the same secret in the request header
:::
@@ -17,22 +17,22 @@ To enable the API endpoints, `api-secret` should be configured.
#### Description
-Execute [atlantis plan](using-atlantis.html#atlantis-plan) on the specified repository.
+Execute [atlantis plan](using-atlantis.md#atlantis-plan) on the specified repository.
#### Parameters
-| Name | Type | Required | Description |
-|------------|-------------------------------------|----------|------------------------------------------|
-| Repository | string | Yes | Name of the Terraform repository |
-| Ref | string | Yes | Git reference, like a branch name |
-| Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
-| Paths | [ [Path](api-endpoints.html#path) ] | Yes | Paths to the projects to run the plan |
-| PR | int | No | Pull Request number |
+| Name | Type | Required | Description |
+|------------|---------|----------|------------------------------------------|
+| Repository | string | Yes | Name of the Terraform repository |
+| Ref | string | Yes | Git reference, like a branch name |
+| Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
+| Paths | Path | Yes | Paths to the projects to run the plan |
+| PR | int | No | Pull Request number |
-##### Path
+#### Path
-Similar to the [Options](using-atlantis.html#options) of `atlantis plan`. Path specifies which directory/workspace
-within the repository to run the plan.
+Similar to the [Options](using-atlantis.md#options) of `atlantis plan`. Path specifies which directory/workspace
+within the repository to run the plan.
At least one of `Directory` or `Workspace` should be specified.
| Name | Type | Required | Description |
@@ -92,22 +92,22 @@ curl --request POST 'https:///api/plan' \
#### Description
-Execute [atlantis apply](using-atlantis.html#atlantis-apply) on the specified repository.
+Execute [atlantis apply](using-atlantis.md#atlantis-apply) on the specified repository.
#### Parameters
-| Name | Type | Required | Description |
-|------------|---------------------------------------|----------|------------------------------------------|
-| Repository | string | Yes | Name of the Terraform repository |
-| Ref | string | Yes | Git reference, like a branch name |
-| Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
-| Paths | [ [Path](api-endpoints.html#path-1) ] | Yes | Paths to the projects to run the apply |
-| PR | int | No | Pull Request number |
+| Name | Type | Required | Description |
+|------------|--------|----------|------------------------------------------|
+| Repository | string | Yes | Name of the Terraform repository |
+| Ref | string | Yes | Git reference, like a branch name |
+| Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
+| Paths | Path | Yes | Paths to the projects to run the apply |
+| PR | int | No | Pull Request number |
-##### Path
+#### Path
-Similar to the [Options](using-atlantis.html#options-1) of `atlantis apply`. Path specifies which directory/workspace
-within the repository to run the apply.
+Similar to the [Options](using-atlantis.md#options-1) of `atlantis apply`. Path specifies which directory/workspace
+within the repository to run the apply.
At least one of `Directory` or `Workspace` should be specified.
| Name | Type | Required | Description |
diff --git a/runatlantis.io/docs/apply-requirements.md b/runatlantis.io/docs/apply-requirements.md
index 870ac4972e..166931851d 100644
--- a/runatlantis.io/docs/apply-requirements.md
+++ b/runatlantis.io/docs/apply-requirements.md
@@ -1,5 +1,5 @@
# Apply Requirements
:::warning REDIRECT
-This page is moved to [Command Requirements](/docs/command-requirements.html).
+This page is moved to [Command Requirements](command-requirements.md).
:::
diff --git a/runatlantis.io/docs/automerging.md b/runatlantis.io/docs/automerging.md
index 1e0b21ba77..2716a572ee 100644
--- a/runatlantis.io/docs/automerging.md
+++ b/runatlantis.io/docs/automerging.md
@@ -1,44 +1,53 @@
# Automerging
+
Atlantis can be configured to automatically merge a pull request after all plans have
been successfully applied.
-
![Automerge](./images/automerge.png)
## How To Enable
+
Automerging can be enabled either by:
+
1. Passing the `--automerge` flag to `atlantis server`. This sets the parameter globally; however, explicit declaration in the repo config will be respected and take priority.
1. Setting `automerge: true` in the repo's `atlantis.yaml` file:
+
```yaml
version: 3
automerge: true
projects:
- dir: .
```
+
:::tip NOTE
If a repo has an `atlantis.yaml` file, then each project in the repo needs
to be configured under the `projects` key.
:::
## How to Disable
+
If automerge is enabled, you can disable it for a single `atlantis apply`
command with the `--auto-merge-disabled` option.
## Requirements
### All Plans Must Succeed
+
When automerge is enabled, **all plans** in a pull request **must succeed** before
**any** plans can be applied.
For example, imagine this scenario:
+
1. I open a pull request that makes changes to two Terraform projects, in `dir1/`
and `dir2/`.
1. The plan for `dir2/` fails because my Terraform syntax is wrong.
In this scenario, I can't run
-```
+
+```shell
atlantis apply -d dir1
```
+
Even though that plan succeeded, because **all** plans must succeed for **any** plans
to be saved.
@@ -47,8 +56,9 @@ autoplan. Then I will be able to apply both plans.
### All Plans must be applied
-If multiple projects/dirs/workspaces are configured to be planned automatically,
+If multiple projects/dirs/workspaces are configured to be planned automatically,
then they should all be applied before Atlantis automatically merges the PR.
## Permissions
+
The Atlantis VCS user must have the ability to merge pull requests.
diff --git a/runatlantis.io/docs/autoplanning.md b/runatlantis.io/docs/autoplanning.md
index 2183219703..b4657d801a 100644
--- a/runatlantis.io/docs/autoplanning.md
+++ b/runatlantis.io/docs/autoplanning.md
@@ -1,8 +1,10 @@
# Autoplanning
+
On any **new** pull request or **new commit** to an existing pull request, Atlantis will attempt to
run `terraform plan` in the directories it thinks hold modified Terraform projects.
The algorithm it uses is as follows:
+
1. Get list of all modified files in pull request
1. Filter to those containing `.tf`
1. Get the directories that those files are in
@@ -11,8 +13,10 @@ The algorithm it uses is as follows:
contains a `main.tf` run plan in that directory, otherwise ignore the change (see below for exceptions).
## Example
+
Given the directory structure:
-```
+
+```plain
.
âââ modules
â  âââ module1
@@ -26,21 +30,25 @@ Given the directory structure:
* If `project1/main.tf` were modified, we would run `plan` in `project1`
* If `modules/module1/main.tf` were modified, we would not automatically run `plan` because we couldn't determine the location of the terraform project
- * You could use an [atlantis.yaml](repo-level-atlantis-yaml.html#configuring-planning) file to specify which projects to plan when this module changed
- * You could enable [module autoplanning](server-configuration.html#autoplan-modules) which indexes projects to their local module dependencies.
- * Or you could manually plan with `atlantis plan -d `
+ * You could use an [atlantis.yaml](repo-level-atlantis-yaml.md#configuring-planning) file to specify which projects to plan when this module changed
+ * You could enable [module autoplanning](server-configuration.md#autoplan-modules) which indexes projects to their local module dependencies.
+ * Or you could manually plan with `atlantis plan -d `
* If `project1/modules/module1/main.tf` were modified, we would look one level above `project1/modules`
into `project1/`, see that there was a `main.tf` file and so run plan in `project1/`
## Bitbucket-Specific Notes
+
Bitbucket does not have a webhook that triggers only upon a new PR or commit. To fix this we cache the last commit to see if it has changed. If the cache is emptied, Atlantis will think your commit is new and you may see extra plans.
This scenario can happen if:
+
* Atlantis restarts
* You are running multiple Atlantis instances behind a load balancer
## Customizing
+
If you would like to customize how Atlantis determines which directory to run in
or disable it all together you need to create an `atlantis.yaml` file.
See
-* [Disabling Autoplanning](repo-level-atlantis-yaml.html#disabling-autoplanning)
-* [Configuring Planning](repo-level-atlantis-yaml.html#configuring-planning)
+
+* [Disabling Autoplanning](repo-level-atlantis-yaml.md#disabling-autoplanning)
+* [Configuring Planning](repo-level-atlantis-yaml.md#configuring-planning)
diff --git a/runatlantis.io/docs/checkout-strategy.md b/runatlantis.io/docs/checkout-strategy.md
index 066f7444f0..5c38586a4c 100644
--- a/runatlantis.io/docs/checkout-strategy.md
+++ b/runatlantis.io/docs/checkout-strategy.md
@@ -7,6 +7,7 @@ variable that get passed to the `atlantis server` command.
Atlantis supports `branch` and `merge` strategies.
## Branch
+
If set to `branch` (the default), Atlantis will check out the source branch
of the pull request.
@@ -17,6 +18,7 @@ If the pull request was asking to merge `branch` into `main`,
Atlantis would check out `branch` at commit `C3`.
## Merge
+
The problem with the `branch` strategy, is that if users push branches that are
out of date with `main`, then their `terraform plan` could be deleting
some resources that were configured in the main branch.
@@ -49,9 +51,9 @@ commit is pushed to `main` **after** Atlantis runs `plan`, nothing will happen.
To optimize cloning time, Atlantis can perform a shallow clone by specifying the `--checkout-depth` flag. The cloning is performed in a following manner:
-- Shallow clone of the default branch is performed with depth of `--checkout-depth` value of zero (full clone).
-- `branch` is retrieved, including the same amount of commits.
-- Merge base of the default branch and `branch` is checked for existence in the shallow clone.
-- If the merge base is not present, it means that either of the branches are ahead of the merge base by more than `--checkout-depth` commits. In this case full repo history is fetched.
+* Shallow clone of the default branch is performed with depth of `--checkout-depth` value of zero (full clone).
+* `branch` is retrieved, including the same amount of commits.
+* Merge base of the default branch and `branch` is checked for existence in the shallow clone.
+* If the merge base is not present, it means that either of the branches are ahead of the merge base by more than `--checkout-depth` commits. In this case full repo history is fetched.
-If the commit history often diverges by more than the default checkout depth then the `--checkout-depth` flag should be tuned to avoid full fetches.
\ No newline at end of file
+If the commit history often diverges by more than the default checkout depth then the `--checkout-depth` flag should be tuned to avoid full fetches.
diff --git a/runatlantis.io/docs/command-requirements.md b/runatlantis.io/docs/command-requirements.md
index e3aea4ea21..bbf12ede00 100644
--- a/runatlantis.io/docs/command-requirements.md
+++ b/runatlantis.io/docs/command-requirements.md
@@ -1,7 +1,7 @@
# Command Requirements
-[[toc]]
## Intro
+
Atlantis requires certain conditions be satisfied **before** `atlantis apply` and `atlantis import`
commands can be run:
@@ -10,31 +10,41 @@ commands can be run:
* [UnDiverged](#undiverged) - requires pull requests to be ahead of the base branch
## What Happens If The Requirement Is Not Met?
+
If the requirement is not met, users will see an error if they try to run `atlantis apply`:
![Mergeable Apply Requirement](./images/apply-requirement.png)
## Supported Requirements
+
### Approved
+
The `approved` requirement will prevent applies unless the pull request is approved
by at least one person other than the author.
#### Usage
+
The `approved` requirement by:
+
1. Creating a `repos.yaml` file with the `apply_requirements` key:
+
```yaml
repos:
- id: /.*/
apply_requirements: [approved]
```
+
1. Or by allowing an `atlantis.yaml` file to specify the `apply_requirements` key in the `repos.yaml` config:
- #### repos.yaml
+
+ **repos.yaml**
+
```yaml
repos:
- id: /.*/
allowed_overrides: [apply_requirements]
```
- #### atlantis.yaml
+ **atlantis.yaml**
+
```yaml
version: 3
projects:
@@ -43,7 +53,9 @@ The `approved` requirement by:
```
#### Meaning
+
Each VCS provider has different rules around who can approve:
+
* **GitHub** â **Any user with read permissions** to the repo can approve a pull request
* **GitLab** â The user who can approve can be set in the [repo settings](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
* **Bitbucket Cloud (bitbucket.org)** â A user can approve their own pull request but
@@ -57,11 +69,15 @@ To require **certain people** to approve the pull request, look at the
:::
### Mergeable
+
The `mergeable` requirement will prevent applies unless a pull request is able to be merged.
#### Usage
+
Set the `mergeable` requirement by:
+
1. Creating a `repos.yaml` file with the `apply_requirements` key:
+
```yaml
repos:
- id: /.*/
@@ -69,14 +85,17 @@ Set the `mergeable` requirement by:
```
1. Or by allowing an `atlantis.yaml` file to specify `plan_requirements`, `apply_requirements` and `import_requirements` keys in the `repos.yaml` config:
- #### repos.yaml
+
+ **repos.yaml**
+
```yaml
repos:
- id: /.*/
allowed_overrides: [plan_requirements, apply_requirements, import_requirements]
```
- #### atlantis.yaml
+ **atlantis.yaml**
+
```yaml
version: 3
projects:
@@ -87,25 +106,28 @@ Set the `mergeable` requirement by:
```
#### Meaning
+
Each VCS provider has a different concept of "mergeability":
::: warning
Some VCS providers have a feature for branch protection to control "mergeability". To use it,
limit the base branch so to not bypass the branch protection.
-See also the `branch` keyword in [Server Side Repo Config](server-side-repo-config.html#reference) for more details.
+See also the `branch` keyword in [Server Side Repo Config](server-side-repo-config.md#reference) for more details.
:::
#### GitHub
+
In GitHub, if you're not using [Protected Branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches) then
all pull requests are mergeable unless there is a conflict.
If you set up Protected Branches then you can enforce:
+
* Requiring certain status checks to be passing
* Requiring certain people to have reviewed and approved the pull request
* Requiring `CODEOWNERS` to have reviewed and approved the pull request
-* Requiring that the branch is up to date with `main`
+* Requiring that the branch is up-to-date with `main`
-See [https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)
+See [GitHub: About protected branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)
for more details.
::: warning
@@ -119,6 +141,7 @@ If you set `atlantis/apply` to the mergeable requirement, use the `--gh-allow-me
:::
#### GitLab
+
For GitLab, a merge request will be merged if there are no conflicts, no unresolved discussions if it is a project requirement and if all necessary approvers have approved the pull request.
For pipelines, if the project requires that pipelines must succeed, all builds except the apply command status will be checked.
@@ -126,6 +149,7 @@ For pipelines, if the project requires that pipelines must succeed, all builds e
For Jobs with allow_failure setting set to true, will be ignored. If the pipeline has been skipped and the project allows merging, it will be marked as mergeable.
#### Bitbucket.org (Bitbucket Cloud) and Bitbucket Server (Stash)
+
For Bitbucket, we just check if there is a conflict that is preventing a
merge. We don't check anything else because Bitbucket's API doesn't support it.
@@ -133,9 +157,11 @@ If you need a specific check, please
[open an issue](https://github.com/runatlantis/atlantis/issues/new).
#### Azure DevOps
+
In Azure DevOps, all pull requests are mergeable unless there is a conflict. You can set a pull request to "Complete" right away, or set "Auto-Complete", which will merge after all branch policies are met. See [Review code with pull requests](https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops).
[Branch policies](https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops) can:
+
* Require a minimum number of reviewers
* Allow users to approve their own changes
* Allow completion even if some reviewers vote "Waiting" or "Reject"
@@ -147,12 +173,16 @@ At this time, the Azure DevOps client only supports merging using the default 'n
:::
### UnDiverged
+
Prevent applies if there are any changes on the base branch since the most recent plan.
Applies to `merge` checkout strategy only which you need to set via `--checkout-strategy` flag.
#### Usage
+
You can set the `undiverged` requirement by:
+
1. Creating a `repos.yaml` file with `plan_requirements`, `apply_requirements` and `import_requirements` keys:
+
```yaml
repos:
- id: /.*/
@@ -160,15 +190,19 @@ You can set the `undiverged` requirement by:
apply_requirements: [undiverged]
import_requirements: [undiverged]
```
+
1. Or by allowing an `atlantis.yaml` file to specify the `plan_requirements`, `apply_requirements` and `import_requirements` keys in your `repos.yaml` config:
- #### repos.yaml
+
+ **repos.yaml**
+
```yaml
repos:
- id: /.*/
allowed_overrides: [plan_requirements, apply_requirements, import_requirements]
```
- #### atlantis.yaml
+ **atlantis.yaml**
+
```yaml
version: 3
projects:
@@ -177,7 +211,9 @@ You can set the `undiverged` requirement by:
apply_requirements: [undiverged]
import_requirements: [undiverged]
```
+
#### Meaning
+
The `merge` checkout strategy creates a temporary merge commit and runs the `plan` on the Atlantis local version of the PR
source and destination branch. The local destination branch can become out of date since changes to the destination branch are not fetched
if there are no changes to the source branch. `undiverged` enforces that Atlantis local version of main is up to date
@@ -185,16 +221,21 @@ with remote so that the state of the source during the `apply` is identical to t
time.
## Setting Command Requirements
+
As mentioned above, you can set command requirements via flags, in `repos.yaml`, or in `atlantis.yaml` if `repos.yaml`
allows the override.
### Flags Override
+
Flags **override** any `repos.yaml` or `atlantis.yaml` settings so they are equivalent to always
having that apply requirement set.
### Project-Specific Settings
+
If you only want some projects/repos to have apply requirements, then you must
+
1. Specifying which repos have which requirements via the `repos.yaml` file.
+
```yaml
repos:
- id: /.*/
@@ -221,7 +262,9 @@ If you only want some projects/repos to have apply requirements, then you must
config.
For example if I have two directories, `staging` and `production`, I might use:
- #### repos.yaml
+
+ **repos.yaml:**
+
```yaml
repos:
- id: /.*/
@@ -229,7 +272,8 @@ If you only want some projects/repos to have apply requirements, then you must
# Allow any repo to specify apply_requirements in atlantis.yaml
```
- #### atlantis.yaml
+ **atlantis.yaml:**
+
```yaml
version: 3
projects:
@@ -248,14 +292,17 @@ If you only want some projects/repos to have apply requirements, then you must
```
### Multiple Requirements
+
You can set any or all of `approved`, `mergeable`, and `undiverged` requirements.
## Who Can Apply?
+
Once the apply requirement is satisfied, **anyone** that can comment on the pull
request can run the actual `atlantis apply` command.
## Next Steps
-* For more information on GitHub pull request reviews and approvals see: [https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews)
-* For more information on GitLab merge request reviews and approvals (only supported on GitLab Enterprise) see: [https://docs.gitlab.com/ee/user/project/merge_requests/approvals/](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/).
-* For more information on Bitbucket pull request reviews and approvals see: [https://confluence.atlassian.com/bitbucket/pull-requests-and-code-review-223220593.html](https://confluence.atlassian.com/bitbucket/pull-requests-and-code-review-223220593.html)
-* For more information on Azure DevOps pull request reviews and approvals see: [https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops&tabs=browser](https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops&tabs=browser)
+
+* For more information on GitHub pull request reviews and approvals see: [GitHub: About pull request reviews](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews)
+* For more information on GitLab merge request reviews and approvals (only supported on GitLab Enterprise) see: [GitLab: Merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/).
+* For more information on Bitbucket pull request reviews and approvals see: [BitBucket: Use pull requests for code review](https://confluence.atlassian.com/bitbucket/pull-requests-and-code-review-223220593.html)
+* For more information on Azure DevOps pull request reviews and approvals see: [Azure DevOps: Create pull requests](https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops&tabs=browser)
diff --git a/runatlantis.io/docs/configuring-atlantis.md b/runatlantis.io/docs/configuring-atlantis.md
index 46edbbbc3c..c40e55560c 100644
--- a/runatlantis.io/docs/configuring-atlantis.md
+++ b/runatlantis.io/docs/configuring-atlantis.md
@@ -1,25 +1,29 @@
# Configuring Atlantis
There are three methods for configuring Atlantis:
+
1. Passing flags to the `atlantis server` command
1. Creating a server-side repo config file and using the `--repo-config` flag
1. Placing an `atlantis.yaml` file at the root of your Terraform repositories
## Flags
+
Flags to `atlantis server` are used to configure the global operation of
Atlantis, for example setting credentials for your Git Host
or configuring SSL certs.
-See [Server Configuration](server-configuration.html) for more details.
+See [Server Configuration](server-configuration.md) for more details.
## Server-Side Repo Config
+
A Server-Side Repo Config file is used to control per-repo behaviour
and what users can do in repo-level `atlantis.yaml` files.
-See [Server-Side Repo Config](server-side-repo-config.html) for more details.
+See [Server-Side Repo Config](server-side-repo-config.md) for more details.
## Repo-Level `atlantis.yaml` Files
+
`atlantis.yaml` files placed at the root of your Terraform repos can be used to
change the default Atlantis behaviour for each repo.
-See [Repo-Level atlantis.yaml Files](repo-level-atlantis-yaml.html) for more details.
+See [Repo-Level atlantis.yaml Files](repo-level-atlantis-yaml.md) for more details.
diff --git a/runatlantis.io/docs/configuring-webhooks.md b/runatlantis.io/docs/configuring-webhooks.md
index be285ef6bc..295b50f437 100644
--- a/runatlantis.io/docs/configuring-webhooks.md
+++ b/runatlantis.io/docs/configuring-webhooks.md
@@ -1,16 +1,18 @@
# Configuring Webhooks
+
Atlantis needs to receive Webhooks from your Git host so that it can respond to pull request events.
:::tip Prerequisites
+
* You have created an [access credential](access-credentials.md)
* You have created a [webhook secret](webhook-secrets.md)
* You have [deployed](deployment.md) Atlantis and have a url for it
:::
See the instructions for your specific provider below.
-[[toc]]
## GitHub/GitHub Enterprise
+
You can install your webhook at the [organization](https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts) level, or for each individual repository.
::: tip NOTE
@@ -22,101 +24,130 @@ When authenticating as a GitHub App, Webhooks are automatically created and need
If you're installing on the organization, navigate to your organization's page and click **Settings**.
If installing on a single repository, navigate to the repository home page and click **Settings**.
-- Select **Webhooks** or **Hooks** in the sidebar
-- Click **Add webhook**
-- set **Payload URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
-- double-check you added `/events` to the end of your URL.
-- set **Content type** to `application/json`
-- set **Secret** to the Webhook Secret you generated previously
- - **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
-- select **Let me select individual events**
-- check the boxes
- - **Pull request reviews**
- - **Pushes**
- - **Issue comments**
- - **Pull requests**
-- leave **Active** checked
-- click **Add webhook**
-- See [Next Steps](#next-steps)
+
+* Select **Webhooks** or **Hooks** in the sidebar
+* Click **Add webhook**
+* set **Payload URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
+* double-check you added `/events` to the end of your URL.
+* set **Content type** to `application/json`
+* set **Secret** to the Webhook Secret you generated previously
+ * **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
+* select **Let me select individual events**
+* check the boxes
+ * **Pull request reviews**
+ * **Pushes**
+ * **Issue comments**
+ * **Pull requests**
+* leave **Active** checked
+* click **Add webhook**
+* See [Next Steps](#next-steps)
## GitLab
+
If you're using GitLab, navigate to your project's home page in GitLab
-- Click **Settings > Webhooks** in the sidebar
-- set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
-- double-check you added `/events` to the end of your URL.
-- set **Secret Token** to the Webhook Secret you generated previously
- - **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
-- check the boxes
- - **Push events**
- - **Comments**
- - **Merge Request events**
-- leave **Enable SSL verification** checked
-- click **Add webhook**
-- See [Next Steps](#next-steps)
+
+* Click **Settings > Webhooks** in the sidebar
+* set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
+* double-check you added `/events` to the end of your URL.
+* set **Secret Token** to the Webhook Secret you generated previously
+ * **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
+* check the boxes
+ * **Push events**
+ * **Comments**
+ * **Merge Request events**
+* leave **Enable SSL verification** checked
+* click **Add webhook**
+* See [Next Steps](#next-steps)
+
+## Gitea
+
+If you're using Gitea, navigate to your project's home page in Gitea
+
+* Click **Settings > Webhooks** in the top- and then sidebar
+* Click **Add webhook > Gitea** (Gitea webhooks are service specific, but this works)
+* set **Target URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
+* double-check you added `/events` to the end of your URL.
+* set **Secret** to the Webhook Secret you generated previously
+ * **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
+* Select **Custom Events...**
+* Check the boxes
+ * **Repository events > Push**
+ * **Issue events > Issue Comment**
+ * **Pull Request events > Pull Request**
+ * **Pull Request events > Pull Request Comment**
+ * **Pull Request events > Pull Request Reviewed**
+ * **Pull Request events > Pull Request Synchronized**
+* Leave **Active** checked
+* Click **Add Webhook**
+* See [Next Steps](#next-steps)
## Bitbucket Cloud (bitbucket.org)
-- Go to your repo's home page
-- Click **Settings** in the sidebar
-- Click **Webhooks** under the **WORKFLOW** section
-- Click **Add webhook**
-- Enter "Atlantis" for **Title**
-- set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
-- double-check you added `/events` to the end of your URL.
-- Keep **Status** as Active
-- Don't check **Skip certificate validation** because NGROK has a valid cert.
-- Select **Choose from a full list of triggers**
-- Under **Repository** **un**check everything
-- Under **Issues** leave everything **un**checked
-- Under **Pull Request**, select: Created, Updated, Merged, Declined and Comment created
-- Click **Save**
+
+* Go to your repo's home page
+* Click **Settings** in the sidebar
+* Click **Webhooks** under the **WORKFLOW** section
+* Click **Add webhook**
+* Enter "Atlantis" for **Title**
+* set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
+* double-check you added `/events` to the end of your URL.
+* Keep **Status** as Active
+* Don't check **Skip certificate validation** because NGROK has a valid cert.
+* Select **Choose from a full list of triggers**
+* Under **Repository** **un**check everything
+* Under **Issues** leave everything **un**checked
+* Under **Pull Request**, select: Created, Updated, Merged, Declined and Comment created
+* Click **Save**
-- See [Next Steps](#next-steps)
+* See [Next Steps](#next-steps)
## Bitbucket Server (aka Stash)
-- Go to your repo's home page
-- Click **Settings** in the sidebar
-- Click **Webhooks** under the **WORKFLOW** section
-- Click **Create webhook**
-- Enter "Atlantis" for **Name**
-- set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
-- Double-check you added `/events` to the end of your URL.
-- Set **Secret** to the Webhook Secret you generated previously
- - **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
-- Under **Pull Request**, select: Opened, Source branch updated, Merged, Declined, Deleted and Comment added
-- Click **Save**
-- See [Next Steps](#next-steps)
+
+* Go to your repo's home page
+* Click **Settings** in the sidebar
+* Click **Webhooks** under the **WORKFLOW** section
+* Click **Create webhook**
+* Enter "Atlantis" for **Name**
+* set **URL** to `http://$URL/events` (or `https://$URL/events` if you're using SSL) where `$URL` is where Atlantis is hosted. **Be sure to add `/events`**
+* Double-check you added `/events` to the end of your URL.
+* Set **Secret** to the Webhook Secret you generated previously
+ * **NOTE** If you're adding a webhook to multiple repositories, each repository will need to use the **same** secret.
+* Under **Pull Request**, select: Opened, Source branch updated, Merged, Declined, Deleted and Comment added
+* Click **Save**
+* See [Next Steps](#next-steps)
## Azure DevOps
+
Webhooks are installed at the [team project](https://docs.microsoft.com/en-us/azure/devops/organizations/projects/about-projects?view=azure-devops) level, but may be restricted to only fire based on events pertaining to [specific repos](https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/webhooks?view=azure-devops) within the team project.
-- Navigate anywhere within a team project, ie: `https://dev.azure.com/orgName/projectName/_git/repoName`
-- Select **Project settings** in the lower-left corner
-- Select **Service hooks**
- - If you see the message "You do not have sufficient permissions to view or configure subscriptions." you need to ensure your user is a member of either the organization's "Project Collection Administrators" group or the project's "Project Administrators" group.
- - To add your user to the Project Collection Build Administrators group, navigate to the organization level, click **Organization Settings** and then click **Permissions**. You should be at `https://dev.azure.com//_settings/groups`. Now click on the **\/Project Collection Administrators** group and add your user as a member.
- - To add your user to the Project Administrators group, navigate to the project level, click **Project Settings** and then click **Permissions**. You should be at `https://dev.azure.com///_settings/permissions`. Now click on the **\/Project Administrators** group and add your user as a member.
-- Click **Create subscription** or the green plus icon to add a new webhook
-- Scroll to the bottom of the list and select **Web Hooks**
-- Click **Next**
-- Under "Trigger on this type of event", select **Pull request created**
- - Optionally, select a repository under **Filters** to restrict the scope of this webhook subscription to a specific repository
-- Click **Next**
-- Set **URL** to `http://$URL/events` where `$URL` is where Atlantis is hosted. Note that SSL, or `https://$URL/events`, is required if you set a Basic username and password for the webhook). **Be sure to add `/events`**
-- It is strongly recommended to set a Basic Username and Password for all webhooks
-- Leave all three drop-down menus for `...to send` set to **All**
-- Resource version should be set to **1.0** for `Pull request created` and `Pull request updated` event types and **2.0** for `Pull request commented on`
-- **NOTE** If you're adding a webhook to multiple team projects or repositories (using filters), each repository will need to use the **same** basic username and password.
-- Click **Finish**
+* Navigate anywhere within a team project, ie: `https://dev.azure.com/orgName/projectName/_git/repoName`
+* Select **Project settings** in the lower-left corner
+* Select **Service hooks**
+ * If you see the message "You do not have sufficient permissions to view or configure subscriptions." you need to ensure your user is a member of either the organization's "Project Collection Administrators" group or the project's "Project Administrators" group.
+ * To add your user to the Project Collection Build Administrators group, navigate to the organization level, click **Organization Settings** and then click **Permissions**. You should be at `https://dev.azure.com//_settings/groups`. Now click on the **\/Project Collection Administrators** group and add your user as a member.
+ * To add your user to the Project Administrators group, navigate to the project level, click **Project Settings** and then click **Permissions**. You should be at `https://dev.azure.com///_settings/permissions`. Now click on the **\/Project Administrators** group and add your user as a member.
+* Click **Create subscription** or the green plus icon to add a new webhook
+* Scroll to the bottom of the list and select **Web Hooks**
+* Click **Next**
+* Under "Trigger on this type of event", select **Pull request created**
+ * Optionally, select a repository under **Filters** to restrict the scope of this webhook subscription to a specific repository
+* Click **Next**
+* Set **URL** to `http://$URL/events` where `$URL` is where Atlantis is hosted. Note that SSL, or `https://$URL/events`, is required if you set a Basic username and password for the webhook). **Be sure to add `/events`**
+* It is strongly recommended to set a Basic Username and Password for all webhooks
+* Leave all three drop-down menus for `...to send` set to **All**
+* Resource version should be set to **1.0** for `Pull request created` and `Pull request updated` event types and **2.0** for `Pull request commented on`
+* **NOTE** If you're adding a webhook to multiple team projects or repositories (using filters), each repository will need to use the **same** basic username and password.
+* Click **Finish**
Repeat the process above until you have webhook subscriptions for the following event types that will trigger on all repositories Atlantis will manage:
-- Pull request created (you just added this one)
-- Pull request updated
-- Pull request commented on
+* Pull request created (you just added this one)
+* Pull request updated
+* Pull request commented on
-- See [Next Steps](#next-steps)
+* See [Next Steps](#next-steps)
## Next Steps
+
* To verify that Atlantis is receiving your webhooks, create a test pull request to your repo.
* You should see the request show up in the Atlantis logs at an `INFO` level.
* You'll now need to configure Atlantis to add your [Provider Credentials](provider-credentials.md)
diff --git a/runatlantis.io/docs/custom-policy-checks.md b/runatlantis.io/docs/custom-policy-checks.md
index 9c6d362803..4c353335c7 100644
--- a/runatlantis.io/docs/custom-policy-checks.md
+++ b/runatlantis.io/docs/custom-policy-checks.md
@@ -1,9 +1,11 @@
# Custom Policy Checks
-If you want to run custom policy tools or scripts instead of the built-in Conftest integration, you can do so by setting the `custom_policy_check` option and running it in a custom workflow. Note: custom policy tool output is simply parsed for "fail" substrings to determine if the policy set passed.
-This option can be configured either at the server-level in a [repos.yaml config file](server-configuration.md) or at the repo-level in an [atlantis.yaml file.](repo-level-atlantis-yaml.md).
+If you want to run custom policy tools or scripts instead of the built-in Conftest integration, you can do so by setting the `custom_policy_check` option and running it in a custom workflow. Note: custom policy tool output is simply parsed for "fail" substrings to determine if the policy set passed.
+
+This option can be configured either at the server-level in a [repos.yaml config file](server-configuration.md) or at the repo-level in an [atlantis.yaml file.](repo-level-atlantis-yaml.md).
## Server-side config example
+
Set the `policy_check` and `custom_policy_check` options to true, and run the custom tool in the policy check steps as seen below.
```yaml
@@ -30,8 +32,8 @@ policies:
source: local
```
-
## Repo-level atlantis.yaml example
+
First, you will need to ensure `custom_policy_check` is within the `allowed_overrides` field of the server-side config. Next, just set the custom option to true on the specific project you want as shown in the example `atlantis.yaml` below:
```yaml
diff --git a/runatlantis.io/docs/custom-workflows.md b/runatlantis.io/docs/custom-workflows.md
index 61f7ae78ef..2e26e74b07 100644
--- a/runatlantis.io/docs/custom-workflows.md
+++ b/runatlantis.io/docs/custom-workflows.md
@@ -3,23 +3,25 @@
Custom workflows can be defined to override the default commands that Atlantis
runs.
-[[toc]]
-
## Usage
+
Custom workflows can be specified in the Server-Side Repo Config or in the Repo-Level
`atlantis.yaml` files.
-**Notes**
+**Notes:**
+
* If you want to allow repos to select their own workflows, they must have the
-`allowed_overrides: [workflow]` setting. See [server-side repo config use cases](server-side-repo-config.html#allow-repos-to-choose-a-server-side-workflow) for more details.
+`allowed_overrides: [workflow]` setting. See [server-side repo config use cases](server-side-repo-config.md#allow-repos-to-choose-a-server-side-workflow) for more details.
* If in addition you also want to allow repos to define their own workflows, they must have the
-`allow_custom_workflows: true` setting. See [server-side repo config use cases](server-side-repo-config.html#allow-repos-to-define-their-own-workflows) for more details.
-
+`allow_custom_workflows: true` setting. See [server-side repo config use cases](server-side-repo-config.md#allow-repos-to-define-their-own-workflows) for more details.
## Use Cases
+
### .tfvars files
+
Given the structure:
-```
+
+```plain
.
âââ project1
âââ main.tf
@@ -29,6 +31,7 @@ Given the structure:
If you wanted Atlantis to automatically run plan with `-var-file staging.tfvars` and `-var-file production.tfvars`
you could define two workflows:
+
```yaml
# repos.yaml or atlantis.yaml
workflows:
@@ -62,7 +65,9 @@ workflows:
- state_rm:
extra_args: ["-lock=false"]
```
+
Then in your repo-level `atlantis.yaml` file, you would reference the workflows:
+
```yaml
# atlantis.yaml
version: 3
@@ -80,20 +85,27 @@ workflows:
# If you didn't define the workflows in your server-side repos.yaml config,
# you would define them here instead.
```
+
When you want to apply the plans, you can comment
-```
+
+```shell
atlantis apply -p project1-staging
```
+
and
-```
+
+```shell
atlantis apply -p project1-production
```
+
Where `-p` refers to the project name.
### Adding extra arguments to Terraform commands
+
If you need to append flags to `terraform plan` or `apply` temporarily, you can
append flags on a comment following `--`, for example commenting:
-```
+
+```shell
atlantis plan -- -lock=false
```
@@ -117,7 +129,7 @@ workflows:
extra_args: ["-lock=false"]
```
-If [policy checking](/docs/policy-checking.html#how-it-works) is enabled, `extra_args` can also be used to change the default behaviour of conftest.
+If [policy checking](policy-checking.md#how-it-works) is enabled, `extra_args` can also be used to change the default behaviour of conftest.
```yaml
workflows:
@@ -130,6 +142,7 @@ workflows:
```
### Custom init/plan/apply Commands
+
If you want to customize `terraform init`, `plan` or `apply` in ways that
aren't supported by `extra_args`, you can completely override those commands.
@@ -162,14 +175,15 @@ workflows:
```
### CDKTF
+
Here are the requirements to enable [CDKTF](https://developer.hashicorp.com/terraform/cdktf)
-- A custom image with `CDKTF` installed
-- Add `**/cdk.tf.json` to the list of Atlantis autoplan files.
-- Set the `atlantis-include-git-untracked-files` flag so that the Terraform files dynamically generated
+* A custom image with `CDKTF` installed
+* Add `**/cdk.tf.json` to the list of Atlantis autoplan files.
+* Set the `atlantis-include-git-untracked-files` flag so that the Terraform files dynamically generated
by CDKTF will be add to the Atlantis modified file list.
-- Use `pre_workflow_hooks` to run `cdktf synth`
-- Optional: There isn't a requirement to use a repo `atlantis.yaml` but one can be leveraged if needed.
+* Use `pre_workflow_hooks` to run `cdktf synth`
+* Optional: There isn't a requirement to use a repo `atlantis.yaml` but one can be leveraged if needed.
#### Custom Image
@@ -192,6 +206,7 @@ ATLANTIS_INCLUDE_GIT_UNTRACKED_FILES=true
OR
`atlantis server --config config.yaml`
+
```yaml
# config.yaml
autoplan-file-list: "**/*.tf,**/*.tfvars,**/*.tfvars.json,**/cdk.tf.json"
@@ -203,6 +218,7 @@ include-git-untracked-files: true
Use `pre_workflow_hooks`
`atlantis server --repo-config="repos.yaml"`
+
```yaml
# repos.yaml
repos:
@@ -243,6 +259,7 @@ generating the `cdk.tf.json` Terraform files.
1. Atlantis then runs `terraform` workflows in the respective directories as usual.
### Terragrunt
+
Atlantis supports running custom commands in place of the default Atlantis
commands. We can use this functionality to enable
[Terragrunt](https://github.com/gruntwork-io/terragrunt).
@@ -250,7 +267,8 @@ commands. We can use this functionality to enable
You can either use your repo's `atlantis.yaml` file or the Atlantis server's `repos.yaml` file.
Given a directory structure:
-```
+
+```plain
.
âââ live
  âââ prod
@@ -315,6 +333,7 @@ workflows:
```
If using the repo's `atlantis.yaml` file you would use the following config:
+
```yaml
version: 3
projects:
@@ -353,10 +372,9 @@ workflows:
**NOTE:** If using the repo's `atlantis.yaml` file, you will need to specify each directory that is a Terragrunt project.
-
::: warning
Atlantis will need to have the `terragrunt` binary in its PATH.
-If you're using Docker you can build your own image, see [Customization](/docs/deployment.html#customization).
+If you're using Docker you can build your own image, see [Customization](deployment.md#customization).
:::
If you don't want to create/manage the repo's `atlantis.yaml` file yourself, you can use the tool [terragrunt-atlantis-config](https://github.com/transcend-io/terragrunt-atlantis-config) to generate it.
@@ -364,6 +382,7 @@ If you don't want to create/manage the repo's `atlantis.yaml` file yourself, you
The `terragrunt-atlantis-config` tool is a community project and not maintained by the Atlantis team.
### Running custom commands
+
Atlantis supports running completely custom commands. In this example, we want to run
a script after every `apply`:
@@ -378,6 +397,7 @@ workflows:
```
::: tip Notes
+
* We don't need to write a `plan` key under `myworkflow`. If `plan`
isn't set, Atlantis will use the default plan workflow which is what we want in this case.
* A custom command will only terminate if all output file descriptors are closed.
@@ -389,6 +409,7 @@ the redirect, the script would block the Atlantis workflow.
:::
### Custom Backend Config
+
If you need to specify the `-backend-config` flag to `terraform init` you'll need to use a custom workflow.
In this example, we're using custom backend files to configure two remote states, one for each environment.
We're then using `.tfvars` files to load different variables for each environment.
@@ -413,12 +434,14 @@ workflows:
- plan:
extra_args: [-var-file=production.tfvars]
```
+
::: warning NOTE
We have to use a custom `run` step to `rm -rf .terraform` because otherwise Terraform
will complain in-between commands since the backend config has changed.
:::
You would then reference the workflows in your repo-level `atlantis.yaml`:
+
```yaml
version: 3
projects:
@@ -431,7 +454,9 @@ projects:
```
## Reference
+
### Workflow
+
```yaml
plan:
apply:
@@ -447,6 +472,7 @@ state_rm:
| state_rm | [Stage](#stage) | `steps: [init, state_rm]` | no | How to run state rm for this project. |
### Stage
+
```yaml
steps:
- run: custom-command
@@ -460,8 +486,11 @@ steps:
| steps | array[[Step](#step)] | `[]` | no | List of steps for this stage. If the steps key is empty, no steps will be run for this stage. |
### Step
+
#### Built-In Commands
+
Steps can be a single string for a built-in command.
+
```yaml
- init
- plan
@@ -469,12 +498,15 @@ Steps can be a single string for a built-in command.
- import
- state_rm
```
+
| Key | Type | Default | Required | Description |
|---------------------------------|--------|---------|----------|------------------------------------------------------------------------------------------------------------------------------|
| init/plan/apply/import/state_rm | string | none | no | Use a built-in command without additional configuration. Only `init`, `plan`, `apply`, `import` and `state_rm` are supported |
#### Built-In Command With Extra Args
+
A map from string to `extra_args` for a built-in command with extra arguments.
+
```yaml
- init:
extra_args: [arg1, arg2]
@@ -487,64 +519,71 @@ A map from string to `extra_args` for a built-in command with extra arguments.
- state_rm:
extra_args: [arg1, arg2]
```
+
| Key | Type | Default | Required | Description |
|---------------------------------|------------------------------------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| init/plan/apply/import/state_rm | map[`extra_args` -> array[string]] | none | no | Use a built-in command and append `extra_args`. Only `init`, `plan`, `apply`, `import` and `state_rm` are supported as keys and only `extra_args` is supported as a value |
+| init/plan/apply/import/state_rm | map\[`extra_args` -> array\[string\]\] | none | no | Use a built-in command and append `extra_args`. Only `init`, `plan`, `apply`, `import` and `state_rm` are supported as keys and only `extra_args` is supported as a value |
#### Custom `run` Command
+
A custom command can be written in 2 ways
Compact:
+
```yaml
- run: custom-command arg1 arg2
```
+
| Key | Type | Default | Required | Description |
|-----|--------|---------|----------|----------------------|
| run | string | none | no | Run a custom command |
Full
+
```yaml
- run:
command: custom-command arg1 arg2
output: show
custom_regex: .*
```
+
| Key | Type | Default | Required | Description |
|-------------------|-----------------------|---------|-----------|-----------------------|
| run | map[string -> string] | none | no | Run a custom command |
| run.command | string | none | yes | Shell command to run |
-| run.output | string | "show" | no | How to post-process the output of this command when posted in the PR comment. The options are * `show` - preserve the full output * `hide` - hide output from comment (still visible in the real-time streaming output) * `strip_refreshing` - hide all output up until and including the last line containing "Refreshing...". This matches the behavior of the built-in `plan` command * `custom_regex` - filters the comment output based on the regex specified on `run.regex_filter` by replacing matched patterns with the text ` * `strip_refreshing_with_custom_regex` - applies `strip_refreshing` and `custom_regex` to the output |
+| run.output | string | "show" | no | How to post-process the output of this command when posted in the PR comment. The options are *`show` - preserve the full output * `hide` - hide output from comment (still visible in the real-time streaming output) *`strip_refreshing` - hide all output up until and including the last line containing "Refreshing...". This matches the behavior of the built-in `plan` command * `custom_regex` - filters the comment output based on the regex specified on `run.regex_filter` by replacing matched patterns with the text ` * `strip_refreshing_with_custom_regex` - applies `strip_refreshing` and `custom_regex` to the output |
| run.custom_regex | string | none | no | Regex filter to be applied to output. Required when `run.output` is `custom_regex` or `strip_refreshing_with_custom_regex` |
::: tip Notes
+
* `run` steps in the main `workflow` are executed with the following environment variables:
note: these variables are not available to `pre` or `post` workflows
- * `WORKSPACE` - The Terraform workspace used for this project, ex. `default`.
+ * `WORKSPACE` - The Terraform workspace used for this project, ex. `default`.
NOTE: if the step is executed before `init` then Atlantis won't have switched to this workspace yet.
- * `ATLANTIS_TERRAFORM_VERSION` - The version of Terraform used for this project, ex. `0.11.0`.
- * `DIR` - Absolute path to the current directory.
- * `PLANFILE` - Absolute path to the location where Atlantis expects the plan to
+ * `ATLANTIS_TERRAFORM_VERSION` - The version of Terraform used for this project, ex. `0.11.0`.
+ * `DIR` - Absolute path to the current directory.
+ * `PLANFILE` - Absolute path to the location where Atlantis expects the plan to
either be generated (by plan) or already exist (if running apply). Can be used to
override the built-in `plan`/`apply` commands, ex. `run: terraform plan -out $PLANFILE`.
- * `SHOWFILE` - Absolute path to the location where Atlantis expects the plan in json format to
+ * `SHOWFILE` - Absolute path to the location where Atlantis expects the plan in json format to
either be generated (by show) or already exist (if running policy checks). Can be used to
override the built-in `plan`/`apply` commands, ex. `run: terraform show -json $PLANFILE > $SHOWFILE`.
- * `POLICYCHECKFILE` - Absolute path to the location of policy check output if Atlantis runs policy checks.
- See [policy checking](/docs/policy-checking.html#data-for-custom-run-steps) for information of data structure.
- * `BASE_REPO_NAME` - Name of the repository that the pull request will be merged into, ex. `atlantis`.
- * `BASE_REPO_OWNER` - Owner of the repository that the pull request will be merged into, ex. `runatlantis`.
- * `HEAD_REPO_NAME` - Name of the repository that is getting merged into the base repository, ex. `atlantis`.
- * `HEAD_REPO_OWNER` - Owner of the repository that is getting merged into the base repository, ex. `acme-corp`.
- * `HEAD_BRANCH_NAME` - Name of the head branch of the pull request (the branch that is getting merged into the base)
- * `HEAD_COMMIT` - The sha256 that points to the head of the branch that is being pull requested into the base. If the pull request is from Bitbucket Cloud the string will only be 12 characters long because Bitbucket Cloud truncates its commit IDs.
- * `BASE_BRANCH_NAME` - Name of the base branch of the pull request (the branch that the pull request is getting merged into)
- * `PROJECT_NAME` - Name of the project configured in `atlantis.yaml`. If no project name is configured this will be an empty string.
- * `PULL_NUM` - Pull request number or ID, ex. `2`.
- * `PULL_URL` - Pull request URL, ex. `https://github.com/runatlantis/atlantis/pull/2`.
- * `PULL_AUTHOR` - Username of the pull request author, ex. `acme-user`.
- * `REPO_REL_DIR` - The relative path of the project in the repository. For example if your project is in `dir1/dir2/` then this will be set to `"dir1/dir2"`. If your project is at the root this will be `"."`.
- * `USER_NAME` - Username of the VCS user running command, ex. `acme-user`. During an autoplan, the user will be the Atlantis API user, ex. `atlantis`.
- * `COMMENT_ARGS` - Any additional flags passed in the comment on the pull request. Flags are separated by commas and
+ * `POLICYCHECKFILE` - Absolute path to the location of policy check output if Atlantis runs policy checks.
+ See [policy checking](policy-checking.md#data-for-custom-run-steps) for information of data structure.
+ * `BASE_REPO_NAME` - Name of the repository that the pull request will be merged into, ex. `atlantis`.
+ * `BASE_REPO_OWNER` - Owner of the repository that the pull request will be merged into, ex. `runatlantis`.
+ * `HEAD_REPO_NAME` - Name of the repository that is getting merged into the base repository, ex. `atlantis`.
+ * `HEAD_REPO_OWNER` - Owner of the repository that is getting merged into the base repository, ex. `acme-corp`.
+ * `HEAD_BRANCH_NAME` - Name of the head branch of the pull request (the branch that is getting merged into the base)
+ * `HEAD_COMMIT` - The sha256 that points to the head of the branch that is being pull requested into the base. If the pull request is from Bitbucket Cloud the string will only be 12 characters long because Bitbucket Cloud truncates its commit IDs.
+ * `BASE_BRANCH_NAME` - Name of the base branch of the pull request (the branch that the pull request is getting merged into)
+ * `PROJECT_NAME` - Name of the project configured in `atlantis.yaml`. If no project name is configured this will be an empty string.
+ * `PULL_NUM` - Pull request number or ID, ex. `2`.
+ * `PULL_URL` - Pull request URL, ex. `https://github.com/runatlantis/atlantis/pull/2`.
+ * `PULL_AUTHOR` - Username of the pull request author, ex. `acme-user`.
+ * `REPO_REL_DIR` - The relative path of the project in the repository. For example if your project is in `dir1/dir2/` then this will be set to `"dir1/dir2"`. If your project is at the root this will be `"."`.
+ * `USER_NAME` - Username of the VCS user running command, ex. `acme-user`. During an autoplan, the user will be the Atlantis API user, ex. `atlantis`.
+ * `COMMENT_ARGS` - Any additional flags passed in the comment on the pull request. Flags are separated by commas and
every character is escaped, ex. `atlantis plan -- arg1 arg2` will result in `COMMENT_ARGS=\a\r\g\1,\a\r\g\2`.
* A custom command will only terminate if all output file descriptors are closed.
Therefore a custom command can only be sent to the background (e.g. for an SSH tunnel during
@@ -556,12 +595,14 @@ the redirect, the script would block the Atlantis workflow.
:::
#### Environment Variable `env` Command
+
The `env` command allows you to set environment variables that will be available
to all steps defined **below** the `env` step.
You can set hard coded values via the `value` key, or set dynamic values via
the `command` key which allows you to run any command and uses the output
as the environment variable value.
+
```yaml
- env:
name: ENV_NAME
@@ -570,34 +611,56 @@ as the environment variable value.
name: ENV_NAME_2
command: 'echo "dynamic-value-$(date)"'
```
+
| Key | Type | Default | Required | Description |
|-----------------|-----------------------|---------|----------|-----------------------------------------------------------------------------------------------------------------|
-| env | map[string -> string] | none | no | Set environment variables for subsequent steps |
+| env | map\[string -> string\] | none | no | Set environment variables for subsequent steps |
| env.name | string | none | yes | Name of the environment variable |
| env.value | string | none | no | Set the value of the environment variable to a hard-coded string. Cannot be set at the same time as `command` |
| env.command | string | none | no | Set the value of the environment variable to the output of a command. Cannot be set at the same time as `value` |
::: tip Notes
+
* `env` `command`'s can use any of the built-in environment variables available
to `run` commands.
:::
#### Multiple Environment Variables `multienv` Command
+
The `multienv` command allows you to set dynamic number of multiple environment variables that will be available
to all steps defined **below** the `multienv` step.
+
+Compact:
+
```yaml
- multienv: custom-command
```
-| Key | Type | Default | Required | Description |
-|----------|--------|---------|----------|--------------------------------------------------------------------------------|
-| multienv | string | none | no | Run a custom command and add set environment variables according to the result |
-The result of the executed command must have a fixed format:
-EnvVar1Name=value1,EnvVar2Name=value2,EnvVar3Name=value3
+| Key | Type | Default | Required | Description |
+|----------|--------|---------|----------|------------------------------------------------------------|
+| multienv | string | none | no | Run a custom command and add printed environment variables |
-The name-value pairs in the result are added as environment variables if success is true otherwise the workflow execution stops with error and the errorMessage is getting displayed.
+Full:
+
+```yaml
+- multienv:
+ command: custom-command
+ output: show
+```
+
+| Key | Type | Default | Required | Description |
+|------------------|-----------------------|---------|----------|-------------------------------------------------------------------------------------|
+| multienv | map[string -> string] | none | no | Run a custom command and add printed environment variables |
+| multienv.command | string | none | yes | Name of the custom script to run |
+| multienv.output | string | "show" | no | Setting output to "hide" will supress the message obout added environment variables |
+
+The output of the command execution must have the following format:
+`EnvVar1Name=value1,EnvVar2Name=value2,EnvVar3Name=value3`
+
+The name-value pairs in the output are added as environment variables if command execution is successful, otherwise the workflow execution is interrupted with an error and the errorMessage is returned.
::: tip Notes
+
* `multienv` `command`'s can use any of the built-in environment variables available
to `run` commands.
:::
diff --git a/runatlantis.io/docs/deployment.md b/runatlantis.io/docs/deployment.md
index 05e91b5e70..dfe5ae27cc 100644
--- a/runatlantis.io/docs/deployment.md
+++ b/runatlantis.io/docs/deployment.md
@@ -1,29 +1,33 @@
# Deployment
+
This page covers getting Atlantis up and running in your infrastructure.
::: tip Prerequisites
-* You have created [access credentials](access-credentials.html) for your Atlantis user
-* You have created a [webhook secret](webhook-secrets.html)
-:::
-[[toc]]
+* You have created [access credentials](access-credentials.md) for your Atlantis user
+* You have created a [webhook secret](webhook-secrets.md)
+:::
## Architecture Overview
+
### Runtime
+
Atlantis is a simple [Go](https://golang.org/) app. It receives webhooks from
your Git host and executes Terraform commands locally. There is an official
Atlantis [Docker image](https://ghcr.io/runatlantis/atlantis).
### Routing
+
Atlantis and your Git host need to be able to route and communicate with one another. Your Git host needs to be able to send webhooks to Atlantis and Atlantis needs to be able to make API calls to your Git host.
If you're using
-a public Git host like github.com, gitlab.com, bitbucket.org, or dev.azure.com then you'll need to
+a public Git host like github.com, gitlab.com, gitea.com, bitbucket.org, or dev.azure.com then you'll need to
expose Atlantis to the internet.
-If you're using a private Git host like GitHub Enterprise, GitLab Enterprise or
+If you're using a private Git host like GitHub Enterprise, GitLab Enterprise, self-hosted Gitea or
Bitbucket Server, then Atlantis needs to be routable from the private host and Atlantis will need to be able to route to the private host.
### Data
+
Atlantis has no external database. Atlantis stores Terraform plan files on disk.
If Atlantis loses that data in between a `plan` and `apply` cycle, then users will have
to re-run `plan`. Because of this, you may want to provision a persistent disk
@@ -32,6 +36,7 @@ for Atlantis.
## Deployment
Pick your deployment type:
+
* [Kubernetes Helm Chart](#kubernetes-helm-chart)
* [Kubernetes Manifests](#kubernetes-manifests)
* [Kubernetes Kustomize](#kubernetes-kustomize)
@@ -41,21 +46,27 @@ Pick your deployment type:
* [Docker](#docker)
* [Roll Your Own](#roll-your-own)
-
### Kubernetes Helm Chart
+
Atlantis has an [official Helm chart](https://github.com/runatlantis/helm-charts/tree/main/charts/atlantis)
To install:
+
1. Add the runatlantis helm chart repository to helm
+
```bash
helm repo add runatlantis https://runatlantis.github.io/helm-charts
```
+
1. `cd` into a directory where you're going to configure your Atlantis Helm chart
1. Create a `values.yaml` file by running
+
```bash
helm inspect values runatlantis/atlantis > values.yaml
```
+
1. Edit `values.yaml` and add your access credentials and webhook secret
+
```yaml
# for example
github:
@@ -63,28 +74,33 @@ To install:
token: bar
secret: baz
```
+
1. Edit `values.yaml` and set your `orgAllowlist` (see [Repo Allowlist](server-configuration.md#repo-allowlist) for more information)
+
```yaml
orgAllowlist: github.com/runatlantis/*
```
- **Note**: For helm chart version < `4.0.2`, `orgWhitelist` must be used instead.
-1. Configure any other variables (see [https://github.com/runatlantis/helm-charts#customization](https://github.com/runatlantis/helm-charts#customization)
+
+ **Note**: For helm chart version < `4.0.2`, `orgWhitelist` must be used instead.
+1. Configure any other variables (see [Atlantis Helm Chart: Customization](https://github.com/runatlantis/helm-charts#customization)
for documentation)
1. Run
+
```sh
helm install atlantis runatlantis/atlantis -f values.yaml
```
If you are using helm v2, run:
+
```sh
helm install -f values.yaml runatlantis/atlantis
```
-
Atlantis should be up and running in minutes! See [Next Steps](#next-steps) for
what to do next.
### Kubernetes Manifests
+
If you'd like to use a raw Kubernetes manifest, we offer either a
[Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
or a [Statefulset](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) with persistent storage.
@@ -94,35 +110,42 @@ or you upgrade Atlantis, you won't lose plans that haven't been applied. If
you do lose that data, you just need to run `atlantis plan` again so it's not the end of the world.
Regardless of whether you choose a Deployment or StatefulSet, first create a Secret with the webhook secret and access token:
+
```bash
echo -n "yourtoken" > token
echo -n "yoursecret" > webhook-secret
kubectl create secret generic atlantis-vcs --from-file=token --from-file=webhook-secret
```
+
::: tip Note
If you're using Bitbucket Cloud then there is no webhook secret since it's not supported.
:::
Next, edit the manifests below as follows:
-1. Replace `` in `image: ghcr.io/runatlantis/atlantis:` with the most recent version from [https://github.com/runatlantis/atlantis/releases/latest](https://github.com/runatlantis/atlantis/releases/latest).
+
+1. Replace `` in `image: ghcr.io/runatlantis/atlantis:` with the most recent version from [GitHub: Atlantis latest release](https://github.com/runatlantis/atlantis/releases/latest).
* NOTE: You never want to run with `:latest` because if your Pod moves to a new node, Kubernetes will pull the latest image and you might end
up upgrading Atlantis by accident!
2. Replace `value: github.com/yourorg/*` under `name: ATLANTIS_REPO_ALLOWLIST` with the allowlist pattern
-for your Terraform repos. See [Repo Allowlist](server-configuration.html#repo-allowlist) for more details.
+for your Terraform repos. See [--repo-allowlist](server-configuration.md#repo-allowlist) for more details.
3. If you're using GitHub:
1. Replace `` with the username of your Atlantis GitHub user without the `@`.
- 2. Delete all the `ATLANTIS_GITLAB_*`, `ATLANTIS_BITBUCKET_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
+ 2. Delete all the `ATLANTIS_GITLAB_*`, `ATLANTIS_GITEA_*`, `ATLANTIS_BITBUCKET_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
4. If you're using GitLab:
1. Replace `` with the username of your Atlantis GitLab user without the `@`.
- 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_BITBUCKET_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
-5. If you're using Bitbucket:
+ 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_GITEA_*`, `ATLANTIS_BITBUCKET_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
+5. If you're using Gitea:
+ 1. Replace `` with the username of your Atlantis Gitea user without the `@`.
+ 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_GITLAB_*`, `ATLANTIS_BITBUCKET_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
+6. If you're using Bitbucket:
1. Replace `` with the username of your Atlantis Bitbucket user without the `@`.
- 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_GITLAB_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
-6. If you're using Azure DevOps:
+ 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_GITLAB_*`, `ATLANTIS_GITEA_*`, and `ATLANTIS_AZUREDEVOPS_*` environment variables.
+7. If you're using Azure DevOps:
1. Replace `` with the username of your Atlantis Azure DevOps user without the `@`.
- 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_GITLAB_*`, and `ATLANTIS_BITBUCKET_*` environment variables.
+ 2. Delete all the `ATLANTIS_GH_*`, `ATLANTIS_GITLAB_*`, `ATLANTIS_GITEA_*`, and `ATLANTIS_BITBUCKET_*` environment variables.
#### StatefulSet Manifest
+
Show...
@@ -185,6 +208,21 @@ spec:
key: webhook-secret
### End GitLab Config ###
+ ### Gitea Config ###
+ - name: ATLANTIS_GITEA_USER
+ value: # 4i. If you're using Gitea replace with the username of your Atlantis Gitea user without the `@`.
+ - name: ATLANTIS_GITEA_TOKEN
+ valueFrom:
+ secretKeyRef:
+ name: atlantis-vcs
+ key: token
+ - name: ATLANTIS_GITEA_WEBHOOK_SECRET
+ valueFrom:
+ secretKeyRef:
+ name: atlantis-vcs
+ key: webhook-secret
+ ### End Gitea Config ###
+
### Bitbucket Config ###
- name: ATLANTIS_BITBUCKET_USER
value: # 5i. If you're using Bitbucket replace with the username of your Atlantis Bitbucket user without the `@`.
@@ -272,10 +310,11 @@ spec:
selector:
app.kubernetes.io/name: atlantis
```
-
+
#### Deployment Manifest
+
Show...
@@ -333,6 +372,21 @@ spec:
key: webhook-secret
### End GitLab Config ###
+ ### Gitea Config ###
+ - name: ATLANTIS_GITEA_USER
+ value: # 4i. If you're using Gitea replace with the username of your Atlantis Gitea user without the `@`.
+ - name: ATLANTIS_GITEA_TOKEN
+ valueFrom:
+ secretKeyRef:
+ name: atlantis-vcs
+ key: token
+ - name: ATLANTIS_GITEA_WEBHOOK_SECRET
+ valueFrom:
+ secretKeyRef:
+ name: atlantis-vcs
+ key: webhook-secret
+ ### End Gitea Config ###
+
### Bitbucket Config ###
- name: ATLANTIS_BITBUCKET_USER
value: # 5i. If you're using Bitbucket replace with the username of your Atlantis Bitbucket user without the `@`.
@@ -405,14 +459,16 @@ spec:
selector:
app.kubernetes.io/name: atlantis
```
+
#### Routing and SSL
+
The manifests above create a Kubernetes `Service` of `type: ClusterIP` which isn't accessible outside your cluster.
Depending on how you're doing routing into Kubernetes, you may want to use a Service of `type: LoadBalancer` so that Atlantis is accessible
to GitHub/GitLab and your internal users.
-If you want to add SSL you can use something like [https://github.com/jetstack/cert-manager](https://github.com/jetstack/cert-manager) to generate SSL
+If you want to add SSL you can use something like [cert-manager](https://github.com/cert-manager/cert-manager) to generate SSL
certs and mount them into the Pod. Then set the `ATLANTIS_SSL_CERT_FILE` and `ATLANTIS_SSL_KEY_FILE` environment variables to enable SSL.
You could also set up SSL at your LoadBalancer.
@@ -425,6 +481,7 @@ A `kustomization.yaml` file is provided in the directory `kustomize/`, so you ma
You will need to provide a secret (with the default name of `atlantis-vcs`) to configure Atlantis with access credentials for your remote repositories.
Example:
+
```yaml
bases:
- github.com/runatlantis/atlantis//kustomize
@@ -450,7 +507,6 @@ patchesStrategicMerge:
#### Required
-
```yaml
...
containers:
@@ -481,6 +537,26 @@ containers:
key: webhook-secret
```
+#### Gitea
+
+```yaml
+containers:
+- name: atlantis
+ env:
+ - name: ATLANTIS_GITEA_USER
+ value: # 4i. If you're using Gitea replace with the username of your Atlantis Gitea user without the `@`.
+ - name: ATLANTIS_GITEA_TOKEN
+ valueFrom:
+ secretKeyRef:
+ name: atlantis-vcs
+ key: token
+ - name: ATLANTIS_GITEA_WEBHOOK_SECRET
+ valueFrom:
+ secretKeyRef:
+ name: atlantis-vcs
+ key: webhook-secret
+```
+
#### GitHub
```yaml
@@ -519,37 +595,44 @@ containers:
```
### OpenShift
+
The Helm chart and Kubernetes manifests above are compatible with OpenShift, however you need to run
with an additional environment variable: `HOME=/home/atlantis`. This is required because
OpenShift runs Docker images with random user id's that use `/` as their home directory.
### AWS Fargate
+
If you'd like to run Atlantis on [AWS Fargate](https://aws.amazon.com/fargate/)
check out the Atlantis module on the [Terraform Module Registry](https://registry.terraform.io/modules/terraform-aws-modules/atlantis/aws/latest)
and then check out the [Next Steps](#next-steps).
### Google Kubernetes Engine (GKE)
+
You can run Atlantis on GKE using the [Helm chart](#kubernetes-helm-chart) or the [manifests](#kubernetes-manifests).
There is also a set of full Terraform configurations that create a GKE Cluster,
-Cloud Storage Backend and TLS certs: [https://github.com/sethvargo/atlantis-on-gke](https://github.com/sethvargo/atlantis-on-gke).
+Cloud Storage Backend and TLS certs: [sethvargo atlantis-on-gke](https://github.com/sethvargo/atlantis-on-gke).
Once you're done, see [Next Steps](#next-steps).
### Google Compute Engine (GCE)
-Atlantis can be run on Google Compute Engine using a Terraform module that deploys it as a Docker container on a managed Compute Engine instance.
-This [Terraform module](https://registry.terraform.io/modules/bschaatsbergen/atlantis/gce/latest) features the creation of a Cloud load balancer, a Container-Optimized OS-based VM, a persistent data disk, and a managed instance group.
+Atlantis can be run on Google Compute Engine using a Terraform module that deploys it as a Docker container on a managed Compute Engine instance.
+
+This [Terraform module](https://registry.terraform.io/modules/runatlantis/atlantis/gce/latest) features the creation of a Cloud load balancer, a Container-Optimized OS-based VM, a persistent data disk, and a managed instance group.
After it is deployed, see [Next Steps](#next-steps).
### Docker
+
Atlantis has an [official](https://ghcr.io/runatlantis/atlantis) Docker image: `ghcr.io/runatlantis/atlantis`.
#### Customization
+
If you need to modify the Docker image that we provide, for instance to add the terragrunt binary, you can do something like this:
1. Create a custom docker file
+
```dockerfile
FROM ghcr.io/runatlantis/atlantis:{latest version}
@@ -563,32 +646,37 @@ Additionally, the /docker-entrypoint.d/ directory offers a flexible option for i
**Important Notice**: There is a critical update regarding the data directory in Atlantis. In versions prior to 0.26.0, the directory was configured to be accessible by the root user. However, with the transition to the atlantis user in newer versions, it is imperative to update the directory permissions accordingly in your current deployment when upgrading to a version later than 0.26.0. This step ensures seamless access and functionality for the atlantis user.
1. Build your Docker image
+
```bash
docker build -t {YOUR_DOCKER_ORG}/atlantis-custom .
```
1. Run your image
+
```bash
docker run {YOUR_DOCKER_ORG}/atlantis-custom server --gh-user=GITHUB_USERNAME --gh-token=GITHUB_TOKEN
```
### Microsoft Azure
-The standard [Kubernetes Helm Chart](#kubernetes-helm-chart) should work fine on [Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes).
+The standard [Kubernetes Helm Chart](#kubernetes-helm-chart) should work fine on [Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes).
-Another option is [Azure Container Instances](https://docs.microsoft.com/en-us/azure/container-instances/). See this community member's [repo](https://github.com/jplane/atlantis-on-aci) or the new and more up-to-date [Terraform module](https://github.com/getindata/terraform-azurerm-atlantis) for install scripts and more information on running Atlantis on ACI.
+Another option is [Azure Container Instances](https://docs.microsoft.com/en-us/azure/container-instances/). See this community member's [repo](https://github.com/jplane/atlantis-on-aci) or the new and more up-to-date [Terraform module](https://github.com/getindata/terraform-azurerm-atlantis) for install scripts and more information on running Atlantis on ACI.
**Note on ACI Deployment:** Due to a bug in earlier Docker releases, Docker v23.0.0 or later is required for straightforward deployment. Alternatively, the Atlantis Docker image can be pushed to a private registry such as ACR and then used.
### Roll Your Own
+
If you want to roll your own Atlantis installation, you can get the `atlantis`
-binary from [https://github.com/runatlantis/atlantis/releases](https://github.com/runatlantis/atlantis/releases)
+binary from [GitHub](https://github.com/runatlantis/atlantis/releases)
or use the [official Docker image](https://ghcr.io/runatlantis/atlantis).
#### Startup Command
+
The exact flags to `atlantis server` depends on your Git host:
##### GitHub
+
```bash
atlantis server \
--atlantis-url="$URL" \
@@ -599,6 +687,7 @@ atlantis server \
```
##### GitHub Enterprise
+
```bash
HOSTNAME=YOUR_GITHUB_ENTERPRISE_HOSTNAME # ex. github.runatlantis.io
atlantis server \
@@ -611,6 +700,7 @@ atlantis server \
```
##### GitLab
+
```bash
atlantis server \
--atlantis-url="$URL" \
@@ -621,6 +711,7 @@ atlantis server \
```
##### GitLab Enterprise
+
```bash
HOSTNAME=YOUR_GITLAB_ENTERPRISE_HOSTNAME # ex. gitlab.runatlantis.io
atlantis server \
@@ -632,7 +723,20 @@ atlantis server \
--repo-allowlist="$REPO_ALLOWLIST"
```
+##### Gitea
+
+```bash
+atlantis server \
+--atlantis-url="$URL" \
+--gitea-user="$USERNAME" \
+--gitea-token="$TOKEN" \
+--gitea-webhook-secret="$SECRET" \
+--gitea-page-size=30 \
+--repo-allowlist="$REPO_ALLOWLIST"
+```
+
##### Bitbucket Cloud (bitbucket.org)
+
```bash
atlantis server \
--atlantis-url="$URL" \
@@ -642,6 +746,7 @@ atlantis server \
```
##### Bitbucket Server (aka Stash)
+
```bash
BASE_URL=YOUR_BITBUCKET_SERVER_URL # ex. http://bitbucket.mycorp:7990
atlantis server \
@@ -670,21 +775,23 @@ atlantis server \
```
Where
-- `$URL` is the URL that Atlantis can be reached at
-- `$USERNAME` is the GitHub/GitLab/Bitbucket/AzureDevops username you generated the token for
-- `$TOKEN` is the access token you created. If you don't want this to be passed
+
+* `$URL` is the URL that Atlantis can be reached at
+* `$USERNAME` is the GitHub/GitLab/Gitea/Bitbucket/AzureDevops username you generated the token for
+* `$TOKEN` is the access token you created. If you don't want this to be passed
in as an argument for security reasons you can specify it in a config file
- (see [Configuration](/docs/server-configuration.html#environment-variables))
- or as an environment variable: `ATLANTIS_GH_TOKEN` or `ATLANTIS_GITLAB_TOKEN`
+ (see [Configuration](server-configuration.md#environment-variables))
+ or as an environment variable: `ATLANTIS_GH_TOKEN` or `ATLANTIS_GITLAB_TOKEN` or `ATLANTIS_GITEA_TOKEN`
or `ATLANTIS_BITBUCKET_TOKEN` or `ATLANTIS_AZUREDEVOPS_TOKEN`
-- `$SECRET` is the random key you used for the webhook secret.
+* `$SECRET` is the random key you used for the webhook secret.
If you don't want this to be passed in as an argument for security reasons
you can specify it in a config file
- (see [Configuration](/docs/server-configuration.html#environment-variables))
- or as an environment variable: `ATLANTIS_GH_WEBHOOK_SECRET` or `ATLANTIS_GITLAB_WEBHOOK_SECRET`
-- `$REPO_ALLOWLIST` is which repos Atlantis can run on, ex.
+ (see [Configuration](server-configuration.md#environment-variables))
+ or as an environment variable: `ATLANTIS_GH_WEBHOOK_SECRET` or `ATLANTIS_GITLAB_WEBHOOK_SECRET` or
+ `ATLANTIS_GITEA_WEBHOOK_SECRET`
+* `$REPO_ALLOWLIST` is which repos Atlantis can run on, ex.
`github.com/runatlantis/*` or `github.enterprise.corp.com/*`.
- See [Repo Allowlist](server-configuration.html#repo-allowlist) for more details.
+ See [--repo-allowlist](server-configuration.md#repo-allowlist) for more details.
Atlantis is now running!
::: tip
@@ -693,5 +800,6 @@ restart it in case of failure.
:::
## Next Steps
+
* To ensure Atlantis is running, load its UI. By default Atlantis runs on port `4141`.
-* Now you're ready to add Webhooks to your repos. See [Configuring Webhooks](configuring-webhooks.html).
+* Now you're ready to add Webhooks to your repos. See [Configuring Webhooks](configuring-webhooks.md).
diff --git a/runatlantis.io/docs/faq.md b/runatlantis.io/docs/faq.md
index 2cea8e8c92..1764719d97 100644
--- a/runatlantis.io/docs/faq.md
+++ b/runatlantis.io/docs/faq.md
@@ -1,4 +1,5 @@
# FAQ
+
**Q: Does Atlantis affect Terraform [remote state](https://developer.hashicorp.com/terraform/language/state/remote)?**
A: No. Atlantis does not interfere with Terraform remote state in any way. Under the hood, Atlantis is simply executing `terraform plan` and `terraform apply`.
diff --git a/runatlantis.io/docs/how-atlantis-works.md b/runatlantis.io/docs/how-atlantis-works.md
index ed57d988f5..f486091b3b 100644
--- a/runatlantis.io/docs/how-atlantis-works.md
+++ b/runatlantis.io/docs/how-atlantis-works.md
@@ -1,7 +1,8 @@
# How Atlantis Works
+
This section of docs talks about how Atlantis at deeper level.
-* [Locking](locking.html)
-* [Autoplanning](autoplanning.html)
-* [Automerging](automerging.html)
-* [Security](security.html)
+* [Locking](locking.md)
+* [Autoplanning](autoplanning.md)
+* [Automerging](automerging.md)
+* [Security](security.md)
diff --git a/runatlantis.io/docs/installation-guide.md b/runatlantis.io/docs/installation-guide.md
index fafa5d5b90..f5f1bd71d1 100644
--- a/runatlantis.io/docs/installation-guide.md
+++ b/runatlantis.io/docs/installation-guide.md
@@ -1,20 +1,22 @@
# Installation Guide
+
This guide is for installing a **production-ready** instance of Atlantis onto your
infrastructure:
+
1. First, ensure your Terraform setup meets the Atlantis **requirements**
- * See [Requirements](requirements.html)
-1. Create **access credentials** for your Git host (GitHub, GitLab, Bitbucket, Azure DevOps)
- * See [Generating Git Host Access Credentials](access-credentials.html)
+ * See [Requirements](requirements.md)
+1. Create **access credentials** for your Git host (GitHub, GitLab, Gitea, Bitbucket, Azure DevOps)
+ * See [Generating Git Host Access Credentials](access-credentials.md)
1. Create a **webhook secret** so Atlantis can validate webhooks
- * See [Creating a Webhook Secret](webhook-secrets.html)
+ * See [Creating a Webhook Secret](webhook-secrets.md)
1. **Deploy** Atlantis into your infrastructure
- * See [Deployment](deployment.html)
+ * See [Deployment](deployment.md)
1. Configure **Webhooks** on your Git host so Atlantis can respond to your pull requests
- * See [Configuring Webhooks](configuring-webhooks.html)
+ * See [Configuring Webhooks](configuring-webhooks.md)
1. Configure **provider credentials** so Atlantis can actually run Terraform commands
- * See [Provider Credentials](provider-credentials.html)
+ * See [Provider Credentials](provider-credentials.md)
:::tip
-If you want to test out Atlantis first, check out [Test Drive](../guide/test-drive.html)
-and [Testing Locally](../guide/testing-locally.html).
+If you want to test out Atlantis first, check out [Test Drive](../guide/test-drive.md)
+and [Testing Locally](../guide/testing-locally.md).
:::
diff --git a/runatlantis.io/docs/locking.md b/runatlantis.io/docs/locking.md
index 65836d3b70..c75e2b3fce 100644
--- a/runatlantis.io/docs/locking.md
+++ b/runatlantis.io/docs/locking.md
@@ -1,4 +1,5 @@
# Locking
+
When `plan` is run, the directory and Terraform workspace are **Locked** until the pull request is merged or closed, or the plan is manually deleted.
If another user attempts to `plan` for the same directory and workspace in a different pull request
@@ -12,9 +13,8 @@ Which links them to the pull request that holds the lock.
Only the directory in the repo and Terraform workspace are locked, not the whole repo.
:::
-[[toc]]
-
## Why
+
1. Because `atlantis apply` is being done before the pull request is merged, after
an apply your `main` branch does not represent the most up to date version of your infrastructure
anymore. With locking, you can ensure that no other changes will be made until the
@@ -30,6 +30,7 @@ but with the added ability to re-plan/apply multiple times if things don't work.
will be made invalid after the in-progress plan is applied.
## Viewing Locks
+
To view locks, go to the URL that Atlantis is hosted at:
![Locks View](./images/locks-ui.png)
@@ -41,6 +42,7 @@ You can click on a lock to view its details:
## Unlocking
+
The project and workspace will be automatically unlocked when the PR is merged or closed.
To unlock the project and workspace without completing an `apply` and merging, comment `atlantis unlock` on the PR,
@@ -59,6 +61,7 @@ to delete the lock.
Once a plan is discarded, you'll need to run `plan` again prior to running `apply` when you go back to that pull request.
## Relationship to Terraform State Locking
+
Atlantis does not conflict with [Terraform State Locking](https://developer.hashicorp.com/terraform/language/state/locking). Under the hood, all
Atlantis is doing is running `terraform plan` and `apply` and so all of the
locking built in to those commands by Terraform isn't affected.
diff --git a/runatlantis.io/docs/policy-checking.md b/runatlantis.io/docs/policy-checking.md
index c996ef7ee0..60d5b306e0 100644
--- a/runatlantis.io/docs/policy-checking.md
+++ b/runatlantis.io/docs/policy-checking.md
@@ -10,7 +10,7 @@ for using this step include:
## How it works?
-Enabling "policy checking" in addition to the [mergeable apply requirement](/docs/command-requirements.html#supported-requirements) blocks applies on plans that fail any of the defined conftest policies.
+Enabling "policy checking" in addition to the [mergeable apply requirement](command-requirements.md#supported-requirements) blocks applies on plans that fail any of the defined conftest policies.
![Policy Check Apply Failure](./images/policy-check-apply-failure.png)
@@ -20,9 +20,9 @@ Any failures need to either be addressed in a successive commit, or approved by
![Policy Check Approval](./images/policy-check-approval.png)
-
Policy approvals may be cleared either by re-planing, or by issuing the following command:
-```
+
+```shell
atlantis approve_policies --clear-policy-approval
```
@@ -44,11 +44,11 @@ All repositories will have policy checking enabled.
### Step 2: Define the policy configuration
-Policy Configuration is defined in the [server-side repo configuration](https://www.runatlantis.io/docs/server-side-repo-config.html#reference).
+Policy Configuration is defined in the [server-side repo configuration](server-side-repo-config.md#reference).
In this example we will define one policy set with one owner:
-```
+```yaml
policies:
owners:
users:
@@ -72,11 +72,11 @@ policies:
- `owners` - Defines the users/teams which are able to approve a specific policy set.
- `approve_count` - Defines the number of approvals needed to bypass policy checks. Defaults to the top-level policies configuration, if not specified.
-By default conftest is configured to only run the `main` package. If you wish to run specific/multiple policies consider passing `--namespace` or `--all-namespaces` to conftest with [`extra_args`](https://www.runatlantis.io/docs/custom-workflows.html#adding-extra-arguments-to-terraform-commands) via a custom workflow as shown in the below example.
+By default conftest is configured to only run the `main` package. If you wish to run specific/multiple policies consider passing `--namespace` or `--all-namespaces` to conftest with [`extra_args`](custom-workflows.md#adding-extra-arguments-to-terraform-commands) via a custom workflow as shown in the below example.
Example Server Side Repo configuration using `--all-namespaces` and a local src dir.
-```
+```yaml
repos:
- id: github.com/myorg/example-repo
workflow: custom
@@ -104,7 +104,7 @@ workflows:
Conftest policies are based on [Open Policy Agent (OPA)](https://www.openpolicyagent.org/) and written in [rego](https://www.openpolicyagent.org/docs/latest/policy-language/#what-is-rego). Following our example, simply create a `rego` file in `null_resource_warning` folder with following code, the code below a simple policy that will fail for plans containing newly created `null_resource`s.
-```
+```rego
package main
resource_types = {"null_resource"}
@@ -144,7 +144,7 @@ That's it! Now your Atlantis instance is configured to run policies on your Terr
### Pulling policies from a remote location
-Conftest supports [pulling policies](https://www.conftest.dev/sharing/#pulling) from remote locations such as S3, git, OCI, and other protocols supported by the [go-getter](https://github.com/hashicorp/go-getter) library. The key [`extra_args`](https://www.runatlantis.io/docs/custom-workflows.html#adding-extra-arguments-to-terraform-commands) can be used to pass in the [`--update`](https://www.conftest.dev/sharing/#-update-flag) flag to tell `conftest` to pull the policies into the project folder before running the policy check.
+Conftest supports [pulling policies](https://www.conftest.dev/sharing/#pulling) from remote locations such as S3, git, OCI, and other protocols supported by the [go-getter](https://github.com/hashicorp/go-getter) library. The key [`extra_args`](custom-workflows.md#adding-extra-arguments-to-terraform-commands) can be used to pass in the [`--update`](https://www.conftest.dev/sharing/#-update-flag) flag to tell `conftest` to pull the policies into the project folder before running the policy check.
```yaml
workflows:
@@ -163,7 +163,7 @@ Note that authentication may need to be configured separately if pulling policie
### Running policy check against Terraform source code
-By default, Atlantis runs the policy check against the [`SHOWFILE`](https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command). In order to run the policy test against Terraform files directly, override the default `conftest` command used and pass in `*.tf` as one of the inputs to `conftest`. The `show` step is required so that Atlantis will generate the `SHOWFILE`.
+By default, Atlantis runs the policy check against the [`SHOWFILE`](custom-workflows.md#custom-run-command). In order to run the policy test against Terraform files directly, override the default `conftest` command used and pass in `*.tf` as one of the inputs to `conftest`. The `show` step is required so that Atlantis will generate the `SHOWFILE`.
```yaml
workflows:
@@ -171,13 +171,12 @@ workflows:
policy_check:
steps:
- show
- - run: conftest test $SHOWFILE *.tf
+ - run: conftest test $SHOWFILE *.tf --no-fail
```
### Quiet policy checks
-By default, Atlantis will add a comment to all pull requests with the policy check result - both successes and failures. Version 0.21.0 added the [`--quiet-policy-checks`](server-configuration.html#quiet-policy-checks) option, which will instead only add comments when policy checks fail, significantly reducing the number of comments when most policy check results succeed.
-
+By default, Atlantis will add a comment to all pull requests with the policy check result - both successes and failures. Version 0.21.0 added the [`--quiet-policy-checks`](server-configuration.md#quiet-policy-checks) option, which will instead only add comments when policy checks fail, significantly reducing the number of comments when most policy check results succeed.
### Data for custom run steps
@@ -198,9 +197,10 @@ When the policy check workflow runs, a file is created in the working directory
## Running policy check only on some repositories
-When policy checking is enabled it will be enforced on all repositories, in order to disable policy checking on some repositories first [enable policy checks](https://www.runatlantis.io/docs/policy-checking.html#getting-started) and then disable it explicitly on each repository with the `policy_check` flag.
+When policy checking is enabled it will be enforced on all repositories, in order to disable policy checking on some repositories first [enable policy checks](policy-checking.md#getting-started) and then disable it explicitly on each repository with the `policy_check` flag.
For server side config:
+
```yml
# repos.yaml
repos:
@@ -216,6 +216,7 @@ repos:
```
For repo level `atlantis.yaml` config:
+
```yml
version: 3
projects:
diff --git a/runatlantis.io/docs/post-workflow-hooks.md b/runatlantis.io/docs/post-workflow-hooks.md
index a9f1e05e94..91ba0b7aa7 100644
--- a/runatlantis.io/docs/post-workflow-hooks.md
+++ b/runatlantis.io/docs/post-workflow-hooks.md
@@ -2,12 +2,10 @@
Post workflow hooks can be defined to run scripts after default or custom
workflows are executed. Post workflow hooks differ from [custom
-workflows](custom-workflows.html#custom-run-command) in that they are run
+workflows](custom-workflows.md#custom-run-command) in that they are run
outside of Atlantis commands. Which means they do not surface their output
back to the PR as a comment.
-[[toc]]
-
## Usage
Post workflow hooks can only be specified in the Server-Side Repo Config under
@@ -44,7 +42,6 @@ have finished.
In this example we use a custom workflow to generate cost estimates for each
workflow using [Infracost](https://www.infracost.io/docs/integrations/cicd/#cicd-integrations), then create a summary report after all workflows have completed.
-
```yaml
# repos.yaml
workflows:
@@ -88,7 +85,7 @@ repos:
### Custom `run` Command
This is very similar to [custom workflow run
-command](custom-workflows.html#custom-run-command).
+command](custom-workflows.md#custom-run-command).
```yaml
- run: custom-command
@@ -102,6 +99,7 @@ command](custom-workflows.html#custom-run-command).
| shellArgs | string | '-c' | no | The shell arguments to use for running the command |
::: tip Notes
+
* `run` commands are executed with the following environment variables:
* `BASE_REPO_NAME` - Name of the repository that the pull request will be merged into, ex. `atlantis`.
* `BASE_REPO_OWNER` - Owner of the repository that the pull request will be merged into, ex. `runatlantis`.
diff --git a/runatlantis.io/docs/pre-workflow-hooks.md b/runatlantis.io/docs/pre-workflow-hooks.md
index 9087be24c7..dce3f2fe7d 100644
--- a/runatlantis.io/docs/pre-workflow-hooks.md
+++ b/runatlantis.io/docs/pre-workflow-hooks.md
@@ -2,15 +2,13 @@
Pre workflow hooks can be defined to run scripts before default or custom
workflows are executed. Pre workflow hooks differ from [custom
-workflows](custom-workflows.html#custom-run-command) in several ways.
+workflows](custom-workflows.md#custom-run-command) in several ways.
1. Pre workflow hooks do not require the repository configuration to be
- present. This can be utilized to [dynamically generate repo configs](pre-workflow-hooks.html#dynamic-repo-config-generation).
+ present. This can be utilized to [dynamically generate repo configs](pre-workflow-hooks.md#dynamic-repo-config-generation).
2. Pre workflow hooks are run outside of Atlantis commands. Which means
they do not surface their output back to the PR as a comment.
-[[toc]]
-
## Usage
Pre workflow hooks can only be specified in the Server-Side Repo Config under the
@@ -19,9 +17,9 @@ Pre workflow hooks can only be specified in the Server-Side Repo Config under th
::: tip Note
By default, `pre-workflow-hooks` do not prevent Atlantis from executing its
workflows(`plan`, `apply`) even if a `run` command exits with an error. This
-behavior can be changed by setting the [fail-on-pre-workflow-hook-error](server-configuration.html#fail-on-pre-workflow-hook-error)
+behavior can be changed by setting the [fail-on-pre-workflow-hook-error](server-configuration.md#fail-on-pre-workflow-hook-error)
flag in the Atlantis server configuration.
-:::
+:::
## Atlantis Command Targetting
@@ -84,7 +82,7 @@ repos:
### Custom `run` Command
This is very similar to the [custom workflow run
-command](custom-workflows.html#custom-run-command).
+command](custom-workflows.md#custom-run-command).
```yaml
- run: custom-command
@@ -98,6 +96,7 @@ command](custom-workflows.html#custom-run-command).
| shellArgs | string | '-c' | no | The shell arguments to use for running the command |
::: tip Notes
+
* `run` commands are executed with the following environment variables:
* `BASE_REPO_NAME` - Name of the repository that the pull request will be merged into, ex. `atlantis`.
* `BASE_REPO_OWNER` - Owner of the repository that the pull request will be merged into, ex. `runatlantis`.
@@ -109,7 +108,7 @@ command](custom-workflows.html#custom-run-command).
* `PULL_NUM` - Pull request number or ID, ex. `2`.
* `PULL_URL` - Pull request URL, ex. `https://github.com/runatlantis/atlantis/pull/2`.
* `PULL_AUTHOR` - Username of the pull request author, ex. `acme-user`.
- * `DIR` - The absolute path to the root of the cloned repository.
+ * `DIR` - The absolute path to the root of the cloned repository.
* `USER_NAME` - Username of the VCS user running command, ex. `acme-user`. During an autoplan, the user will be the Atlantis API user, ex. `atlantis`.
* `COMMENT_ARGS` - Any additional flags passed in the comment on the pull request. Flags are separated by commas and
every character is escaped, ex. `atlantis plan -- arg1 arg2` will result in `COMMENT_ARGS=\a\r\g\1,\a\r\g\2`.
diff --git a/runatlantis.io/docs/provider-credentials.md b/runatlantis.io/docs/provider-credentials.md
index 793c082e94..09dd289759 100644
--- a/runatlantis.io/docs/provider-credentials.md
+++ b/runatlantis.io/docs/provider-credentials.md
@@ -1,17 +1,19 @@
# Provider Credentials
+
Atlantis runs Terraform by simply executing `terraform plan` and `apply` commands
on the server Atlantis is hosted on.
Just like when you run Terraform locally, Atlantis needs credentials for your
specific provider.
It's up to you how you provide credentials for your specific provider to Atlantis:
-* The Atlantis [Helm Chart](deployment.html#kubernetes-helm-chart) and
- [AWS Fargate Module](deployment.html#aws-fargate) have their own mechanisms for provider
+
+* The Atlantis [Helm Chart](deployment.md#kubernetes-helm-chart) and
+ [AWS Fargate Module](deployment.md#aws-fargate) have their own mechanisms for provider
credentials. Read their docs.
* If you're running Atlantis in a cloud then many clouds have ways to give cloud API access
to applications running on them, ex:
- * [AWS EC2 Roles](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) (Search for "EC2 Role")
- * [GCE Instance Service Accounts](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference)
+ * [AWS EC2 Roles](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) (Search for "EC2 Role")
+ * [GCE Instance Service Accounts](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference)
* Many users set environment variables, ex. `AWS_ACCESS_KEY`, where Atlantis is running.
* Others create the necessary config files, ex. `~/.aws/credentials`, where Atlantis is running.
* Use the [HashiCorp Vault Provider](https://registry.terraform.io/providers/hashicorp/vault/latest/docs)
@@ -22,10 +24,10 @@ As a general rule, if you can `ssh` or `exec` into the server where Atlantis is
running and run `terraform` commands like you would locally, then Atlantis will work.
:::
-
## AWS Specific Info
### Multiple AWS Accounts
+
Atlantis supports multiple AWS accounts through the use of Terraform's
[AWS Authentication](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) (Search for "Authentication").
@@ -41,6 +43,7 @@ won't work for multiple accounts since Atlantis wouldn't know which environment
Terraform with.
### Assume Role Session Names
+
If you're using Terraform < 0.12, Atlantis injects 5 Terraform variables that can be used to dynamically name the assume role session name.
Setting the `session_name` allows you to trace API calls made through Atlantis back to a specific
user and repo via CloudWatch:
@@ -89,5 +92,6 @@ You can still set these variables yourself using the `extra_args` configuration.
:::
## Next Steps
-* If you want to configure Atlantis further, read [Configuring Atlantis](configuring-atlantis.html)
-* If you're ready to use Atlantis, read [Using Atlantis](using-atlantis.html)
+
+* If you want to configure Atlantis further, read [Configuring Atlantis](configuring-atlantis.md)
+* If you're ready to use Atlantis, read [Using Atlantis](using-atlantis.md)
diff --git a/runatlantis.io/docs/repo-level-atlantis-yaml.md b/runatlantis.io/docs/repo-level-atlantis-yaml.md
index c4c6ed3792..11feb31224 100644
--- a/runatlantis.io/docs/repo-level-atlantis-yaml.md
+++ b/runatlantis.io/docs/repo-level-atlantis-yaml.md
@@ -1,31 +1,33 @@
# Repo Level atlantis.yaml Config
+
An `atlantis.yaml` file specified at the root of a Terraform repo allows you
to instruct Atlantis on the structure of your repo and set custom workflows.
-[[toc]]
-
## Do I need an atlantis.yaml file?
+
`atlantis.yaml` files are only required if you wish to customize some aspect of Atlantis.
The default Atlantis config works for many users without changes.
Read through the [use-cases](#use-cases) to determine if you need it.
## Enabling atlantis.yaml
+
By default, all repos are allowed to have an `atlantis.yaml` file,
but some of the keys are restricted by default.
Restricted keys can be set in the server-side `repos.yaml` repo config file.
You can enable `atlantis.yaml` to override restricted
-keys by setting the `allowed_overrides` key there. See the [Server Side Repo Config](server-side-repo-config.html) for
+keys by setting the `allowed_overrides` key there. See the [Server Side Repo Config](server-side-repo-config.md) for
more details.
-**Notes**
+**Notes:**
+
* By default, repo root `atlantis.yaml` file is used.
-* You can change this behaviour by setting [Server Side Repo Config](server-side-repo-config.html)
+* You can change this behaviour by setting [Server Side Repo Config](server-side-repo-config.md)
::: danger DANGER
Atlantis uses the `atlantis.yaml` version from the pull request, similar to other
-CI/CD systems. If you're allowing users to [create custom workflows](server-side-repo-config.html#allow-repos-to-define-their-own-workflows)
+CI/CD systems. If you're allowing users to [create custom workflows](server-side-repo-config.md#allow-repos-to-define-their-own-workflows)
then this means
anyone that can create a pull request to your repo can run arbitrary code on the
Atlantis server.
@@ -66,7 +68,9 @@ projects:
workspace: default
terraform_version: v0.11.0
delete_source_branch_on_merge: true
- repo_locking: true
+ repo_locking: true # deprecated: use repo_locks instead
+ repo_locks:
+ mode: on_plan
custom_policy_check: false
autoplan:
when_modified: ["*.tf", "../modules/**/*.tf", ".terraform.lock.hcl"]
@@ -74,6 +78,7 @@ projects:
plan_requirements: [mergeable, approved, undiverged]
apply_requirements: [mergeable, approved, undiverged]
import_requirements: [mergeable, approved, undiverged]
+ silence_pr_comments: ["apply"]
execution_order_group: 1
depends_on:
- project-1
@@ -147,7 +152,9 @@ grep -P 'backend[\s]+"s3"' **/*.tf |
```
## Use Cases
+
### Disabling Autoplanning
+
```yaml
version: 3
projects:
@@ -155,6 +162,7 @@ projects:
autoplan:
enabled: false
```
+
This will stop Atlantis automatically running plan when `project1/` is updated
in a pull request.
@@ -178,7 +186,7 @@ Parallel plans and applies work across both multiple directories and multiple wo
Given the directory structure:
-```
+```plain
.
âââ modules
â  âââ module1
@@ -193,7 +201,6 @@ Given the directory structure:
If you want Atlantis to plan `project1/` whenever any `.tf` files under `module1/` change or any `.tf` or `.tfvars` files under `project1/` change you could use the following configuration:
-
```yaml
version: 3
projects:
@@ -203,12 +210,14 @@ projects:
```
Note:
+
* `when_modified` uses the [`.dockerignore` syntax](https://docs.docker.com/engine/reference/builder/#dockerignore-file)
* The paths are relative to the project's directory.
* `when_modified` will be used by both automatic and manually run plans.
* `when_modified` will continue to work for manually run plans even when autoplan is disabled.
### Supporting Terraform Workspaces
+
```yaml
version: 3
projects:
@@ -217,34 +226,44 @@ projects:
- dir: project1
workspace: production
```
+
With the above config, when Atlantis determines that the configuration for the `project1` dir has changed,
it will run plan for both the `staging` and `production` workspaces.
If you want to `plan` or `apply` for a specific workspace you can use
-```
+
+```shell
atlantis plan -w staging -d project1
```
+
and
-```
+
+```shell
atlantis apply -w staging -d project1
```
### Using .tfvars files
-See [Custom Workflow Use Cases: Using .tfvars files](custom-workflows.html#tfvars-files)
+
+See [Custom Workflow Use Cases: Using .tfvars files](custom-workflows.md#tfvars-files)
### Adding extra arguments to Terraform commands
-See [Custom Workflow Use Cases: Adding extra arguments to Terraform commands](custom-workflows.html#adding-extra-arguments-to-terraform-commands)
+
+See [Custom Workflow Use Cases: Adding extra arguments to Terraform commands](custom-workflows.md#adding-extra-arguments-to-terraform-commands)
### Custom init/plan/apply Commands
-See [Custom Workflow Use Cases: Custom init/plan/apply Commands](custom-workflows.html#custom-init-plan-apply-commands)
+
+See [Custom Workflow Use Cases: Custom init/plan/apply Commands](custom-workflows.md#custom-init-plan-apply-commands)
### Terragrunt
-See [Custom Workflow Use Cases: Terragrunt](custom-workflows.html#terragrunt)
+
+See [Custom Workflow Use Cases: Terragrunt](custom-workflows.md#terragrunt)
### Running custom commands
-See [Custom Workflow Use Cases: Running custom commands](custom-workflows.html#running-custom-commands)
+
+See [Custom Workflow Use Cases: Running custom commands](custom-workflows.md#running-custom-commands)
### Terraform Versions
+
If you'd like to use a different version of Terraform than what is in Atlantis'
`PATH` or is set by the `--default-tf-version` flag, then set the `terraform_version` key:
@@ -258,7 +277,9 @@ projects:
Atlantis will automatically download and use this version.
### Requiring Approvals For Production
+
In this example, we only want to require `apply` approvals for the `production` directory.
+
```yaml
version: 3
projects:
@@ -268,12 +289,14 @@ projects:
apply_requirements: [approved]
import_requirements: [approved]
```
+
:::warning
`plan_requirements`, `apply_requirements` and `import_requirements` are restricted keys so this repo will need to be configured
-to be allowed to set this key. See [Server-Side Repo Config Use Cases](server-side-repo-config.html#repos-can-set-their-own-apply-an-applicable-subcommand).
+to be allowed to set this key. See [Server-Side Repo Config Use Cases](server-side-repo-config.md#repos-can-set-their-own-apply-an-applicable-subcommand).
:::
### Order of planning/applying
+
```yaml
version: 3
abort_on_execution_order_fail: true
@@ -283,12 +306,13 @@ projects:
- dir: project2
execution_order_group: 1
```
+
With this config above, Atlantis runs planning/applying for project2 first, then for project1.
Several projects can have same `execution_order_group`. Any order in one group isn't guaranteed.
`parallel_plan` and `parallel_apply` respect these order groups, so parallel planning/applying works
-in each group one by one.
+in each group one by one.
-If any plan/apply fails and `abort_on_execution_order_fail` is set to true on a repo level, all the
+If any plan/apply fails and `abort_on_execution_order_fail` is set to true on a repo level, all the
following groups will be aborted. For this example, if project2 fails then project1 will not run.
Execution order groups are useful when you have dependencies between projects. However, they are only applicable in the case where
@@ -296,6 +320,7 @@ you initiate a global apply for all of your projects, i.e `atlantis apply`. If y
Thus, the `depends_on` key is more useful in this case. and can be used in conjunction with execution order groups.
The following configuration is an example of how to use execution order groups and depends_on together to enforce dependencies between projects.
+
```yaml
version: 3
projects:
@@ -323,6 +348,7 @@ projects:
workspace: production
workflow: infra
```
+
the `depends_on` feature will make sure that `production` is not applied before `staging` for example.
::: tip
@@ -331,11 +357,14 @@ What Happens if one or more project's dependencies are not applied?
If there's one or more projects in the dependency list which is not in applied status, users will see an error message like this:
`Can't apply your project unless you apply its dependencies`
:::
+
### Autodiscovery Config
+
```yaml
autodiscover:
mode: "auto"
```
+
The above is the default configuration for `autodiscover.mode`. When `autodiscover.mode` is auto,
projects will be discovered only if the repo has no `projects` configured.
@@ -343,14 +372,16 @@ projects will be discovered only if the repo has no `projects` configured.
autodiscover:
mode: "disabled"
```
+
With the config above, Atlantis will never try to discover projects, even when there are no
`projects` configured. This is useful if dynamically generating Atlantis config in pre_workflow hooks.
-See [Dynamic Repo Config Generation](pre-workflow-hooks.html#dynamic-repo-config-generation).
+See [Dynamic Repo Config Generation](pre-workflow-hooks.md#dynamic-repo-config-generation).
```yaml
autodiscover:
mode: "enabled"
```
+
With the config above, Atlantis will unconditionally try to discover projects based on modified_files,
even when the directory of the project is missing from the configured `projects` in the repo configuration.
If a discovered project has the same directory as a project which was manually configured in `projects`,
@@ -360,10 +391,13 @@ Use this feature when some projects require specific configuration in a repo wit
it's still desirable for Atlantis to plan/apply for projects not enumerated in the config.
### Custom Backend Config
-See [Custom Workflow Use Cases: Custom Backend Config](custom-workflows.html#custom-backend-config)
+
+See [Custom Workflow Use Cases: Custom Backend Config](custom-workflows.md#custom-backend-config)
## Reference
+
### Top-Level Keys
+
```yaml
version: 3
automerge: false
@@ -372,16 +406,18 @@ projects:
workflows:
allowed_regexp_prefixes:
```
-| Key | Type | Default | Required | Description |
-|-------------------------------|----------------------------------------------------------|---------|----------|--------------------------------------------------------------------------------------------------------------------------------------|
-| version | int | none | **yes** | This key is required and must be set to `3`. |
-| automerge | bool | `false` | no | Automatically merges pull request when all plans are applied. |
-| delete_source_branch_on_merge | bool | `false` | no | Automatically deletes the source branch on merge. |
-| projects | array[[Project](repo-level-atlantis-yaml.html#project)] | `[]` | no | Lists the projects in this repo. |
-| workflows *(restricted)* | map[string: [Workflow](custom-workflows.html#reference)] | `{}` | no | Custom workflows. |
-| allowed_regexp_prefixes | array[string] | `[]` | no | Lists the allowed regexp prefixes to use when the [`--enable-regexp-cmd`](server-configuration.html#enable-regexp-cmd) flag is used. |
+
+| Key | Type | Default | Required | Description |
+|-------------------------------|--------------------------------------------------------|---------|----------|------------------------------------------------------------------------------------------------------------------------------------|
+| version | int | none | **yes** | This key is required and must be set to `3`. |
+| automerge | bool | `false` | no | Automatically merges pull request when all plans are applied. |
+| delete_source_branch_on_merge | bool | `false` | no | Automatically deletes the source branch on merge. |
+| projects | array[[Project](repo-level-atlantis-yaml.md#project)] | `[]` | no | Lists the projects in this repo. |
+| workflows *(restricted)* | map[string: [Workflow](custom-workflows.md#reference)] | `{}` | no | Custom workflows. |
+| allowed_regexp_prefixes | array\[string\] | `[]` | no | Lists the allowed regexp prefixes to use when the [`--enable-regexp-cmd`](server-configuration.md#enable-regexp-cmd) flag is used. |
### Project
+
```yaml
name: myname
branch: /mybranch/
@@ -389,45 +425,62 @@ dir: mydir
workspace: myworkspace
execution_order_group: 0
delete_source_branch_on_merge: false
-repo_locking: true
+repo_locking: true # deprecated: use repo_locks instead
+repo_locks:
+ mode: on_plan
custom_policy_check: false
autoplan:
terraform_version: 0.11.0
plan_requirements: ["approved"]
apply_requirements: ["approved"]
import_requirements: ["approved"]
+silence_pr_comments: ["apply"]
workflow: myworkflow
```
-| Key | Type | Default | Required | Description |
-|------------------------------------------|-----------------------|-------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| name | string | none | maybe | Required if there is more than one project with the same `dir` and `workspace`. This project name can be used with the `-p` flag. |
-| branch | string | none | no | Regex matching projects by the base branch of pull request (the branch the pull request is getting merged into). Only projects that match the PR's branch will be considered. By default, all branches are matched. |
-| dir | string | none | **yes** | The directory of this project relative to the repo root. For example if the project was under `./project1` then use `project1`. Use `.` to indicate the repo root. |
-| workspace | string | `"default"` | no | The [Terraform workspace](https://developer.hashicorp.com/terraform/language/state/workspaces) for this project. Atlantis will switch to this workplace when planning/applying and will create it if it doesn't exist. |
-| execution_order_group | int | `0` | no | Index of execution order group. Projects will be sort by this field before planning/applying. |
-| delete_source_branch_on_merge | bool | `false` | no | Automatically deletes the source branch on merge. |
-| repo_locking | bool | `true` | no | Get a repository lock in this project when plan. |
-| custom_policy_check | bool | `false` | no | Enable using policy check tools other than Conftest |
-| autoplan | [Autoplan](#autoplan) | none | no | A custom autoplan configuration. If not specified, will use the autoplan config. See [Autoplanning](autoplanning.html). |
-| terraform_version | string | none | no | A specific Terraform version to use when running commands for this project. Must be [Semver compatible](https://semver.org/), ex. `v0.11.0`, `0.12.0-beta1`. |
-| plan_requirements *(restricted)* | array[string] | none | no | Requirements that must be satisfied before `atlantis plan` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.html) for more details. |
-| apply_requirements *(restricted)* | array[string] | none | no | Requirements that must be satisfied before `atlantis apply` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.html) for more details. |
-| import_requirements *(restricted)* | array[string] | none | no | Requirements that must be satisfied before `atlantis import` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.html) for more details. |
-| workflow *(restricted)* | string | none | no | A custom workflow. If not specified, Atlantis will use its default workflow. |
+| Key | Type | Default | Required | Description |
+|-----------------------------------------|-------------------------|-----------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| name | string | none | maybe | Required if there is more than one project with the same `dir` and `workspace`. This project name can be used with the `-p` flag. |
+| branch | string | none | no | Regex matching projects by the base branch of pull request (the branch the pull request is getting merged into). Only projects that match the PR's branch will be considered. By default, all branches are matched. |
+| dir | string | none | **yes** | The directory of this project relative to the repo root. For example if the project was under `./project1` then use `project1`. Use `.` to indicate the repo root. |
+| workspace | string | `"default"` | no | The [Terraform workspace](https://developer.hashicorp.com/terraform/language/state/workspaces) for this project. Atlantis will switch to this workplace when planning/applying and will create it if it doesn't exist. |
+| execution_order_group | int | `0` | no | Index of execution order group. Projects will be sort by this field before planning/applying. |
+| delete_source_branch_on_merge | bool | `false` | no | Automatically deletes the source branch on merge. |
+| repo_locking | bool | `true` | no | (deprecated) Get a repository lock in this project when plan. |
+| repo_locks | [RepoLocks](#repolocks) | `mode: on_plan` | no | Get a repository lock in this project on plan or apply. See [RepoLocks](#repolocks) for more details. |
+| custom_policy_check | bool | `false` | no | Enable using policy check tools other than Conftest |
+| autoplan | [Autoplan](#autoplan) | none | no | A custom autoplan configuration. If not specified, will use the autoplan config. See [Autoplanning](autoplanning.md). |
+| terraform_version | string | none | no | A specific Terraform version to use when running commands for this project. Must be [Semver compatible](https://semver.org/), ex. `v0.11.0`, `0.12.0-beta1`. |
+| plan_requirements *(restricted)* | array\[string\] | none | no | Requirements that must be satisfied before `atlantis plan` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.md) for more details. |
+| apply_requirements *(restricted)* | array\[string\] | none | no | Requirements that must be satisfied before `atlantis apply` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.md) for more details. |
+| import_requirements *(restricted)* | array\[string\] | none | no | Requirements that must be satisfied before `atlantis import` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.md) for more details. |
+| silence_pr_comments | array\[string\] | none | no | Silence PR comments from defined stages while preserving PR status checks. Supported values are: `plan`, `apply`. |
+| workflow *(restricted)* | string | none | no | A custom workflow. If not specified, Atlantis will use its default workflow. |
::: tip
A project represents a Terraform state. Typically, there is one state per directory and workspace however it's possible to
have multiple states in the same directory using `terraform init -backend-config=custom-config.tfvars`.
-Atlantis supports this but requires the `name` key to be specified. See [Custom Backend Config](custom-workflows.html#custom-backend-config) for more details.
+Atlantis supports this but requires the `name` key to be specified. See [Custom Backend Config](custom-workflows.md#custom-backend-config) for more details.
:::
### Autoplan
+
```yaml
enabled: true
when_modified: ["*.tf", "terragrunt.hcl", ".terraform.lock.hcl"]
```
-| Key | Type | Default | Required | Description |
-|-----------------------|---------------|----------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| enabled | boolean | `true` | no | Whether autoplanning is enabled for this project. |
-| when_modified | array[string] | `["**/*.tf*"]` | no | Uses [.dockerignore](https://docs.docker.com/engine/reference/builder/#dockerignore-file) syntax. If any modified file in the pull request matches, this project will be planned. See [Autoplanning](autoplanning.html). Paths are relative to the project's dir. |
+
+| Key | Type | Default | Required | Description |
+|-----------------------|-----------------|----------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| enabled | boolean | `true` | no | Whether autoplanning is enabled for this project. |
+| when_modified | array\[string\] | `["**/*.tf*"]` | no | Uses [.dockerignore](https://docs.docker.com/engine/reference/builder/#dockerignore-file) syntax. If any modified file in the pull request matches, this project will be planned. See [Autoplanning](autoplanning.md). Paths are relative to the project's dir. |
+
+### RepoLocks
+
+```yaml
+mode: on_apply
+```
+
+| Key | Type | Default | Required | Description |
+|------|--------|-----------|----------|---------------------------------------------------------------------------------------------------------------------------------------|
+| mode | `Mode` | `on_plan` | no | Whether or not repository locks are enabled for this project on plan or apply. Valid values are `disabled`, `on_plan` and `on_apply`. |
diff --git a/runatlantis.io/docs/requirements.md b/runatlantis.io/docs/requirements.md
index e300e63fe7..a661ac3508 100644
--- a/runatlantis.io/docs/requirements.md
+++ b/runatlantis.io/docs/requirements.md
@@ -1,19 +1,21 @@
# Requirements
+
Atlantis works with most Git hosts and Terraform setups. Read on to confirm
it works with yours.
-[[toc]]
-
## Git Host
+
Atlantis integrates with the following Git hosts:
* GitHub (public, private or enterprise)
* GitLab (public, private or enterprise)
+* Gitea (public, private and compatible forks like Forgejo)
* Bitbucket Cloud aka bitbucket.org (public or private)
* Bitbucket Server aka Stash
* Azure DevOps
## Terraform State
+
Atlantis supports all backend types **except for local state**. We don't support local state
because Atlantis does not have permanent storage and it doesn't commit the new
statefile back to version control.
@@ -24,17 +26,20 @@ storage from Terraform Cloud. This is fully supported by Atlantis.
:::
## Repository Structure
+
Atlantis supports any Terraform repository structure, for example:
### Single Terraform Project At Repo Root
-```
+
+```plain
.
âââ main.tf
âââ ...
```
### Multiple Project Folders
-```
+
+```plain
.
âââ project1
â  âââ main.tf
@@ -45,7 +50,8 @@ Atlantis supports any Terraform repository structure, for example:
```
### Modules
-```
+
+```plain
.
âââ project1
â  âââ main.tf
@@ -55,35 +61,42 @@ Atlantis supports any Terraform repository structure, for example:
  âââ main.tf
âââ ...
```
+
With modules, if you want `project1` automatically planned when `module1` is modified
-you need to create an `atlantis.yaml` file. See [atlantis.yaml Use Cases](repo-level-atlantis-yaml.html#configuring-planning) for more details.
+you need to create an `atlantis.yaml` file. See [atlantis.yaml Use Cases](repo-level-atlantis-yaml.md#configuring-planning) for more details.
+
+### Terraform Workspaces
-### Terraform Workspaces
*See [Terraform's docs](https://developer.hashicorp.com/terraform/language/state/workspaces) if you are unfamiliar with workspaces.*
If you're using Terraform `>= 0.9.0`, Atlantis supports workspaces through an
`atlantis.yaml` file that tells Atlantis the names of your workspaces
-(see [atlantis.yaml Use Cases](repo-level-atlantis-yaml.html#supporting-terraform-workspaces) for more details)
+(see [atlantis.yaml Use Cases](repo-level-atlantis-yaml.md#supporting-terraform-workspaces) for more details)
### .tfvars Files
-```
+
+```plain
.
âââ production.tfvars
âââ staging.tfvars
âââ main.tf
```
+
For Atlantis to be able to plan automatically with `.tfvars files`, you need to create
an `atlantis.yaml` file to tell it to use `-var-file={YOUR_FILE}`.
-See [atlantis.yaml Use Cases](custom-workflows.html#tfvars-files) for more details.
+See [atlantis.yaml Use Cases](custom-workflows.md#tfvars-files) for more details.
### Multiple Repos
+
Atlantis supports multiple repos as wellâas long as there is a webhook configured
for each repo.
## Terraform Versions
+
Atlantis supports all Terraform versions (including 0.12) and can be configured
-to use different versions for different repositories/projects. See [Terraform Versions](terraform-versions.html).
+to use different versions for different repositories/projects. See [Terraform Versions](terraform-versions.md).
## Next Steps
+
* If your Terraform setup meets the Atlantis requirements, continue the installation
- guide and set up your [Git Host Access Credentials](access-credentials.html)
+ guide and set up your [Git Host Access Credentials](access-credentials.md)
diff --git a/runatlantis.io/docs/security.md b/runatlantis.io/docs/security.md
index a6bafda5a8..0f5d8df4c6 100644
--- a/runatlantis.io/docs/security.md
+++ b/runatlantis.io/docs/security.md
@@ -1,13 +1,16 @@
# Security
-[[toc]]
+
## Exploits
+
Because you usually run Atlantis on a server with credentials that allow access to your infrastructure it's important that you deploy Atlantis securely.
Atlantis could be exploited by
+
* An attacker submitting a pull request that contains a malicious Terraform file that
uses a malicious provider or an [`external` data source](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source)
that Atlantis then runs `terraform plan` on (which it does automatically unless you've turned off automatic plans).
* Running `terraform apply` on a malicious Terraform file with [local-exec](https://developer.hashicorp.com/terraform/language/resources/provisioners/local-exec)
+
```tf
resource "null_resource" "null" {
provisioner "local-exec" {
@@ -15,10 +18,12 @@ Atlantis could be exploited by
}
}
```
+
* Running malicious custom build commands specified in an `atlantis.yaml` file. Atlantis uses the `atlantis.yaml` file from the pull request branch, **not** `main`.
* Someone adding `atlantis plan/apply` comments on your valid pull requests causing terraform to run when you don't want it to.
## Bitbucket Cloud (bitbucket.org)
+
::: danger
Bitbucket Cloud does not support webhook secrets. This could allow attackers to spoof requests from Bitbucket. Ensure you are allowing only Bitbucket IPs.
:::
@@ -33,16 +38,21 @@ To prevent this, allowlist [Bitbucket's IP addresses](https://confluence.atlassi
(see Outbound IPv4 addresses).
## Mitigations
+
### Don't Use On Public Repos
+
Because anyone can comment on public pull requests, even with all the security mitigations available, it's still dangerous to run Atlantis on public repos without proper configuration of the security settings.
### Don't Use `--allow-fork-prs`
+
If you're running on a public repo (which isn't recommended, see above) you shouldn't set `--allow-fork-prs` (defaults to false)
because anyone can open up a pull request from their fork to your repo.
### `--repo-allowlist`
+
Atlantis requires you to specify a allowlist of repositories it will accept webhooks from via the `--repo-allowlist` flag.
For example:
+
* Specific repositories: `--repo-allowlist=github.com/runatlantis/atlantis,github.com/runatlantis/atlantis-tests`
* Your whole organization: `--repo-allowlist=github.com/runatlantis/*`
* Every repository in your GitHub Enterprise install: `--repo-allowlist=github.yourcompany.com/*`
@@ -52,19 +62,22 @@ For example:
This flag ensures your Atlantis install isn't being used with repositories you don't control. See `atlantis server --help` for more details.
### Protect Terraform Planning
+
If attackers submitting pull requests with malicious Terraform code is in your threat model
then you must be aware that `terraform apply` approvals are not enough. It is possible
to run malicious code in a `terraform plan` using the [`external` data source](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source)
or by specifying a malicious provider. This code could then exfiltrate your credentials.
To prevent this, you could:
+
1. Bake providers into the Atlantis image or host and deny egress in production.
1. Implement the provider registry protocol internally and deny public egress, that way you control who has write access to the registry.
-1. Modify your [server-side repo configuration](https://www.runatlantis.io/docs/server-side-repo-config.html)'s `plan` step to validate against the
+1. Modify your [server-side repo configuration](server-side-repo-config.md)'s `plan` step to validate against the
use of disallowed providers or data sources or PRs from not allowed users. You could also add in extra validation at this point, e.g.
requiring a "thumbs-up" on the PR before allowing the `plan` to continue. Conftest could be of use here.
### `--var-file-allowlist`
+
The files on your Atlantis install may be accessible as [variable definition files](https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files)
from pull requests by adding
`atlantis plan -- -var-file=/path/to/file` comments. To mitigate this security risk, Atlantis has limited such access
@@ -72,6 +85,7 @@ only to the files allowlisted by the `--var-file-allowlist` flag. If this argume
Atlantis' data directory.
### Webhook Secrets
+
Atlantis should be run with Webhook secrets set via the `$ATLANTIS_GH_WEBHOOK_SECRET`/`$ATLANTIS_GITLAB_WEBHOOK_SECRET` environment variables.
Even with the `--repo-allowlist` flag set, without a webhook secret, attackers could make requests to Atlantis posing as a repository that is allowlisted.
Webhook secrets ensure that the webhook requests are actually coming from your VCS provider (GitHub or GitLab).
@@ -81,17 +95,20 @@ If you are using Azure DevOps, instead of webhook secrets add a [basic username
:::
### Azure DevOps Basic Authentication
+
Azure DevOps supports sending a basic authentication header in all webhook events. This requires using an HTTPS URL for your webhook location.
### SSL/HTTPS
+
If you're using webhook secrets but your traffic is over HTTP then the webhook secrets
could be stolen. Enable SSL/HTTPS using the `--ssl-cert-file` and `--ssl-key-file`
flags.
### Enable Authentication on Atlantis Web Server
+
It is very recommended to enable authentication in the web service. Enable BasicAuth using the `--web-basic-auth=true` and setup a username and a password using `--web-username=yourUsername` and `--web-password=yourPassword` flags.
-You can also pass these as environment variables `ATLANTIS_WEB_BASIC_AUTH=true` `ATLANTIS_WEB_USERNAME=yourUsername` and `ATLANTIS_WEB_PASSWORD=yourPassword`.
+You can also pass these as environment variables `ATLANTIS_WEB_BASIC_AUTH=true` `ATLANTIS_WEB_USERNAME=yourUsername` and `ATLANTIS_WEB_PASSWORD=yourPassword`.
:::tip Tip
We do encourage the usage of complex passwords in order to prevent basic bruteforcing attacks.
diff --git a/runatlantis.io/docs/server-configuration.md b/runatlantis.io/docs/server-configuration.md
index e2722f5478..6e421c0f3d 100644
--- a/runatlantis.io/docs/server-configuration.md
+++ b/runatlantis.io/docs/server-configuration.md
@@ -1,12 +1,12 @@
# Server Configuration
+
This page explains how to configure the `atlantis server` command.
Configuration to `atlantis server` can be specified via command line flags,
environment variables, a config file or a mix of the three.
-[[toc]]
-
## Environment Variables
+
All flags can be specified as environment variables.
1. Take the flag name, ex. `--gh-user`
@@ -24,11 +24,13 @@ The flag `--atlantis-url` is set by the environment variable `ATLANTIS_ATLANTIS_
:::
## Config File
+
All flags can also be specified via a YAML config file.
To use a YAML config file, run `atlantis server --config /path/to/config.yaml`.
The keys of your config file should be the same as the flag names, ex.
+
```yaml
gh-token: ...
log-level: ...
@@ -40,40 +42,49 @@ The `--config` config file is only used as an alternate way of setting `atlantis
:::
## Precedence
+
Values are chosen in this order:
+
1. Flags
1. Environment Variables
1. Config File
-
## Flags
+
### `--allow-commands`
+
```bash
atlantis server --allow-commands=version,plan,apply,unlock,approve_policies
# or
ATLANTIS_ALLOW_COMMANDS='version,plan,apply,unlock,approve_policies'
```
+
List of allowed commands to be run on the Atlantis server, Defaults to `version,plan,apply,unlock,approve_policies`
Notes:
- * Accepts a comma separated list, ex. `command1,command2`.
- * `version`, `plan`, `apply`, `unlock`, `approve_policies`, `import`, `state` and `all` are available.
- * `all` is a special keyword that allows all commands. If pass `all` then all other commands will be ignored.
+
+* Accepts a comma separated list, ex. `command1,command2`.
+* `version`, `plan`, `apply`, `unlock`, `approve_policies`, `import`, `state` and `all` are available.
+* `all` is a special keyword that allows all commands. If pass `all` then all other commands will be ignored.
### `--allow-draft-prs`
+
```bash
atlantis server --allow-draft-prs
# or
ATLANTIS_ALLOW_DRAFT_PRS=true
```
+
Respond to pull requests from draft prs. Defaults to `false`.
### `--allow-fork-prs`
+
```bash
atlantis server --allow-fork-prs
# or
ATLANTIS_ALLOW_FORK_PRS=true
```
+
Respond to pull requests from forks. Defaults to `false`.
:::warning SECURITY WARNING
@@ -85,33 +96,40 @@ Values are chosen in this order:
:::
### `--api-secret`
+
```bash
atlantis server --api-secret="secret"
# or (recommended)
ATLANTIS_API_SECRET="secret"
```
- Required secret used to validate requests made to the [`/api/*` endpoints](api-endpoints.html).
+
+ Required secret used to validate requests made to the [`/api/*` endpoints](api-endpoints.md).
### `--atlantis-url`
+
```bash
atlantis server --atlantis-url="https://my-domain.com:9090/basepath"
# or
ATLANTIS_ATLANTIS_URL=https://my-domain.com:9090/basepath
```
+
Specify the URL that Atlantis is accessible from. Used in the Atlantis UI
and in links from pull request comments. Defaults to `http://$(hostname):$port`
where `$port` is from the [`--port`](#port) flag. Supports a basepath if you're hosting Atlantis under a path.
Notes:
- * If a load balancer with a non http/https port (not the one defined in the `--port` flag) is used, update the URL to include the port like in the example above.
- * This URL is used as the `details` link next to each atlantis job to view the job's logs.
+
+* If a load balancer with a non http/https port (not the one defined in the `--port` flag) is used, update the URL to include the port like in the example above.
+* This URL is used as the `details` link next to each atlantis job to view the job's logs.
### `--autodiscover-mode`
+
```bash
atlantis server --autodiscover-mode=""
# or
ATLANTIS_AUTODISCOVER_MODE=""
```
+
Sets auto discover mode, default is `auto`. When set to `auto`, projects in a repo will be discovered by
Atlantis when there are no projects configured in the repo config. If one or more projects are defined
in the repo config then auto discovery will be completely disabled.
@@ -123,40 +141,45 @@ Values are chosen in this order:
When set to `disabled` projects will never be discovered, even if there are no projects configured in the repo config.
### `--automerge`
+
```bash
atlantis server --automerge
# or
ATLANTIS_AUTOMERGE=true
```
+
Automatically merge pull requests after all plans have been successfully applied.
- Defaults to `false`. See [Automerging](automerging.html) for more details.
+ Defaults to `false`. See [Automerging](automerging.md) for more details.
### `--autoplan-file-list`
+
```bash
# NOTE: Use single quotes to avoid shell expansion of *.
atlantis server --autoplan-file-list='**/*.tf,project1/*.pkr.hcl'
# or
ATLANTIS_AUTOPLAN_FILE_LIST='**/*.tf,project1/*.pkr.hcl'
```
+
List of file patterns that Atlantis will use to check if a directory contains modified files that should trigger project planning.
Notes:
- * Accepts a comma separated list, ex. `pattern1,pattern2`.
- * Patterns use the [`.dockerignore` syntax](https://docs.docker.com/engine/reference/builder/#dockerignore-file)
- * List of file patterns will be used by both automatic and manually run plans.
- * When not set, defaults to all `.tf`, `.tfvars`, `.tfvars.json`, `terragrunt.hcl` and `.terraform.lock.hcl` files
+
+* Accepts a comma separated list, ex. `pattern1,pattern2`.
+* Patterns use the [`.dockerignore` syntax](https://docs.docker.com/engine/reference/builder/#dockerignore-file)
+* List of file patterns will be used by both automatic and manually run plans.
+* When not set, defaults to all `.tf`, `.tfvars`, `.tfvars.json`, `terragrunt.hcl` and `.terraform.lock.hcl` files
(`--autoplan-file-list='**/*.tf,**/*.tfvars,**/*.tfvars.json,**/terragrunt.hcl,**/.terraform.lock.hcl'`).
- * Setting `--autoplan-file-list` will override the defaults. You **must** add `**/*.tf` and other defaults if you want to include them.
- * A custom [Workflow](repo-level-atlantis-yaml.html#configuring-planning) that uses autoplan `when_modified` will ignore this value.
+* Setting `--autoplan-file-list` will override the defaults. You **must** add `**/*.tf` and other defaults if you want to include them.
+* A custom [Workflow](repo-level-atlantis-yaml.md#configuring-planning) that uses autoplan `when_modified` will ignore this value.
Examples:
- * Autoplan when any `*.tf` or `*.tfvars` file is modified.
- * `--autoplan-file-list='**/*.tf,**/*.tfvars'`
- * Autoplan when any `*.tf` file is modified except in `project2/` directory
- * `--autoplan-file-list='**/*.tf,!project2'`
- * Autoplan when any `*.tf` files or `.yml` files in subfolder of `project1` is modified.
- * `--autoplan-file-list='**/*.tf,project2/**/*.yml'`
+* Autoplan when any `*.tf` or `*.tfvars` file is modified.
+ * `--autoplan-file-list='**/*.tf,**/*.tfvars'`
+* Autoplan when any `*.tf` file is modified except in `project2/` directory
+ * `--autoplan-file-list='**/*.tf,!project2'`
+* Autoplan when any `*.tf` files or `.yml` files in subfolder of `project1` is modified.
+ * `--autoplan-file-list='**/*.tf,project2/**/*.yml'`
::: warning NOTE
By default, changes to modules will not trigger autoplanning. See the flags below.
@@ -202,8 +225,8 @@ Current default is "" (disabled).
Examples:
- * `**/*.tf` - will index all projects that have a `.tf` file in their directory, and plan them whenever an in-repo module dependency has changed.
- * `**/*.tf,!foo,!bar` - will index all projects containing `.tf` except `foo` and `bar` and plan them whenever an in-repo module dependency has changed.
+* `**/*.tf` - will index all projects that have a `.tf` file in their directory, and plan them whenever an in-repo module dependency has changed.
+* `**/*.tf,!foo,!bar` - will index all projects containing `.tf` except `foo` and `bar` and plan them whenever an in-repo module dependency has changed.
This allows projects to opt-out of auto-planning when a module dependency changes.
::: warning NOTE
@@ -217,35 +240,43 @@ and set `--autoplan-modules` to `false`.
:::
### `--azuredevops-hostname`
+
```bash
atlantis server --azuredevops-hostname="dev.azure.com"
# or
ATLANTIS_AZUREDEVOPS_HOSTNAME="dev.azure.com"
```
+
Azure DevOps hostname to support cloud and self hosted instances. Defaults to `dev.azure.com`.
### `--azuredevops-token`
+
```bash
atlantis server --azuredevops-token="RandomStringProducedByAzureDevOps"
# or (recommended)
ATLANTIS_AZUREDEVOPS_TOKEN="RandomStringProducedByAzureDevOps"
```
+
Azure DevOps token of API user.
### `--azuredevops-user`
+
```bash
atlantis server --azuredevops-user="username@example.com"
# or
ATLANTIS_AZUREDEVOPS_USER="username@example.com"
```
+
Azure DevOps username of API user.
### `--azuredevops-webhook-password`
+
```bash
atlantis server --azuredevops-webhook-password="password123"
# or (recommended)
ATLANTIS_AZUREDEVOPS_WEBHOOK_PASSWORD="password123"
```
+
Azure DevOps basic authentication password for inbound webhooks (see
[docs](https://docs.microsoft.com/en-us/azure/devops/service-hooks/authorize?view=azure-devops)).
@@ -258,47 +289,57 @@ and set `--autoplan-modules` to `false`.
:::
### `--azuredevops-webhook-user`
+
```bash
atlantis server --azuredevops-webhook-user="username@example.com"
# or
ATLANTIS_AZUREDEVOPS_WEBHOOK_USER="username@example.com"
```
+
Azure DevOps basic authentication username for inbound webhooks.
### `--bitbucket-base-url`
+
```bash
atlantis server --bitbucket-base-url="http://bitbucket.corp:7990/basepath"
# or
ATLANTIS_BITBUCKET_BASE_URL="http://bitbucket.corp:7990/basepath"
```
+
Base URL of Bitbucket Server (aka Stash) installation. Must include
`http://` or `https://`. If using Bitbucket Cloud (bitbucket.org), do not set. Defaults to
`https://api.bitbucket.org`.
### `--bitbucket-token`
+
```bash
atlantis server --bitbucket-token="token"
# or (recommended)
ATLANTIS_BITBUCKET_TOKEN="token"
```
+
Bitbucket app password of API user.
### `--bitbucket-user`
+
```bash
atlantis server --bitbucket-user="myuser"
# or
ATLANTIS_BITBUCKET_USER="myuser"
```
+
Bitbucket username of API user.
### `--bitbucket-webhook-secret`
+
```bash
atlantis server --bitbucket-webhook-secret="secret"
# or (recommended)
ATLANTIS_BITBUCKET_WEBHOOK_SECRET="secret"
```
+
Secret used to validate Bitbucket webhooks. Only Bitbucket Server supports webhook secrets.
- For Bitbucket.org, see [Security](security.html#bitbucket-cloud-bitbucket-org) for mitigations.
+ For Bitbucket.org, see [Security](security.md#bitbucket-cloud-bitbucket-org) for mitigations.
::: warning SECURITY WARNING
If not specified, Atlantis won't be able to validate that the incoming webhook call came from Bitbucket.
@@ -306,143 +347,173 @@ and set `--autoplan-modules` to `false`.
:::
### `--checkout-depth`
+
```bash
atlantis server --checkout-depth=0
# or
ATLANTIS_CHECKOUT_DEPTH=0
```
+
The number of commits to fetch from the branch. Used if `--checkout-strategy=merge` since the `--checkout-strategy=branch` (default) checkout strategy always defaults to a shallow clone using a depth of 1.
- Defaults to `0`. See [Checkout Strategy](checkout-strategy.html) for more details.
+ Defaults to `0`. See [Checkout Strategy](checkout-strategy.md) for more details.
### `--checkout-strategy`
+
```bash
atlantis server --checkout-strategy=""
# or
ATLANTIS_CHECKOUT_STRATEGY=""
```
+
How to check out pull requests. Use either `branch` or `merge`.
- Defaults to `branch`. See [Checkout Strategy](checkout-strategy.html) for more details.
+ Defaults to `branch`. See [Checkout Strategy](checkout-strategy.md) for more details.
### `--config`
+
```bash
atlantis server --config="my/config/file.yaml"
# or
ATLANTIS_CONFIG="my/config/file.yaml"
```
+
YAML config file where flags can also be set. See [Config File](#config-file) for more details.
### `--data-dir`
+
```bash
atlantis server --data-dir="path/to/data/dir"
# or
ATLANTIS_DATA_DIR="path/to/data/dir"
```
+
Directory where Atlantis will store its data. Will be created if it doesn't exist.
Defaults to `~/.atlantis`. Atlantis will store its database, checked out repos, Terraform plans and downloaded
- Terraform binaries here. If Atlantis loses this directory, [locks](locking.html)
+ Terraform binaries here. If Atlantis loses this directory, [locks](locking.md)
will be lost and unapplied plans will be lost.
Note that the atlantis user is restricted to `~/.atlantis`.
If you set the `--data-dir` flag to a path outside of Atlantis its home directory, ensure that you grant the atlantis user the correct permissions.
### `--default-tf-version`
+
```bash
atlantis server --default-tf-version="v0.12.31"
# or
ATLANTIS_DEFAULT_TF_VERSION="v0.12.31"
```
+
Terraform version to default to. Will download to `/bin/terraform`
- if not in `PATH`. See [Terraform Versions](terraform-versions.html) for more details.
+ if not in `PATH`. See [Terraform Versions](terraform-versions.md) for more details.
### `--disable-apply-all`
+
```bash
atlantis server --disable-apply-all
# or
ATLANTIS_DISABLE_APPLY_ALL=true
```
+
Disable `atlantis apply` command so a specific project/workspace/directory has to
be specified for applies.
### `--disable-autoplan`
+
```bash
atlantis server --disable-autoplan
# or
ATLANTIS_DISABLE_AUTOPLAN=true
```
+
Disable atlantis auto planning.
### `--disable-autoplan-label`
+
```bash
atlantis server --disable-autoplan-label="no-autoplan"
# or
ATLANTIS_DISABLE_AUTOPLAN_LABEL="no-autoplan"
```
+
Disable atlantis auto planning only on pull requests with the specified label.
If `disable-autoplan` property is `true`, this flag has no effect.
### `--disable-markdown-folding`
+
```bash
atlantis server --disable-markdown-folding
# or
- ATLANTIS_DISABLE_MARKDOWN_FOLDER=true
+ ATLANTIS_DISABLE_MARKDOWN_FOLDING=true
```
+
Disable folding in markdown output using the `` html tag.
### `--disable-repo-locking`
+
```bash
atlantis server --disable-repo-locking
# or
ATLANTIS_DISABLE_REPO_LOCKING=true
```
+
Stops atlantis from locking projects and or workspaces when running terraform.
### `--disable-unlock-label`
+
```bash
atlantis server --disable-unlock-label do-not-unlock
# or
ATLANTIS_DISABLE_UNLOCK_LABEL="do-not-unlock"
```
+
Stops atlantis from unlocking a pull request with this label. Defaults to "" (feature disabled).
### `--emoji-reaction`
+
```bash
atlantis server --emoji-reaction thumbsup
# or
ATLANTIS_EMOJI_REACTION=thumbsup
```
- The emoji reaction to use for marking processed comments. Currently supported on Azure DevOps, GitHub and GitLab.
- Defaults to `eyes`.
+
+ The emoji reaction to use for marking processed comments. Currently supported on Azure DevOps, GitHub and GitLab. If not specified, Atlantis will not use an emoji reaction.
+ Defaults to "" (empty string).
### `--enable-diff-markdown-format`
+
```bash
atlantis server --enable-diff-markdown-format
# or
ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT=true
```
+
Enable Atlantis to format Terraform plan output into a markdown-diff friendly format for color-coding purposes.
Useful to enable for use with GitHub.
### `--enable-policy-checks`
+
```bash
atlantis server --enable-policy-checks
# or
ATLANTIS_ENABLE_POLICY_CHECKS=true
```
- Enables atlantis to run server side policies on the result of a terraform plan. Policies are defined in [server side repo config](https://www.runatlantis.io/docs/server-side-repo-config.html#reference).
+
+ Enables atlantis to run server side policies on the result of a terraform plan. Policies are defined in [server side repo config](server-side-repo-config.md#reference).
### `--enable-regexp-cmd`
+
```bash
atlantis server --enable-regexp-cmd
# or
ATLANTIS_ENABLE_REGEXP_CMD=true
```
+
Enable Atlantis to use regular expressions to run plan/apply commands against defined project names when `-p` flag is passed with it.
This can be used to run all defined projects (with the `name` key) in `atlantis.yaml` using `atlantis plan -p .*`.
- The flag will only allow the regexes listed in the [`allowed_regexp_prefixes`](https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html#reference) key defined in the repo `atlantis.yaml` file. If the key is undefined, its value defaults to `[]` which will allow any regex.
+ The flag will only allow the regexes listed in the [`allowed_regexp_prefixes`](repo-level-atlantis-yaml.md#reference) key defined in the repo `atlantis.yaml` file. If the key is undefined, its value defaults to `[]` which will allow any regex.
This will not work with `-d` yet and to use `-p` the repo projects must be defined in the repo `atlantis.yaml` file.
@@ -454,16 +525,19 @@ and set `--autoplan-modules` to `false`.
:::
### `--executable-name`
+
```bash
atlantis server --executable-name="atlantis"
# or
ATLANTIS_EXECUTABLE_NAME="atlantis"
```
+
Comment command trigger executable name. Defaults to `atlantis`.
This is useful when running multiple Atlantis servers against a single repository.
### `--fail-on-pre-workflow-hook-error`
+
```bash
atlantis server --fail-on-pre-workflow-hook-error
# or
@@ -472,32 +546,96 @@ and set `--autoplan-modules` to `false`.
Fail and do not run the requested Atlantis command if any of the pre workflow hooks error.
+### `--gitea-base-url`
+
+ ```bash
+ atlantis server --gitea-base-url="http://your-gitea.corp:7990/basepath"
+ # or
+ ATLANTIS_GITEA_BASE_URL="http://your-gitea.corp:7990/basepath"
+ ```
+
+ Base URL of Gitea installation. Must include `http://` or `https://`. Defaults to `https://gitea.com` if left empty/absent.
+
+### `--gitea-token`
+
+ ```bash
+ atlantis server --gitea-token="token"
+ # or (recommended)
+ ATLANTIS_GITEA_TOKEN="token"
+ ```
+
+ Gitea app password of API user.
+
+### `--gitea-user`
+
+ ```bash
+ atlantis server --gitea-user="myuser"
+ # or
+ ATLANTIS_GITEA_USER="myuser"
+ ```
+
+ Gitea username of API user.
+
+### `--gitea-webhook-secret`
+
+ ```bash
+ atlantis server --gitea-webhook-secret="secret"
+ # or (recommended)
+ ATLANTIS_GITEA_WEBHOOK_SECRET="secret"
+ ```
+
+ Secret used to validate Gitea webhooks.
+
+ ::: warning SECURITY WARNING
+ If not specified, Atlantis won't be able to validate that the incoming webhook call came from Gitea.
+ This means that an attacker could spoof calls to Atlantis and cause it to perform malicious actions.
+ :::
+
+### `--gitea-page-size`
+
+ ```bash
+ atlantis server --gitea-page-size=30
+ # or (recommended)
+ ATLANTIS_GITEA_PAGE_SIZE=30
+ ```
+
+ Number of items on a single page in Gitea paged responses.
+
+ ::: warning Configuration dependent
+ The default value conforms to the Gitea server's standard config setting: DEFAULT_PAGING_NUM
+ The highest valid value depends on the Gitea server's config setting: MAX_RESPONSE_ITEMS
+ :::
+
### `--gh-allow-mergeable-bypass-apply`
+
```bash
atlantis server --gh-allow-mergeable-bypass-apply
# or
ATLANTIS_GH_ALLOW_MERGEABLE_BYPASS_APPLY=true
```
+
Feature flag to enable ability to use `mergeable` mode with required apply status check.
### `--gh-app-id`
+
```bash
atlantis server --gh-app-id="00000"
# or
ATLANTIS_GH_APP_ID="00000"
```
+
GitHub app ID. If set, GitHub authentication will be performed as [an installation](https://docs.github.com/en/rest/apps/installations).
::: tip
A GitHub app can be created by starting Atlantis first, then pointing your browser at
- ```
+ ```shell
$(hostname)/github-app/setup
```
You'll be redirected to GitHub to create a new app, and will then be redirected to
- ```
+ ```shell
$(hostname)/github-app/exchange-code?code=some-code
```
@@ -505,11 +643,13 @@ and set `--autoplan-modules` to `false`.
:::
### `--gh-app-key`
+
```bash
atlantis server --gh-app-key="-----BEGIN RSA PRIVATE KEY-----(...)"
# or
ATLANTIS_GH_APP_KEY="-----BEGIN RSA PRIVATE KEY-----(...)"
```
+
The PEM encoded private key for the GitHub App.
::: warning SECURITY WARNING
@@ -517,44 +657,69 @@ and set `--autoplan-modules` to `false`.
:::
### `--gh-app-key-file`
+
```bash
atlantis server --gh-app-key-file="path/to/app-key.pem"
# or
ATLANTIS_GH_APP_KEY_FILE="path/to/app-key.pem"
```
+
Path to a GitHub App PEM encoded private key file. If set, GitHub authentication will be performed as [an installation](https://docs.github.com/en/rest/apps/installations).
### `--gh-app-slug`
+
```bash
atlantis server --gh-app-slug="myappslug"
# or
ATLANTIS_GH_APP_SLUG="myappslug"
```
+
A slugged version of GitHub app name shown in pull requests comments, etc (not `Atlantis App` but something like `atlantis-app`). Atlantis uses the value of this parameter to identify the comments it has left on GitHub pull requests. This is used for functions such as `--hide-prev-plan-comments`. You need to obtain this value from your GitHub app, one way is to go to your App settings and open "Public page" from the left sidebar. Your `--gh-app-slug` value will be the last part of the URL, e.g `https://github.com/apps/`.
### `--gh-hostname`
+
```bash
atlantis server --gh-hostname="my.github.enterprise.com"
# or
ATLANTIS_GH_HOSTNAME="my.github.enterprise.com"
```
+
Hostname of your GitHub Enterprise installation. If using [GitHub.com](https://github.com),
don't set. Defaults to `github.com`.
+### `--gh-app-installation-id`
+
+ ```bash
+ atlantis server --gh-app-installation-id="123"
+ # or
+ ATLANTIS_GH_APP_INSTALLATION_ID="123"
+ ```
+
+The installation ID of a specific instance of a GitHub application. Normally this value is
+derived by querying GitHub for the list of installations of the ID supplied via `--gh-app-id` and selecting
+the first one found and where multiple installations results in an error. Use this flag if you have multiple
+instances of Atlantis but you want to use a single already-installed GitHub app for all of them. You would normally do this if
+you are running a proxy as your single GitHub application that will proxy to an appropriate Atlantis instance
+based on the organization or user that triggered the webhook.
+
### `--gh-org`
+
```bash
atlantis server --gh-org="myorgname"
# or
ATLANTIS_GH_ORG="myorgname"
```
+
GitHub organization name. Set to enable creating a private GitHub app for this organization.
### `--gh-team-allowlist`
+
```bash
atlantis server --gh-team-allowlist="myteam:plan, secteam:apply, DevOps Team:apply, DevOps Team:import"
# or
ATLANTIS_GH_TEAM_ALLOWLIST="myteam:plan, secteam:apply, DevOps Team:apply, DevOps Team:import"
```
+
In versions v0.21.0 and later, the GitHub team name can be a name or a slug.
In versions v0.20.1 and below, the Github team name required the case sensitive team name.
@@ -569,28 +734,34 @@ and set `--autoplan-modules` to `false`.
:::
### `--gh-token`
+
```bash
atlantis server --gh-token="token"
# or (recommended)
ATLANTIS_GH_TOKEN="token"
```
+
GitHub token of API user.
### `--gh-user`
+
```bash
atlantis server --gh-user="myuser"
# or
ATLANTIS_GH_USER="myuser"
```
+
GitHub username of API user.
### `--gh-webhook-secret`
+
```bash
atlantis server --gh-webhook-secret="secret"
# or (recommended)
ATLANTIS_GH_WEBHOOK_SECRET="secret"
```
- Secret used to validate GitHub webhooks (see [https://developer.github.com/webhooks/securing/](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks)).
+
+ Secret used to validate GitHub webhooks (see [GitHub: Validating webhook deliveries](https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries)).
::: warning SECURITY WARNING
If not specified, Atlantis won't be able to validate that the incoming webhook call came from GitHub.
@@ -598,36 +769,44 @@ and set `--autoplan-modules` to `false`.
:::
### `--gitlab-hostname`
+
```bash
atlantis server --gitlab-hostname="my.gitlab.enterprise.com"
# or
ATLANTIS_GITLAB_HOSTNAME="my.gitlab.enterprise.com"
```
+
Hostname of your GitLab Enterprise installation. If using [Gitlab.com](https://gitlab.com),
don't set. Defaults to `gitlab.com`.
### `--gitlab-token`
+
```bash
atlantis server --gitlab-token="token"
# or (recommended)
ATLANTIS_GITLAB_TOKEN="token"
```
+
GitLab token of API user.
### `--gitlab-user`
+
```bash
atlantis server --gitlab-user="myuser"
# or
ATLANTIS_GITLAB_USER="myuser"
```
+
GitLab username of API user.
### `--gitlab-webhook-secret`
+
```bash
atlantis server --gitlab-webhook-secret="secret"
# or (recommended)
ATLANTIS_GITLAB_WEBHOOK_SECRET="secret"
```
+
Secret used to validate GitLab webhooks.
::: warning SECURITY WARNING
@@ -636,71 +815,86 @@ and set `--autoplan-modules` to `false`.
:::
### `--help`
+
```bash
atlantis server --help
```
+
View help.
### `--hide-prev-plan-comments`
+
```bash
atlantis server --hide-prev-plan-comments
# or
ATLANTIS_HIDE_PREV_PLAN_COMMENTS=true
```
+
Hide previous plan comments to declutter PRs. This is only supported in
GitHub and GitLab currently. This is not enabled by default. When using Github App, you need to set `--gh-app-slug` to enable this feature.
### `--hide-unchanged-plan-comments`
+
```bash
atlantis server --hide-unchanged-plan-comments
# or
ATLANTIS_HIDE_UNCHANGED_PLAN_COMMENTS=true
```
+
Remove no-changes plan comments from the pull request.
This is useful when you have many projects and want to keep the pull request clean from useless comments.
### `--include-git-untracked-files`
+
```bash
atlantis server --include-git-untracked-files
# or
ATLANTIS_INCLUDE_GIT_UNTRACKED_FILES=true
```
+
Include git untracked files in the Atlantis modified file list.
Used for example with CDKTF pre-workflow hooks that dynamically generate
Terraform files.
### `--locking-db-type`
+
```bash
atlantis server --locking-db-type=""
# or
ATLANTIS_LOCKING_DB_TYPE=""
```
+
The locking database type to use for storing plan and apply locks. Defaults to `boltdb`.
Notes:
- * If set to `boltdb`, only one process may have access to the boltdb instance.
- * If set to `redis`, then `--redis-host`, `--redis-port`, and `--redis-password` must be set.
+
+* If set to `boltdb`, only one process may have access to the boltdb instance.
+* If set to `redis`, then `--redis-host`, `--redis-port`, and `--redis-password` must be set.
### `--log-level`
+
```bash
atlantis server --log-level=""
# or
ATLANTIS_LOG_LEVEL=""
```
+
Log level. Defaults to `info`.
### `--markdown-template-overrides-dir`
+
```bash
atlantis server --markdown-template-overrides-dir="path/to/templates/"
# or
ATLANTIS_MARKDOWN_TEMPLATE_OVERRIDES_DIR="path/to/templates/"
```
+
This will be available in v0.21.0.
Directory where Atlantis will read in overrides for markdown templates used to render comments on pull requests.
Markdown template overrides may be specified either in individual files, or all together in a single file. All template
- override files _must_ have the `.tmpl` extension, otherwise they will not be parsed.
+ override files *must* have the `.tmpl` extension, otherwise they will not be parsed.
Markdown templates which may have overrides can be found [here](https://github.com/runatlantis/atlantis/tree/main/server/events/templates)
@@ -710,67 +904,83 @@ This is useful when you have many projects and want to keep the pull request cle
Defaults to the atlantis home directory `/home/atlantis/.markdown_templates/` in `/$HOME/.markdown_templates`.
### `--parallel-apply`
+
```bash
atlantis server --parallel-apply
# or
ATLANTIS_PARALLEL_APPLY=true
```
- Whether to run apply operations in parallel. Defaults to `false`. Explicit declaration in [repo config](repo-level-atlantis-yaml.html#run-plans-and-applies-in-parallel) takes precedence.
+
+ Whether to run apply operations in parallel. Defaults to `false`. Explicit declaration in [repo config](repo-level-atlantis-yaml.md#run-plans-and-applies-in-parallel) takes precedence.
### `--parallel-plan`
+
```bash
atlantis server --parallel-plan
# or
ATLANTIS_PARALLEL_PLAN=true
```
- Whether to run plan operations in parallel. Defaults to `false`. Explicit declaration in [repo config](repo-level-atlantis-yaml.html#run-plans-and-applies-in-parallel) takes precedence.
+
+ Whether to run plan operations in parallel. Defaults to `false`. Explicit declaration in [repo config](repo-level-atlantis-yaml.md#run-plans-and-applies-in-parallel) takes precedence.
### `--parallel-pool-size`
+
```bash
atlantis server --parallel-pool-size=100
# or
ATLANTIS_PARALLEL_POOL_SIZE=100
```
+
Max size of the wait group that runs parallel plans and applies (if enabled). Defaults to `15`
### `--port`
+
```bash
atlantis server --port=4141
# or
ATLANTIS_PORT=4141
```
+
Port to bind to. Defaults to `4141`.
### `--quiet-policy-checks`
+
```bash
atlantis server --quiet-policy-checks
# or
ATLANTIS_QUIET_POLICY_CHECKS=true
```
+
Exclude policy check comments from pull requests unless there's an actual error from conftest. This also excludes warnings. Defaults to `false`.
### `--redis-db`
+
```bash
atlantis server --redis-db=0
# or
ATLANTIS_REDIS_DB=0
```
+
The Redis Database to use when using a Locking DB type of `redis`. Defaults to `0`.
### `--redis-host`
+
```bash
atlantis server --redis-host="localhost"
# or
ATLANTIS_REDIS_HOST="localhost"
```
+
The Redis Hostname for when using a Locking DB type of `redis`.
### `--redis-insecure-skip-verify`
+
```bash
atlantis server --redis-insecure-skip-verify=false
# or
ATLANTIS_REDIS_INSECURE_SKIP_VERIFY=false
```
+
Controls whether the Redis client verifies the Redis server's certificate chain and host name. If true, accepts any certificate presented by the server and any host name in that certificate. Defaults to `false`.
::: warning SECURITY WARNING
@@ -778,82 +988,97 @@ This is useful when you have many projects and want to keep the pull request cle
:::
### `--redis-password`
+
```bash
atlantis server --redis-password="password123"
# or (recommended)
ATLANTIS_REDIS_PASSWORD="password123"
```
+
The Redis Password for when using a Locking DB type of `redis`.
### `--redis-port`
+
```bash
atlantis server --redis-port=6379
# or
ATLANTIS_REDIS_PORT=6379
```
+
The Redis Port for when using a Locking DB type of `redis`. Defaults to `6379`.
### `--redis-tls-enabled`
+
```bash
atlantis server --redis-tls-enabled=false
# or
ATLANTIS_REDIS_TLS_ENABLED=false
```
+
Enables a TLS connection, with min version of 1.2, to Redis when using a Locking DB type of `redis`. Defaults to `false`.
### `--repo-allowlist`
+
```bash
# NOTE: Use single quotes to avoid shell expansion of *.
atlantis server --repo-allowlist='github.com/myorg/*'
# or
ATLANTIS_REPO_ALLOWLIST='github.com/myorg/*'
```
+
Atlantis requires you to specify an allowlist of repositories it will accept webhooks from.
Notes:
- * Accepts a comma separated list, ex. `definition1,definition2`
- * Format is `{hostname}/{owner}/{repo}`, ex. `github.com/runatlantis/atlantis`
- * `*` matches any characters, ex. `github.com/runatlantis/*` will match all repos in the runatlantis organization
- * An entry beginning with `!` negates it, ex. `github.com/foo/*,!github.com/foo/bar` will match all github repos in the `foo` owner *except* `bar`.
- * For Bitbucket Server: `{hostname}` is the domain without scheme and port, `{owner}` is the name of the project (not the key), and `{repo}` is the repo name
- * User (not project) repositories take on the format: `{hostname}/{full name}/{repo}` (e.g., `bitbucket.example.com/Jane Doe/myatlantis` for username `jdoe` and full name `Jane Doe`, which is not very intuitive)
- * For Azure DevOps the allowlist takes one of two forms: `{owner}.visualstudio.com/{project}/{repo}` or `dev.azure.com/{owner}/{project}/{repo}`
- * Microsoft is in the process of changing Azure DevOps to the latter form, so it may be safest to always specify both formats in your repo allowlist for each repository until the change is complete.
+
+* Accepts a comma separated list, ex. `definition1,definition2`
+* Format is `{hostname}/{owner}/{repo}`, ex. `github.com/runatlantis/atlantis`
+* `*` matches any characters, ex. `github.com/runatlantis/*` will match all repos in the runatlantis organization
+* An entry beginning with `!` negates it, ex. `github.com/foo/*,!github.com/foo/bar` will match all github repos in the `foo` owner *except* `bar`.
+* For Bitbucket Server: `{hostname}` is the domain without scheme and port, `{owner}` is the name of the project (not the key), and `{repo}` is the repo name
+ * User (not project) repositories take on the format: `{hostname}/{full name}/{repo}` (e.g., `bitbucket.example.com/Jane Doe/myatlantis` for username `jdoe` and full name `Jane Doe`, which is not very intuitive)
+* For Azure DevOps the allowlist takes one of two forms: `{owner}.visualstudio.com/{project}/{repo}` or `dev.azure.com/{owner}/{project}/{repo}`
+* Microsoft is in the process of changing Azure DevOps to the latter form, so it may be safest to always specify both formats in your repo allowlist for each repository until the change is complete.
Examples:
- * Allowlist `myorg/repo1` and `myorg/repo2` on `github.com`
- * `--repo-allowlist=github.com/myorg/repo1,github.com/myorg/repo2`
- * Allowlist all repos under `myorg` on `github.com`
- * `--repo-allowlist='github.com/myorg/*'`
- * Allowlist all repos under `myorg` on `github.com`, excluding `myorg/untrusted-repo`
- * `--repo-allowlist='github.com/myorg/*,!github.com/myorg/untrusted-repo'`
- * Allowlist all repos in my GitHub Enterprise installation
- * `--repo-allowlist='github.yourcompany.com/*'`
- * Allowlist all repos under `myorg` project `myproject` on Azure DevOps
- * `--repo-allowlist='myorg.visualstudio.com/myproject/*,dev.azure.com/myorg/myproject/*'`
- * Allowlist all repositories
- * `--repo-allowlist='*'`
+
+* Allowlist `myorg/repo1` and `myorg/repo2` on `github.com`
+ * `--repo-allowlist=github.com/myorg/repo1,github.com/myorg/repo2`
+* Allowlist all repos under `myorg` on `github.com`
+ * `--repo-allowlist='github.com/myorg/*'`
+* Allowlist all repos under `myorg` on `github.com`, excluding `myorg/untrusted-repo`
+ * `--repo-allowlist='github.com/myorg/*,!github.com/myorg/untrusted-repo'`
+* Allowlist all repos in my GitHub Enterprise installation
+ * `--repo-allowlist='github.yourcompany.com/*'`
+* Allowlist all repos under `myorg` project `myproject` on Azure DevOps
+ * `--repo-allowlist='myorg.visualstudio.com/myproject/*,dev.azure.com/myorg/myproject/*'`
+* Allowlist all repositories
+ * `--repo-allowlist='*'`
### `--repo-config`
+
```bash
atlantis server --repo-config="path/to/repos.yaml"
# or
ATLANTIS_REPO_CONFIG="path/to/repos.yaml"
```
- Path to a YAML server-side repo config file. See [Server Side Repo Config](server-side-repo-config.html).
+
+ Path to a YAML server-side repo config file. See [Server Side Repo Config](server-side-repo-config.md).
### `--repo-config-json`
+
```bash
atlantis server --repo-config-json='{"repos":[{"id":"/.*/", "apply_requirements":["mergeable"]}]}'
# or
ATLANTIS_REPO_CONFIG_JSON='{"repos":[{"id":"/.*/", "apply_requirements":["mergeable"]}]}'
```
+
Specify server-side repo config as a JSON string. Useful if you don't want to write a config file to disk.
- See [Server Side Repo Config](server-side-repo-config.html) for more details.
+ See [Server Side Repo Config](server-side-repo-config.md) for more details.
::: tip
- If specifying a [Workflow](custom-workflows.html#reference), [step](custom-workflows.html#step)'s
+ If specifying a [Workflow](custom-workflows.md#reference), [step](custom-workflows.md#step)'s
can be specified as follows:
+
```json
{
"repos": [],
@@ -876,25 +1101,30 @@ This is useful when you have many projects and want to keep the pull request cle
}
}
```
+
:::
### `--restrict-file-list`
+
```bash
atlantis server --restrict-file-list
# or (recommended)
ATLANTIS_RESTRICT_FILE_LIST=true
```
+
`--restrict-file-list` will block plan requests from projects outside the files modified in the pull request.
This will not block plan requests with regex if using the `--enable-regexp-cmd` flag, in these cases commands
like `atlantis plan -p .*` will still work if used. normal commands will stil be blocked if necessary.
Defaults to `false`.
### `--silence-allowlist-errors`
+
```bash
atlantis server --silence-allowlist-errors
# or
ATLANTIS_SILENCE_ALLOWLIST_ERRORS=true
```
+
Some users use the `--repo-allowlist` flag to control which repos Atlantis
responds to. Normally, if Atlantis receives a pull request webhook from a repo not listed
in the allowlist, it will comment back with an error. This flag disables that commenting.
@@ -903,20 +1133,24 @@ This is useful when you have many projects and want to keep the pull request cle
at an organization level rather than on each repo.
### `--silence-fork-pr-errors`
+
```bash
atlantis server --silence-fork-pr-errors
# or
ATLANTIS_SILENCE_FORK_PR_ERRORS=true
```
+
Normally, if Atlantis receives a pull request webhook from a fork and --allow-fork-prs is not set,
it will comment back with an error. This flag disables that commenting.
### `--silence-no-projects`
+
```bash
atlantis server --silence-no-projects
# or
ATLANTIS_SILENCE_NO_PROJECTS=true
```
+
`--silence-no-projects` will tell Atlantis to ignore PRs if none of the modified files are part of a project defined in the `atlantis.yaml` file.
This flag ensures an Atlantis server only responds to its explicitly declared projects.
This has no effect if projects are undefined in the repo level `atlantis.yaml`.
@@ -926,78 +1160,96 @@ This is useful when you have many projects and want to keep the pull request cle
delegate work to each Atlantis server. Also useful when used with pre_workflow_hooks to dynamically generate an `atlantis.yaml` file.
### `--silence-vcs-status-no-plans`
+
```bash
atlantis server --silence-vcs-status-no-plans
# or
ATLANTIS_SILENCE_VCS_STATUS_NO_PLANS=true
```
+
`--silence-vcs-status-no-plans` will tell Atlantis to ignore setting VCS status on plans if none of the modified files are part of a project defined in the `atlantis.yaml` file.
### `--silence-vcs-status-no-projects`
+
```bash
atlantis server --silence-vcs-status-no-projects
# or
ATLANTIS_SILENCE_VCS_STATUS_NO_PROJECTS=true
```
+
`--silence-vcs-status-no-projects` will tell Atlantis to ignore setting VCS status on any command if none of the modified files are part of a project defined in the `atlantis.yaml` file.
### `--skip-clone-no-changes`
+
```bash
atlantis server --skip-clone-no-changes
# or
ATLANTIS_SKIP_CLONE_NO_CHANGES=true
```
+
`--skip-clone-no-changes` will skip cloning the repo during autoplan if there are no changes to Terraform projects. This will only apply for GitHub and GitLab and only for repos that have `atlantis.yaml` file. Defaults to `false`.
### `--slack-token`
+
```bash
atlantis server --slack-token=token
# or (recommended)
ATLANTIS_SLACK_TOKEN='token'
```
- API token for Slack notifications. Slack is not fully supported. TODO: Slack docs.
+
+ API token for Slack notifications. See [Using Slack hooks](using-slack-hooks.md).
### `--ssl-cert-file`
+
```bash
atlantis server --ssl-cert-file="/etc/ssl/certs/my-cert.crt"
# or
ATLANTIS_SSL_CERT_FILE="/etc/ssl/certs/my-cert.crt"
```
+
File containing x509 Certificate used for serving HTTPS.
If the cert is signed by a CA, the file should be the concatenation
of the server's certificate, any intermediates, and the CA's certificate.
### `--ssl-key-file`
+
```bash
atlantis server --ssl-key-file="/etc/ssl/private/my-cert.key"
# or
ATLANTIS_SSL_KEY_FILE="/etc/ssl/private/my-cert.key"
```
+
File containing x509 private key matching `--ssl-cert-file`.
### `--stats-namespace`
+
```bash
atlantis server --stats-namespace="myatlantis"
# or
ATLANTIS_STATS_NAMESPACE="myatlantis"
```
- Namespace for emitting stats/metrics. See [stats](stats.html) section.
+
+ Namespace for emitting stats/metrics. See [stats](stats.md) section.
### `--tf-download`
+
```bash
atlantis server --tf-download=false
# or
ATLANTIS_TF_DOWNLOAD=false
```
+
Defaults to `true`. Allow Atlantis to list and download additional versions of Terraform.
Setting this to `false` can be useful in an air-gapped environment where a download mirror is not available.
### `--tf-download-url`
+
```bash
atlantis server --tf-download-url="https://releases.company.com"
# or
ATLANTIS_TF_DOWNLOAD_URL="https://releases.company.com"
```
+
An alternative URL to download Terraform versions if they are missing. Useful in an airgapped
environment where releases.hashicorp.com is not available. Directory structure of the custom
endpoint should match that of releases.hashicorp.com.
@@ -1005,106 +1257,128 @@ Setting this to `false` can be useful in an air-gapped environment where a downl
This has no impact if `--tf-download` is set to `false`.
### `--tfe-hostname`
+
```bash
atlantis server --tfe-hostname="my-terraform-enterprise.company.com"
# or
ATLANTIS_TFE_HOSTNAME="my-terraform-enterprise.company.com"
```
+
Hostname of your Terraform Enterprise installation to be used in conjunction with
- `--tfe-token`. See [Terraform Cloud](terraform-cloud.html) for more details.
+ `--tfe-token`. See [Terraform Cloud](terraform-cloud.md) for more details.
If using Terraform Cloud (i.e. you don't have your own Terraform Enterprise installation)
no need to set since it defaults to `app.terraform.io`.
### `--tfe-local-execution-mode`
+
```bash
atlantis server --tfe-local-execution-mode
# or
ATLANTIS_TFE_LOCAL_EXECUTION_MODE=true
```
- Enable if you're using local execution mode (instead of TFE/C's remote execution mode). See [Terraform Cloud](terraform-cloud.html) for more details.
+
+ Enable if you're using local execution mode (instead of TFE/C's remote execution mode). See [Terraform Cloud](terraform-cloud.md) for more details.
### `--tfe-token`
+
```bash
atlantis server --tfe-token="xxx.atlasv1.yyy"
# or (recommended)
ATLANTIS_TFE_TOKEN='xxx.atlasv1.yyy'
```
- A token for Terraform Cloud/Terraform Enterprise integration. See [Terraform Cloud](terraform-cloud.html) for more details.
+
+ A token for Terraform Cloud/Terraform Enterprise integration. See [Terraform Cloud](terraform-cloud.md) for more details.
### `--use-tf-plugin-cache`
+
```bash
atlantis server --use-tf-plugin-cache=false
# or
ATLANTIS_USE_TF_PLUGIN_CACHE=false
```
+
Set to false if you want to disable terraform plugin cache.
This flag is useful when having multiple projects that need to run a plan and apply in the same PR to avoid the race condition of `plugin_cache_dir` concurrently, this is a terraform known issue, more info:
-- [plugin_cache_dir concurrently discussion](https://github.com/hashicorp/terraform/issues/31964)
-- [PR to improve the situation](https://github.com/hashicorp/terraform/pull/33479)
+* [plugin_cache_dir concurrently discussion](https://github.com/hashicorp/terraform/issues/31964)
+* [PR to improve the situation](https://github.com/hashicorp/terraform/pull/33479)
The effect of the race condition is more evident when using parallel configuration to run plan and apply, by disabling the use of plugin cache will impact in the performance when starting a new plan or apply, but in large atlantis deployments with multiple projects and shared modules the use of `--parallel_plan` and `--parallel_apply` is mandatory for an efficient managment of the PRs.
### `--var-file-allowlist`
+
```bash
atlantis server --var-file-allowlist='/path/to/tfvars/dir'
# or
ATLANTIS_VAR_FILE_ALLOWLIST='/path/to/tfvars/dir'
```
+
Comma-separated list of additional directory paths where [variable definition files](https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files) can be read from.
The paths in this argument should be absolute paths. Relative paths and globbing are currently not supported.
If this argument is not provided, it defaults to Atlantis' data directory, determined by the `--data-dir` argument.
### `--vcs-status-name`
+
```bash
atlantis server --vcs-status-name="atlantis-dev"
# or
ATLANTIS_VCS_STATUS_NAME="atlantis-dev"
```
+
Name used to identify Atlantis when updating a pull request status. Defaults to `atlantis`.
This is useful when running multiple Atlantis servers against a single repository so you can
give each Atlantis server its own unique name to prevent the statuses clashing.
### `--web-basic-auth`
+
```bash
atlantis server --web-basic-auth
# or
ATLANTIS_WEB_BASIC_AUTH=true
```
+
Enable Basic Authentication on the Atlantis web service.
### `--web-password`
+
```bash
atlantis server --web-password="atlantis"
# or
ATLANTIS_WEB_PASSWORD="atlantis"
```
+
Password used for Basic Authentication on the Atlantis web service. Defaults to `atlantis`.
### `--web-username`
+
```bash
atlantis server --web-username="atlantis"
# or
ATLANTIS_WEB_USERNAME="atlantis"
```
+
Username used for Basic Authentication on the Atlantis web service. Defaults to `atlantis`.
### `--websocket-check-origin`
+
```bash
atlantis server --websocket-check-origin
# or
ATLANTIS_WEBSOCKET_CHECK_ORIGIN=true
```
+
Only allow websockets connection when they originate from the running Atlantis web server
### `--write-git-creds`
+
```bash
atlantis server --write-git-creds
# or
ATLANTIS_WRITE_GIT_CREDS=true
```
+
Write out a .git-credentials file with the provider user and token to allow
cloning private modules over HTTPS or SSH. See [here](https://git-scm.com/docs/git-credential-store) for more information.
@@ -1121,4 +1395,3 @@ The effect of the race condition is more evident when using parallel configurati
::: warning SECURITY WARNING
This does write secrets to disk and should only be enabled in a secure environment.
:::
-
diff --git a/runatlantis.io/docs/server-side-repo-config.md b/runatlantis.io/docs/server-side-repo-config.md
index 77b44be4fa..16899ac9a3 100644
--- a/runatlantis.io/docs/server-side-repo-config.md
+++ b/runatlantis.io/docs/server-side-repo-config.md
@@ -1,27 +1,29 @@
-# Server Side Config
+# Server Side Repo Config
+
A Server-Side Config file is used for more groups of server config that can't reasonably be expressed through flags.
One such usecase is to control per-repo behaviour
and what users can do in repo-level `atlantis.yaml` files.
-[[toc]]
-
## Do I Need A Server-Side Config File?
+
You do not need a server-side repo config file unless you want to customize
some aspect of Atlantis on a per-repo basis.
Read through the [use-cases](#use-cases) to determine if you need it.
## Enabling Server Side Config
+
To use server side repo config create a config file, ex. `repos.yaml`, and pass it to
the `atlantis server` command via the `--repo-config` flag, ex. `--repo-config=path/to/repos.yaml`.
If you don't wish to write a config file to disk, you can use the
`--repo-config-json` flag or `ATLANTIS_REPO_CONFIG_JSON` environment variable
-to specify your config as JSON. See [--repo-config-json](server-configuration.html#repo-config-json)
+to specify your config as JSON. See [--repo-config-json](server-configuration.md#repo-config-json)
for an example.
-
+
## Example Server Side Repo
+
```yaml
# repos lists the config for specific repos.
repos:
@@ -54,9 +56,9 @@ repos:
# allowed_overrides specifies which keys can be overridden by this repo in
# its atlantis.yaml file.
- allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge, repo_locking, custom_policy_check]
+ allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge, repo_locking, repo_locks, custom_policy_check]
- # allowed_workflows specifies which workflows the repos that match
+ # allowed_workflows specifies which workflows the repos that match
# are allowed to select.
allowed_workflows: [custom]
@@ -71,18 +73,24 @@ repos:
# repo_locking defines whether lock repository when planning.
# If true (default), atlantis try to get a lock.
+ # deprecated: use repo_locks instead
repo_locking: true
+ # repo_locks defines whether the repository would be locked on apply instead of plan, or disabled
+ # Valid values are on_plan (default), on_apply or disabled.
+ repo_locks:
+ mode: on_plan
+
# custom_policy_check defines whether policy checking tools besides Conftest are enabled in checks
# If false (default), only Conftest JSON output is allowed
custom_policy_check: false
# pre_workflow_hooks defines arbitrary list of scripts to execute before workflow execution.
- pre_workflow_hooks:
+ pre_workflow_hooks:
- run: my-pre-workflow-hook-command arg1
-
+
# post_workflow_hooks defines arbitrary list of scripts to execute after workflow execution.
- post_workflow_hooks:
+ post_workflow_hooks:
- run: my-post-workflow-hook-command arg1
# policy_check defines if policy checking should be enable on this repository.
@@ -112,13 +120,16 @@ workflows:
```
## Use Cases
+
Here are some of the reasons you might want to use a repo config.
### Requiring PR Is Approved Before an applicable subcommand
+
If you want to require that all (or specific) repos must have pull requests
approved before Atlantis will allow running `apply` or `import`, use the `plan_requirements`, `apply_requirements` or `import_requirements` keys.
For all repos:
+
```yaml
# repos.yaml
repos:
@@ -129,6 +140,7 @@ repos:
```
For a specific repo:
+
```yaml
# repos.yaml
repos:
@@ -138,13 +150,15 @@ repos:
import_requirements: [approved]
```
-See [Command Requirements](command-requirements.html) for more details.
+See [Command Requirements](command-requirements.md) for more details.
### Requiring PR Is "Mergeable" Before Apply or Import
+
If you want to require that all (or specific) repos must have pull requests
in a mergeable state before Atlantis will allow running `apply` or `import`, use the `plan_requirements`, `apply_requirements` or `import_requirements` keys.
For all repos:
+
```yaml
# repos.yaml
repos:
@@ -155,6 +169,7 @@ repos:
```
For a specific repo:
+
```yaml
# repos.yaml
repos:
@@ -164,13 +179,15 @@ repos:
import_requirements: [mergeable]
```
-See [Command Requirements](command-requirements.html) for more details.
+See [Command Requirements](command-requirements.md) for more details.
### Repos Can Set Their Own Apply an applicable subcommand
+
If you want all (or specific) repos to be able to override the default apply requirements, use
the `allowed_overrides` key.
To allow all repos to override the default:
+
```yaml
# repos.yaml
repos:
@@ -183,7 +200,9 @@ repos:
# But all repos can set their own using atlantis.yaml
allowed_overrides: [plan_requirements, apply_requirements, import_requirements]
```
+
To allow only a specific repo to override the default:
+
```yaml
# repos.yaml
repos:
@@ -200,6 +219,7 @@ repos:
Then each allowed repo can have an `atlantis.yaml` file that
sets `plan_requirements`, `apply_requirements` or `import_requirements` to an empty array (disabling the requirement).
+
```yaml
# atlantis.yaml in the repo root or set repo_config_file in repos.yaml
version: 3
@@ -211,6 +231,7 @@ projects:
```
### Running Scripts Before Atlantis Workflows
+
If you want to run scripts that would execute before Atlantis can run default or
custom workflows, you can create a `pre-workflow-hooks`:
@@ -222,10 +243,12 @@ repos:
- run: |
my bash script inline
```
-See [Pre Workflow Hooks](pre-workflow-hooks.html) for more details on writing
+
+See [Pre Workflow Hooks](pre-workflow-hooks.md) for more details on writing
pre workflow hooks.
### Running Scripts After Atlantis Workflows
+
If you want to run scripts that would execute after Atlantis runs default or
custom workflows, you can create a `post-workflow-hooks`:
@@ -237,15 +260,18 @@ repos:
- run: |
my bash script inline
```
-See [Post Workflow Hooks](post-workflow-hooks.html) for more details on writing
+
+See [Post Workflow Hooks](post-workflow-hooks.md) for more details on writing
post workflow hooks.
### Change The Default Atlantis Workflow
+
If you want to change the default commands that Atlantis runs during `plan` and `apply`
phases, you can create a new `workflow`.
If you want to use that workflow by default for all repos, use the workflow
key `default`:
+
```yaml
# repos.yaml
# NOTE: the repos key is not required.
@@ -261,10 +287,11 @@ workflows:
- run: my custom apply command
```
-See [Custom Workflows](custom-workflows.html) for more details on writing
+See [Custom Workflows](custom-workflows.md) for more details on writing
custom workflows.
### Allow Repos To Choose A Server-Side Workflow
+
If you want repos to be able to choose their own workflows that are defined
in the server-side repo config, you need to create the workflows
server-side and then allow each repo to override the `workflow` key:
@@ -295,7 +322,8 @@ workflows:
steps:
- run: another custom command
```
-Or, if you want to restrict what workflows each repo has access to, use the `allowed_workflows`
+
+Or, if you want to restrict what workflows each repo has access to, use the `allowed_workflows`
key:
```yaml
@@ -345,13 +373,15 @@ There is always a workflow named `default` that corresponds to Atlantis' default
unless you've created your own server-side workflow with that key (overriding it).
:::
-See [Custom Workflows](custom-workflows.html) for more details on writing
+See [Custom Workflows](custom-workflows.md) for more details on writing
custom workflows.
### Allow Using Custom Policy Tools
+
Conftest is the standard policy check application integrated with Atlantis, but custom tools can still be run in custom workflows when the `custom_policy_check` option is set. See the [Custom Policy Checks page](custom-policy-checks.md) for detailed examples.
### Allow Repos To Define Their Own Workflows
+
If you want repos to be able to define their own workflows you need to
allow them to override the `workflow` key and set `allow_custom_workflows` to `true`.
@@ -375,6 +405,7 @@ repos:
```
Then each allowed repo can define and use a custom workflow in their `atlantis.yaml` files:
+
```yaml
# atlantis.yaml
version: 3
@@ -392,12 +423,13 @@ workflows:
- run: my custom apply command
```
-See [Custom Workflows](custom-workflows.html) for more details on writing
+See [Custom Workflows](custom-workflows.md) for more details on writing
custom workflows.
### Multiple Atlantis Servers Handle The Same Repository
+
Running multiple Atlantis servers to handle the same repository can be done to separate permissions for each Atlantis server.
-In this case, a different [atlantis.yaml](repo-level-atlantis-yaml.html) repository config file can be used by using different `repos.yaml` files.
+In this case, a different [atlantis.yaml](repo-level-atlantis-yaml.md) repository config file can be used by using different `repos.yaml` files.
For example, consider a situation where a separate `production-server` atlantis uses repo config `atlantis-production.yaml` and `staging-server` atlantis uses repo config `atlantis-staging.yaml`.
@@ -416,7 +448,7 @@ repos:
```
Then, create `atlantis-production.yaml` and `atlantis-staging.yaml` files in the repository.
-See the configuration examples in [atlantis.yaml](repo-level-atlantis-yaml.html).
+See the configuration examples in [atlantis.yaml](repo-level-atlantis-yaml.md).
```yaml
# atlantis-production.yaml
@@ -438,25 +470,29 @@ Now, 2 webhook URLs can be setup for the repository, which send events to `produ
Each servers handle different repository config files.
:::tip Notes
-* If `no projects` comments are annoying, set [--silence-no-projects](server-configuration.html#silence-no-projects).
-* The command trigger executable name can be reconfigured from `atlantis` to something else by setting [Executable Name](server-configuration.html#executable-name).
+
+* If `no projects` comments are annoying, set [--silence-no-projects](server-configuration.md#silence-no-projects).
+* The command trigger executable name can be reconfigured from `atlantis` to something else by setting [Executable Name](server-configuration.md#executable-name).
* When using different atlantis server vcs users such as `@atlantis-staging`, the comment `@atlantis-staging plan` can be used instead `atlantis plan` to call `staging-server` only.
:::
## Reference
### Top-Level Keys
-| Key | Type | Default | Required | Description |
-|-----------|---------------------------------------------------------|-----------|----------|---------------------------------------------------------------------------------------|
-| repos | array[[Repo](#repo)] | see below | no | List of repos to apply settings to. |
-| workflows | map[string: [Workflow](custom-workflows.html#workflow)] | see below | no | Map from workflow name to workflow. Workflows override the default Atlantis commands. |
-| policies | Policies. | none | no | List of policy sets to run and associated metadata |
-| metrics | Metrics. | none | no | Map of metric configuration |
+| Key | Type | Default | Required | Description |
+|-----------|-------------------------------------------------------|-----------|----------|---------------------------------------------------------------------------------------|
+| repos | array[[Repo](#repo)] | see below | no | List of repos to apply settings to. |
+| workflows | map[string: [Workflow](custom-workflows.md#workflow)] | see below | no | Map from workflow name to workflow. Workflows override the default Atlantis commands. |
+| policies | Policies. | none | no | List of policy sets to run and associated metadata |
+| metrics | Metrics. | none | no | Map of metric configuration |
::: tip A Note On Defaults
+
#### `repos`
+
`repos` always contains a first element with the Atlantis default config:
+
```yaml
repos:
- id: /.*/
@@ -470,7 +506,9 @@ repos:
```
#### `workflows`
+
`workflows` always contains the Atlantis default workflow under the key `default`:
+
```yaml
workflows:
default:
@@ -485,29 +523,33 @@ If you set a workflow with the key `default`, it will override this.
:::
### Repo
-| Key | Type | Default | Required | Description |
-|-------------------------------|----------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| id | string | none | yes | Value can be a regular expression when specified as /<regex>/ or an exact string match. Repo IDs are of the form `{vcs hostname}/{org}/{name}`, ex. `github.com/owner/repo`. Hostname is specified without scheme or port. For Bitbucket Server, {org} is the **name** of the project, not the key. |
-| branch | string | none | no | An regex matching pull requests by base branch (the branch the pull request is getting merged into). By default, all branches are matched |
-| repo_config_file | string | none | no | Repo config file path in this repo. By default, use `atlantis.yaml` which is located on repository root. When multiple atlantis servers work with the same repo, please set different file names. |
-| workflow | string | none | no | A custom workflow.
-| plan_requirements | []string | none | no | Requirements that must be satisfied before `atlantis plan` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.html) for more details. | |
-| apply_requirements | []string | none | no | Requirements that must be satisfied before `atlantis apply` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.html) for more details. |
-| import_requirements | []string | none | no | Requirements that must be satisfied before `atlantis import` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.html) for more details. |
-| allowed_overrides | []string | none | no | A list of restricted keys that `atlantis.yaml` files can override. The only supported keys are `apply_requirements`, `workflow`, `delete_source_branch_on_merge`,`repo_locking`, and `custom_policy_check` |
-| allowed_workflows | []string | none | no | A list of workflows that `atlantis.yaml` files can select from. |
-| allow_custom_workflows | bool | false | no | Whether or not to allow [Custom Workflows](custom-workflows.html). |
-| delete_source_branch_on_merge | bool | false | no | Whether or not to delete the source branch on merge. |
-| repo_locking | bool | false | no | Whether or not to get a lock. |
-| policy_check | bool | false | no | Whether or not to run policy checks on this repository. |
-| custom_policy_check | bool | false | no | Whether or not to enable custom policy check tools outside of Conftest on this repository. |
-| autodiscover | AutoDiscover | none | no | Auto discover settings for this repo
+| Key | Type | Default | Required | Description |
+|-------------------------------|-------------------------|-----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| id | string | none | yes | Value can be a regular expression when specified as /<regex>/ or an exact string match. Repo IDs are of the form `{vcs hostname}/{org}/{name}`, ex. `github.com/owner/repo`. Hostname is specified without scheme or port. For Bitbucket Server, {org} is the **name** of the project, not the key. |
+| branch | string | none | no | An regex matching pull requests by base branch (the branch the pull request is getting merged into). By default, all branches are matched |
+| repo_config_file | string | none | no | Repo config file path in this repo. By default, use `atlantis.yaml` which is located on repository root. When multiple atlantis servers work with the same repo, please set different file names. |
+| workflow | string | none | no | A custom workflow. |
+| plan_requirements | []string | none | no | Requirements that must be satisfied before `atlantis plan` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.md) for more details. |
+| apply_requirements | []string | none | no | Requirements that must be satisfied before `atlantis apply` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.md) for more details. |
+| import_requirements | []string | none | no | Requirements that must be satisfied before `atlantis import` can be run. Currently the only supported requirements are `approved`, `mergeable`, and `undiverged`. See [Command Requirements](command-requirements.md) for more details. |
+| allowed_overrides | []string | none | no | A list of restricted keys that `atlantis.yaml` files can override. The only supported keys are `apply_requirements`, `workflow`, `delete_source_branch_on_merge`,`repo_locking`, `repo_locks`, and `custom_policy_check` |
+| allowed_workflows | []string | none | no | A list of workflows that `atlantis.yaml` files can select from. |
+| allow_custom_workflows | bool | false | no | Whether or not to allow [Custom Workflows](custom-workflows.md). |
+| delete_source_branch_on_merge | bool | false | no | Whether or not to delete the source branch on merge. |
+| repo_locking | bool | false | no | (deprecated) Whether or not to get a lock. |
+| repo_locks | [RepoLocks](#repolocks) | `mode: on_plan` | no | Whether or not repository locks are enabled for this project on plan or apply. See [RepoLocks](#repolocks) for more details. |
+| policy_check | bool | false | no | Whether or not to run policy checks on this repository. |
+| custom_policy_check | bool | false | no | Whether or not to enable custom policy check tools outside of Conftest on this repository. |
+| autodiscover | AutoDiscover | none | no | Auto discover settings for this repo |
+| silence_pr_comments | []string | none | no | Silence PR comments from defined stages while preserving PR status checks. Useful in large environments with many Atlantis instances and/or projects, when the comments are too big and too many, therefore it is preferable to rely solely on PR status checks. Supported values are: `plan`, `apply`. |
:::tip Notes
+
* If multiple repos match, the last match will apply.
* If a key isn't defined, it won't override a key that matched from above.
For example, given a repo ID `github.com/owner/repo` and a config:
+
```yaml
repos:
- id: /.*/
@@ -518,12 +560,14 @@ If you set a workflow with the key `default`, it will override this.
```
The final config will look like:
+
```yaml
apply_requirements: []
workflow: default
allowed_overrides: []
allow_custom_workflows: true
```
+
Where
* `apply_requirements` is set from the `id: github.com/owner/repo` config because
it overrides the previous matching config from `id: /.*/`.
@@ -535,6 +579,16 @@ If you set a workflow with the key `default`, it will override this.
by the `id: github.com/owner/repo` config because it didn't define that key.
:::
+### RepoLocks
+
+```yaml
+mode: on_apply
+```
+
+| Key | Type | Default | Required | Description |
+|------|--------|-----------|----------|---------------------------------------------------------------------------------------------------------------------------------------|
+| mode | `Mode` | `on_plan` | no | Whether or not repository locks are enabled for this project on plan or apply. Valid values are `disabled`, `on_plan` and `on_apply`. |
+
### Policies
| Key | Type | Default | Required | Description |
@@ -545,6 +599,7 @@ If you set a workflow with the key `default`, it will override this.
| policy_sets | []PolicySet | none | yes | set of policies to run on a plan output |
### Owners
+
| Key | Type | Default | Required | Description |
|-------------|-------------------|---------|------------|---------------------------------------------------------|
| users | []string | none | no | list of github users that can approve failing policies |
@@ -558,7 +613,6 @@ If you set a workflow with the key `default`, it will override this.
| path | string | none | yes | path to the rego policies directory |
| source | string | none | yes | only `local` is supported at this time |
-
### Metrics
| Key | Type | Default | Required | Description |
diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md
index a2980c5634..9c6073ab64 100644
--- a/runatlantis.io/docs/stats.md
+++ b/runatlantis.io/docs/stats.md
@@ -8,12 +8,11 @@ Currently Statsd and Prometheus is supported. See configuration below for detail
## Configuration
-Metrics are configured through the [Server Side Config](server-side-repo-config.html#metrics).
+Metrics are configured through the [Server Side Config](server-side-repo-config.md#metrics).
## Available Metrics
-Assuming metrics are exposed from the endpoint `/metrics` from the [metrics](server-side-repo-config.html#metrics) server side config e.g.
-
+Assuming metrics are exposed from the endpoint `/metrics` from the [metrics](server-side-repo-config.md#metrics) server side config e.g.
```yaml
metrics:
@@ -21,10 +20,8 @@ metrics:
endpoint: "/metrics"
```
-
To see all the metrics exposed from atlantis service, make a GET request to the `/metrics` endpoint.
-
```bash
curl localhost:4141/metrics
# HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter
@@ -47,20 +44,19 @@ atlantis_cmd_autoplan_builder_execution_time_count 10
.....
```
-
::: tip NOTE
The output shown above is trimmed, since with every new version release this metric set will need to be updated accordingly as there may be a case if some metrics are added/modified/deprecated, so the output shown above just gives a brief idea of how these metrics look like and rest can be explored.
:::
Important metrics to monitor are
-| Metric Name | Metric Type | Purpose |
-|------------------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
-| `atlantis_cmd_autoplan_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when [autoplan](autoplanning.html#autoplanning) has thrown error. |
-| `atlantis_cmd_comment_plan_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis plan` has thrown error. |
-| `atlantis_cmd_autoplan_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when [autoplan](autoplanning.html#autoplanning) has run successfully. |
-| `atlantis_cmd_comment_apply_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has thrown error. |
-| `atlantis_cmd_comment_apply_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has run successfully. |
+| Metric Name | Metric Type | Purpose |
+|------------------------------------------------|----------------------------------------------------------------------|-------------------------------------------------------------------------------------|
+| `atlantis_cmd_autoplan_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when [autoplan](autoplanning.md#autoplanning) has thrown error. |
+| `atlantis_cmd_comment_plan_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis plan` has thrown error. |
+| `atlantis_cmd_autoplan_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when [autoplan](autoplanning.md#autoplanning) has run successfully. |
+| `atlantis_cmd_comment_apply_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has thrown error. |
+| `atlantis_cmd_comment_apply_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has run successfully. |
::: tip NOTE
There are plenty of additional metrics exposed by atlantis that are not described above.
diff --git a/runatlantis.io/docs/streaming-logs.md b/runatlantis.io/docs/streaming-logs.md
index c066d47d47..df936c52f9 100644
--- a/runatlantis.io/docs/streaming-logs.md
+++ b/runatlantis.io/docs/streaming-logs.md
@@ -20,4 +20,3 @@ This will link to the atlantis UI which provides real-time logging in addition t
::: warning
As of now the logs are currently stored in memory and cleared when a given pull request is closed, so this link shouldn't be persisted anywhere.
:::
-
diff --git a/runatlantis.io/docs/terraform-cloud.md b/runatlantis.io/docs/terraform-cloud.md
index bab22a5db0..2e3393d7dd 100644
--- a/runatlantis.io/docs/terraform-cloud.md
+++ b/runatlantis.io/docs/terraform-cloud.md
@@ -6,15 +6,17 @@ and Private Terraform Enterprise was renamed Terraform Enterprise.
:::
Atlantis integrates seamlessly with Terraform Cloud and Terraform Enterprise, whether you're using:
+
* [Free Remote State Management](https://app.terraform.io)
* Terraform Cloud Paid Tiers
* A Private Installation of Terraform Enterprise
Read the docs below :point_down: depending on your use-case.
-[[toc]]
## Using Atlantis With Free Remote State Storage
+
To use Atlantis with Free Remote State Storage, you need to:
+
1. Migrate your state to Terraform Cloud. See [Migrating State from Local Terraform](https://developer.hashicorp.com/terraform/cloud-docs/migrate)
1. Update any projects that are referencing the state you migrated to use the new location
1. [Generate a Terraform Cloud/Enterprise Token](#generating-a-terraform-cloud-enterprise-token)
@@ -24,6 +26,7 @@ That's it! Atlantis will run as normal and your state will be stored in Terrafor
Cloud.
## Using Atlantis With Terraform Cloud Remote Operations or Terraform Enterprise
+
Atlantis integrates with the full version of Terraform Cloud and Terraform Enterprise
via the [remote backend](https://developer.hashicorp.com/terraform/language/settings/backends/remote).
@@ -31,7 +34,9 @@ Atlantis will run `terraform` commands as usual, however those commands will
actually be executed *remotely* in Terraform Cloud or Terraform Enterprise.
### Why?
+
Using Atlantis with Terraform Cloud or Terraform Enterprise gives you access to features like:
+
* Real-time streaming output
* Ability to cancel in-progress commands
* Secret variables
@@ -40,28 +45,34 @@ Using Atlantis with Terraform Cloud or Terraform Enterprise gives you access to
**Without** having to change your pull request workflow.
### Getting Started
+
To use Atlantis with Terraform Cloud Remote Operations or Terraform Enterprise, you need to:
+
1. Migrate your state to Terraform Cloud/Enterprise. See [Migrating State from Local Terraform](https://developer.hashicorp.com/terraform/cloud-docs/migrate)
1. Update any projects that are referencing the state you migrated to use the new location
1. [Generate a Terraform Cloud/Enterprise Token](#generating-a-terraform-cloud-enterprise-token)
1. [Pass the token to Atlantis](#passing-the-token-to-atlantis)
## Generating a Terraform Cloud/Enterprise Token
+
Atlantis needs a Terraform Cloud/Enterprise Token that it will use to access the API.
Using a **Team Token is recommended**, however you can also use a User Token.
### Team Token
+
To generate a team token, click on **Settings** in the top bar, then **Teams** in
the sidebar.
Choose an existing team or create a new one.
Enable the **Manage Workspaces** permission, then scroll down to **Team API Token**.
### User Token
+
To generate a user token, click on your avatar, then **User Settings**, then
**Tokens** in the sidebar.
Ensure the **Manage Workspaces** permission is enabled for this user's team.
## Passing The Token To Atlantis
+
The token can be passed to Atlantis via the `ATLANTIS_TFE_TOKEN` environment variable.
You can also use the `--tfe-token` flag, however your token would then be easily
@@ -88,12 +99,14 @@ Under the hood, Atlantis is generating a `~/.terraformrc` file.
If you already had a `~/.terraformrc` file where Atlantis is running,
then you'll need to manually
add the credentials block to that file:
-```
+
+```hcl
...
credentials "app.terraform.io" {
token = "xxxx"
}
```
+
instead of using the `ATLANTIS_TFE_TOKEN` environment variable, since Atlantis
won't overwrite your `.terraformrc` file.
:::
diff --git a/runatlantis.io/docs/terraform-versions.md b/runatlantis.io/docs/terraform-versions.md
index 79fdee0db3..321278d505 100644
--- a/runatlantis.io/docs/terraform-versions.md
+++ b/runatlantis.io/docs/terraform-versions.md
@@ -4,47 +4,60 @@ You can customize which version of Terraform Atlantis defaults to by setting
the `--default-tf-version` flag (ex. `--default-tf-version=v1.3.7`).
## Via `atlantis.yaml`
+
If you wish to use a different version than the default for a specific repo or project, you need
to create an `atlantis.yaml` file and set the `terraform_version` key:
+
```yaml
version: 3
projects:
- dir: .
terraform_version: v1.1.5
```
-See [atlantis.yaml Use Cases](repo-level-atlantis-yaml.html#terraform-versions) for more details.
+
+See [atlantis.yaml Use Cases](repo-level-atlantis-yaml.md#terraform-versions) for more details.
## Via terraform config
+
Alternatively, one can use the terraform configuration block's `required_version` key to specify an exact version (`x.y.z` or `= x.y.z`), or as of [atlantis v0.21.0](https://github.com/runatlantis/atlantis/releases/tag/v0.21.0), a comparison or pessimistic [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints#version-constraint-syntax):
-#### Exactly version 1.2.9
+
+### Exactly version 1.2.9
+
```tf
terraform {
required_version = "= 1.2.9"
}
```
-#### Any patch/tiny version of minor version 1.2 (1.2.z)
+
+### Any patch/tiny version of minor version 1.2 (1.2.z)
+
```tf
terraform {
required_version = "~> 1.2.0"
}
```
-#### Any minor version of major version 1 (1.y.z)
+
+### Any minor version of major version 1 (1.y.z)
+
```tf
terraform {
required_version = "~> 1.2"
}
```
-#### Any version that is at least 1.2.0
+
+### Any version that is at least 1.2.0
+
```tf
terraform {
required_version = ">= 1.2.0"
}
```
+
See [Terraform `required_version`](https://developer.hashicorp.com/terraform/language/settings#specifying-a-required-terraform-version) for reference.
::: tip NOTE
Atlantis will automatically download the latest version that fulfills the constraint specified.
-A `terraform_version` specified in the `atlantis.yaml` file takes precedence over both the [`--default-tf-version`](server-configuration.html#default-tf-version) flag and the `required_version` in the terraform hcl.
+A `terraform_version` specified in the `atlantis.yaml` file takes precedence over both the [`--default-tf-version`](server-configuration.md#default-tf-version) flag and the `required_version` in the terraform hcl.
:::
::: tip NOTE
diff --git a/runatlantis.io/docs/troubleshooting-https.md b/runatlantis.io/docs/troubleshooting-https.md
index 191a4b1242..f59058da1c 100644
--- a/runatlantis.io/docs/troubleshooting-https.md
+++ b/runatlantis.io/docs/troubleshooting-https.md
@@ -3,25 +3,24 @@
When using a self-signed certificate for Atlantis (with flags `--ssl-cert-file` and `--ssl-key-file`),
there are a few considerations.
-Atlantis uses the web server from the standard Go library,
+Atlantis uses the web server from the standard Go library,
the method name is [ListenAndServeTLS](https://pkg.go.dev/net/http#ListenAndServeTLS).
`ListenAndServeTLS` acts identically to [ListenAndServe](https://pkg.go.dev/net/http#ListenAndServe),
-except that it expects HTTPS connections.
-Additionally, files containing a certificate and matching private key for the server must be provided.
-If the certificate is signed by a certificate authority,
-the file passed to `--ssl-cert-file` should be the concatenation of the server's certificate, any intermediates, and the CA's certificate.
+except that it expects HTTPS connections.
+Additionally, files containing a certificate and matching private key for the server must be provided.
+If the certificate is signed by a certificate authority,
+the file passed to `--ssl-cert-file` should be the concatenation of the server's certificate, any intermediates, and the CA's certificate.
-If you have this error when specifying a TLS cert with a key:
-```
+If you have this error when specifying a TLS cert with a key:
+
+```plain
[ERROR] server.go:413 server: Tls: private key does not match public key
```
Check that the locally signed certificate authority is prepended to the self signed certificate.
-A good example is shown at [Seth Vargo terraform implementation of atlantis-on-gke](https://github.com/sethvargo/atlantis-on-gke/blob/master/terraform/tls.tf#L64)
+A good example is shown at [Seth Vargo terraform implementation of atlantis-on-gke](https://github.com/sethvargo/atlantis-on-gke/blob/master/terraform/tls.tf#L64-L84)
For Go specific TLS resources have a look at the repository by [denji called golang-tls](https://github.com/denji/golang-tls).
For a complete explanation on PKI, read this [article](https://smallstep.com/blog/everything-pki.html).
-
-
diff --git a/runatlantis.io/docs/upgrading-atlantis-yaml.md b/runatlantis.io/docs/upgrading-atlantis-yaml.md
index 1b8fe7aaa0..37e20900e8 100644
--- a/runatlantis.io/docs/upgrading-atlantis-yaml.md
+++ b/runatlantis.io/docs/upgrading-atlantis-yaml.md
@@ -1,15 +1,17 @@
# Upgrading atlantis.yaml
## Upgrading From v2 To v3
+
Atlantis version `v0.7.0` introduced a new version 3 of `atlantis.yaml`.
-**If you're not using [custom `run` steps](custom-workflows.html#custom-run-command),
+**If you're not using [custom `run` steps](custom-workflows.md#custom-run-command),
then you can upgrade from `version: 2` to `version: 3` without any changes.**
**NOTE:** Version 2 **is not being deprecated** and there is no need to upgrade your version
if you don't wish to do so.
The only change from v2 to v3 is that we're parsing custom `run` steps differently.
+
```yaml
# atlantis.yaml
workflows:
@@ -18,33 +20,38 @@ workflows:
steps:
- run: my custom command
```
+
An example workflow using a custom run step
Previously, we used a library that would parse the custom step prior to running
it. Now, we just run the step directly. This will only affect your steps if they were using shell escaping of some sort.
For example, if your step was previously:
+
```yaml
# version: 2
- run: "printf \'print me\'"
```
You can now write this in version 3 as:
+
```yaml
# version: 3
- run: "printf 'print me'"
```
-
## Upgrading From V1 To V3
+
If you are upgrading from an **old** Atlantis version `<=v0.3.10` (from before July 4, 2018)
you'll need to follow the following steps.
### Single atlantis.yaml
+
If you had multiple `atlantis.yaml` files per directory then you'll need to
consolidate them into a single `atlantis.yaml` file at the root of the repo.
For example, if you had a directory structure:
-```
+
+```plain
.
âââ project1
â âââ atlantis.yaml
@@ -53,7 +60,8 @@ For example, if you had a directory structure:
```
Then your new structure would look like:
-```
+
+```plain
.
âââ atlantis.yaml
âââ project1
@@ -61,6 +69,7 @@ Then your new structure would look like:
```
And your `atlantis.yaml` would look something like:
+
```yaml
version: 2
projects:
@@ -80,13 +89,16 @@ workflows:
We will talk more about `workflows` below.
### Terraform Version
+
The `terraform_version` key moved from being a top-level key to being per `project`
so if before your `atlantis.yaml` was in directory `mydir` and looked like:
+
```yaml
terraform_version: 0.11.0
```
Then your new config would be:
+
```yaml
version: 2
projects:
@@ -95,9 +107,11 @@ projects:
```
### Workflows
+
Workflows are the new way to set all `pre_*`, `post_*` and `extra_arguments`.
Each `project` can have a custom workflow via the `workflow` key.
+
```yaml
version: 2
projects:
@@ -106,6 +120,7 @@ projects:
```
Workflows are defined as a top-level key:
+
```yaml
version: 2
projects:
@@ -118,6 +133,7 @@ workflows:
To start with, determine whether you're customizing commands that happen during
`plan` or `apply`. You then set that key under the workflow's name:
+
```yaml
...
workflows:
@@ -133,6 +149,7 @@ workflows:
If you're not customizing a specific stage then you can omit that key. For example
if you're only customizing the commands that happen during `plan` then your config
will look like:
+
```yaml
...
workflows:
@@ -143,7 +160,9 @@ workflows:
```
#### Extra Arguments
+
`extra_arguments` is now specified as follows. Given a previous config:
+
```yaml
extra_arguments:
- command_name: init
@@ -158,6 +177,7 @@ extra_arguments:
```
Your config would now look like:
+
```yaml
...
workflows:
@@ -174,8 +194,8 @@ workflows:
extra_args: ["-lock=false"]
```
-
#### Pre/Post Commands
+
Instead of using `pre_*` or `post_*`, you now can insert your custom commands
before/after the built-in commands. Given a previous config:
@@ -202,6 +222,7 @@ post_apply:
```
Your config would now look like:
+
```yaml
...
workflows:
diff --git a/runatlantis.io/docs/using-atlantis.md b/runatlantis.io/docs/using-atlantis.md
index 15a0b5a681..61c06e1a21 100644
--- a/runatlantis.io/docs/using-atlantis.md
+++ b/runatlantis.io/docs/using-atlantis.md
@@ -5,8 +5,9 @@ Atlantis triggers commands via pull request comments.
::: tip
You can use following executable names.
+
* `atlantis help`
- * `atlantis` is executable name. You can configure by [Executable Name](/docs/server-configuration.html#executable-name).
+ * `atlantis` is executable name. You can configure by [Executable Name](server-configuration.md#executable-name).
* `run help`
* `run` is a global executable name.
* `@GithubUser help`
@@ -14,35 +15,46 @@ You can use following executable names.
:::
Currently, Atlantis supports the following commands.
-[[toc]]
---
+
## atlantis help
+
```bash
atlantis help
```
+
### Explanation
+
View help
---
+
## atlantis version
+
```bash
atlantis version
```
### Explanation
+
Print the output of 'terraform version'.
---
+
## atlantis plan
+
```bash
atlantis plan [options] -- [terraform plan flags]
```
+
### Explanation
+
Runs `terraform plan` on the pull request's branch. You may wish to re-run plan after Atlantis has already done
so if you've changed some resources manually.
### Examples
+
```bash
# Runs plan for any projects that Atlantis thinks were modified.
# If an `atlantis.yaml` file is specified, runs plan on the projects that
@@ -60,9 +72,10 @@ atlantis plan -w staging
```
### Options
+
* `-d directory` Which directory to run plan in relative to root of repo. Use `.` for root.
- * Ex. `atlantis plan -d child/dir`
-* `-p project` Which project to run plan for. Refers to the name of the project configured in the repo's [`atlantis.yaml` file](repo-level-atlantis-yaml.html). Cannot be used at same time as `-d` or `-w` because the project defines this already.
+ * Ex. `atlantis plan -d child/dir`
+* `-p project` Which project to run plan for. Refers to the name of the project configured in the repo's [`atlantis.yaml` file](repo-level-atlantis-yaml.md). Cannot be used at same time as `-d` or `-w` because the project defines this already.
* `-w workspace` Switch to this [Terraform workspace](https://developer.hashicorp.com/terraform/language/state/workspaces) before planning. Defaults to `default`. Ignore this if Terraform workspaces are unused.
* `--verbose` Append Atlantis log to comment.
@@ -74,30 +87,38 @@ A `atlantis plan` (without flags), like autoplans, discards all plans previously
If `terraform plan` requires additional arguments, like `-target=resource` or `-var 'foo=bar'` or `-var-file myfile.tfvars`
you can append them to the end of the comment after `--`, ex.
-```
+
+```shell
atlantis plan -d dir -- -var foo='bar'
```
-If you always need to append a certain flag, see [Custom Workflow Use Cases](custom-workflows.html#adding-extra-arguments-to-terraform-commands).
+
+If you always need to append a certain flag, see [Custom Workflow Use Cases](custom-workflows.md#adding-extra-arguments-to-terraform-commands).
### Using the -destroy Flag
#### Example
+
To perform a destructive plan that will destroy resources you can use the `-destroy` flag like this:
```bash
atlantis plan -- -destroy
atlantis plan -d dir -- -destroy
```
-::: warning NOTE
+
+::: warning NOTE
The `-destroy` flag generates a destroy plan, If this plan is applied it can result in data loss or service disruptions. Ensure that you have thoroughly reviewed your Terraform configuration and intend to remove the specified resources before using this flag.
:::
---
+
## atlantis apply
+
```bash
atlantis apply [options] -- [terraform apply flags]
```
+
### Explanation
+
Runs `terraform apply` for the plan that matches the directory/project/workspace.
::: tip
@@ -106,8 +127,8 @@ This includes all projects that have been planned manually with `atlantis plan`
For Atlantis commands to work, Atlantis needs to know the location where the plan file is. For that, you can use $PLANFILE which will contain the path of the plan file to be used in your custom steps. i.e `terraform plan -out $PLANFILE`
:::
-
### Examples
+
```bash
# Runs apply for all unapplied plans from this pull request.
atlantis apply
@@ -123,15 +144,17 @@ atlantis apply -w staging
```
### Options
+
* `-d directory` Apply the plan for this directory, relative to root of repo. Use `.` for root.
-* `-p project` Apply the plan for this project. Refers to the name of the project configured in the repo's [`atlantis.yaml` file](repo-level-atlantis-yaml.html). Cannot be used at same time as `-d` or `-w`.
+* `-p project` Apply the plan for this project. Refers to the name of the project configured in the repo's [`atlantis.yaml` file](repo-level-atlantis-yaml.md). Cannot be used at same time as `-d` or `-w`.
* `-w workspace` Apply the plan for this [Terraform workspace](https://developer.hashicorp.com/terraform/language/state/workspaces). Ignore this if Terraform workspaces are unused.
-* `--auto-merge-disabled` Disable [automerge](automerging.html) for this apply command.
+* `--auto-merge-disabled` Disable [automerge](automerging.md) for this apply command.
* `--verbose` Append Atlantis log to comment.
### Additional Terraform flags
Because Atlantis under the hood is running `terraform apply plan.tfplan`, any Terraform options that would change the `plan` are ignored, ex:
+
* `-target=resource`
* `-var 'foo=bar'`
* `-var-file=myfile.tfvars`
@@ -140,17 +163,22 @@ They're ignored because they can't be specified for an already generated planfil
If you would like to specify these flags, do it while running `atlantis plan`.
---
+
## atlantis import
+
```bash
atlantis import [options] ADDRESS ID -- [terraform import flags]
```
+
### Explanation
+
Runs `terraform import` that matches the directory/project/workspace.
This command discards the terraform plan result. After an import and before an apply, another `atlantis plan` must be run again.
-To allow the `import` command requires [--allow-commands](/docs/server-configuration.html#allow-commands) configuration.
+To allow the `import` command requires [--allow-commands](server-configuration.md#allow-commands) configuration.
### Examples
+
```bash
# Runs import
atlantis import ADDRESS ID
@@ -166,36 +194,45 @@ atlantis import -w staging ADDRESS ID
```
::: tip
+
* If import for_each resources, it requires a single quoted address.
* ex. `atlantis import 'aws_instance.example["foo"]' i-1234567890abcdef0`
:::
### Options
+
* `-d directory` Import a resource for this directory, relative to root of repo. Use `.` for root.
-* `-p project` Import a resource for this project. Refers to the name of the project configured in the repo's [`atlantis.yaml`](repo-level-atlantis-yaml.html) repo configuration file. This cannot be used at the same time as `-d` or `-w`.
+* `-p project` Import a resource for this project. Refers to the name of the project configured in the repo's [`atlantis.yaml`](repo-level-atlantis-yaml.md) repo configuration file. This cannot be used at the same time as `-d` or `-w`.
* `-w workspace` Import a resource for a specific [Terraform workspace](https://developer.hashicorp.com/terraform/language/state/workspaces). Ignore this if Terraform workspaces are unused.
### Additional Terraform flags
If `terraform import` requires additional arguments, like `-var 'foo=bar'` or `-var-file myfile.tfvars`
append them to the end of the comment after `--`, e.g.
-```
+
+```shell
atlantis import -d dir 'aws_instance.example["foo"]' i-1234567890abcdef0 -- -var foo='bar'
```
-If a flag is needed to be always appended, see [Custom Workflow Use Cases](custom-workflows.html#adding-extra-arguments-to-terraform-commands).
+
+If a flag is needed to be always appended, see [Custom Workflow Use Cases](custom-workflows.md#adding-extra-arguments-to-terraform-commands).
---
+
## atlantis state rm
+
```bash
atlantis state [options] rm ADDRESS... -- [terraform state rm flags]
```
+
### Explanation
+
Runs `terraform state rm` that matches the directory/project/workspace.
This command discards the terraform plan result. After run state rm and before an apply, another `atlantis plan` must be run again.
-To allow the `state` command requires [--allow-commands](/docs/server-configuration.html#allow-commands) configuration.
+To allow the `state` command requires [--allow-commands](server-configuration.md#allow-commands) configuration.
### Examples
+
```bash
# Runs state rm
atlantis state rm ADDRESS1 ADDRESS2
@@ -211,44 +248,55 @@ atlantis state -w staging rm ADDRESS
```
::: tip
+
* If run state rm to for_each resources, it requires a single quoted address.
* ex. `atlantis state rm 'aws_instance.example["foo"]'`
:::
### Options
+
* `-d directory` Run state rm a resource for this directory, relative to root of repo. Use `.` for root.
-* `-p project` Run state rm a resource for this project. Refers to the name of the project configured in the repo's [`atlantis.yaml`](repo-level-atlantis-yaml.html) repo configuration file. This cannot be used at the same time as `-d` or `-w`.
+* `-p project` Run state rm a resource for this project. Refers to the name of the project configured in the repo's [`atlantis.yaml`](repo-level-atlantis-yaml.md) repo configuration file. This cannot be used at the same time as `-d` or `-w`.
* `-w workspace` Run state rm a resource for a specific [Terraform workspace](https://developer.hashicorp.com/terraform/language/state/workspaces). Ignore this if Terraform workspaces are unused.
### Additional Terraform flags
If `terraform state rm` requires additional arguments, like `-lock=false'`
append them to the end of the comment after `--`, e.g.
-```
+
+```shell
atlantis state -d dir rm 'aws_instance.example["foo"]' -- -lock=false
```
-If a flag is needed to be always appended, see [Custom Workflow Use Cases](custom-workflows.html#adding-extra-arguments-to-terraform-commands).
+
+If a flag is needed to be always appended, see [Custom Workflow Use Cases](custom-workflows.md#adding-extra-arguments-to-terraform-commands).
---
+
## atlantis unlock
+
```bash
atlantis unlock
```
### Explanation
+
Removes all atlantis locks and discards all plans for this PR.
To unlock a specific plan you can use the Atlantis UI.
---
+
## atlantis approve_policies
+
```bash
atlantis approve_policies
```
### Explanation
+
Approves all current policy checking failures for the PR.
-See also [policy checking](/docs/policy-checking.html).
+See also [policy checking](policy-checking.md).
### Options
+
* `--verbose` Append Atlantis log to comment.
diff --git a/runatlantis.io/docs/using-slack-hooks.md b/runatlantis.io/docs/using-slack-hooks.md
index c75c243fca..572b0857f8 100644
--- a/runatlantis.io/docs/using-slack-hooks.md
+++ b/runatlantis.io/docs/using-slack-hooks.md
@@ -13,7 +13,7 @@ For this you'll need to:
## Configuring Slack for Atlantis
-* Go to [https://api.slack.com/apps](https://api.slack.com/apps)
+* Go to [Slack: Apps](https://api.slack.com/apps)
* Click the `Create New App` button
* Select `From scratch` in the dialog that opens
* Give it a name, e.g. `atlantis-bot`.
@@ -43,13 +43,12 @@ webhooks:
workspace-regex: .*
branch-regex: .*
kind: slack
- channel: my-channel
+ channel: my-channel-id
```
If you are deploying Atlantis as a Helm chart, this can be implemented via the `config` parameter available for [chart customizations](https://github.com/runatlantis/helm-charts#customization):
-```
-
+```yaml
## Use Server Side Config,
## ref: https://www.runatlantis.io/docs/server-configuration.html
config: |
@@ -59,9 +58,7 @@ config: |
workspace-regex: .*
branch-regex: .*
kind: slack
- channel: my-channel
+ channel: my-channel-id
```
-
-
-The `apply` event information will be sent to the `my-channel` Slack channel.
+The `apply` event information will be sent to the `my-channel-id` Slack channel.
diff --git a/runatlantis.io/docs/webhook-secrets.md b/runatlantis.io/docs/webhook-secrets.md
index 8b66ee8276..4e2ab1a059 100644
--- a/runatlantis.io/docs/webhook-secrets.md
+++ b/runatlantis.io/docs/webhook-secrets.md
@@ -17,27 +17,30 @@ Azure DevOps uses Basic authentication for webhooks rather than webhook secrets.
:::
::: tip NOTE
-An app-wide token is generated during [GitHub App setup](access-credentials.html#github-app). You can recover it by navigating to the [GitHub app settings page](https://github.com/settings/apps) and selecting "Edit" next to your Atlantis app's name. Token appears after clicking "Edit" under the Webhook header.
+An app-wide token is generated during [GitHub App setup](access-credentials.md#github-app). You can recover it by navigating to the [GitHub app settings page](https://github.com/settings/apps) and selecting "Edit" next to your Atlantis app's name. Token appears after clicking "Edit" under the Webhook header.
:::
::: warning
Bitbucket.org **does not** support webhook secrets.
-To mitigate, use repo allowlists and IP allowlists. See [Security](security.html#bitbucket-cloud-bitbucket-org) for more information.
+To mitigate, use repo allowlists and IP allowlists. See [Security](security.md#bitbucket-cloud-bitbucket-org) for more information.
:::
## Generating A Webhook Secret
+
You can use any random string generator to create your Webhook secret. It should be > 24 characters.
For example:
+
* Generate via Ruby with `ruby -rsecurerandom -e 'puts SecureRandom.hex(32)'`
-* Generate online with [https://www.browserling.com/tools/random-string](https://www.browserling.com/tools/random-string)
+* Generate online with [browserling: Generate Random Strings and Numbers](https://www.browserling.com/tools/random-string)
::: tip NOTE
You must use **the same** webhook secret for each repo.
:::
## Next Steps
+
* Record your secret
-* You'll be using it later to [configure your webhooks](configuring-webhooks.html), however if you're
-following the [Installation Guide](installation-guide.html) then your next step is to
-[Deploy Atlantis](deployment.html)
+* You'll be using it later to [configure your webhooks](configuring-webhooks.md), however if you're
+following the [Installation Guide](installation-guide.md) then your next step is to
+[Deploy Atlantis](deployment.md)
diff --git a/runatlantis.io/e2e/site-check.spec.js b/runatlantis.io/e2e/site-check.spec.js
new file mode 100644
index 0000000000..2fbf3b5a3a
--- /dev/null
+++ b/runatlantis.io/e2e/site-check.spec.js
@@ -0,0 +1,12 @@
+import { test } from '@playwright/test';
+
+test('page should load without errors', async ({ page }) => {
+ // Listen for any errors that occur within the page
+ page.on('pageerror', error => {
+ console.error('Page error:', error.message);
+ throw new Error(`Page error: ${error.message}`);
+ });
+
+ // Navigate to the URL
+ await page.goto('http://localhost:8080/');
+});
diff --git a/runatlantis.io/guide/README.md b/runatlantis.io/guide.md
similarity index 80%
rename from runatlantis.io/guide/README.md
rename to runatlantis.io/guide.md
index 15472518b8..9d71a3acf1 100644
--- a/runatlantis.io/guide/README.md
+++ b/runatlantis.io/guide.md
@@ -1,15 +1,17 @@
# Introduction
## Getting Started
-* If you'd like to just test out running Atlantis on an **example repo** check out the [Test Drive](test-drive.html).
-* If you'd like to test out running Atlantis on **your repos** then read [Testing Locally](testing-locally.html).
-* If you're ready to properly install Atlantis on real infrastructure then head over to the [Installation Guide](/docs/installation-guide.html).
+
+* If you'd like to just test out running Atlantis on an **example repo** check out the [Test Drive](./guide/test-drive.md).
+* If you'd like to test out running Atlantis on **your repos** then read [Testing Locally](./guide/testing-locally.md).
+* If you're ready to properly install Atlantis on real infrastructure then head over to the [Installation Guide](./docs/installation-guide.md).
::: tip Looking for the full docs?
-Go here: [www.runatlantis.io/docs](/docs/)
+Go here: [www.runatlantis.io/docs](./docs.md)
:::
## Overview â What Is Atlantis?
+
Atlantis is an application for automating Terraform via pull requests. It is deployed
as a standalone application into your infrastructure. No third-party has access to
your credentials.
@@ -21,14 +23,18 @@ When you want to apply, comment `atlantis apply` on the pull request and Atlanti
will run `terraform apply` and comment back with the output.
## Watch
+
Check out the video below to see it in action:
-[![Atlantis Walkthrough](./images/atlantis-walkthrough-icon.png)](https://www.youtube.com/watch?v=TmIPWda0IKg)
+[![Atlantis Walkthrough](./guide/images/atlantis-walkthrough-icon.png)](https://www.youtube.com/watch?v=TmIPWda0IKg)
## Why would you run Atlantis?
+
### Increased visibility
+
When everyone is executing Terraform on their own computers, it's hard to know the
current state of your infrastructure:
+
* Is what's in `main` branch deployed?
* Did someone forget to create a pull request for that latest change?
* What was the output from that last `terraform apply`?
@@ -37,6 +43,7 @@ With Atlantis, everything is visible on the pull request. You can view the histo
of everything that was done to your infrastructure.
### Enable collaboration with everyone
+
You probably don't want to distribute Terraform credentials to everyone in your
engineering organization, but now anyone can open up a Terraform pull request.
@@ -44,10 +51,12 @@ You can require approval before the pull request is applied so nothing happens
accidentally.
### Review Terraform pull requests better
+
You can't fully review a Terraform change without seeing the output of `terraform plan`.
Now that output is added to the pull request automatically.
### Standardize your workflows
+
Atlantis locks a directory/workspace until the pull request is merged or the lock
is manually deleted. This ensures that changes are applied in the order expected.
@@ -55,6 +64,7 @@ The exact commands that Atlantis runs are configurable. You can run custom scrip
to construct your ideal workflow.
## Next Steps
-* If you'd like to just test out running Atlantis on an **example repo** check out the [Test Drive](test-drive.html).
-* If you'd like to test out running Atlantis on **your repos** then read [Testing Locally](testing-locally.html).
-* If you're ready to properly install Atlantis on real infrastructure then head over to the [Installation Guide](/docs/installation-guide.html).
+
+* If you'd like to just test out running Atlantis on an **example repo** check out the [Test Drive](./guide/test-drive.md).
+* If you'd like to test out running Atlantis on **your repos** then read [Testing Locally](./guide/testing-locally.md).
+* If you're ready to properly install Atlantis on real infrastructure then head over to the [Installation Guide](./docs/installation-guide.md).
diff --git a/runatlantis.io/guide/test-drive.md b/runatlantis.io/guide/test-drive.md
index 22e8c77f21..8510f0a0e2 100644
--- a/runatlantis.io/guide/test-drive.md
+++ b/runatlantis.io/guide/test-drive.md
@@ -1,18 +1,22 @@
# Test Drive
-To test drive Atlantis on an example repo, download the latest release:
-[https://github.com/runatlantis/atlantis/releases](https://github.com/runatlantis/atlantis/releases)
+
+To test drive Atlantis on an example repo, download the latest release from
+[GitHub](https://github.com/runatlantis/atlantis/releases)
Once you've extracted the archive, run:
+
```bash
./atlantis testdrive
```
This mode sets up Atlantis on a test repo so you can try it out. It will
+
- Fork an example Terraform project into your GitHub account
- Install Terraform (if not already in your PATH)
- Install [ngrok](https://ngrok.com/) so we can expose Atlantis to GitHub
- Start Atlantis so you can execute commands on the pull request
## Next Steps
-* If you're ready to test out running Atlantis on **your repos** then read [Testing Locally](testing-locally.html).
-* If you're ready to properly install Atlantis on real infrastructure then head over to the [Installation Guide](/docs/installation-guide.html).
+
+- If you're ready to test out running Atlantis on **your repos** then read [Testing Locally](testing-locally.md).
+- If you're ready to properly install Atlantis on real infrastructure then head over to the [Installation Guide](../docs/installation-guide.md).
diff --git a/runatlantis.io/guide/testing-locally.md b/runatlantis.io/guide/testing-locally.md
index 054b0d9c2a..4e00c923de 100644
--- a/runatlantis.io/guide/testing-locally.md
+++ b/runatlantis.io/guide/testing-locally.md
@@ -1,45 +1,51 @@
# Testing Locally
+
These instructions are for running Atlantis **locally on your own computer** so you can test it out against
your own repositories before deciding whether to install it more permanently.
::: tip
-If you want to set up a production-ready Atlantis installation, read [Deployment](../docs/deployment.html).
+If you want to set up a production-ready Atlantis installation, read [Deployment](../docs/deployment.md).
:::
Steps:
-[[toc]]
-
## Install Terraform
+
`terraform` needs to be in the `$PATH` for Atlantis.
-Download from [https://developer.hashicorp.com/terraform/downloads](https://developer.hashicorp.com/terraform/downloads)
-```
+Download from [Terraform](https://developer.hashicorp.com/terraform/downloads)
+
+```shell
unzip path/to/terraform_*.zip -d /usr/local/bin
```
## Download Atlantis
-Get the latest release from [https://github.com/runatlantis/atlantis/releases](https://github.com/runatlantis/atlantis/releases)
+
+Get the latest release from [GitHub](https://github.com/runatlantis/atlantis/releases)
and unpackage it.
## Download Ngrok
+
Atlantis needs to be accessible somewhere that github.com/gitlab.com/bitbucket.org or your GitHub/GitLab Enterprise installation can reach.
One way to accomplish this is with ngrok, a tool that forwards your local port to a random
public hostname.
-Go to [https://ngrok.com/download](https://ngrok.com/download), download ngrok and `unzip` it.
+[Download](https://ngrok.com/download) ngrok and `unzip` it.
Start `ngrok` on port `4141` and take note of the hostname it gives you:
+
```bash
./ngrok http 4141
```
In a new tab (where you'll soon start Atlantis) create an environment variable with
ngrok's hostname:
+
```bash
URL="https://{YOUR_HOSTNAME}.ngrok.io"
```
## Create a Webhook Secret
+
GitHub and GitLab use webhook secrets so clients can verify that the webhooks came
from them.
::: warning
@@ -47,16 +53,19 @@ Bitbucket Cloud (bitbucket.org) doesn't use webhook secrets so if you're using B
When you're ready to do a production deploy of Atlantis you should allowlist [Bitbucket IPs](https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html)
to ensure the webhooks are coming from them.
:::
-Create a random string of any length (you can use [https://www.random.org/strings/](https://www.random.org/strings/))
+Create a random string of any length (you can use [random.org](https://www.random.org/strings/))
and set an environment variable:
-```
+
+```shell
SECRET="{YOUR_RANDOM_STRING}"
```
## Add Webhook
+
Take the URL that ngrok output and create a webhook in your GitHub, GitLab or Bitbucket repo:
### GitHub or GitHub Enterprise Webhook
+
Expand
@@ -82,6 +91,7 @@ Take the URL that ngrok output and create a webhook in your GitHub, GitLab or Bi
### GitLab or GitLab Enterprise Webhook
+
Expand
@@ -103,6 +113,7 @@ Take the URL that ngrok output and create a webhook in your GitHub, GitLab or Bi
+
## Create an access token for Atlantis
+
We recommend using a dedicated CI user or creating a new user named **@atlantis** that performs all API actions, however for testing,
you can use your own user. Here we'll create the access token that Atlantis uses to comment on the pull request and
set commit statuses.
### GitHub or GitHub Enterprise Access Token
+
- Create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token)
- create a token with **repo** scope
- set the token as an environment variable
-```
+
+```shell
TOKEN="{YOUR_TOKEN}"
```
### GitLab or GitLab Enterprise Access Token
-- follow [https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html#create-a-personal-access-token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html#create-a-personal-access-token)
+
+- follow [GitLab: Create a personal access token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html#create-a-personal-access-token)
- create a token with **api** scope
- set the token as an environment variable
-```
+
+```shell
TOKEN="{YOUR_TOKEN}"
```
### Bitbucket Cloud (bitbucket.org) Access Token
-- follow [https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/)
+
+- follow [BitBucket Cloud: Create an app password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/)
- Label the password "atlantis"
- Select **Pull requests**: **Read** and **Write** so that Atlantis can read your pull requests and write comments to them
- set the token as an environment variable
-```
+
+```shell
TOKEN="{YOUR_TOKEN}"
```
### Bitbucket Server (aka Stash) Access Token
+
- Click on your avatar in the top right and select **Manage account**
- Click **HTTP access tokens** in the sidebar
- Click **Create token**
- Name the token **atlantis**
- Give the token **Read** Project permissions and **Write** Pull request permissions
-- Choose an Expiry option **Do not expire** or **Expire automatically**
+- Choose an Expiry option **Do not expire** or **Expire automatically**
- Click **Create** and set the token as an environment variable
-```
+
+```shell
TOKEN="{YOUR_TOKEN}"
```
+### Gitea Access Token
+
+- Go to "Profile and Settings" > "Settings" in Gitea (top-right)
+- Go to "Applications" under "User Settings" in Gitea
+- Create a token under the "Manage Access Tokens" with the following permissions:
+ - issue: Read and Write
+ - repository: Read and Write
+- Record the access token
## Start Atlantis
+
You're almost ready to start Atlantis, just set two more variables:
```bash
@@ -195,9 +255,11 @@ REPO_ALLOWLIST="$YOUR_GIT_HOST/$YOUR_USERNAME/$YOUR_REPO"
# server without scheme or port and $YOUR_USERNAME will be the name of the **project** the repo
# is under, **not the key** of the project.
```
+
Now you can start Atlantis. The exact command differs depending on your Git host:
### GitHub Command
+
```bash
atlantis server \
--atlantis-url="$URL" \
@@ -208,6 +270,7 @@ atlantis server \
```
### GitHub Enterprise Command
+
```bash
HOSTNAME=YOUR_GITHUB_ENTERPRISE_HOSTNAME # ex. github.runatlantis.io
atlantis server \
@@ -220,6 +283,7 @@ atlantis server \
```
### GitLab Command
+
```bash
atlantis server \
--atlantis-url="$URL" \
@@ -230,6 +294,7 @@ atlantis server \
```
### GitLab Enterprise Command
+
```bash
HOSTNAME=YOUR_GITLAB_ENTERPRISE_HOSTNAME # ex. gitlab.runatlantis.io
atlantis server \
@@ -242,6 +307,7 @@ atlantis server \
```
### Bitbucket Cloud (bitbucket.org) Command
+
```bash
atlantis server \
--atlantis-url="$URL" \
@@ -251,6 +317,7 @@ atlantis server \
```
### Bitbucket Server (aka Stash) Command
+
```bash
BASE_URL=YOUR_BITBUCKET_SERVER_URL # ex. http://bitbucket.mycorp:7990
atlantis server \
@@ -278,46 +345,71 @@ atlantis server \
--ssl-key-file=file.key
```
+### Gitea
+
+```bash
+atlantis server \
+--atlantis-url="$URL" \
+--gitea-user="$ATLANTIS_GITEA_USER" \
+--gitea-token="$ATLANTIS_GITEA_TOKEN" \
+--gitea-webhook-secret="$ATLANTIS_GITEA_WEBHOOK_SECRET" \
+--gitea-base-url="$ATLANTIS_GITEA_BASE_URL" \
+--gitea-page-size="$ATLANTIS_GITEA_PAGE_SIZE" \
+--repo-allowlist="$REPO_ALLOWLIST"
+--ssl-cert-file=file.crt
+--ssl-key-file=file.key
+```
+
## Create a pull request
+
Create a pull request so you can test Atlantis.
::: tip
You could add a null resource as a test:
+
```hcl
resource "null_resource" "example" {}
```
+
Or just modify the whitespace in a file.
:::
### Autoplan
+
You should see Atlantis logging about receiving the webhook and you should see the output of `terraform plan` on your repo.
Atlantis tries to figure out the directory to plan in based on the files modified.
If you need to customize the directories that Atlantis runs in or the commands it runs if you're using workspaces
-or `.tfvars` files, see [atlantis.yaml Reference](/docs/repo-level-atlantis-yaml.html#reference).
+or `.tfvars` files, see [atlantis.yaml Reference](../docs/repo-level-atlantis-yaml.md#reference).
### Manual Plan
+
To manually `plan` in a specific directory or workspace, comment on the pull request using the `-d` or `-w` flags:
-```
+
+```shell
atlantis plan -d mydir
atlantis plan -w staging
```
To add additional arguments to the underlying `terraform plan` you can use:
-```
+
+```shell
atlantis plan -- -target=resource -var 'foo=bar'
```
### Apply
+
If you'd like to `apply`, type a comment: `atlantis apply`. You can use the `-d` or `-w` flags to point
Atlantis at a specific plan. Otherwise it tries to apply the plan for the root directory.
## Real-time logs
-The [real-time terraform output](/docs/streaming-logs.md) for your command can be found by clicking into the status check for a given project in a PR which
+
+The [real-time terraform output](../docs/streaming-logs.md) for your command can be found by clicking into the status check for a given project in a PR which
links to the log-streaming UI. This is a terminal UI where you can view your commands executing in real-time.
## Next Steps
-* If things are working as expected you can `Ctrl-C` the `atlantis server` command and the `ngrok` command.
-* Hopefully Atlantis is working with your repo and you're ready to move on to a [production-ready deployment](../docs/deployment.html).
-* If it's not working as expected, you may need to customize how Atlantis runs with an `atlantis.yaml` file.
-See [atlantis.yaml use cases](/docs/repo-level-atlantis-yaml.html#use-cases).
-* Check out our [full documentation](../docs/) for more details.
+
+- If things are working as expected you can `Ctrl-C` the `atlantis server` command and the `ngrok` command.
+- Hopefully Atlantis is working with your repo and you're ready to move on to a [production-ready deployment](../docs/deployment.md).
+- If it's not working as expected, you may need to customize how Atlantis runs with an `atlantis.yaml` file.
+See [atlantis.yaml use cases](../docs/repo-level-atlantis-yaml.md#use-cases).
+- Check out our [full documentation](../docs.md) for more details.
diff --git a/runatlantis.io/index.md b/runatlantis.io/index.md
new file mode 100644
index 0000000000..537c45de24
--- /dev/null
+++ b/runatlantis.io/index.md
@@ -0,0 +1,43 @@
+---
+# https://vitepress.dev/reference/default-theme-home-page
+layout: home
+
+pageClass: home-custom
+
+hero:
+ name: Atlantis
+ text: Terraform Pull Request Automation
+ tagline: Running Terraform Workflows with Ease
+ image: /hero.png
+ actions:
+ - theme: brand
+ text: Get Started
+ link: /guide
+ - theme: alt
+ text: What is Atlantis?
+ link: /blog/2017/introducing-atlantis
+ - theme: alt
+ text: Join us on Slack
+ link: https://join.slack.com/t/atlantis-community/shared_invite/zt-9xlxtxtc-CUSKB1ATt_sQy6um~LDPNw
+
+features:
+ - title: Fewer Mistakes
+ details: "Catch errors in Terraform plan output before applying changes. Ensure changes are applied before merging."
+ icon: â
+ - title: Empower Developers
+ details: "Developers can safely submit Terraform pull requests without credentials. Require approvals for applies."
+ icon: đģ
+ - title: Instant Audit Logs
+ details: "Detailed logs for infrastructure changes, approvals, and user actions. Configure approvals for production changes."
+ icon: đ
+ - title: Proven at Scale
+ details: "Used by top companies to manage over 600 repos with 300 developers. In production since 2017."
+ icon: đ
+ - title: Self-Hosted
+ details: "Your credentials remain secure. Deployable on VMs, Kubernetes, Fargate, etc. Supports GitHub, GitLab, Bitbucket, Azure DevOps."
+ icon: âī¸
+ - title: Open Source
+ details: "Atlantis is an open source project with strong community support, powered by volunteer contributions."
+ icon: đ
+
+---
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-114x114.png b/runatlantis.io/public/apple-touch-icon-114x114.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-114x114.png
rename to runatlantis.io/public/apple-touch-icon-114x114.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-120x120.png b/runatlantis.io/public/apple-touch-icon-120x120.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-120x120.png
rename to runatlantis.io/public/apple-touch-icon-120x120.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-144x144.png b/runatlantis.io/public/apple-touch-icon-144x144.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-144x144.png
rename to runatlantis.io/public/apple-touch-icon-144x144.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-152x152.png b/runatlantis.io/public/apple-touch-icon-152x152.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-152x152.png
rename to runatlantis.io/public/apple-touch-icon-152x152.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-57x57.png b/runatlantis.io/public/apple-touch-icon-57x57.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-57x57.png
rename to runatlantis.io/public/apple-touch-icon-57x57.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-60x60.png b/runatlantis.io/public/apple-touch-icon-60x60.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-60x60.png
rename to runatlantis.io/public/apple-touch-icon-60x60.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-72x72.png b/runatlantis.io/public/apple-touch-icon-72x72.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-72x72.png
rename to runatlantis.io/public/apple-touch-icon-72x72.png
diff --git a/runatlantis.io/.vuepress/public/apple-touch-icon-76x76.png b/runatlantis.io/public/apple-touch-icon-76x76.png
similarity index 100%
rename from runatlantis.io/.vuepress/public/apple-touch-icon-76x76.png
rename to runatlantis.io/public/apple-touch-icon-76x76.png
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic1.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic1.webp
new file mode 100644
index 0000000000..50d4156d52
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic1.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic2.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic2.webp
new file mode 100644
index 0000000000..fe15cbf47e
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic2.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic3.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic3.webp
new file mode 100644
index 0000000000..b448df066d
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic3.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic4.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic4.webp
new file mode 100644
index 0000000000..79418e0b3e
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic4.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic5.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic5.webp
new file mode 100644
index 0000000000..3c0086d447
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic5.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic6.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic6.webp
new file mode 100644
index 0000000000..3be25b55b5
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic6.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic7.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic7.webp
new file mode 100644
index 0000000000..bf38895ebc
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic7.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic8.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic8.webp
new file mode 100644
index 0000000000..9220492f87
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic8.webp differ
diff --git a/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic9.webp b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic9.webp
new file mode 100644
index 0000000000..1aaad9cc7b
Binary files /dev/null and b/runatlantis.io/public/blog/4-reasons-to-try-hashicorps-new-free-terraform-remote-state-storage/pic9.webp differ
diff --git a/runatlantis.io/public/blog/april-2024-survey-results/deploy.webp b/runatlantis.io/public/blog/april-2024-survey-results/deploy.webp
new file mode 100644
index 0000000000..38b721ccaa
Binary files /dev/null and b/runatlantis.io/public/blog/april-2024-survey-results/deploy.webp differ
diff --git a/runatlantis.io/public/blog/april-2024-survey-results/features.webp b/runatlantis.io/public/blog/april-2024-survey-results/features.webp
new file mode 100644
index 0000000000..d116d5ab5f
Binary files /dev/null and b/runatlantis.io/public/blog/april-2024-survey-results/features.webp differ
diff --git a/runatlantis.io/public/blog/april-2024-survey-results/iac.webp b/runatlantis.io/public/blog/april-2024-survey-results/iac.webp
new file mode 100644
index 0000000000..793dba5de6
Binary files /dev/null and b/runatlantis.io/public/blog/april-2024-survey-results/iac.webp differ
diff --git a/runatlantis.io/public/blog/april-2024-survey-results/interact.webp b/runatlantis.io/public/blog/april-2024-survey-results/interact.webp
new file mode 100644
index 0000000000..0eca135b15
Binary files /dev/null and b/runatlantis.io/public/blog/april-2024-survey-results/interact.webp differ
diff --git a/runatlantis.io/public/blog/april-2024-survey-results/repos.webp b/runatlantis.io/public/blog/april-2024-survey-results/repos.webp
new file mode 100644
index 0000000000..6e15d4e9f6
Binary files /dev/null and b/runatlantis.io/public/blog/april-2024-survey-results/repos.webp differ
diff --git a/runatlantis.io/public/blog/april-2024-survey-results/vcs.webp b/runatlantis.io/public/blog/april-2024-survey-results/vcs.webp
new file mode 100644
index 0000000000..628ab3869d
Binary files /dev/null and b/runatlantis.io/public/blog/april-2024-survey-results/vcs.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic1.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic1.webp
new file mode 100644
index 0000000000..72dbca2425
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic1.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic2.gif b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic2.gif
new file mode 100644
index 0000000000..5846753a4f
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic2.gif differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic3.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic3.webp
new file mode 100644
index 0000000000..8119b862e5
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic3.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic4.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic4.webp
new file mode 100644
index 0000000000..96a6eb388d
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic4.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic5.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic5.webp
new file mode 100644
index 0000000000..936b7a02ab
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic5.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic6.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic6.webp
new file mode 100644
index 0000000000..aafbc40298
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic6.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic7.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic7.webp
new file mode 100644
index 0000000000..5e55af24fe
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic7.webp differ
diff --git a/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic8.webp b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic8.webp
new file mode 100644
index 0000000000..ced941c865
Binary files /dev/null and b/runatlantis.io/public/blog/atlantis-0-4-4-now-supports-bitbucket/pic8.webp differ
diff --git a/runatlantis.io/public/blog/hosting-our-static-site/code/cloudfront.tf b/runatlantis.io/public/blog/hosting-our-static-site/code/cloudfront.tf
new file mode 100644
index 0000000000..3f0a3a4715
--- /dev/null
+++ b/runatlantis.io/public/blog/hosting-our-static-site/code/cloudfront.tf
@@ -0,0 +1,59 @@
+resource "aws_cloudfront_distribution" "www_distribution" {
+ // origin is where CloudFront gets its content from.
+ origin {
+ // We need to set up a "custom" origin because otherwise CloudFront won't
+ // redirect traffic from the root domain to the www domain, that is from
+ // runatlantis.io to www.runatlantis.io.
+ custom_origin_config {
+ // These are all the defaults.
+ http_port = "80"
+ https_port = "443"
+ origin_protocol_policy = "http-only"
+ origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
+ }
+
+ // Here we're using our S3 bucket's URL!
+ domain_name = "${aws_s3_bucket.www.website_endpoint}"
+ // This can be any name to identify this origin.
+ origin_id = "${var.www_domain_name}"
+ }
+
+ enabled = true
+ default_root_object = "index.html"
+
+ // All values are defaults from the AWS console.
+ default_cache_behavior {
+ viewer_protocol_policy = "redirect-to-https"
+ compress = true
+ allowed_methods = ["GET", "HEAD"]
+ cached_methods = ["GET", "HEAD"]
+ // This needs to match the `origin_id` above.
+ target_origin_id = "${var.www_domain_name}"
+ min_ttl = 0
+ default_ttl = 86400
+ max_ttl = 31536000
+
+ forwarded_values {
+ query_string = false
+ cookies {
+ forward = "none"
+ }
+ }
+ }
+
+ // Here we're ensuring we can hit this distribution using www.runatlantis.io
+ // rather than the domain name CloudFront gives us.
+ aliases = ["${var.www_domain_name}"]
+
+ restrictions {
+ geo_restriction {
+ restriction_type = "none"
+ }
+ }
+
+ // Here's where our certificate is loaded in!
+ viewer_certificate {
+ acm_certificate_arn = "${aws_acm_certificate.certificate.arn}"
+ ssl_support_method = "sni-only"
+ }
+}
diff --git a/runatlantis.io/public/blog/hosting-our-static-site/code/dns.tf b/runatlantis.io/public/blog/hosting-our-static-site/code/dns.tf
new file mode 100644
index 0000000000..3d1c0a4a57
--- /dev/null
+++ b/runatlantis.io/public/blog/hosting-our-static-site/code/dns.tf
@@ -0,0 +1,18 @@
+// We want AWS to host our zone so its nameservers can point to our CloudFront
+// distribution.
+resource "aws_route53_zone" "zone" {
+ name = "${var.root_domain_name}"
+}
+
+// This Route53 record will point at our CloudFront distribution.
+resource "aws_route53_record" "www" {
+ zone_id = "${aws_route53_zone.zone.zone_id}"
+ name = "${var.www_domain_name}"
+ type = "A"
+
+ alias = {
+ name = "${aws_cloudfront_distribution.www_distribution.domain_name}"
+ zone_id = "${aws_cloudfront_distribution.www_distribution.hosted_zone_id}"
+ evaluate_target_health = false
+ }
+}
diff --git a/runatlantis.io/public/blog/hosting-our-static-site/code/full.tf b/runatlantis.io/public/blog/hosting-our-static-site/code/full.tf
new file mode 100644
index 0000000000..c35ac47529
--- /dev/null
+++ b/runatlantis.io/public/blog/hosting-our-static-site/code/full.tf
@@ -0,0 +1,84 @@
+resource "aws_s3_bucket" "root" {
+ bucket = "${var.root_domain_name}"
+ acl = "public-read"
+ policy = < /tmp/ngrok.log &
+./ngrok config add-authtoken $NGROK_AUTH_TOKEN > /dev/null 2>&1
+./ngrok http 4141 > /tmp/ngrok.log 2>&1 &
sleep 2
# find out what URL ngrok has given us
export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[] | select(.proto=="https") | .public_url')
# Now we can start the e2e tests
+cd "${GITHUB_WORKSPACE:-$(git rev-parse --show-toplevel)}/e2e"
echo "Running 'make build'"
make build
diff --git a/scripts/fmt.sh b/scripts/fmt.sh
new file mode 100755
index 0000000000..b8a5aef752
--- /dev/null
+++ b/scripts/fmt.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+go install golang.org/x/tools/cmd/goimports@latest
+
+gobin="$(go env GOPATH)/bin"
+declare -r gobin
+
+declare -a files
+readarray -d '' files < <(find . -type f -name '*.go' ! -name 'mock_*' ! -path './vendor/*' ! -path '**/mocks/*' -print0)
+declare -r files
+
+output="$("${gobin}"/goimports -l "${files[@]}")"
+declare -r output
+
+if [[ -n "$output" ]]; then
+ echo "These files had their 'import' changed - please fix them locally and push a fix"
+
+ echo "$output"
+
+ exit 1
+fi
diff --git a/scripts/pin_ci_terraform_providers.sh b/scripts/pin_ci_terraform_providers.sh
new file mode 100755
index 0000000000..8de2dfab6c
--- /dev/null
+++ b/scripts/pin_ci_terraform_providers.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# Script to pin terraform providers in e2e tests
+
+RANDOM_PROVIDER_VERSION="3.6.1"
+NULL_PROVIDER_VERSION="3.2.2"
+
+TEST_REPOS_DIR="server/controllers/events/testdata/test-repos"
+
+for file in $(find $TEST_REPOS_DIR -name '*.tf')
+do
+ basename=$(basename $file)
+ if [[ "$basename" == "versions.tf" ]]
+ then
+ continue
+ fi
+ if [[ "$basename" != "main.tf" ]]
+ then
+ echo "Found unexpected file: $file"
+ exit 1
+ fi
+ has_null_provider=false
+ has_random_provider=false
+
+ version_file="$(dirname $file)/versions.tf"
+ for resource in $(cat $file | grep '^resource' | awk '{print $2}' | tr -d '"')
+ do
+ if [[ "$resource" == "null_resource" ]]
+ then
+ has_null_provider=true
+ elif [[ "$resource" == "random_id" ]]
+ then
+ has_random_provider=true
+ else
+ echo "Unknown resource $resource in $file"
+ exit 1
+ fi
+ done
+ if ! $has_null_provider && ! $has_random_provider
+ then
+ echo "No providers needed for $file"
+ continue
+ fi
+ echo "Adding $version_file for $file"
+ rm -f $version_file
+ if $has_null_provider
+ then
+ echo 'provider "null" {}' >> $version_file
+ fi
+ if $has_random_provider
+ then
+ echo 'provider "random" {}' >> $version_file
+ fi
+ echo "terraform {" >> $version_file
+ echo " required_providers {" >> $version_file
+
+ if $has_random_provider
+ then
+ echo " random = {" >> $version_file
+ echo ' source = "hashicorp/random"' >> $version_file
+ echo " version = \"= $RANDOM_PROVIDER_VERSION\"" >> $version_file
+ echo " }" >> $version_file
+ fi
+ if $has_null_provider
+ then
+ echo " null = {" >> $version_file
+ echo ' source = "hashicorp/null"' >> $version_file
+ echo " version = \"= $NULL_PROVIDER_VERSION\"" >> $version_file
+ echo " }" >> $version_file
+ fi
+ echo " }" >> $version_file
+ echo "}" >> $version_file
+
+done
diff --git a/server/controllers/api_controller.go b/server/controllers/api_controller.go
index 43e316bbdf..c48c99b41d 100644
--- a/server/controllers/api_controller.go
+++ b/server/controllers/api_controller.go
@@ -20,16 +20,19 @@ import (
const atlantisTokenHeader = "X-Atlantis-Token"
type APIController struct {
- APISecret []byte
- Locker locking.Locker
- Logger logging.SimpleLogging
- Parser events.EventParsing
- ProjectCommandBuilder events.ProjectCommandBuilder
- ProjectPlanCommandRunner events.ProjectPlanCommandRunner
- ProjectApplyCommandRunner events.ProjectApplyCommandRunner
- RepoAllowlistChecker *events.RepoAllowlistChecker
- Scope tally.Scope
- VCSClient vcs.Client
+ APISecret []byte
+ Locker locking.Locker
+ Logger logging.SimpleLogging
+ Parser events.EventParsing
+ ProjectCommandBuilder events.ProjectCommandBuilder
+ ProjectPlanCommandRunner events.ProjectPlanCommandRunner
+ ProjectApplyCommandRunner events.ProjectApplyCommandRunner
+ FailOnPreWorkflowHookError bool
+ PreWorkflowHooksCommandRunner events.PreWorkflowHooksCommandRunner
+ PostWorkflowHooksCommandRunner events.PostWorkflowHooksCommandRunner
+ RepoAllowlistChecker *events.RepoAllowlistChecker
+ Scope tally.Scope
+ VCSClient vcs.Client
}
type APIRequest struct {
@@ -44,7 +47,7 @@ type APIRequest struct {
}
}
-func (a *APIRequest) getCommands(ctx *command.Context, cmdBuilder func(*command.Context, *events.CommentCommand) ([]command.ProjectContext, error)) ([]command.ProjectContext, error) {
+func (a *APIRequest) getCommands(ctx *command.Context, cmdBuilder func(*command.Context, *events.CommentCommand) ([]command.ProjectContext, error)) ([]command.ProjectContext, []*events.CommentCommand, error) {
cc := make([]*events.CommentCommand, 0)
for _, project := range a.Projects {
@@ -63,12 +66,12 @@ func (a *APIRequest) getCommands(ctx *command.Context, cmdBuilder func(*command.
for _, commentCommand := range cc {
projectCmds, err := cmdBuilder(ctx, commentCommand)
if err != nil {
- return nil, fmt.Errorf("failed to build command: %v", err)
+ return nil, nil, fmt.Errorf("failed to build command: %v", err)
}
cmds = append(cmds, projectCmds...)
}
- return cmds, nil
+ return cmds, cc, nil
}
func (a *APIController) apiReportError(w http.ResponseWriter, code int, err error) {
@@ -142,29 +145,55 @@ func (a *APIController) Apply(w http.ResponseWriter, r *http.Request) {
}
func (a *APIController) apiPlan(request *APIRequest, ctx *command.Context) (*command.Result, error) {
- cmds, err := request.getCommands(ctx, a.ProjectCommandBuilder.BuildPlanCommands)
+ cmds, cc, err := request.getCommands(ctx, a.ProjectCommandBuilder.BuildPlanCommands)
if err != nil {
return nil, err
}
var projectResults []command.ProjectResult
- for _, cmd := range cmds {
+ for i, cmd := range cmds {
+ err = a.PreWorkflowHooksCommandRunner.RunPreHooks(ctx, cc[i])
+ if err != nil {
+ ctx.Log.Err("Error running pre-workflow hooks %s.", err)
+ if a.FailOnPreWorkflowHookError {
+ return nil, err
+ }
+ }
+
res := a.ProjectPlanCommandRunner.Plan(cmd)
projectResults = append(projectResults, res)
+
+ err = a.PostWorkflowHooksCommandRunner.RunPostHooks(ctx, cc[i])
+ if err != nil {
+ ctx.Log.Err("Error running post-workflow hooks %s.", err)
+ }
}
return &command.Result{ProjectResults: projectResults}, nil
}
func (a *APIController) apiApply(request *APIRequest, ctx *command.Context) (*command.Result, error) {
- cmds, err := request.getCommands(ctx, a.ProjectCommandBuilder.BuildApplyCommands)
+ cmds, cc, err := request.getCommands(ctx, a.ProjectCommandBuilder.BuildApplyCommands)
if err != nil {
return nil, err
}
var projectResults []command.ProjectResult
- for _, cmd := range cmds {
+ for i, cmd := range cmds {
+ err = a.PreWorkflowHooksCommandRunner.RunPreHooks(ctx, cc[i])
+ if err != nil {
+ ctx.Log.Err("Error running pre-workflow hooks %s.", err)
+ if a.FailOnPreWorkflowHookError {
+ return nil, err
+ }
+ }
+
res := a.ProjectApplyCommandRunner.Apply(cmd)
projectResults = append(projectResults, res)
+
+ err = a.PostWorkflowHooksCommandRunner.RunPostHooks(ctx, cc[i])
+ if err != nil {
+ ctx.Log.Err("Error running post-workflow hooks %s.", err)
+ }
}
return &command.Result{ProjectResults: projectResults}, nil
}
@@ -223,6 +252,7 @@ func (a *APIController) apiParseAndValidate(r *http.Request) (*APIRequest, *comm
},
Scope: a.Scope,
Log: a.Logger,
+ API: true,
}, http.StatusOK, nil
}
diff --git a/server/controllers/api_controller_test.go b/server/controllers/api_controller_test.go
index 1f2370ef08..3b3aa520aa 100644
--- a/server/controllers/api_controller_test.go
+++ b/server/controllers/api_controller_test.go
@@ -86,17 +86,27 @@ func setup(t *testing.T) (controllers.APIController, *MockProjectCommandBuilder,
ApplySuccess: "success",
})
+ preWorkflowHooksCommandRunner := NewMockPreWorkflowHooksCommandRunner()
+
+ When(preWorkflowHooksCommandRunner.RunPreHooks(Any[*command.Context](), Any[*events.CommentCommand]())).ThenReturn(nil)
+
+ postWorkflowHooksCommandRunner := NewMockPostWorkflowHooksCommandRunner()
+
+ When(postWorkflowHooksCommandRunner.RunPostHooks(Any[*command.Context](), Any[*events.CommentCommand]())).ThenReturn(nil)
+
ac := controllers.APIController{
- APISecret: []byte(atlantisToken),
- Locker: locker,
- Logger: logger,
- Scope: scope,
- Parser: parser,
- ProjectCommandBuilder: projectCommandBuilder,
- ProjectPlanCommandRunner: projectCommandRunner,
- ProjectApplyCommandRunner: projectCommandRunner,
- VCSClient: vcsClient,
- RepoAllowlistChecker: repoAllowlistChecker,
+ APISecret: []byte(atlantisToken),
+ Locker: locker,
+ Logger: logger,
+ Scope: scope,
+ Parser: parser,
+ ProjectCommandBuilder: projectCommandBuilder,
+ ProjectPlanCommandRunner: projectCommandRunner,
+ ProjectApplyCommandRunner: projectCommandRunner,
+ PreWorkflowHooksCommandRunner: preWorkflowHooksCommandRunner,
+ PostWorkflowHooksCommandRunner: postWorkflowHooksCommandRunner,
+ VCSClient: vcsClient,
+ RepoAllowlistChecker: repoAllowlistChecker,
}
return ac, projectCommandBuilder, projectCommandRunner
}
diff --git a/server/controllers/events/events_controller.go b/server/controllers/events/events_controller.go
index 2246a8f48b..a7ffa0c592 100644
--- a/server/controllers/events/events_controller.go
+++ b/server/controllers/events/events_controller.go
@@ -14,6 +14,7 @@
package events
import (
+ "encoding/json"
"fmt"
"io"
"net/http"
@@ -28,6 +29,7 @@ import (
"github.com/runatlantis/atlantis/server/events/vcs"
"github.com/runatlantis/atlantis/server/events/vcs/bitbucketcloud"
"github.com/runatlantis/atlantis/server/events/vcs/bitbucketserver"
+ "github.com/runatlantis/atlantis/server/events/vcs/gitea"
"github.com/runatlantis/atlantis/server/logging"
tally "github.com/uber-go/tally/v4"
gitlab "github.com/xanzy/go-gitlab"
@@ -37,6 +39,11 @@ const githubHeader = "X-Github-Event"
const gitlabHeader = "X-Gitlab-Event"
const azuredevopsHeader = "Request-Id"
+const giteaHeader = "X-Gitea-Event"
+const giteaEventTypeHeader = "X-Gitea-Event-Type"
+const giteaSignatureHeader = "X-Gitea-Signature"
+const giteaRequestIDHeader = "X-Gitea-Delivery"
+
// bitbucketEventTypeHeader is the same in both cloud and server.
const bitbucketEventTypeHeader = "X-Event-Key"
const bitbucketCloudRequestIDHeader = "X-Request-UUID"
@@ -91,11 +98,20 @@ type VCSEventsController struct {
// Azure DevOps Team Project. If empty, no request validation is done.
AzureDevopsWebhookBasicPassword []byte
AzureDevopsRequestValidator AzureDevopsRequestValidator
+ GiteaWebhookSecret []byte
}
// Post handles POST webhook requests.
func (e *VCSEventsController) Post(w http.ResponseWriter, r *http.Request) {
- if r.Header.Get(githubHeader) != "" {
+ if r.Header.Get(giteaHeader) != "" {
+ if !e.supportsHost(models.Gitea) {
+ e.respond(w, logging.Debug, http.StatusBadRequest, "Ignoring request since not configured to support Gitea")
+ return
+ }
+ e.Logger.Debug("handling Gitea post")
+ e.handleGiteaPost(w, r)
+ return
+ } else if r.Header.Get(githubHeader) != "" {
if !e.supportsHost(models.Github) {
e.respond(w, logging.Debug, http.StatusBadRequest, "Ignoring request since not configured to support GitHub")
return
@@ -288,6 +304,91 @@ func (e *VCSEventsController) handleAzureDevopsPost(w http.ResponseWriter, r *ht
}
}
+func (e *VCSEventsController) handleGiteaPost(w http.ResponseWriter, r *http.Request) {
+ signature := r.Header.Get(giteaSignatureHeader)
+ eventType := r.Header.Get(giteaEventTypeHeader)
+ reqID := r.Header.Get(giteaRequestIDHeader)
+
+ defer r.Body.Close() // Ensure the request body is closed
+
+ body, err := io.ReadAll(r.Body)
+ if err != nil {
+ e.respond(w, logging.Error, http.StatusBadRequest, "Unable to read body: %s %s=%s", err, "X-Gitea-Delivery", reqID)
+ return
+ }
+
+ if len(e.GiteaWebhookSecret) > 0 {
+ if err := gitea.ValidateSignature(body, signature, e.GiteaWebhookSecret); err != nil {
+ e.respond(w, logging.Warn, http.StatusBadRequest, errors.Wrap(err, "request did not pass validation").Error())
+ return
+ }
+ }
+
+ // Log the event type for debugging purposes
+ e.Logger.Debug("Received Gitea event %s with ID %s", eventType, reqID)
+
+ // Depending on the event type, handle the event appropriately
+ switch eventType {
+ case "pull_request_comment":
+ e.HandleGiteaPullRequestCommentEvent(w, body, reqID)
+ case "pull_request":
+ e.Logger.Debug("Handling as pull_request")
+ e.handleGiteaPullRequestEvent(w, body, reqID)
+ // Add other case handlers as necessary
+ default:
+ e.respond(w, logging.Debug, http.StatusOK, "Ignoring unsupported Gitea event type: %s %s=%s", eventType, "X-Gitea-Delivery", reqID)
+ }
+}
+
+func (e *VCSEventsController) handleGiteaPullRequestEvent(w http.ResponseWriter, body []byte, reqID string) {
+ e.Logger.Debug("Entering handleGiteaPullRequestEvent")
+ // Attempt to unmarshal the incoming body into the Gitea PullRequest struct
+ var payload gitea.GiteaWebhookPayload
+ if err := json.Unmarshal(body, &payload); err != nil {
+ e.Logger.Err("Failed to unmarshal Gitea webhook payload: %v", err)
+ e.respond(w, logging.Error, http.StatusBadRequest, "Failed to parse request body")
+ return
+ }
+
+ e.Logger.Debug("Successfully unmarshaled Gitea event")
+
+ // Use the parser function to convert into Atlantis models
+ pull, pullEventType, baseRepo, headRepo, user, err := e.Parser.ParseGiteaPullRequestEvent(payload.PullRequest)
+ if err != nil {
+ e.Logger.Err("Failed to parse Gitea pull request event: %v", err)
+ e.respond(w, logging.Error, http.StatusInternalServerError, "Failed to process event")
+ return
+ }
+
+ e.Logger.Debug("Parsed Gitea event into Atlantis models successfully")
+
+ logger := e.Logger.With("gitea-request-id", reqID)
+ logger.Debug("Identified Gitea event as type", "type", pullEventType)
+
+ // Call a generic handler for pull request events
+ response := e.handlePullRequestEvent(logger, baseRepo, headRepo, pull, user, pullEventType)
+
+ e.respond(w, logging.Debug, http.StatusOK, response.body)
+}
+
+// HandleGiteaPullRequestCommentEvent handles comment events from Gitea where Atlantis commands can come from.
+func (e *VCSEventsController) HandleGiteaPullRequestCommentEvent(w http.ResponseWriter, body []byte, reqID string) {
+ var event gitea.GiteaIssueCommentPayload
+ if err := json.Unmarshal(body, &event); err != nil {
+ e.Logger.Err("Failed to unmarshal Gitea comment payload: %v", err)
+ e.respond(w, logging.Error, http.StatusBadRequest, "Failed to parse request body")
+ return
+ }
+ e.Logger.Debug("Successfully unmarshaled Gitea comment event")
+
+ baseRepo, user, pullNum, _ := e.Parser.ParseGiteaIssueCommentEvent(event)
+ // Since we're lacking headRepo and maybePull details, we'll pass nil
+ // This follows the same approach as the GitHub client for handling comment events without full PR details
+ response := e.handleCommentEvent(e.Logger, baseRepo, nil, nil, user, pullNum, event.Comment.Body, event.Comment.ID, models.Gitea)
+
+ e.respond(w, logging.Debug, http.StatusOK, response.body)
+}
+
// HandleGithubCommentEvent handles comment events from GitHub where Atlantis
// commands can come from. It's exported to make testing easier.
func (e *VCSEventsController) HandleGithubCommentEvent(event *github.IssueCommentEvent, githubReqID string, logger logging.SimpleLogging) HTTPResponse {
@@ -571,7 +672,7 @@ func (e *VCSEventsController) handleCommentEvent(logger logging.SimpleLogging, b
}
}
- // It's a comment we're gonna react to, so add a reaction.
+ // It's a comment we're going to react to so add a reaction.
if e.EmojiReaction != "" {
err := e.VCSClient.ReactToComment(logger, baseRepo, pullNum, commentID, e.EmojiReaction)
if err != nil {
diff --git a/server/controllers/events/events_controller_e2e_test.go b/server/controllers/events/events_controller_e2e_test.go
index 781d483c34..7f63f191f5 100644
--- a/server/controllers/events/events_controller_e2e_test.go
+++ b/server/controllers/events/events_controller_e2e_test.go
@@ -53,12 +53,12 @@ var mockPreWorkflowHookRunner *runtimemocks.MockPreWorkflowHookRunner
var mockPostWorkflowHookRunner *runtimemocks.MockPostWorkflowHookRunner
-func (m *NoopTFDownloader) GetFile(_, _ string) error {
+func (m *NoopTFDownloader) GetAny(_, _ string) error {
return nil
}
-func (m *NoopTFDownloader) GetAny(_, _ string) error {
- return nil
+func (m *NoopTFDownloader) Install(_ string, _ string, _ *version.Version) (string, error) {
+ return "", nil
}
type LocalConftestCache struct {
@@ -1333,7 +1333,6 @@ func setupE2E(t *testing.T, repoDir string, opt setupOption) (events_controllers
workingDir := &events.FileWorkspace{
DataDir: dataDir,
TestingOverrideHeadCloneURL: "override-me",
- Logger: logger,
}
var preWorkflowHooks []*valid.WorkflowHook
if !opt.disablePreWorkflowHooks {
@@ -1425,7 +1424,6 @@ func setupE2E(t *testing.T, repoDir string, opt setupOption) (events_controllers
false,
"auto",
statsScope,
- logger,
terraformClient,
)
diff --git a/server/controllers/events/events_controller_test.go b/server/controllers/events/events_controller_test.go
index 183772df8e..9594ae5284 100644
--- a/server/controllers/events/events_controller_test.go
+++ b/server/controllers/events/events_controller_test.go
@@ -42,6 +42,7 @@ import (
)
const githubHeader = "X-Github-Event"
+const giteaHeader = "X-Gitea-Event"
const gitlabHeader = "X-Gitlab-Event"
const azuredevopsHeader = "Request-Id"
@@ -68,6 +69,17 @@ func TestPost_UnsupportedVCSGithub(t *testing.T) {
ResponseContains(t, w, http.StatusBadRequest, "Ignoring request since not configured to support GitHub")
}
+func TestPost_UnsupportedVCSGitea(t *testing.T) {
+ t.Log("when the request is for an unsupported vcs a 400 is returned")
+ e, _, _, _, _, _, _, _, _ := setup(t)
+ e.SupportedVCSHosts = nil
+ req, _ := http.NewRequest("GET", "", bytes.NewBuffer(nil))
+ req.Header.Set(giteaHeader, "value")
+ w := httptest.NewRecorder()
+ e.Post(w, req)
+ ResponseContains(t, w, http.StatusBadRequest, "Ignoring request since not configured to support Gitea")
+}
+
func TestPost_UnsupportedVCSGitlab(t *testing.T) {
t.Log("when the request is for an unsupported vcs a 400 is returned")
e, _, _, _, _, _, _, _, _ := setup(t)
@@ -90,6 +102,17 @@ func TestPost_InvalidGithubSecret(t *testing.T) {
ResponseContains(t, w, http.StatusBadRequest, "err")
}
+func TestPost_InvalidGiteaSecret(t *testing.T) {
+ t.Log("when the gitea payload can't be validated a 400 is returned")
+ e, v, _, _, _, _, _, _, _ := setup(t)
+ w := httptest.NewRecorder()
+ req, _ := http.NewRequest("GET", "", bytes.NewBuffer(nil))
+ req.Header.Set(giteaHeader, "value")
+ When(v.Validate(req, secret)).ThenReturn(nil, errors.New("err"))
+ e.Post(w, req)
+ ResponseContains(t, w, http.StatusBadRequest, "request did not pass validation")
+}
+
func TestPost_InvalidGitlabSecret(t *testing.T) {
t.Log("when the gitlab payload can't be validated a 400 is returned")
e, _, gl, _, _, _, _, _, _ := setup(t)
@@ -112,6 +135,18 @@ func TestPost_UnsupportedGithubEvent(t *testing.T) {
ResponseContains(t, w, http.StatusOK, "Ignoring unsupported event")
}
+func TestPost_UnsupportedGiteaEvent(t *testing.T) {
+ t.Log("when the event type is an unsupported gitea event we ignore it")
+ e, v, _, _, _, _, _, _, _ := setup(t)
+ w := httptest.NewRecorder()
+ req, _ := http.NewRequest("GET", "", bytes.NewBuffer(nil))
+ req.Header.Set(giteaHeader, "value")
+ e.GiteaWebhookSecret = nil
+ When(v.Validate(req, nil)).ThenReturn([]byte(`{"not an event": ""}`), nil)
+ e.Post(w, req)
+ ResponseContains(t, w, http.StatusOK, "Ignoring unsupported Gitea event")
+}
+
func TestPost_UnsupportedGitlabEvent(t *testing.T) {
t.Log("when the event type is an unsupported gitlab event we ignore it")
e, _, gl, _, _, _, _, _, _ := setup(t)
@@ -211,8 +246,10 @@ func TestPost_GitlabCommentNotAllowlisted(t *testing.T) {
w := httptest.NewRecorder()
e.Post(w, req)
- Equals(t, http.StatusForbidden, w.Result().StatusCode)
- body, _ := io.ReadAll(w.Result().Body)
+ resp := w.Result()
+ defer resp.Body.Close()
+ Equals(t, http.StatusForbidden, resp.StatusCode)
+ body, _ := io.ReadAll(resp.Body)
exp := "Repo not allowlisted"
Assert(t, strings.Contains(string(body), exp), "exp %q to be contained in %q", exp, string(body))
expRepo, _ := models.NewRepo(models.Gitlab, "gitlabhq/gitlab-test", "https://example.com/gitlabhq/gitlab-test.git", "", "")
@@ -244,8 +281,10 @@ func TestPost_GitlabCommentNotAllowlistedWithSilenceErrors(t *testing.T) {
w := httptest.NewRecorder()
e.Post(w, req)
- Equals(t, http.StatusForbidden, w.Result().StatusCode)
- body, _ := io.ReadAll(w.Result().Body)
+ resp := w.Result()
+ defer resp.Body.Close()
+ Equals(t, http.StatusForbidden, resp.StatusCode)
+ body, _ := io.ReadAll(resp.Body)
exp := "Repo not allowlisted"
Assert(t, strings.Contains(string(body), exp), "exp %q to be contained in %q", exp, string(body))
vcsClient.VerifyWasCalled(Never()).CreateComment(Any[logging.SimpleLogging](), Any[models.Repo](), Any[int](), Any[string](), Any[string]())
@@ -276,8 +315,10 @@ func TestPost_GithubCommentNotAllowlisted(t *testing.T) {
w := httptest.NewRecorder()
e.Post(w, req)
- Equals(t, http.StatusForbidden, w.Result().StatusCode)
- body, _ := io.ReadAll(w.Result().Body)
+ resp := w.Result()
+ defer resp.Body.Close()
+ Equals(t, http.StatusForbidden, resp.StatusCode)
+ body, _ := io.ReadAll(resp.Body)
exp := "Repo not allowlisted"
Assert(t, strings.Contains(string(body), exp), "exp %q to be contained in %q", exp, string(body))
expRepo, _ := models.NewRepo(models.Github, "baxterthehacker/public-repo", "https://github.com/baxterthehacker/public-repo.git", "", "")
@@ -310,8 +351,10 @@ func TestPost_GithubCommentNotAllowlistedWithSilenceErrors(t *testing.T) {
w := httptest.NewRecorder()
e.Post(w, req)
- Equals(t, http.StatusForbidden, w.Result().StatusCode)
- body, _ := io.ReadAll(w.Result().Body)
+ resp := w.Result()
+ defer resp.Body.Close()
+ Equals(t, http.StatusForbidden, resp.StatusCode)
+ body, _ := io.ReadAll(resp.Body)
exp := "Repo not allowlisted"
Assert(t, strings.Contains(string(body), exp), "exp %q to be contained in %q", exp, string(body))
vcsClient.VerifyWasCalled(Never()).CreateComment(Any[logging.SimpleLogging](), Any[models.Repo](), Any[int](), Any[string](), Any[string]())
@@ -976,7 +1019,8 @@ func setup(t *testing.T) (events_controllers.VCSEventsController, *mocks.MockGit
CommandRunner: cr,
PullCleaner: c,
GithubWebhookSecret: secret,
- SupportedVCSHosts: []models.VCSHostType{models.Github, models.Gitlab, models.AzureDevops},
+ SupportedVCSHosts: []models.VCSHostType{models.Github, models.Gitlab, models.AzureDevops, models.Gitea},
+ GiteaWebhookSecret: secret,
GitlabWebhookSecret: secret,
GitlabRequestParserValidator: gl,
RepoAllowlistChecker: repoAllowlistChecker,
diff --git a/server/controllers/events/testdata/null_provider_lockfile_old_version b/server/controllers/events/testdata/null_provider_lockfile_old_version
index 9af6a64b26..c83acaa26b 100644
--- a/server/controllers/events/testdata/null_provider_lockfile_old_version
+++ b/server/controllers/events/testdata/null_provider_lockfile_old_version
@@ -2,20 +2,24 @@
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/null" {
- version = "3.1.0"
- constraints = "3.1.0"
+ version = "3.2.2"
+ constraints = "3.2.2"
hashes = [
- "h1:grYDj8/Lvp1OwME+g1AsECPN1czO5ssSf+8fCluCHQY=",
- "zh:02a1675fd8de126a00460942aaae242e65ca3380b5bb192e8773ef3da9073fd2",
- "zh:53e30545ff8926a8e30ad30648991ca8b93b6fa496272cd23b26763c8ee84515",
- "zh:5f9200bf708913621d0f6514179d89700e9aa3097c77dac730e8ba6e5901d521",
- "zh:9ebf4d9704faba06b3ec7242c773c0fbfe12d62db7d00356d4f55385fc69bfb2",
- "zh:a6576c81adc70326e4e1c999c04ad9ca37113a6e925aefab4765e5a5198efa7e",
- "zh:a8a42d13346347aff6c63a37cda9b2c6aa5cc384a55b2fe6d6adfa390e609c53",
- "zh:c797744d08a5307d50210e0454f91ca4d1c7621c68740441cf4579390452321d",
- "zh:cecb6a304046df34c11229f20a80b24b1603960b794d68361a67c5efe58e62b8",
- "zh:e1371aa1e502000d9974cfaff5be4cfa02f47b17400005a16f14d2ef30dc2a70",
- "zh:fc39cc1fe71234a0b0369d5c5c7f876c71b956d23d7d6f518289737a001ba69b",
- "zh:fea4227271ebf7d9e2b61b89ce2328c7262acd9fd190e1fd6d15a591abfa848e",
+ "h1:Gef5VGfobY5uokA5nV/zFvWeMNR2Pmq79DH94QnNZPM=",
+ "h1:IMVAUHKoydFrlPrl9OzasDnw/8ntZFerCC9iXw1rXQY=",
+ "h1:vWAsYRd7MjYr3adj8BVKRohVfHpWQdvkIwUQ2Jf5FVM=",
+ "h1:zT1ZbegaAYHwQa+QwIFugArWikRJI9dqohj8xb0GY88=",
+ "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7",
+ "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a",
+ "zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3",
+ "zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606",
+ "zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546",
+ "zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539",
+ "zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452",
+ "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
+ "zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422",
+ "zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae",
+ "zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1",
+ "zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e",
]
}
diff --git a/server/controllers/events/testdata/test-repos/automerge/dir1/versions.tf b/server/controllers/events/testdata/test-repos/automerge/dir1/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/automerge/dir1/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/automerge/dir2/versions.tf b/server/controllers/events/testdata/test-repos/automerge/dir2/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/automerge/dir2/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/automerge/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/automerge/exp-output-autoplan.txt
index c32ed6dfdc..8f32ac5efc 100644
--- a/server/controllers/events/testdata/test-repos/automerge/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/automerge/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
```diff
@@ -20,10 +21,14 @@ Plan: 1 to add, 0 to change, 0 to destroy.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
+ ```shell
+ atlantis plan -d dir1
+ ```
---
### 2. dir: `dir2` workspace: `default`
@@ -43,17 +48,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
+ ```shell
+ atlantis plan -d dir2
+ ```
---
### Plan Summary
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/main.tf b/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/main.tf
index 2aa6a6437d..231579dd90 100644
--- a/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/main.tf
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/main.tf
@@ -1,4 +1,3 @@
resource "random_id" "dummy1" {
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/versions.tf b/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/dir1/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/main.tf b/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/main.tf
index 5292f29c85..97f93c35e1 100644
--- a/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/main.tf
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/main.tf
@@ -1,4 +1,3 @@
resource "random_id" "dummy2" {
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/versions.tf b/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/dir2/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-autoplan.txt
index 7f0f5f45a8..d49fde3e8f 100644
--- a/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
Show Output
@@ -21,18 +22,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
-
+ ```shell
+ atlantis plan -d dir1
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -54,18 +58,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
-
+ ```shell
+ atlantis plan -d dir2
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -73,7 +80,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-import-dummy1.txt b/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-import-dummy1.txt
index 04f87516ab..0e6c0c960c 100644
--- a/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-import-dummy1.txt
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-import-dummy1.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
\ No newline at end of file
+ ```shell
+ atlantis plan -d dir1
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-plan-again.txt b/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-plan-again.txt
index c9a7d87124..f94c8567ed 100644
--- a/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-plan-again.txt
+++ b/server/controllers/events/testdata/test-repos/import-multiple-project/exp-output-plan-again.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
```diff
@@ -14,10 +15,14 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
+ ```shell
+ atlantis plan -d dir1
+ ```
---
### 2. dir: `dir2` workspace: `default`
@@ -38,18 +43,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
-
+ ```shell
+ atlantis plan -d dir2
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -57,7 +65,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 1 with changes, 1 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-autoplan.txt
index 8fcbeaa757..ddcccae10a 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-autoplan.txt
@@ -17,7 +17,6 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
# random_id.for_each["default"] will be created
@@ -28,22 +27,29 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 2 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 2 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-count.txt b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-count.txt
index d7957913db..32680f595f 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-count.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-count.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-foreach.txt b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-foreach.txt
index 45b02dd35f..1e1caabfca 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-foreach.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-import-foreach.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-plan-again.txt b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-plan-again.txt
index 46a378158b..379d9e8ce7 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-plan-again.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project-var/exp-output-plan-again.txt
@@ -8,13 +8,21 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=overridden`
+ ```shell
+ atlantis plan -d . -- -var var=overridden
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-single-project-var/main.tf b/server/controllers/events/testdata/test-repos/import-single-project-var/main.tf
index f7bf7839d0..082a9534c0 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project-var/main.tf
+++ b/server/controllers/events/testdata/test-repos/import-single-project-var/main.tf
@@ -1,12 +1,10 @@
resource "random_id" "for_each" {
for_each = toset([var.var])
- keepers = {}
byte_length = 1
}
resource "random_id" "count" {
count = 1
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/import-single-project-var/versions.tf b/server/controllers/events/testdata/test-repos/import-single-project-var/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/import-single-project-var/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-autoplan.txt
index 5662b98336..9c9fa29474 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-autoplan.txt
@@ -17,7 +17,6 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
# random_id.dummy2 will be created
@@ -28,22 +27,29 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 2 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 2 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy1.txt b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy1.txt
index 1823a29537..f4a6cb37d9 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy1.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy1.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy2.txt b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy2.txt
index d515857ff1..9ab2dbb7e3 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy2.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-import-dummy2.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-plan-again.txt b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-plan-again.txt
index adc09b4a37..a7268e38f8 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project/exp-output-plan-again.txt
+++ b/server/controllers/events/testdata/test-repos/import-single-project/exp-output-plan-again.txt
@@ -8,13 +8,21 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/import-single-project/main.tf b/server/controllers/events/testdata/test-repos/import-single-project/main.tf
index 2e60a118f5..0a1884fe5e 100644
--- a/server/controllers/events/testdata/test-repos/import-single-project/main.tf
+++ b/server/controllers/events/testdata/test-repos/import-single-project/main.tf
@@ -1,9 +1,7 @@
resource "random_id" "dummy1" {
- keepers = {}
byte_length = 1
}
resource "random_id" "dummy2" {
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/import-single-project/versions.tf b/server/controllers/events/testdata/test-repos/import-single-project/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/import-single-project/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/import-workspace/dir1/main.tf b/server/controllers/events/testdata/test-repos/import-workspace/dir1/main.tf
index de0cb8d4a2..0bc18fe1e3 100644
--- a/server/controllers/events/testdata/test-repos/import-workspace/dir1/main.tf
+++ b/server/controllers/events/testdata/test-repos/import-workspace/dir1/main.tf
@@ -1,14 +1,12 @@
resource "random_id" "dummy1" {
count = terraform.workspace == "ops" ? 1 : 0
- keepers = {}
byte_length = 1
}
resource "random_id" "dummy2" {
count = terraform.workspace == "ops" ? 1 : 0
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/import-workspace/dir1/versions.tf b/server/controllers/events/testdata/test-repos/import-workspace/dir1/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/import-workspace/dir1/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy1.txt b/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy1.txt
index 99e0e3434f..38f283b20e 100644
--- a/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy1.txt
+++ b/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy1.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
diff --git a/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy2.txt b/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy2.txt
index 3f168d91b3..cd4659c0b7 100644
--- a/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy2.txt
+++ b/server/controllers/events/testdata/test-repos/import-workspace/exp-output-import-dir1-ops-dummy2.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
diff --git a/server/controllers/events/testdata/test-repos/import-workspace/exp-output-plan.txt b/server/controllers/events/testdata/test-repos/import-workspace/exp-output-plan.txt
index 9859fcbc1f..7edca86268 100644
--- a/server/controllers/events/testdata/test-repos/import-workspace/exp-output-plan.txt
+++ b/server/controllers/events/testdata/test-repos/import-workspace/exp-output-plan.txt
@@ -8,13 +8,21 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p dir1-ops`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p dir1-ops
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-autoplan.txt
index 1e55d623b5..43a1815d11 100644
--- a/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `staging` workspace: `default`
1. dir: `production` workspace: `default`
+---
### 1. dir: `staging` workspace: `default`
Show Output
@@ -23,13 +24,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ var = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
-
+ ```shell
+ atlantis plan -d staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -53,13 +58,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ var = "production"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d production
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production`
-
+ ```shell
+ atlantis plan -d production
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -67,7 +76,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-production.txt b/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-production.txt
index f08e2c50ae..298d515d93 100644
--- a/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-production.txt
+++ b/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-production.txt
@@ -20,8 +20,12 @@ Plan: 1 to add, 0 to change, 0 to destroy.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d production
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production`
+ ```shell
+ atlantis plan -d production
+ ```
diff --git a/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-staging.txt b/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-staging.txt
index de773736db..9f8399b7f1 100644
--- a/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-staging.txt
+++ b/server/controllers/events/testdata/test-repos/modules-yaml/exp-output-plan-staging.txt
@@ -20,8 +20,12 @@ Plan: 1 to add, 0 to change, 0 to destroy.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
+ ```shell
+ atlantis plan -d staging
+ ```
diff --git a/server/controllers/events/testdata/test-repos/modules-yaml/modules/null/versions.tf b/server/controllers/events/testdata/test-repos/modules-yaml/modules/null/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/modules-yaml/modules/null/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/modules/exp-output-autoplan-only-staging.txt b/server/controllers/events/testdata/test-repos/modules/exp-output-autoplan-only-staging.txt
index d1faf53fc8..c3bdadc019 100644
--- a/server/controllers/events/testdata/test-repos/modules/exp-output-autoplan-only-staging.txt
+++ b/server/controllers/events/testdata/test-repos/modules/exp-output-autoplan-only-staging.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ var = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
-
+ ```shell
+ atlantis plan -d staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/modules/exp-output-plan-production.txt b/server/controllers/events/testdata/test-repos/modules/exp-output-plan-production.txt
index 19246ade07..13d2414f3f 100644
--- a/server/controllers/events/testdata/test-repos/modules/exp-output-plan-production.txt
+++ b/server/controllers/events/testdata/test-repos/modules/exp-output-plan-production.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ var = "production"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d production
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production`
-
+ ```shell
+ atlantis plan -d production
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/modules/exp-output-plan-staging.txt b/server/controllers/events/testdata/test-repos/modules/exp-output-plan-staging.txt
index d1faf53fc8..c3bdadc019 100644
--- a/server/controllers/events/testdata/test-repos/modules/exp-output-plan-staging.txt
+++ b/server/controllers/events/testdata/test-repos/modules/exp-output-plan-staging.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ var = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
-
+ ```shell
+ atlantis plan -d staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/modules/modules/null/versions.tf b/server/controllers/events/testdata/test-repos/modules/modules/null/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/modules/modules/null/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-apply-reqs/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-approve-policies-clear.txt b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-approve-policies-clear.txt
index e6643f8ce3..107a689278 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-approve-policies-clear.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-approve-policies-clear.txt
@@ -1,6 +1,7 @@
Ran Approve Policies for 1 projects:
1. dir: `.` workspace: `default`
+---
### 1. dir: `.` workspace: `default`
**Approve Policies Failed**: One or more policy sets require additional approval.
@@ -9,15 +10,25 @@ Ran Approve Policies for 1 projects:
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-clear-approval/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-auto-policy-check.txt
index f366769233..c8b5da50dd 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-auto-policy-check.txt
@@ -25,15 +25,24 @@ post-conftest output
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-custom-run-steps/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-approve-policies.txt b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-approve-policies.txt
index d6e39f260d..b842f99682 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-approve-policies.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-approve-policies.txt
@@ -1,6 +1,7 @@
Ran Approve Policies for 1 projects:
1. dir: `.` workspace: `default`
+---
### 1. dir: `.` workspace: `default`
**Approve Policies Error**
@@ -15,15 +16,25 @@ Ran Approve Policies for 1 projects:
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-diff-owner/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-previous-match/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo-server-side/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-disabled-repo/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo-server-side/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-enabled-repo/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-auto-policy-check.txt
index c7f45c85f5..669b9cb064 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - null_resource_policy - WARNING: Null Resource crea
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-extra-args/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-extra-args/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-extra-args/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-extra-args/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/dir1/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/dir1/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/dir1/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/dir2/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/dir2/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/dir2/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-apply.txt b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-apply.txt
index eb6bda8987..7e0bd72a67 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-apply.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-apply.txt
@@ -2,6 +2,7 @@ Ran Apply for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
```diff
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-auto-policy-check.txt
index c292c651f3..944cd1ba56 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-auto-policy-check.txt
@@ -2,6 +2,7 @@ Ran Policy Check for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
#### Policy Set: `test_policy`
@@ -13,10 +14,14 @@ Ran Policy Check for 2 projects:
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d dir1`
+ ```shell
+ atlantis plan -d dir1
+ ```
---
### 2. dir: `dir2` workspace: `default`
@@ -35,15 +40,25 @@ FAIL - - main - WARNING: Forbidden Resource creation is pro
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d dir2`
+ ```shell
+ atlantis plan -d dir2
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-autoplan.txt
index 098c4eba93..e01442f671 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-multi-projects/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
Show Output
@@ -23,13 +24,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
-
+ ```shell
+ atlantis plan -d dir1
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -53,13 +58,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
-
+ ```shell
+ atlantis plan -d dir2
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -67,7 +76,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks-success-silent/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks-success-silent/exp-output-autoplan.txt
index ea7d4bf3ec..0fe7b1646b 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks-success-silent/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks-success-silent/exp-output-autoplan.txt
@@ -9,13 +9,21 @@ state, without changing any real infrastructure.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/policy-checks/exp-output-auto-policy-check.txt
index 0ace841faf..3d94c6521c 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks/exp-output-auto-policy-check.txt
@@ -15,15 +15,24 @@ FAIL - - main - WARNING: Null Resource creation is prohibit
policy set: test_policy: requires: 1 approval(s), have: 0.
```
* :heavy_check_mark: To **approve** this project, comment:
- * `atlantis approve_policies -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis approve_policies -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment:
- * `atlantis approve_policies`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :heavy_check_mark: To **approve** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis approve_policies
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan`
\ No newline at end of file
+ ```shell
+ atlantis plan
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/policy-checks/exp-output-autoplan.txt
index 6f7ce87643..d3f41336a8 100644
--- a/server/controllers/events/testdata/test-repos/policy-checks/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/policy-checks/exp-output-autoplan.txt
@@ -19,17 +19,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/policy-checks/versions.tf b/server/controllers/events/testdata/test-repos/policy-checks/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/policy-checks/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-apply.txt b/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-apply.txt
index a136ff9691..4b78a636d5 100644
--- a/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-apply.txt
+++ b/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-apply.txt
@@ -2,6 +2,7 @@ Ran Apply for 2 projects:
1. dir: `infrastructure/production` workspace: `default`
1. dir: `infrastructure/staging` workspace: `default`
+---
### 1. dir: `infrastructure/production` workspace: `default`
```diff
diff --git a/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-autoplan.txt
index 29f5f76dae..8bf40fc657 100644
--- a/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/repo-config-file/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `infrastructure/staging` workspace: `default`
1. dir: `infrastructure/production` workspace: `default`
+---
### 1. dir: `infrastructure/staging` workspace: `default`
```diff
@@ -20,10 +21,14 @@ Plan: 1 to add, 0 to change, 0 to destroy.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d infrastructure/staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d infrastructure/staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d infrastructure/staging`
+ ```shell
+ atlantis plan -d infrastructure/staging
+ ```
---
### 2. dir: `infrastructure/production` workspace: `default`
@@ -43,17 +48,25 @@ Plan: 1 to add, 0 to change, 0 to destroy.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d infrastructure/production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d infrastructure/production
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d infrastructure/production`
+ ```shell
+ atlantis plan -d infrastructure/production
+ ```
---
### Plan Summary
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/repo-config-file/infrastructure/production/versions.tf b/server/controllers/events/testdata/test-repos/repo-config-file/infrastructure/production/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/repo-config-file/infrastructure/production/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/repo-config-file/infrastructure/staging/versions.tf b/server/controllers/events/testdata/test-repos/repo-config-file/infrastructure/staging/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/repo-config-file/infrastructure/staging/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/server-side-cfg/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/server-side-cfg/exp-output-autoplan.txt
index ad9591b8ae..37e78c18af 100644
--- a/server/controllers/events/testdata/test-repos/server-side-cfg/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/server-side-cfg/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `.` workspace: `default`
1. dir: `.` workspace: `staging`
+---
### 1. dir: `.` workspace: `default`
Show Output
@@ -28,13 +29,17 @@ Changes to Outputs:
postplan custom
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -61,13 +66,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -w staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w staging`
-
+ ```shell
+ atlantis plan -w staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -75,7 +84,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/server-side-cfg/versions.tf b/server/controllers/events/testdata/test-repos/server-side-cfg/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/server-side-cfg/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-autoplan.txt
index 6e70ac89fb..822531032c 100644
--- a/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-autoplan.txt
@@ -30,17 +30,25 @@ Changes to Outputs:
+ var = "default"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-plan.txt b/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-plan.txt
index 6e70ac89fb..822531032c 100644
--- a/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-plan.txt
+++ b/server/controllers/events/testdata/test-repos/simple-with-lockfile/exp-output-plan.txt
@@ -30,17 +30,25 @@ Changes to Outputs:
+ var = "default"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple-with-lockfile/versions.tf b/server/controllers/events/testdata/test-repos/simple-with-lockfile/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/simple-with-lockfile/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-apply-all.txt b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-apply-all.txt
index 61eac2271a..4e757a396c 100644
--- a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-apply-all.txt
+++ b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-apply-all.txt
@@ -2,6 +2,7 @@ Ran Apply for 2 projects:
1. dir: `.` workspace: `default`
1. dir: `.` workspace: `staging`
+---
### 1. dir: `.` workspace: `default`
```diff
diff --git a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-autoplan.txt
index dcbb45bf78..c445925f6c 100644
--- a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `.` workspace: `default`
1. dir: `.` workspace: `staging`
+---
### 1. dir: `.` workspace: `default`
Show Output
@@ -29,13 +30,17 @@ Changes to Outputs:
postplan
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -60,13 +65,17 @@ Changes to Outputs:
+ var = "fromfile"
+ workspace = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -w staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w staging`
-
+ ```shell
+ atlantis plan -w staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -74,7 +83,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-default.txt b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-default.txt
index f0419c9189..b944f4deab 100644
--- a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-default.txt
+++ b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-default.txt
@@ -25,17 +25,25 @@ Changes to Outputs:
postplan
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-staging.txt b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-staging.txt
index 7e34016bab..64880424f6 100644
--- a/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-staging.txt
+++ b/server/controllers/events/testdata/test-repos/simple-yaml/exp-output-plan-staging.txt
@@ -20,17 +20,25 @@ Changes to Outputs:
+ var = "fromfile"
+ workspace = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -w staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w staging`
-
+ ```shell
+ atlantis plan -w staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple-yaml/versions.tf b/server/controllers/events/testdata/test-repos/simple-yaml/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/simple-yaml/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/simple/exp-output-apply-var-all.txt b/server/controllers/events/testdata/test-repos/simple/exp-output-apply-var-all.txt
index 2977099b55..cb7dd9a752 100644
--- a/server/controllers/events/testdata/test-repos/simple/exp-output-apply-var-all.txt
+++ b/server/controllers/events/testdata/test-repos/simple/exp-output-apply-var-all.txt
@@ -2,6 +2,7 @@ Ran Apply for 2 projects:
1. dir: `.` workspace: `default`
1. dir: `.` workspace: `new_workspace`
+---
### 1. dir: `.` workspace: `default`
Show Output
diff --git a/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt b/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt
index 242515e415..13bdae3fac 100644
--- a/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt
+++ b/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt
@@ -30,17 +30,25 @@ Changes to Outputs:
+ var = "new_workspace"
+ workspace = "new_workspace"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w new_workspace`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -w new_workspace
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w new_workspace -- -var var=new_workspace`
-
+ ```shell
+ atlantis plan -w new_workspace -- -var var=new_workspace
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt b/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt
index 5a86cff0c9..ab28d0ca84 100644
--- a/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt
+++ b/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt
@@ -30,17 +30,25 @@ Changes to Outputs:
+ var = "overridden"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=overridden`
-
+ ```shell
+ atlantis plan -d . -- -var var=overridden
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan.txt b/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan.txt
index 54e5505476..191b540b63 100644
--- a/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan.txt
+++ b/server/controllers/events/testdata/test-repos/simple/exp-output-atlantis-plan.txt
@@ -30,17 +30,25 @@ Changes to Outputs:
+ var = "default_workspace"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=default_workspace`
-
+ ```shell
+ atlantis plan -d . -- -var var=default_workspace
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple/exp-output-auto-policy-check.txt b/server/controllers/events/testdata/test-repos/simple/exp-output-auto-policy-check.txt
index c6e0823922..fd03e48aed 100644
--- a/server/controllers/events/testdata/test-repos/simple/exp-output-auto-policy-check.txt
+++ b/server/controllers/events/testdata/test-repos/simple/exp-output-auto-policy-check.txt
@@ -5,13 +5,21 @@ Ran Policy Check for dir: `.` workspace: `default`
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To re-run policies **plan** this project again by commenting:
- * `atlantis plan -d .`
+ ```shell
+ atlantis plan -d .
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/simple/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/simple/exp-output-autoplan.txt
index 6e70ac89fb..822531032c 100644
--- a/server/controllers/events/testdata/test-repos/simple/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/simple/exp-output-autoplan.txt
@@ -30,17 +30,25 @@ Changes to Outputs:
+ var = "default"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/simple/versions.tf b/server/controllers/events/testdata/test-repos/simple/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/simple/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/main.tf b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/main.tf
index 1af2266d40..0c4b79e3f8 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/main.tf
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/main.tf
@@ -1,4 +1,3 @@
resource "random_id" "dummy" {
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/versions.tf b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir1/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/main.tf b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/main.tf
index 1af2266d40..0c4b79e3f8 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/main.tf
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/main.tf
@@ -1,4 +1,3 @@
resource "random_id" "dummy" {
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/versions.tf b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/dir2/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-autoplan.txt
index 49c4dc2673..1de0174378 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
Show Output
@@ -21,18 +22,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
-
+ ```shell
+ atlantis plan -d dir1
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -54,18 +58,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
-
+ ```shell
+ atlantis plan -d dir2
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -73,7 +80,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy1.txt b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy1.txt
index 45b6c1ed55..8d98fee1d7 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy1.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy1.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
\ No newline at end of file
+ ```shell
+ atlantis plan -d dir1
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy2.txt b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy2.txt
index 7a28ec5e85..e6bef5251a 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy2.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-import-dummy2.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
\ No newline at end of file
+ ```shell
+ atlantis plan -d dir2
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan-again.txt b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan-again.txt
index 49c4dc2673..1de0174378 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan-again.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan-again.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
Show Output
@@ -21,18 +22,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
-
+ ```shell
+ atlantis plan -d dir1
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -54,18 +58,21 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
-
+ ```shell
+ atlantis plan -d dir2
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -73,7 +80,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan.txt b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan.txt
index fb3cfdbbd7..d74495004a 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-plan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
```diff
@@ -14,10 +15,14 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir1
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
+ ```shell
+ atlantis plan -d dir1
+ ```
---
### 2. dir: `dir2` workspace: `default`
@@ -31,17 +36,25 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d dir2
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
+ ```shell
+ atlantis plan -d dir2
+ ```
---
### Plan Summary
2 projects, 0 with changes, 2 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-state-rm-multiple-projects.txt b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-state-rm-multiple-projects.txt
index 3c8e0eb0bb..973455d73c 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-state-rm-multiple-projects.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-multiple-project/exp-output-state-rm-multiple-projects.txt
@@ -2,6 +2,7 @@ Ran State for 2 projects:
1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`
+---
### 1. dir: `dir1` workspace: `default`
```diff
@@ -12,7 +13,9 @@ Successfully removed 1 resource instance(s).
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
+ ```shell
+ atlantis plan -d dir1
+ ```
---
### 2. dir: `dir2` workspace: `default`
@@ -24,6 +27,8 @@ Successfully removed 1 resource instance(s).
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
+ ```shell
+ atlantis plan -d dir2
+ ```
---
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-autoplan.txt
index 077f989d9a..3728b1b223 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-autoplan.txt
@@ -17,7 +17,6 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
# random_id.for_each["default"] will be created
@@ -28,7 +27,6 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
# random_id.simple will be created
@@ -39,22 +37,29 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 3 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
+ ```shell
+ atlantis plan -d .
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-count.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-count.txt
index d7957913db..32680f595f 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-count.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-count.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-foreach.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-foreach.txt
index 284c8e2457..982e937496 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-foreach.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-foreach.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-simple.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-simple.txt
index 1f17baa2d7..be74444839 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-simple.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-import-simple.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan-again.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan-again.txt
index edb4c17579..288ee1df89 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan-again.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan-again.txt
@@ -17,7 +17,6 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
# random_id.for_each["overridden"] will be created
@@ -28,7 +27,6 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
# random_id.simple will be created
@@ -39,22 +37,29 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 3 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=overridden`
-
+ ```shell
+ atlantis plan -d . -- -var var=overridden
+ ```
Plan: 3 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan.txt
index 46a378158b..379d9e8ce7 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-plan.txt
@@ -8,13 +8,21 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d .
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=overridden`
+ ```shell
+ atlantis plan -d . -- -var var=overridden
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-foreach.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-foreach.txt
index 264b5f2881..a6f0f97cce 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-foreach.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-foreach.txt
@@ -8,4 +8,6 @@ Successfully removed 1 resource instance(s).
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-multiple.txt b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-multiple.txt
index a0d1b54717..0848fc65e8 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-multiple.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/exp-output-state-rm-multiple.txt
@@ -9,4 +9,6 @@ Successfully removed 2 resource instance(s).
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
\ No newline at end of file
+ ```shell
+ atlantis plan -d .
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/main.tf b/server/controllers/events/testdata/test-repos/state-rm-single-project/main.tf
index d434ac8645..05e52a00b2 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-single-project/main.tf
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/main.tf
@@ -1,17 +1,14 @@
resource "random_id" "simple" {
- keepers = {}
byte_length = 1
}
resource "random_id" "for_each" {
for_each = toset([var.var])
- keepers = {}
byte_length = 1
}
resource "random_id" "count" {
count = 1
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-single-project/versions.tf b/server/controllers/events/testdata/test-repos/state-rm-single-project/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/state-rm-single-project/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/main.tf b/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/main.tf
index 353cb66e31..3056320d04 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/main.tf
+++ b/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/main.tf
@@ -1,7 +1,6 @@
resource "random_id" "dummy1" {
count = terraform.workspace == "ops" ? 1 : 0
- keepers = {}
byte_length = 1
}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/versions.tf b/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/versions.tf
new file mode 100644
index 0000000000..2c49bb6727
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/state-rm-workspace/dir1/versions.tf
@@ -0,0 +1,9 @@
+provider "random" {}
+terraform {
+ required_providers {
+ random = {
+ source = "hashicorp/random"
+ version = "3.6.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-import-dummy1.txt b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-import-dummy1.txt
index a6a1dbbfaa..b81ff32704 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-import-dummy1.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-import-dummy1.txt
@@ -15,4 +15,6 @@ your Terraform state and will henceforth be managed by Terraform.
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
\ No newline at end of file
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan-again.txt b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan-again.txt
index b24ee90b20..632b3cf24c 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan-again.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan-again.txt
@@ -17,22 +17,29 @@ Terraform will perform the following actions:
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
- + keepers = {}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p dir1-ops`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p dir1-ops
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
-
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
diff --git a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan.txt b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan.txt
index 4c73caa512..3beeb14cab 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-plan.txt
@@ -10,13 +10,21 @@ and found no differences, so no changes are needed.
```
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p dir1-ops`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p dir1-ops
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-state-rm-dummy1.txt b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-state-rm-dummy1.txt
index 5aa99db217..8c63577a49 100644
--- a/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-state-rm-dummy1.txt
+++ b/server/controllers/events/testdata/test-repos/state-rm-workspace/exp-output-state-rm-dummy1.txt
@@ -8,4 +8,6 @@ Successfully removed 1 resource instance(s).
:put_litter_in_its_place: A plan file was discarded. Re-plan would be required before applying.
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p dir1-ops`
\ No newline at end of file
+ ```shell
+ atlantis plan -p dir1-ops
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt b/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt
index 20be38a244..cf3378bc59 100644
--- a/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt
+++ b/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt
@@ -20,17 +20,25 @@ Changes to Outputs:
+ var = "default"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p default`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p default
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p default`
-
+ ```shell
+ atlantis plan -p default
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt b/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt
index e34c9bc2dd..efad85de0e 100644
--- a/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt
+++ b/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt
@@ -20,17 +20,25 @@ Changes to Outputs:
+ var = "staging"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p staging`
-
+ ```shell
+ atlantis plan -p staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/versions.tf b/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/tfvars-yaml-no-autoplan/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/tfvars-yaml/exp-output-autoplan.txt b/server/controllers/events/testdata/test-repos/tfvars-yaml/exp-output-autoplan.txt
index 82ce193d9f..75c4320f96 100644
--- a/server/controllers/events/testdata/test-repos/tfvars-yaml/exp-output-autoplan.txt
+++ b/server/controllers/events/testdata/test-repos/tfvars-yaml/exp-output-autoplan.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. project: `default` dir: `.` workspace: `default`
1. project: `staging` dir: `.` workspace: `default`
+---
### 1. project: `default` dir: `.` workspace: `default`
Show Output
@@ -26,13 +27,17 @@ Changes to Outputs:
workspace=default
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p default`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p default
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p default`
-
+ ```shell
+ atlantis plan -p default
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -57,13 +62,17 @@ Changes to Outputs:
+ var = "staging"
+ workspace = "default"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -p staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p staging`
-
+ ```shell
+ atlantis plan -p staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -71,7 +80,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/tfvars-yaml/versions.tf b/server/controllers/events/testdata/test-repos/tfvars-yaml/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/tfvars-yaml/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt
index cd4e8e0b95..986241f599 100644
--- a/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt
+++ b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `production` workspace: `production`
1. dir: `staging` workspace: `staging`
+---
### 1. dir: `production` workspace: `production`
Show Output
@@ -23,13 +24,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "production"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production -w production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d production -w production
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production -w production`
-
+ ```shell
+ atlantis plan -d production -w production
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -53,13 +58,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d staging -w staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging -w staging`
-
+ ```shell
+ atlantis plan -d staging -w staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -67,7 +76,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt
index cd4e8e0b95..986241f599 100644
--- a/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt
+++ b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt
@@ -2,6 +2,7 @@ Ran Plan for 2 projects:
1. dir: `production` workspace: `production`
1. dir: `staging` workspace: `staging`
+---
### 1. dir: `production` workspace: `production`
Show Output
@@ -23,13 +24,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "production"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production -w production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d production -w production
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production -w production`
-
+ ```shell
+ atlantis plan -d production -w production
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -53,13 +58,17 @@ Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ workspace = "staging"
```
+
* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
+ ```shell
+ atlantis apply -d staging -w staging
+ ```
+* :put_litter_in_its_place: To **delete** this plan and lock, click [here](lock-url)
* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging -w staging`
-
+ ```shell
+ atlantis plan -d staging -w staging
+ ```
Plan: 1 to add, 0 to change, 0 to destroy.
---
@@ -67,7 +76,11 @@ Plan: 1 to add, 0 to change, 0 to destroy.
2 projects, 2 with changes, 0 with no changes, 0 failed
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To **delete** all plans and locks for the PR, comment:
- * `atlantis unlock`
\ No newline at end of file
+* :fast_forward: To **apply** all unapplied plans from this Pull Request, comment:
+ ```shell
+ atlantis apply
+ ```
+* :put_litter_in_its_place: To **delete** all plans and locks from this Pull Request, comment:
+ ```shell
+ atlantis unlock
+ ```
\ No newline at end of file
diff --git a/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/production/versions.tf b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/production/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/production/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/staging/versions.tf b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/staging/versions.tf
new file mode 100644
index 0000000000..96a68f8056
--- /dev/null
+++ b/server/controllers/events/testdata/test-repos/workspace-parallel-yaml/staging/versions.tf
@@ -0,0 +1,8 @@
+terraform {
+ required_providers {
+ null = {
+ source = "hashicorp/null"
+ version = "= 3.2.2"
+ }
+ }
+}
diff --git a/server/controllers/github_app_controller.go b/server/controllers/github_app_controller.go
index 5ac08d00fa..823c82928e 100644
--- a/server/controllers/github_app_controller.go
+++ b/server/controllers/github_app_controller.go
@@ -6,7 +6,7 @@ import (
"net/http"
"net/url"
- "github.com/runatlantis/atlantis/server/controllers/templates"
+ "github.com/runatlantis/atlantis/server/controllers/web_templates"
"github.com/runatlantis/atlantis/server/events/vcs"
"github.com/runatlantis/atlantis/server/logging"
)
@@ -70,7 +70,7 @@ func (g *GithubAppController) ExchangeCode(w http.ResponseWriter, r *http.Reques
g.Logger.Debug("Found credentials for GitHub app %q with id %d", app.Name, app.ID)
- err = templates.GithubAppSetupTemplate.Execute(w, templates.GithubSetupData{
+ err = web_templates.GithubAppSetupTemplate.Execute(w, web_templates.GithubSetupData{
Target: "",
Manifest: "",
ID: app.ID,
@@ -142,7 +142,7 @@ func (g *GithubAppController) New(w http.ResponseWriter, _ *http.Request) {
return
}
- err = templates.GithubAppSetupTemplate.Execute(w, templates.GithubSetupData{
+ err = web_templates.GithubAppSetupTemplate.Execute(w, web_templates.GithubSetupData{
Target: url.String(),
Manifest: string(jsonManifest),
})
diff --git a/server/controllers/jobs_controller.go b/server/controllers/jobs_controller.go
index 0363977944..bb38a05e44 100644
--- a/server/controllers/jobs_controller.go
+++ b/server/controllers/jobs_controller.go
@@ -6,7 +6,7 @@ import (
"net/url"
"github.com/gorilla/mux"
- "github.com/runatlantis/atlantis/server/controllers/templates"
+ "github.com/runatlantis/atlantis/server/controllers/web_templates"
"github.com/runatlantis/atlantis/server/controllers/websocket"
"github.com/runatlantis/atlantis/server/core/locking"
"github.com/runatlantis/atlantis/server/logging"
@@ -29,8 +29,8 @@ type JobsController struct {
AtlantisVersion string
AtlantisURL *url.URL
Logger logging.SimpleLogging
- ProjectJobsTemplate templates.TemplateWriter
- ProjectJobsErrorTemplate templates.TemplateWriter
+ ProjectJobsTemplate web_templates.TemplateWriter
+ ProjectJobsErrorTemplate web_templates.TemplateWriter
Backend locking.Backend
WsMux *websocket.Multiplexor
KeyGenerator JobIDKeyGenerator
@@ -45,7 +45,7 @@ func (j *JobsController) getProjectJobs(w http.ResponseWriter, r *http.Request)
return err
}
- viewData := templates.ProjectJobData{
+ viewData := web_templates.ProjectJobData{
AtlantisVersion: j.AtlantisVersion,
ProjectPath: jobID,
CleanedBasePath: j.AtlantisURL.Path,
diff --git a/server/controllers/locks_controller.go b/server/controllers/locks_controller.go
index bab7fad27a..27b330c8b3 100644
--- a/server/controllers/locks_controller.go
+++ b/server/controllers/locks_controller.go
@@ -5,7 +5,7 @@ import (
"net/http"
"net/url"
- "github.com/runatlantis/atlantis/server/controllers/templates"
+ "github.com/runatlantis/atlantis/server/controllers/web_templates"
"github.com/gorilla/mux"
"github.com/runatlantis/atlantis/server/core/locking"
@@ -23,7 +23,7 @@ type LocksController struct {
Logger logging.SimpleLogging
ApplyLocker locking.ApplyLocker
VCSClient vcs.Client
- LockDetailTemplate templates.TemplateWriter
+ LockDetailTemplate web_templates.TemplateWriter
WorkingDir events.WorkingDir
WorkingDirLocker events.WorkingDirLocker
Backend locking.Backend
@@ -73,12 +73,12 @@ func (l *LocksController) GetLock(w http.ResponseWriter, r *http.Request) {
return
}
if lock == nil {
- l.respond(w, logging.Info, http.StatusNotFound, "No lock found at id %q", idUnencoded)
+ l.respond(w, logging.Info, http.StatusNotFound, "No lock found at id '%s'", idUnencoded)
return
}
owner, repo := models.SplitRepoFullName(lock.Project.RepoFullName)
- viewData := templates.LockDetailData{
+ viewData := web_templates.LockDetailData{
LockKeyEncoded: id,
LockKey: idUnencoded,
PullRequestLink: lock.Pull.URL,
@@ -107,18 +107,18 @@ func (l *LocksController) DeleteLock(w http.ResponseWriter, r *http.Request) {
idUnencoded, err := url.PathUnescape(id)
if err != nil {
- l.respond(w, logging.Warn, http.StatusBadRequest, "Invalid lock id %q. Failed with error: %s", id, err)
+ l.respond(w, logging.Warn, http.StatusBadRequest, "Invalid lock id '%s'. Failed with error: '%s'", id, err)
return
}
- lock, err := l.DeleteLockCommand.DeleteLock(idUnencoded)
+ lock, err := l.DeleteLockCommand.DeleteLock(l.Logger, idUnencoded)
if err != nil {
- l.respond(w, logging.Error, http.StatusInternalServerError, "deleting lock failed with: %s", err)
+ l.respond(w, logging.Error, http.StatusInternalServerError, "deleting lock failed with: '%s'", err)
return
}
if lock == nil {
- l.respond(w, logging.Info, http.StatusNotFound, "No lock found at id %q", idUnencoded)
+ l.respond(w, logging.Info, http.StatusNotFound, "No lock found at id '%s'", idUnencoded)
return
}
@@ -139,7 +139,7 @@ func (l *LocksController) DeleteLock(w http.ResponseWriter, r *http.Request) {
} else {
l.Logger.Debug("skipping commenting on pull request and deleting workspace because BaseRepo field is empty")
}
- l.respond(w, logging.Info, http.StatusOK, "Deleted lock id %q", id)
+ l.respond(w, logging.Info, http.StatusOK, "Deleted lock id '%s'", id)
}
// respond is a helper function to respond and log the response. lvl is the log
diff --git a/server/controllers/locks_controller_test.go b/server/controllers/locks_controller_test.go
index 0f80e7c1f7..d878b34e33 100644
--- a/server/controllers/locks_controller_test.go
+++ b/server/controllers/locks_controller_test.go
@@ -11,8 +11,8 @@ import (
"time"
"github.com/runatlantis/atlantis/server/controllers"
- "github.com/runatlantis/atlantis/server/controllers/templates"
- tMocks "github.com/runatlantis/atlantis/server/controllers/templates/mocks"
+ "github.com/runatlantis/atlantis/server/controllers/web_templates"
+ tMocks "github.com/runatlantis/atlantis/server/controllers/web_templates/mocks"
"github.com/runatlantis/atlantis/server/core/db"
"github.com/runatlantis/atlantis/server/core/locking"
@@ -159,7 +159,7 @@ func TestGetLock_None(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.GetLock(w, req)
- ResponseContains(t, w, http.StatusNotFound, "No lock found at id \"id\"")
+ ResponseContains(t, w, http.StatusNotFound, "No lock found at id 'id'")
}
func TestGetLock_Success(t *testing.T) {
@@ -185,7 +185,7 @@ func TestGetLock_Success(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.GetLock(w, req)
- tmpl.VerifyWasCalledOnce().Execute(w, templates.LockDetailData{
+ tmpl.VerifyWasCalledOnce().Execute(w, web_templates.LockDetailData{
LockKeyEncoded: "id",
LockKey: "id",
RepoOwner: "owner",
@@ -215,14 +215,14 @@ func TestDeleteLock_InvalidLockID(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "%A@"})
w := httptest.NewRecorder()
lc.DeleteLock(w, req)
- ResponseContains(t, w, http.StatusBadRequest, "Invalid lock id \"%A@\"")
+ ResponseContains(t, w, http.StatusBadRequest, "Invalid lock id '%A@'")
}
func TestDeleteLock_LockerErr(t *testing.T) {
t.Log("If there is an error retrieving the lock, a 500 is returned")
RegisterMockTestingT(t)
dlc := mocks2.NewMockDeleteLockCommand()
- When(dlc.DeleteLock("id")).ThenReturn(nil, errors.New("err"))
+ When(dlc.DeleteLock(Any[logging.SimpleLogging](), Eq("id"))).ThenReturn(nil, errors.New("err"))
lc := controllers.LocksController{
DeleteLockCommand: dlc,
Logger: logging.NewNoopLogger(t),
@@ -238,7 +238,7 @@ func TestDeleteLock_None(t *testing.T) {
t.Log("If there is no lock at that ID we get a 404")
RegisterMockTestingT(t)
dlc := mocks2.NewMockDeleteLockCommand()
- When(dlc.DeleteLock("id")).ThenReturn(nil, nil)
+ When(dlc.DeleteLock(Any[logging.SimpleLogging](), Eq("id"))).ThenReturn(nil, nil)
lc := controllers.LocksController{
DeleteLockCommand: dlc,
Logger: logging.NewNoopLogger(t),
@@ -247,7 +247,7 @@ func TestDeleteLock_None(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.DeleteLock(w, req)
- ResponseContains(t, w, http.StatusNotFound, "No lock found at id \"id\"")
+ ResponseContains(t, w, http.StatusNotFound, "No lock found at id 'id'")
}
func TestDeleteLock_OldFormat(t *testing.T) {
@@ -255,7 +255,7 @@ func TestDeleteLock_OldFormat(t *testing.T) {
RegisterMockTestingT(t)
cp := vcsmocks.NewMockClient()
dlc := mocks2.NewMockDeleteLockCommand()
- When(dlc.DeleteLock("id")).ThenReturn(&models.ProjectLock{}, nil)
+ When(dlc.DeleteLock(Any[logging.SimpleLogging](), Eq("id"))).ThenReturn(&models.ProjectLock{}, nil)
lc := controllers.LocksController{
DeleteLockCommand: dlc,
Logger: logging.NewNoopLogger(t),
@@ -265,7 +265,7 @@ func TestDeleteLock_OldFormat(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.DeleteLock(w, req)
- ResponseContains(t, w, http.StatusOK, "Deleted lock id \"id\"")
+ ResponseContains(t, w, http.StatusOK, "Deleted lock id 'id'")
cp.VerifyWasCalled(Never()).CreateComment(Any[logging.SimpleLogging](), Any[models.Repo](), Any[int](), Any[string](), Any[string]())
}
@@ -284,7 +284,7 @@ func TestDeleteLock_UpdateProjectStatus(t *testing.T) {
pull := models.PullRequest{
BaseRepo: models.Repo{FullName: repoName},
}
- When(l.DeleteLock("id")).ThenReturn(&models.ProjectLock{
+ When(l.DeleteLock(Any[logging.SimpleLogging](), Eq("id"))).ThenReturn(&models.ProjectLock{
Pull: pull,
Workspace: workspaceName,
Project: models.Project{
@@ -321,7 +321,7 @@ func TestDeleteLock_UpdateProjectStatus(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.DeleteLock(w, req)
- ResponseContains(t, w, http.StatusOK, "Deleted lock id \"id\"")
+ ResponseContains(t, w, http.StatusOK, "Deleted lock id 'id'")
status, err := backend.GetPullStatus(pull)
Ok(t, err)
Assert(t, status.Projects != nil, "status projects was nil")
@@ -338,7 +338,7 @@ func TestDeleteLock_CommentFailed(t *testing.T) {
t.Log("If the commenting fails we still return success")
RegisterMockTestingT(t)
dlc := mocks2.NewMockDeleteLockCommand()
- When(dlc.DeleteLock("id")).ThenReturn(&models.ProjectLock{
+ When(dlc.DeleteLock(Any[logging.SimpleLogging](), Eq("id"))).ThenReturn(&models.ProjectLock{
Pull: models.PullRequest{
BaseRepo: models.Repo{FullName: "owner/repo"},
},
@@ -363,7 +363,7 @@ func TestDeleteLock_CommentFailed(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.DeleteLock(w, req)
- ResponseContains(t, w, http.StatusOK, "Deleted lock id \"id\"")
+ ResponseContains(t, w, http.StatusOK, "Deleted lock id 'id'")
}
func TestDeleteLock_CommentSuccess(t *testing.T) {
@@ -380,7 +380,7 @@ func TestDeleteLock_CommentSuccess(t *testing.T) {
pull := models.PullRequest{
BaseRepo: models.Repo{FullName: "owner/repo"},
}
- When(dlc.DeleteLock("id")).ThenReturn(&models.ProjectLock{
+ When(dlc.DeleteLock(Any[logging.SimpleLogging](), Eq("id"))).ThenReturn(&models.ProjectLock{
Pull: pull,
Workspace: "workspace",
Project: models.Project{
@@ -400,7 +400,7 @@ func TestDeleteLock_CommentSuccess(t *testing.T) {
req = mux.SetURLVars(req, map[string]string{"id": "id"})
w := httptest.NewRecorder()
lc.DeleteLock(w, req)
- ResponseContains(t, w, http.StatusOK, "Deleted lock id \"id\"")
+ ResponseContains(t, w, http.StatusOK, "Deleted lock id 'id'")
cp.VerifyWasCalled(Once()).CreateComment(Any[logging.SimpleLogging](), Eq(pull.BaseRepo), Eq(pull.Num),
Eq("**Warning**: The plan for dir: `path` workspace: `workspace` was **discarded** via the Atlantis UI.\n\n"+
"To `apply` this plan you must run `plan` again."), Eq(""))
diff --git a/server/controllers/templates/web_templates.go b/server/controllers/templates/web_templates.go
deleted file mode 100644
index 01bbc2faac..0000000000
--- a/server/controllers/templates/web_templates.go
+++ /dev/null
@@ -1,695 +0,0 @@
-// Copyright 2017 HootSuite Media Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// Modified hereafter by contributors to runatlantis/atlantis.
-
-package templates
-
-import (
- "html/template"
- "io"
- "time"
-
- "github.com/runatlantis/atlantis/server/jobs"
-)
-
-//go:generate pegomock generate --package mocks -o mocks/mock_template_writer.go TemplateWriter
-
-// TemplateWriter is an interface over html/template that's used to enable
-// mocking.
-type TemplateWriter interface {
- // Execute applies a parsed template to the specified data object,
- // writing the output to wr.
- Execute(wr io.Writer, data interface{}) error
-}
-
-// LockIndexData holds the fields needed to display the index view for locks.
-type LockIndexData struct {
- LockPath string
- RepoFullName string
- PullNum int
- Path string
- Workspace string
- LockedBy string
- Time time.Time
- TimeFormatted string
-}
-
-// ApplyLockData holds the fields to display in the index view
-type ApplyLockData struct {
- Locked bool
- GlobalApplyLockEnabled bool
- Time time.Time
- TimeFormatted string
-}
-
-// IndexData holds the data for rendering the index page
-type IndexData struct {
- Locks []LockIndexData
- PullToJobMapping []jobs.PullInfoWithJobIDs
-
- ApplyLock ApplyLockData
- AtlantisVersion string
- // CleanedBasePath is the path Atlantis is accessible at externally. If
- // not using a path-based proxy, this will be an empty string. Never ends
- // in a '/' (hence "cleaned").
- CleanedBasePath string
-}
-
-var IndexTemplate = template.Must(template.New("index.html.tmpl").Parse(`
-
-
-
-
- atlantis
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
atlantis
-
Plan discarded and unlocked!
-
-
- {{ if .ApplyLock.GlobalApplyLockEnabled }}
- {{ if .ApplyLock.Locked }}
-
- {{ if .Target }}
- Create a github app
- {{ else }}
- Github app created successfully!
- {{ end }}
-
-
-
- {{ if .Target }}
-
- {{ else }}
-
Visit {{ .URL }}/installations/new to install the app for your user or organization, then update the following values in your config and restart Atlantis:
-
-
-
gh-app-id:
{{ .ID }}
-
gh-app-key-file:
{{ .Key }}
-
gh-webhook-secret:
{{ .WebhookSecret }}
-
- {{ end }}
-
-
-
-
-`))
diff --git a/server/controllers/templates/mocks/mock_template_writer.go b/server/controllers/web_templates/mocks/mock_template_writer.go
similarity index 97%
rename from server/controllers/templates/mocks/mock_template_writer.go
rename to server/controllers/web_templates/mocks/mock_template_writer.go
index e3fafa580c..5d3e33a2ef 100644
--- a/server/controllers/templates/mocks/mock_template_writer.go
+++ b/server/controllers/web_templates/mocks/mock_template_writer.go
@@ -1,5 +1,5 @@
// Code generated by pegomock. DO NOT EDIT.
-// Source: github.com/runatlantis/atlantis/server/controllers/templates (interfaces: TemplateWriter)
+// Source: github.com/runatlantis/atlantis/server/controllers/web_templates (interfaces: TemplateWriter)
package mocks
diff --git a/server/controllers/web_templates/templates/github-app.html.tmpl b/server/controllers/web_templates/templates/github-app.html.tmpl
new file mode 100644
index 0000000000..34ce01550d
--- /dev/null
+++ b/server/controllers/web_templates/templates/github-app.html.tmpl
@@ -0,0 +1,81 @@
+
+
+
+
+ atlantis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
atlantis
+
+
+ {{ if .Target }}
+ Create a github app
+ {{ else }}
+ Github app created successfully!
+ {{ end }}
+
+
+
+ {{ if .Target }}
+
+ {{ else }}
+
Visit {{ .URL }}/installations/new to install the app for your user or organization, then update the following values in your config and restart Atlantis: