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

[FEAT]: skip_provider_authentication provider option #1176

Open
jaredfholgate opened this issue Oct 2, 2024 · 2 comments
Open

[FEAT]: skip_provider_authentication provider option #1176

jaredfholgate opened this issue Oct 2, 2024 · 2 comments

Comments

@jaredfholgate
Copy link
Member

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

I appreciate this is something of an edge case, but it would help to significantly reduce the amount of code we have to managed in our Azure Landing Zones and Azure Verified Modules.

We support both Azure DevOps an GitHub as options for our customers to bootstrap their version control system.

Due to a limitation of Terraform Core, we are unable to reference both the azuredevops and github provider in the same module. Terraform Core does not support optional providers. It always attempts to initialise the provider even if no resources or data sources for that provider are part of the graph.

If someone chooses the GitHub option, then we cannot expect them to supply working Azure DevOps credentials as they don't even have access to Azure DevOps.

This means that every module in our module tree has to have 3 versions: azuredevops, github and local (local file system). This is a significant maintenance overhead requiring a lot of copy and paste code.

In order to work around this it would be great if we could add a flag that skips attempting to auth the provider and just returns a success from the init command.

e.g.

provider "azuredevops" {
   skip_provider_authentication = var.version_control_system == "github"
}

The obvious limitation with this is that if someone does reference an Azure DevOps resource or data source when this provider variable is set they will get an auth error.

If this is something you think could work I would be happy to submit a PR for the code.

New or Affected Resource(s)

This is a provider variable.

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000
@jaredfholgate
Copy link
Member Author

Cross referencing the equivalent GitHub issue: integrations/terraform-provider-github#2408

@xuzhang3
Copy link
Collaborator

I'm OK to skip the provider authentication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants