terraform-provider-cloudfoundry
terraform-provider-cloudfoundry copied to clipboard
Allow a list of buildpacks
Current configuration allows only a string for a single buildpack. But CF does allow multiple buildpacks to be specified.
The following snippet is used in one of our apps. To allow the following:
- Deploy a NodeJS app
- Install additional packages on the host using
apt-buildpack
---
applications:
- name: multi-buildpack
buildpacks:
- https://github.com/cloudfoundry/apt-buildpack.git#v0.2.2
- nodejs_buildpack
@dwaynebailey i have the same problem.
I checked the code and see that the plugin use the v2 apis and there it was not possible. We have to think of how we can use the v3 api.
Kind regards
@ArthurHlt I will change that with a PR but the question was:
Should everything be switched to CFv3 Api? or should we bring do that in the same way like cf cli
apply multiple build packs?
CF Cli
PUT /v2/apps/<UUID>
PATCH /v3/apps/<UUID>
In the Patch request the other build packs will be assigned like described in the api description. https://v3-apidocs.cloudfoundry.org/version/3.82.0/index.html#update-an-app
Is there a way you prefer?
Kind regards
@HappyTobi thanks for looking at this, kinda got overwhelmed with the code tbh.
I suspect this is quite invasive:
- The assumption that buildpack is singular is quite prevalent (though using
buildpacks
might allow this to happen side by side - I'd guess going all out for v3 might touch too much code and doing the
PUT
,PATCH
like the cli (didn't realise they did that) might be less effort.
We can do as the cli does, do the update on the app to add more buildpacks like official cli still not use v2. We have already prepared all v3 api inside the provider already, this is used for now only for labels and annotations (see params in https://github.com/cloudfoundry-community/terraform-provider-cf/wiki/resource_space for example)
Has this been updated? If so what is the correct syntax for multiple buildpacks ?
Hi there, we are also looking forward to this feature, since we are required to use the datadog-cloudfoundry-buildpack supply buildpack. Are there any updates on this? Or is there a way around this problem?