Update provider dependencies #
The Magic Modules repository does not contain a complete Go module, preventing the use of automated tooling like go get
from that repository. To add or update provider dependencies, use standard Go tooling to update the dependency in the terraform-provider-google
provider and copy the results to the upstream files in Magic Modules.
Below are the steps you can follow to make the change:
- Navigate to the local
google
provider directory:
cd $GOPATH/src/github.com/hashicorp/terraform-provider-google
- Open the
go.mod
file and add the new entries or modify the versions of existing entries as needed - Update dependencies using either of the following methods
- run the following commands to update all dependencies:
go get go mod tidy
- Alternatively, update a specific package to a desired version:
go get google.golang.org/api@v0.105.0 go mod tidy
- Copy the contents of the updated
go.mod
andgo.sum
file intommv1/third_party/terraform/go.mod
andmmv1/third_party/terraform/go.sum
in themagic-modules
respectively. - Create a pull request containing only the dependency changes.
- Resolve any errors caused by the dependency upgrade.
- After the dependency pull request is merged, continue with a separate pull request for any additional changes that were blocked by the upgrade.