-
Notifications
You must be signed in to change notification settings - Fork 107
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
Create a datasource for URL documents #26
Comments
Have a look at the "file" function of terraform.
|
Hi @sebastianhutter thanks for the tip! I guess that helps keep everything idempotent if someone pastes a url from What I had envisioned was being able to set the desired version number in variables, interpolate the URL and load from there. It's a power tool, and sometimes power tools chop off fingers... 🤪 |
I like power tools ;-) You can do that with terraform natively though. There is a"HTTP" datasource which downloads a file from an URL and which you can then feed into your resources:
(untested) Keeping the tasks separate allows the terraform plugins to remain small and efficient - it also allows terraform to manage dependencies properly - so if the download of the file fails the resource wont be created etc. |
ln case there're multiple configs in the manifest.yaml,
|
This wouldn't work then with kubectl_manifest which as per docu should be used with
This is the error you'd get due to file not being available 'yet':
I haven't found a workaround yet.. |
@pduchnovsky as the error says, this error can be fixed by
See more at https://www.hashicorp.com/blog/resource-targeting-in-terraform. |
If you use terraform cloud as we do for fully automated deployment this is not possible though. |
ah, not sure how your deployment process works. In my imagination, maybe run this command in |
terraform cloud performs changes on environment automatically based on commits to monitored repository, also they do not allow terraform apply on remote backend therefore this workaround wouldn't be viable. |
@sebastianhutter you need |
I know this thread is a few months old but being able to apply a single URL yaml file with multiple configs would be really useful to have as a built-in feature. For example I wanted to |
I tried using the |
I too am seeing a similar issue - in my case, the YAML documents are generated by Rancher on a per-cluster basis, so using static ones isn't an option as there is still a dependency on the |
I managed to make it work like this, if anyone is interested.
|
With the latest http provider use: |
|
It would be useful to have a datasource that could pull documents from the internet. So instead of having 1,000 lines of YAML embedded in the
.tf
, just provide the URL to the YAML and voila!The text was updated successfully, but these errors were encountered: