# Atmos Terraform Apply (Deprecated)

:::warning Deprecated
This GitHub Action is deprecated. New projects should use [native CI integration](/ci) — `atmos terraform apply` (or `atmos terraform deploy`, which adds drift verification) handles planfile retrieval, semantic diff, and CI artifacts directly without a wrapper action.
:::

Simplify provisioning Terraform entirely from within GitHub Action workflows. This action makes it very easy to apply that changes from a `terraform plan` from directly within the GitHub UI. Use this action in your workflows to apply changes to your infrastructure.

Given any component and stack in an Atmos supported infrastructure environment, [`github-action-atmos-terraform-apply`](https://github.com/cloudposse/github-action-atmos-terraform-apply) will retrieve an existing Terraform [planfile](https://developer.hashicorp.com/terraform/tutorials/automation/automate-terraform) from a given S3 bucket using metadata stored inside a DynamoDB table, run `atmos terraform apply` with that planfile, and format the Terraform Apply result as part of a [GitHub Workflow Job Summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/).

This action is intended to be used together with [Atmos Terraform Plan](/deprecated/github-actions/atmos-terraform-plan), as well as integrated into drift detection with [Atmos Terraform Detection and Remediation](/deprecated/github-actions/atmos-terraform-drift-detection) GitHub Actions.

## Features

This GitHub Action incorporates superior GitOps support for Terraform by utilizing the capabilities of Atmos, enabling efficient management of large enterprise-scale environments.

- **Implements Native GitOps** with Atmos and Terraform tightly integrated with GitHub UI
- **No hardcoded credentials.** Use GitHub OIDC to assume roles.
- **Compatible with GitHub Cloud & Self-hosted Runners** for maximum flexibility.
- **Beautiful Job Summaries** don't clutter up pull requests with noisy GitHub comments
- **100% Open Source with Permissive APACHE2 License** means there are no expensive subscriptions or long-term commitments.

## Screenshots

In the following screenshot, we see a successful "apply" Job Summary report. The report utilizes badges to clearly indicate success or failure. Unnecessary details are neatly hidden behind a collapsible `<details/>` block, providing a streamlined view. Additionally, a direct link is provided to view the job run, eliminating the need for developers to search for information about any potential issues.

![Example Image](/img/github-actions/apply.png)

## Usage Example

In this example, the action is triggered when certain events occur, such as a manual workflow dispatch or the opening, synchronization, or reopening of a pull request, specifically on the main branch. It specifies specific permissions related to assuming roles in AWS. Within the "apply" job, the "component" and "stack" are hardcoded (`foobar` and `plat-ue2-sandbox`). In practice, these are usually derived from another action.

:::tip Passing Affected Stacks

We recommend combining this action with the [`affected-stacks`](/deprecated/github-actions/affected-stacks) GitHub Action inside a matrix to apply all affected stacks in parallel.

:::

:::info Why Do We have Two Workflows?

GitHub Actions support 256 matrix jobs in a single workflow at most! When planning all stacks in an Atmos environment, we frequently plan more than 256 component in the stacks at a time. In order to work around this limitation by GitHub, we can add an additional layer of abstraction using reusable workflows.

[256 Matrix Limitation](/deprecated/github-actions/atmos-terraform-drift-detection#256-matrix-limitation)

:::

## Requirements

This action has the requirements as [GitHub Actions](/deprecated/github-actions/). Use the same S3 Bucket, DynamoDB table, IAM Roles and config described there.
