cloudposse / cloudposse/atmos

Fast outputs of components by reading remote state directly without `terraform output`

Open
#180 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
1.4k
Forks
175
Avg merge
2d 3h
Merged PRs (30d)
134

Description

Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Feature

The current way to get component outputs is to use this method

```
atmos terraform outputs eks --stack ue2-sandbox
```

which will run the following commands

```
atmos generate backend
terraform init -reconfigure
terraform output
```

This can take a long time and atmos already knows the s3 bucket, the s3 bucket key, and the workspace

A faster method could be used for `atmos terraform stack outputs` or something where it simply does the following

```
aws s3 cp s3://///terraform.tfstate - | jq .outputs
```

```
{
"transit_gateway_arn": {
"value": "arn:aws:ec2:us-east-2:snip:transit-gateway/tgw-snip",
"type": "string"
},
"transit_gateway_id": {
"value": "tgw-snip",
"type": "string"
},
"transit_gateway_route_table_id": {
"value": "tgw-rtb-snip",
"type": "string"
}
}
```

or use some jq magic to turn it into this

```
transit_gateway_arn = "arn:aws:ec2:us-east-2:snip:transit-gateway/tgw-snip"
transit_gateway_id = "tgw-snip"
transit_gateway_route_table_id = "tgw-rtb-snip"
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing `atmos terraform outputs eks --stack ue2-sandbox` command and how Atmos obtains the S3 bucket, state key, and workspace. Compare that flow with the proposed `aws s3 cp ... | jq .outputs` approach, then define the command behavior and output format before implementing direct remote-state reads without Terraform initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, terraform
Domain
cli, cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.