Skip to content

Conversation

@JFryy
Copy link
Owner

@JFryy JFryy commented Jan 16, 2025

Description

🚀 **Issue: #26

Resolves issue of HCL output to correct format valid terraform to output terraform. The objects are decoded identically as prior:

$ qq tests/test.tf -o json
...
  "resource": {
    "aws_instance": {
      "example": [
        {
          "ami": "${data.aws_ami.latest_amazon_linux.id}",
          "instance_type": "${var.instance_type}",
          "tags": {
            "Name": "ExampleInstance"
          }
        }
      ]
    }
  }
}

But now we properly processed to be a HCL valid format on output:

$ bin/qq tests/test.tf -o tf
output {
  instance_id {
    description = "The ID of the AWS EC2 instance"
    value       = "$${aws_instance.example.id}"
  }
  instance_public_ip {
    description = "The public IP address of the AWS EC2 instance"
    value       = "$${aws_instance.example.public_ip}"
  }
}
resource {
  aws_instance {
    example {
      tags {
        Name = "ExampleInstance"
      }
      ami           = "$${data.aws_ami.latest_amazon_linux.id}"
      instance_type = "$${var.instance_type}"
    }
  }
}
...

Changes

  • 🛠️ Code Changes

    • Implemented feature
    • Fixed bug
    • Refactored component
    • Updated documentation
  • 🐛 Testing

    • [] Added unit tests for new functionality
    • [] Updated existing tests to reflect changes
    • Ran all tests locally
  • 📄 Documentation

    • Updated README or documentation files as needed

Additional Notes

@JFryy JFryy merged commit 5ce1010 into main Jan 16, 2025
1 check passed
@JFryy JFryy deleted the hcl-format-output-fix branch January 16, 2025 21:27
@JFryy JFryy mentioned this pull request Jan 16, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 26, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [JFryy/qq](https://github.com/JFryy/qq) | patch | `v0.2.3` -> `v0.2.4` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>JFryy/qq (JFryy/qq)</summary>

### [`v0.2.4`](https://github.com/JFryy/qq/releases/tag/v0.2.4)

[Compare Source](JFryy/qq@v0.2.3...v0.2.4)

#### What's Changed

-   Add HCL Format Output Fix by [@&#8203;JFryy](https://github.com/JFryy) in JFryy/qq#27
    **Full Changelog**: JFryy/qq@v0.2.3...v0.2.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjIuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEyMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.

2 participants