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

fix: Allow explicit Provider configuration in Module #624

Merged
merged 3 commits into from
Sep 30, 2021
Merged

fix: Allow explicit Provider configuration in Module #624

merged 3 commits into from
Sep 30, 2021

Conversation

shrink
Copy link
Contributor

@shrink shrink commented Sep 30, 2021

Closes #623

This change will enable explicit provider configuration, e.g:

provider "google" {
  alias = "service_account"

  credentials = var.service_account_credentials
}

module "project-factory" {
  providers = {
    google = google.service_account
  }

  # ...
}

I chose the version constraints (>= 3.50, < 4.0) because that is the minimum required to meet every nested module's requirements. modules/shared_vpc_access requires >= 3.43, <4.0 but 3.43 would not meet the >= 3.50, < 4.0 requirements of modules/core_project_factory.

I ran some checks and it's already not possible to use any part of this project with a version less than 3.50 because there's already an implicit dependency on >= 3.50 -- this change just makes it explicit, everything makes use of something with a dependency of >= 3.50 (including gsuite_group). Therefore, I do not believe this is a breaking change.

I reviewed the nested modules required_providers while I was doing this. Every one has a required_providers except svpc_service_project so I have added that to this PR so any provider configuration is passed through.

@shrink shrink requested a review from a team as a code owner September 30, 2021 11:53
@google-cla
Copy link

google-cla bot commented Sep 30, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@shrink
Copy link
Contributor Author

shrink commented Sep 30, 2021

@googlebot I signed it!

@comment-bot-dev
Copy link

comment-bot-dev commented Sep 30, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add to gsuite_enabled as well.

@shrink shrink requested a review from morgante September 30, 2021 15:04
@shrink
Copy link
Contributor Author

shrink commented Sep 30, 2021

@morgante good catch! Thank you, fixed.

Re: the Actions, I am seeing one failing but I do not have permission to view the Google Cloud Build project: is there something I need to action for this to pass, or is it expected to fail when triggered by a non-collaborator?

Google Cloud Build / terraform-google-project-factory-int-trigger (cloud-foundation-cicd)

Thanks,

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are passing now, thanks!

@morgante morgante merged commit 621c527 into terraform-google-modules:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

required_providers is not available in the project-factory Module?
3 participants