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

add -dump flag and Dump() method. #203

Merged
merged 1 commit into from
Sep 3, 2024
Merged

add -dump flag and Dump() method. #203

merged 1 commit into from
Sep 3, 2024

Conversation

fujiwara
Copy link
Owner

@fujiwara fujiwara commented Sep 3, 2024

This PR adds the -dump option and the tfstate.Dump() method. Dump all resources, outputs, and data sources in tfstate.

$ tfstate-lookup -dump

The output is a JSON object. The keys are the address of the resource, output, or data source. The values are the same as the lookup result.

{
  "aws_vpc.main": {
    "arn": "arn:aws:ec2:ap-northeast-1:123456789012:vpc/vpc-1a2b3c4d",
    "assign_generated_ipv6_cidr_block": false,
    // ...
  },
  "data.aws_ami.foo": {
    "arn": "arn:aws:ec2:ap-northeast-1:123456789012:ami/ami-1a2b3c4d",
    // ...
  },
  "output.foo": "bar",
  // ...
}

@fujiwara fujiwara merged commit e4d0ed4 into main Sep 3, 2024
4 checks passed
@fujiwara fujiwara deleted the dump branch September 3, 2024 06:22
fujiwara added a commit that referenced this pull request Sep 3, 2024
@fujiwara fujiwara mentioned this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant