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

Support specifying multiple Providers #524

Open
KashifSaadat opened this issue Dec 20, 2022 · 0 comments
Open

Support specifying multiple Providers #524

KashifSaadat opened this issue Dec 20, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@KashifSaadat
Copy link
Member

Currently a Configuration resource has a provider defined as follows:

apiVersion: terraform.appvia.io/v1alpha1
kind: Configuration
metadata:
  name: <CONFIGURATION-NAME>
spec:
  module: <MODULE-SOURCE>
  providerRef:
    name: <PROVIDER-CRD-NAME>

This has two limitations:

  1. Only one provider can be specified for a Module, which is a problem when a Module requires additional Providers. Either you would have to fork and modify your Module specifying the provider block inside it (bad practice), or separate out resources based on the provider into their own Modules and create each one as an individual Configuration resource (more maintenance effort and introduces complexity where there may be interlinked dependencies).
  2. If a Provider has required configuration (e.g. a url or region), it cannot be provided or overridden within the Configuration Spec. It has to be defined in the Provider resource, which is Clusterwide and so all Configuration resources would use the same spec and can't have variations.

It would be good to have support for these cases, allowing to define a Provider locally, provide configuration to merge into an existing Provider, or prevent modifications in more sensitive cases. For example:

apiVersion: terraform.appvia.io/v1alpha1
kind: Configuration
metadata:
  name: <CONFIGURATION-NAME>
spec:
  module: <MODULE-SOURCE>
  providerRef:
  - name: aws
     configuration:
       tags:
       - ManagedBy: "Terraform"
       - Repository: "https://github.com/appvia/terranetes-controller"
  - name: elasticsearch
     provider: "phillbaker/elasticsearch"
     configuration:
       region: "eu-west-2"

Or if you didn't want to allow developers to modify the configuration of a specific Provider they are referencing:

apiVersion: terraform.appvia.io/v1alpha1
kind: Provider
metadata:
  name: aws
spec:
  allowMergeConfiguration: false
  provider: "aws"
  serviceAccount: "terranetes-executor"
  source: injected
@KashifSaadat KashifSaadat added the enhancement New feature or request label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant