Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nitrocode opened this issue Jul 31, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@nitrocode
Copy link
Member

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

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://<bucket-name>/<component workspace key prefix>/<component name>/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"
@osterman
Copy link
Member

osterman commented Aug 1, 2022

@nitrocode maybe this is a good feature to prototype with atmos custom CLI commands?

#168

I don't think we can implement this in atmos core because it assumes (a) using our tfstate backend (b) using S3 (c) using AWS. Atmos needs to be cloud agnostic.

@osterman
Copy link
Member

osterman commented Aug 1, 2022

Maybe this relates to @Gowiem's request: #178

@osterman osterman added the enhancement New feature or request label Nov 23, 2022
@osterman osterman moved this to In Progress in Atmos Development Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

2 participants