-
Notifications
You must be signed in to change notification settings - Fork 63
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
ConfigMap as module source #179
Comments
The feature makes sense! Thanks for documenting it. |
I just use Helm. File.Get loop to include all files inside the inline. Therefore we just copied our current TF structure into folder "terraform" inside a chart. This enables normal TF work if you want to (assuming you extend provider.tf with configuration for the real cloud, provider.tf to be include has to be ONLY for aliases, not for the provider configured in crossplane ProviderConfig).
|
Thanks @alkuzad, that sounds like a reasonable alternative. |
this would be extremely beneficial for us as well |
Yes, I would like this to ... or atleast the possibility to have a way of including the TF into the configuration once I build/bundle crossplane into a OCI image (sry I am not sure of the correct terminology here ) |
Since this request started with a kustomize example, another workaround is to use If you have a single # kustomization.yaml
configMapGenerator:
- name: my-terraform-module
files:
- main.tf
replacements:
- source:
fieldPath: data.[main.tf]
kind: ConfigMap
name: my-terraform-module
version: v1
targets:
- fieldPaths:
- spec.forProvider.module
select:
group: tf.upbound.io
kind: Workspace
name: my-terraform-module
version: v1beta1
resources:
- workspace.yaml # workspace.yaml
apiVersion: tf.upbound.io/v1beta1
kind: Workspace
metadata:
name: my-terraform-module
spec:
forProvider:
source: ConfigMap
module: <Kustomize will replace this with the contents of `main.tf`> I'm not entirely sure how you'd do this with multiple files, but maybe there's some way to concatenate those files into a single string with some other generator/transformer? The If there's not a way to combine multiple files, you can have multiple |
What problem are you facing?
My kubernetes cluster does not have network access to my git server.
Concatenating all of the tf files into a single string and using it with
Inline
is my only option today that doesn't try to pull the module source from a system outside kubernetes (unless I host tar.gz-d modules in-cluster).How could Official Terraform Provider help solve your problem?
A more kubernetes-native way would be to support terraform modules stored in configmaps.
If one could define module source to come from a configmap, then it would be very easy to package up an existing terraform module into kubernetes manifests and deploy them like any other kubernetes resource.
This would be a welcome improvement over
Inline
module sources.Example:
kustomization.yaml:
kustomize build | kubectl apply -n crossplane-system -
workspace.yaml:
The text was updated successfully, but these errors were encountered: