Skip to content

Test - Infra cost

Test - Infra cost #24

Workflow file for this run

name: "Test - Infra cost"
on:
workflow_dispatch: {}
env:
AWS_REGION: us-east-2
# Permissions required for assuming AWS identity
permissions:
id-token: write
contents: read
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
test:
runs-on: ubuntu-latest
continue-on-error: true
needs: [setup]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Plan Atmos Component
id: current
uses: ./
with:
component: "foobar-changes"
stack: "plat-ue2-sandbox"
component-path: "components/terraform/foobar"
terraform-plan-role: ${{ secrets.TERRAFORM_PLAN_ROLE }}
terraform-state-role: ${{ secrets.TERRAFORM_STATE_ROLE }}
terraform-state-bucket: ${{ secrets.TERRAFORM_STATE_BUCKET }}
terraform-state-table: ${{ secrets.TERRAFORM_STATE_TABLE }}
aws-region: ${{ env.AWS_REGION }}
sha: 55bfef95601890afd80709da39a3ee5e6b4b0d32
enable-infracost: true
infracost-api-key: ${{ secrets.INFRACOST_API_KEY }}
debug: true
outputs:
result: ${{ steps.current.outcome }}
summary: ${{ steps.current.outputs.summary }}
assert:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: nick-fields/assert-action@v1
with:
expected: 'success'
actual: "${{ needs.test.outputs.result }}"
- uses: nick-fields/assert-action@v1
with:
actual: "${{ fromJSON(needs.test.outputs.summary) }}"
expected: |
## Changes Found for `foobar-changes` in `plat-ue2-sandbox`
<a href="https://cloudposse.com/"><img src="https://cloudposse.com/logo-300x69.svg" width="100px" align="right"/></a>
[![create](https://shields.io/badge/PLAN-CREATE-success?style=for-the-badge)](#plat-ue2-sandbox-foobar-changes)
<details><summary><a id="result-plat-ue2-sandbox-foobar-changes" />Plan: 1 to add, 0 to change, 0 to destroy.</summary>
<br/>
To reproduce this locally, run:<br/><br/>
```shell
atmos terraform plan foobar-changes -s plat-ue2-sandbox
```
---
### <a id="create-plat-ue2-sandbox-foobar-changes" />Create
```diff
+ random_id.foo
```
</details>
<details><summary>Terraform <strong>Plan</strong> Summary</summary>
```hcl
# random_id.foo will be created
+ resource "random_id" "foo" {
+ b64_std = (known after apply)
+ b64_url = (known after apply)
+ byte_length = 8
+ dec = (known after apply)
+ hex = (known after apply)
+ id = (known after apply)
+ keepers = {
+ "seed" = "foo-plat-ue2-sandbox-blue"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
```
</details>
<details><summary>Infracost Estimate: monthly cost will not change</summary>
```
──────────────────────────────────
No cloud resources were detected
```
</details>
teardown:
runs-on: ubuntu-latest
needs: [assert]
if: ${{ always() }}
steps:
- name: Tear down
run: echo "Do Tear down"