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 #2408

Open
1 task done
jaredfholgate opened this issue Oct 2, 2024 · 1 comment
Open
1 task done

[FEAT]: skip_provider_authentication provider option #2408

jaredfholgate opened this issue Oct 2, 2024 · 1 comment
Labels
Type: Feature New feature or request

Comments

@jaredfholgate
Copy link

Describe the need

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 GitHub and Azure DevOps 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 github and azuredevops 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 Azure DevOps option, then we cannot expect them to supply working GitHub credentials as they don't even have access to GitHub.

This means that every module in our module tree has to have 3 versions: github, azuredevops 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 "github" {
   skip_provider_authentication = var.version_control_system == "azuredevops"
}

The obvious limitation with this is that if someone does reference a GitHub 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.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jaredfholgate jaredfholgate added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Oct 2, 2024
@jaredfholgate
Copy link
Author

Cross referencing the equivalent Azure DevOps issue: microsoft/terraform-provider-azuredevops#1176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants