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

http data source #11552

Closed
elreydetoda opened this issue Feb 6, 2022 · 7 comments · Fixed by #11658
Closed

http data source #11552

elreydetoda opened this issue Feb 6, 2022 · 7 comments · Fixed by #11658

Comments

@elreydetoda
Copy link

Description

Similar to Terraform's http data source, it would be handy to have an http data source inside of the HCL for packer.

Use Case(s)

Ideally you'd be able to query API endpionts and other things with it, allowing your HCL to dynamically change based on the API results.

My specific use case is I'd like to submit a template to bento project's CentOS Stream templates, and because they've had issues with things being more dynamic with the stream update it's been hard to have something consistently work. We already worked up stream once to try and get a more "official" solution, but it has broken again with the stream 9 build.

Potential configuration

same as the terraform one

data "http" "example" {
  url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"

  # Optional request headers
  request_headers = {
    Accept = "application/json"
  }
}

Potential References

@nywilken
Copy link
Contributor

nywilken commented Feb 8, 2022

Thanks for opening up this feature request. This seems like a good datasource to have. I don't think this is something that we would be able to get to any time soon. But we will gladly review a PR if you were interested in adding the feature.

I'm going to label this as a help-wanted issue in case other members of the community are also interested in help out.

@teddylear
Copy link
Contributor

I can try to take a look at this

@teddylear
Copy link
Contributor

@nywilken Created PR. Please let me know if I should change anything, looks like it's pending a vercel deployment. Thanks!

@s-fuj
Copy link

s-fuj commented May 4, 2022

@teddylear may i know if you are still working on this request? I really want to have this new feature as my packer script is waiting for it.

@teddylear
Copy link
Contributor

teddylear commented May 4, 2022

@s-fuj Yup, still working on issue. Unfortunately I'm still waiting on maintainers to trigger CI build and leave any feedback. @nywilken Any update on triggering CI builds?

Edit: Specifically the markdown file checks

@elreydetoda
Copy link
Author

Thank you @teddylear for the contribution! I wish I could've been more help, but I've never done golang before 😅

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants