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: add terraform resources #1554

Merged
merged 2 commits into from
Sep 3, 2023
Merged

Conversation

mcwarman
Copy link
Member

@mcwarman mcwarman commented Sep 1, 2023

Two new resources

  • terraform/lock - for update lock files
  • terraform/provider - for updating required_providers versions in terraform code

Test

To test this pull request, you can run the following commands:

cd pkg/plugins/resources/terraform
go test ./...
go build -o bin/updatecli && ./bin/updatecli diff --config e2e/updatecli.d/success.d/terraform

Additional Information

Tradeoff

There some logging from the downstream repo, i'm not sure if we can supprress:

update-file-from-source
-----------------------

**Dry Run enabled**

2023/09/01 11:48:48 [DEBUG] providerIndex.createProviderVersion: hashicorp/kubernetes, 2.23.0, linux_amd64
2023/09/01 11:48:48 [DEBUG] Client.ProviderPackageMetadata: GET https://registry.terraform.io/v1/providers/hashicorp/kubernetes/2.23.0/download/linux/amd64
2023/09/01 11:48:48 [DEBUG] ProviderDownloaderClient.download: GET https://releases.hashicorp.com/terraform-provider-kubernetes/2.23.0/terraform-provider-kubernetes_2.23.0_linux_amd64.zip
2023/09/01 11:48:48 [DEBUG] ProviderDownloaderClient.download: GET https://releases.hashicorp.com/terraform-provider-kubernetes/2.23.0/terraform-provider-kubernetes_2.23.0_SHA256SUMS
⚠ - "hashicorp/kubernetes" updated from "2.22.0" to "2.23.0" in file ".terraform.lock.hcl"

Potential improvement

  • There's a lot of duplications between hcl, terraform/lock and terraform/provider in how source, conditions and target works, probably the same with others as well.
  • Terraform registry source
  • Terraform auto discovery

Two new resources
- terraform/lock - for update lock files
- terraform/provider - for updating versions in tf code
@olblak olblak added the enhancement New feature or request label Sep 1, 2023
@olblak
Copy link
Member

olblak commented Sep 3, 2023

The Terraform autodiscovery and Terraform registry as a source would indeed be a great addition.
Regarding the code refactoring, I guess this will come naturally :)

I just did some testing with the e2e tests and it works great :)

@olblak
Copy link
Member

olblak commented Sep 3, 2023

It would great to have the documentation on https://github.com/updatecli/website/ for those two plugins :)

@olblak olblak merged commit 1f70b75 into updatecli:main Sep 3, 2023
6 checks passed
@mcwarman mcwarman deleted the feature/terraform branch September 4, 2023 08:25
@olblak olblak added this to the 0.59.0 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resource-terraform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants