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

🤔 Provider Block is required for deploying azurerm resource using Module object(HCP Terraform operator v2) #537

Open
gogondi1 opened this issue Dec 17, 2024 · 1 comment
Labels
question Further information is requested

Comments

@gogondi1
Copy link

Operator Version, Kind and Kubernetes Version

  • Operator version: v2
  • Kind: Module
  • Kubernetes version: 1.29

YAML Manifest File

# Copy-paste your YAML manifest here
apiVersion: app.terraform.io/v1alpha2
kind: Module
metadata:
  name: greetings3
spec:
  organization: xxxx-xxxx-xxx
  token:
    secretKeyRef:
      name: terraformrc
      key: token
  destroyOnDeletion: true
  module:
    source: app.terraform.io/xxxx-xxxx-xxxx/rg/azurerm
    version: 6.1.0
  outputs:
    - name: resource_group_id
  variables:
    - name: client_name 
    - name: environment
    - name: location
    - name: stack
  workspace:
    name: greetings

Output Log

Kubectl Outputs

Question

Error: Invalid provider configuration
Provider "registry.terraform.io/hashicorp/azurerm" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation. How to resolve this while creating a azurerm
module using HCP Terraform CRD operator v2 using object "Module"

References

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
@gogondi1 gogondi1 added the question Further information is requested label Dec 17, 2024
@arybolovlev
Copy link
Contributor

Hi @gogondi1,

The Module controller generates Terraform code that acts like a wrapper around the one you refer to into spec.module.source. If it has a provider that requires some specific arguments, they either need to be codified and configurable via variables, or they might have support environment variables. In both cases, they should be configured in the workspace.

I hope it helps.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants
@arybolovlev @gogondi1 and others