CLI to support with downloading and compiling terraform providers for Mac with M1 chip

Overview

m1-terraform-provider-helper

A CLI to help with managing the installation and compilation of terraform providers when running a new M1 Mac.

Motivation

While using my new Macbook with M1 chip I often encountered issues in client projects when working with Terraform projects. Either some terraform providers have no adapted to the new darwin_arm64 at all or the version of the used provider is pinned to an older version. In both cases, there is no pre-compiled binary for darwin_arm64 => you have to compile it yourself. There is a nice writeup on how to compile in a Terraform Issue. As I am constantly switching forth and back between using own-compiled binaries and pre-build, I wanted to have an elegant solution which manages all the details by itself.

Installation

brew install kreuzwerker/taps/m1-terraform-provider-helper

Usage

A CLI to manage the installation of terraform providers for the Mac M1 chip

Usage:
  m1-terraform-provider-helper [command]

Available Commands:
  activate    Activate the usage of m1 provider helper
  deactivate  Deactivate the usage of M1 provider helper
  help        Help about any command
  install     Downloads (and compiles) a terraform provider for the M1 chip
  status      Shows the status of the m1 provider installations

Flags:
  -h, --help   help for m1-terraform-provider-helper

Example: You want to install the terraform-provider-vault in version 2.10.0 because you are using it in a project and let's assume it has no pre-build binary for Mac M1:

m1-terraform-provider-helper activate # (In case you have not activated the helper)
m1-terraform-provider-helper install hashicorp/vault -v 2.10.0 # Install and compile

Testing

To run tests execute:

make test
make lint

in the project's root directory.

Build

To build the app execute:

make build

in the project's root directory. This will generate the executable dist/m1-terraform-provider-helper file that you can run.

Release

If you want to generate the changelog and see it only (it will neither commit, tag nor push) run one of the following commands:

make patch
make minor
make major

If you want it automated prepend TAG=1 to the command as follows:

# TAG=1 indicates to tag and generate the changelog
TAG=1 make minor
git push origin main --tags 

License

Distributed under the MIT License. See LICENSE.txt for more information.

Issues
  • template provider not working with terraform 0.12.31

    template provider not working with terraform 0.12.31

    Hi there,

    I've installed the template provider as per:

    m1-terraform-provider-helper install hashicorp/template -v 2.2.0
    

    Expected Behavior

    Terraform commands work:

    Actual Behavior

    Error installing provider "template": no available version is compatible for the requested platform.

    Steps to Reproduce (including precondition)

    m1-terraform-provider-helper status
    Status: Active
    Local providers are us
    m1-terraform-provider-helper list
    hashicorp/template -> 2.2.0
    ben/.terraform.d -> plugins
    

    terraform init (with trace logging):

    2022/06/16 11:19:35 [DEBUG] checking for provider in "."
    2022/06/16 11:19:35 [DEBUG] checking for provider in "/opt/homebrew/opt/[email protected]/bin"
    2022/06/16 11:19:35 [DEBUG] checking for provider in ".terraform/plugins/darwin_arm64"
    2022/06/16 11:19:35 [DEBUG] found provider "terraform-provider-aws_v3.75.2_x5"
    2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins"
    2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins/darwin_arm64"
    2022/06/16 11:19:35 [WARN] found legacy provider "terraform-provider-template_2.2.0_x5"
    2022/06/16 11:19:35 [DEBUG] found valid plugin: "template_2.2.0_x5", "0.0.0", "/Users/ben/.terraform.d/plugins/darwin_arm64/terraform-provider-template_2.2.0_x5"
    2022/06/16 11:19:35 [DEBUG] found valid plugin: "aws", "3.75.2", "/Users/ben/Code/owsy/infrastructure-live/scotam-prod/us-west-2/scotam-prod/data-stores/flowable/postgres/.terragrunt-cache/CoUyt-8Q4K3IIvxGLbTrKVSQw-c/wQX_94XlHXOC511wEnd47cONrjA/data-stores/rds/.terraform/plugins/darwin_arm64/terraform-provider-aws_v3.75.2_x5"
    
    2022/06/16 11:19:35 [DEBUG] plugin requirements: "template"=""
    2022/06/16 11:19:35 [DEBUG] plugin requirements: "aws"="~> 3.0"
    Initializing provider plugins...
    2022/06/16 11:19:35 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
    2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
    - Checking for available provider plugins...
    2022/06/16 11:19:35 [DEBUG] fetching provider versions from "https://registry.terraform.io/v1/providers/-/template/versions"
    2022/06/16 11:19:35 [DEBUG] GET https://registry.terraform.io/v1/providers/-/template/versions
    2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/template/versions
    
    Error installing provider "template": no available version is compatible for the requested platform.
    
    Terraform analyses the configuration and state and automatically downloads
    plugins for the providers used. However, when attempting to download this
    plugin an unexpected error occurred.
    
    This may be caused if for some reason Terraform is unable to reach the
    plugin repository. The repository may be unreachable if access is blocked
    by a firewall.
    
    If automatic installation is not possible or desirable in your environment,
    you may alternatively manually install plugins by downloading a suitable
    distribution package and placing the plugin's executable file in the
    following directory:
        terraform.d/plugins/darwin_arm64
    

    I don't know if this is a problem, but terrform asks for the plugin to be in ~/.terraform.d/plugins/darwin_arm64, but it's in ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64

    after copying terraform-provider-template_2.2.0_x5 to ~/.terraform.d/plugins/darwin_arm64, the log is slightly the different:

    (note the WARN] found legacy provider "terraform-provider-template_2.2.0_x5")

    2022/06/16 11:19:35 [DEBUG] checking for provider in "."
    2022/06/16 11:19:35 [DEBUG] checking for provider in "/opt/homebrew/opt/[email protected]/bin"
    2022/06/16 11:19:35 [DEBUG] checking for provider in ".terraform/plugins/darwin_arm64"
    2022/06/16 11:19:35 [DEBUG] found provider "terraform-provider-aws_v3.75.2_x5"
    2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins"
    2022/06/16 11:19:35 [DEBUG] checking for provider in "/Users/ben/.terraform.d/plugins/darwin_arm64"
    2022/06/16 11:19:35 [WARN] found legacy provider "terraform-provider-template_2.2.0_x5"
    2022/06/16 11:19:35 [DEBUG] found valid plugin: "template_2.2.0_x5", "0.0.0", "/Users/ben/.terraform.d/plugins/darwin_arm64/terraform-provider-template_2.2.0_x5"
    2022/06/16 11:19:35 [DEBUG] found valid plugin: "aws", "3.75.2", "/Users/ben/Code/owsy/infrastructure-live/scotam-prod/us-west-2/scotam-prod/data-stores/flowable/postgres/.terragrunt-cache/CoUyt-8Q4K3IIvxGLbTrKVSQw-c/wQX_94XlHXOC511wEnd47cONrjA/data-stores/rds/.terraform/plugins/darwin_arm64/terraform-provider-aws_v3.75.2_x5"
    
    2022/06/16 11:19:35 [DEBUG] plugin requirements: "template"=""
    2022/06/16 11:19:35 [DEBUG] plugin requirements: "aws"="~> 3.0"
    Initializing provider plugins...
    2022/06/16 11:19:35 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
    2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/.well-known/terraform.json
    - Checking for available provider plugins...
    2022/06/16 11:19:35 [DEBUG] fetching provider versions from "https://registry.terraform.io/v1/providers/-/template/versions"
    2022/06/16 11:19:35 [DEBUG] GET https://registry.terraform.io/v1/providers/-/template/versions
    2022/06/16 11:19:35 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/providers/-/template/versions
    
    Error installing provider "template": no available version is compatible for the requested platform.
    
    Terraform analyses the configuration and state and automatically downloads
    plugins for the providers used. However, when attempting to download this
    plugin an unexpected error occurred.
    
    This may be caused if for some reason Terraform is unable to reach the
    plugin repository. The repository may be unreachable if access is blocked
    by a firewall.
    
    If automatic installation is not possible or desirable in your environment,
    you may alternatively manually install plugins by downloading a suitable
    distribution package and placing the plugin's executable file in the
    following directory:
        terraform.d/plugins/darwin_arm64
    

    Screenshot on This Problem (if possible)

    Your Environment

    • OS: 12.4
    • m1-terraform-provider-helper version: 0.6.0
    bug 
    opened by bendavies 23
  • Feature request: pass in custom build command

    Feature request: pass in custom build command

    Looking for some future proofing here. I know you've been trying to maintain a map of provider to build commands, but a custom command argument would be greatly appreciated for supporting custom builds before you get a chance to update your map in the code.

    Right now, I'm trying to build mongo atlas provider 0.8.2:

    $ m1-terraform-provider-helper install mongodb/mongodbatlas -v v0.8.2
    Repo: https://github.com/mongodb/terraform-provider-mongodbatlas
    GitRepo: [email protected]:mongodb/terraform-provider-mongodbatlas
    2022/01/21 13:17:51 Executingcd /Users/<home_dir>/.m1-terraform-provider-helper && git clone [email protected]:mongodb/terraform-provider-mongodbatlas
    Cloning into 'terraform-provider-mongodbatlas'...
    Cancel
    2022/01/21 13:17:56 Cloning into 'terraform-provider-mongodbatlas'...
    
    HEAD is now at 454ea9c8 Fix 1.2 upgrade/info guide formatting error (#657)
    2022/01/21 13:17:56 version: v0.8.2
    ==> Checking that code complies with gofmt requirements...
    gofmt needs running on the following files:
    ./tools.go
    You can use the command: `make fmt` to reformat code.
    make: *** [fmtcheck] Error 1
    2022/01/21 13:17:59 Bash code did not run successfully: exit status 2
    

    So it is another case of make build not being sufficient.

    enhancement 
    opened by et304383 13
  • Add lockfile upgrade command

    Add lockfile upgrade command

    What does this do / why do we need it?

    Provide a command lockfile upgrade to update the hashes in a lockfile to also contain the hashes of the locally compiled providers. This fixes the problem, that terrraform init won't work when an lockfile exists and local providers are used.

    Check lists

    • [ ] Test passed
    • [ ] Coding style (indentation, etc)
    • [ ] Update README
    • [ ] Enhance install command: When a lockfile exists, encourage users to also use the lockfile upgrade command

    Which issue(s) does this PR fix?

    fixes #38

    opened by Junkern 9
  • Build fails if gofmt fails

    Build fails if gofmt fails

    Expected Behavior

    Binary successfully builds even if linting checks fail.

    Actual Behavior

    Build fails due to linting checks failing

    Steps to Reproduce (including precondition)

    m1-terraform-provider-helper install hashicorp/kubernetes -v v1.13.3
    

    with

    go version go1.17.2 darwin/arm64
    

    It fails with

    2021/11/02 15:46:10 versionv1.13.3
    ==> Checking that code complies with gofmt requirements...
    Cancel
    gofmt needs running on the following files:
    ./tools.go
    You can use the command: `make fmt` to reformat code.
    make: *** [fmtcheck] Error
    

    Which is annoying because it's only a formatting fail and it builds fine. Also, Home-brew doesn't have 1.14 for ARM so to get that version which should pass fmt, it still blows up...

    I'm not really sure what's the best solution, make fmt by default seems like a hard hammer that might not work for all providers.

    bug 
    opened by mnaser 7
  • Hashes not generated, impossible to use in existing projects.

    Hashes not generated, impossible to use in existing projects.

    On m1 mac, obviously, when I try to install a provider (say HashiCorp/google v4.11.0), it successfully installs, however I am not able to run 'terraform init' because it fails to find a checksum for the installed version in lock file.

    Expected Behavior

    After the installation, terraform init successfully initialise terraform.

    Actual Behavior

    After the installation, terraform init logs the following:

    Initializing modules...
    
    Initializing the backend...
    
    Initializing provider plugins...
    - Reusing previous version of hashicorp/archive from the dependency lock file
    - Reusing previous version of hashicorp/google from the dependency lock file
    - Reusing previous version of hashicorp/google-beta from the dependency lock file
    - Reusing previous version of hashicorp/template from the dependency lock file
    - Installing hashicorp/google v4.11.0...
    - Installing hashicorp/google-beta v4.11.0...
    - Installed hashicorp/google-beta v4.11.0 (signed by HashiCorp)
    - Installing hashicorp/template v2.2.0...
    - Installing hashicorp/archive v2.2.0...
    - Installed hashicorp/archive v2.2.0 (signed by HashiCorp)
    ╷
    │ Error: Failed to install provider
    │
    │ Error while installing hashicorp/google v4.11.0: the local package for registry.terraform.io/hashicorp/google 4.11.0 doesn't match any of
    │ the checksums previously recorded in the dependency lock file (this might be because the available checksums are for packages targeting
    │ different platforms)
    ╵
    
    ╷
    │ Error: Failed to install provider
    │
    │ Error while installing hashicorp/template v2.2.0: the local package for registry.terraform.io/hashicorp/template 2.2.0 doesn't match any
    │ of the checksums previously recorded in the dependency lock file (this might be because the available checksums are for packages targeting
    │ different platforms)
    

    Steps to Reproduce (including precondition)

    1. Have a project already configured with google provider for Google Cloud Platform, working on a normal amd64 machine.
    2. Clone the project on an m1 mac
    3. Run m1-terraform-provider-helper install hashicorp/template -v v2.2.0
    4. Run m1-terraform-provider-helper install hashicorp/google -v v4.11.0
    5. Run terraform init

    Your Environment

    • OS: MacOS Monterey 12.2.1
    • m1-terraform-provider-helper version: 0.5.1
    enhancement 
    opened by Chiyo-no-sake 5
  • Does not work with aws provider version 2.70.1

    Does not work with aws provider version 2.70.1

    We are stuck on version 2.x of AWS provider. When attempting to use the tool for this specific version, I get errors from what looks like failure to run bash commands:

    Expected Behavior

    It works!

    Actual Behavior

    It fails with sh line 0 errors (see below).

    m1-terraform-provider-helper install hashicorp/aws -v v2.70.1
    Repo: https://github.com/hashicorp/terraform-provider-aws
    GitRepo: [email protected]:hashicorp/terraform-provider-aws
    HEAD is now at 2ff8acfb9b Merge pull request #22396 from GlennChia/f-aws_dax_cluster
    2022/01/04 10:05:22 version: v2.70.1
    Cancel
    
    sh: line 0: cd: tools: No such file or directory
    2022/01/04 10:06:16 Bash code did not run successfully: exit status 1
    

    Steps to Reproduce (including precondition)

    m1-terraform-provider-helper install hashicorp/aws -v v2.70.1
    

    Your Environment

    • OS: 12.1
    • m1-terraform-provider-helper version: 0.2.4
    bug 
    opened by et304383 5
  • fails to install hashicorp/random -v v2.3.1

    fails to install hashicorp/random -v v2.3.1

    m1-terraform-provider-helper install hashicorp/random -v v2.3.1 Repo: https://github.com/hashicorp/terraform-provider-random GitRepo: https://github.com/hashicorp/terraform-provider-random HEAD is now at d89f018 v2.3.1 2022/06/22 16:02:43 Pulling newest changes from https://github.com/hashicorp/terraform-provider-random fatal: ref refs/remotes/origin/HEAD is not a symbolic ref You are not currently on a branch. Please specify which branch you want to merge with. See git-pull(1) for details.

    git pull <remote> <branch>
    

    2022/06/22 16:02:45 Bash code did not run successfully: exit status 1

    opened by royceshen 4
  • Panic with Go version go1.17.6 darwin/arm64

    Panic with Go version go1.17.6 darwin/arm64

    On my macbook pro M1, that I restored from a time machine backup, I encounter some gRPC rendom bugs. I decided to give this tool a try.

    I wasn't able to install hashicorp/aws provider so I tried updating my go version Now, I get a panic on every installation attempt Here you can find my attempts

    22:18 ❯ m1-terraform-provider-helper install hashicorp/aws
    Cancel
    panic: Get "https://registry.terraform.io/v1/providers/hashicorp/aws": context canceled
    
    goroutine 1 [running]:
    github.com/kreuzwerker/m1-terraform-provider-helper/internal/app.getProviderData({0x16bd77425, 0xd})
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/internal/app/install.go:79 +0x304
    github.com/kreuzwerker/m1-terraform-provider-helper/internal/app.(*App).Install(0x14000124a08, {0x16bd77425, 0xd}, {0x0, 0x0}, {0x0, 0x0})
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/internal/app/install.go:239 +0x30
    github.com/kreuzwerker/m1-terraform-provider-helper/cmd.installCmd.func1(0x140001b4f00, {0x1400019a9d0, 0x1, 0x1})
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/cmd/install.go:26 +0xcc
    github.com/spf13/cobra.(*Command).execute(0x140001b4f00, {0x1400019a9b0, 0x1, 0x1})
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x668
    github.com/spf13/cobra.(*Command).ExecuteC(0x140001b4500)
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x404
    github.com/spf13/cobra.(*Command).Execute(...)
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
    main.main()
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/cmd/m1-terraform-provider-helper/main.go:11 +0x24
    22:19 ❯ brew reinstall kreuzwerker/taps/m1-terraform-provider-helper
    ==> Downloading https://github.com/kreuzwerker/m1-terraform-provider-helper/releases/download/0.5.1/m1-terraform-provider
    Already downloaded: /Users/antoinechapusot/Library/Caches/Homebrew/downloads/0f6cd86f6d6ae5ed6016b6f38237bf41e7b73d1f50b64dbd9bc0152ee7fe44af--m1-terraform-provider-helper_0.5.1_Darwin_arm64.tar.gz
    ==> Reinstalling kreuzwerker/taps/m1-terraform-provider-helper
    🍺  /opt/homebrew/Cellar/m1-terraform-provider-helper/0.5.1: 6 files, 10.2MB, built in 1 second
    ==> Running `brew cleanup m1-terraform-provider-helper`...
    Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
    Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
    22:19 ❯ m1-terraform-provider-helper install hashicorp/aws
    Repo: https://github.com/hashicorp/terraform-provider-aws
    GitRepo: https://github.com/hashicorp/terraform-provider-aws
    HEAD is now at b2290be9a4 Merge pull request #23346 from PatMyron/tflint
    2022/02/24 22:19:32 No version specified, pulling and checking out main branch
    fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
    Already up to date.
    cd providerlint && go install .
    cd tools && go install github.com/bflad/tfproviderdocs
    cd tools && go install github.com/client9/misspell/cmd/misspell
    cd tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint
    cd tools && go install github.com/katbyte/terrafmt
    cd tools && go install github.com/terraform-linters/tflint
    Cancel
    cd tools && go install github.com/pavius/impi/cmd/impi
    cd tools && go install github.com/hashicorp/go-changelog/cmd/changelog-build
    ==> Fixing source code with gofmt...
    gofmt -s -w ./internal ./providerlint/helper ./providerlint/main.go ./providerlint/passes
    stat ./tools.go: no such file or directory
    2022/02/24 22:19:37 Bash code did not run successfully: exit status 2
    22:20 ❯ m1-terraform-provider-helper status
    Status: Active
    Local providers are used
    22:20 ❯ m1-terraform-provider-helper list
    22:20 ❯ m1-terraform-provider-helper install hashicorp/template
    Cancel
    panic: Get "https://registry.terraform.io/v1/providers/hashicorp/template": context canceled
    
    goroutine 1 [running]:
    github.com/kreuzwerker/m1-terraform-provider-helper/internal/app.getProviderData({0x16aea741d, 0x12})
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/internal/app/install.go:79 +0x304
    github.com/kreuzwerker/m1-terraform-provider-helper/internal/app.(*App).Install(0x140000a4a08, {0x16aea741d, 0x12}, {0x0, 0x0}, {0x0, 0x0})
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/internal/app/install.go:239 +0x30
    github.com/kreuzwerker/m1-terraform-provider-helper/cmd.installCmd.func1(0x140001b6f00, {0x1400019a9d0, 0x1, 0x1})
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/cmd/install.go:26 +0xcc
    github.com/spf13/cobra.(*Command).execute(0x140001b6f00, {0x1400019a9b0, 0x1, 0x1})
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x668
    github.com/spf13/cobra.(*Command).ExecuteC(0x140001b6500)
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x404
    github.com/spf13/cobra.(*Command).Execute(...)
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
    main.main()
    	/home/runner/work/m1-terraform-provider-helper/m1-terraform-provider-helper/cmd/m1-terraform-provider-helper/main.go:11 +0x24
    
    opened by ChapChap 4
  • Issues with helm provider - failure to move/rename?

    Issues with helm provider - failure to move/rename?

    Sorry for not using the template, but this is much faster to just show what's happening:

    $ m1-terraform-provider-helper install hashicorp/helm -v v2.4.1
    Repo: https://github.com/hashicorp/terraform-provider-helm
    GitRepo: [email protected]:hashicorp/terraform-provider-helm
    2022/01/12 08:34:05 Executingcd /Users/et304383/.m1-terraform-provider-helper && git clone [email protected]:hashicorp/terraform-provider-helm
    Cloning into 'terraform-provider-helm'...
    Cancel
    Updating files: 100% (6301/6301), done.
    2022/01/12 08:34:39 Cloning into 'terraform-provider-helm'...
    Updating files: 100% (6301/6301), done.
    
    HEAD is now at ac4d18cc1 .github/workflows: Fix waiting-response label removal (#758)
    2022/01/12 08:34:39 version: v2.4.1
    ==> Checking that code complies with gofmt requirements...
    go build -v .
    2022/01/12 08:35:16 Move from /Users/et304383/go/bin/terraform-provider-helm to /Users/et304383/.terraform.d/plugins/registry.terraform.io/hashicorp/helm/v2.4.1/darwin_arm64/terraform-provider-helm_v2.4.1_x5
    2022/01/12 08:35:16 rename /Users/et304383/go/bin/terraform-provider-helm /Users/et304383/.terraform.d/plugins/registry.terraform.io/hashicorp/helm/v2.4.1/darwin_arm64/terraform-provider-helm_v2.4.1_x5: no such file or directory
    $ ll ~/.m1-terraform-provider-helper/terraform-provider-helm/terraform-provider-helm
    -rwxr-xr-x  1 et304383  staff    69M 12 Jan 08:35 /Users/et304383/.m1-terraform-provider-helper/terraform-provider-helm/terraform-provider-helm
    $
    

    So it looks like the file is there, in the git directory. Perhaps the helm devs aren't following a standard for binary generation?

    opened by et304383 4
  • Dangerous behavior: Installing a provider erases uncommitted, tracked code when run from a git repo directory

    Dangerous behavior: Installing a provider erases uncommitted, tracked code when run from a git repo directory

    Expected Behavior

    This app should be safe to run in a git repo.

    Actual Behavior

    Any uncommitted but tracked code will be erased, presumably by this command running with the wrong working directory.

    Steps to Reproduce (including precondition)

    • Create an empty repo
    • track a file
    • install a provider
    • lose your work
    mkdir git-test
    cd git-test 
    git init
    touch file
    git add file
    git status
    m1-terraform-provider-helper install hashicorp/template -v 2.1.2
    git status
    

    Screenshot on This Problem (if possible)

    yikes

    Your Environment

    • OS: MacOS 12.0.1
    • m1-terraform-provider-helper version: stable 0.2.3
    bug 
    opened by RulerOf 4
  • Git permission denied

    Git permission denied

    I try to install hashicorp/template on my m1. Unfortunatelly it cannot get downloaded. I think this is because this repository (https://github.com/hashicorp/terraform-provider-template) is only clonable with https and not git.

    m1-terraform-provider-helper install  hashicorp/template 
    Repo: https://github.com/hashicorp/terraform-provider-template
    GitRepo: [email protected]:hashicorp/terraform-provider-template
    2021/12/22 09:22:06 Executingcd /Users/dani/.m1-terraform-provider-helper && git clone [email protected]:hashicorp/terraform-provider-template
    Cloning into 'terraform-provider-template'...
    [email protected]: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    Expected Behavior

    Download code with https if git protocol is not accepted.

    Actual Behavior

    Download fails

    Steps to Reproduce (including precondition)

    m1-terraform-provider-helper install  hashicorp/template 
    

    Your Environment

    brew info m1-terraform-provider-helper kreuzwerker/taps/m1-terraform-provider-helper: stable 0.2.3 CLI to support with downloading and compiling terraform providers for Mac with M1 chip. https://github.com/kreuzwerker/m1-terraform-provider-helper /opt/homebrew/Cellar/m1-terraform-provider-helper/0.2.3 (6 files, 9.9MB) * Built from source on 2021-12-22 at 09:15:08 From: https://github.com/kreuzwerker/homebrew-taps/blob/HEAD/m1-terraform-provider-helper.rb

    • OS: Monterey
    opened by danielschlegel 4
  • chore(deps): update module go to 1.19

    chore(deps): update module go to 1.19

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | go (source) | golang | minor | 1.18 -> 1.19 |


    Release Notes

    golang/go

    v1.19.0


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • FATA[0047] Bash execution did not run successfully

    FATA[0047] Bash execution did not run successfully

    Hello! I got an error trying to install provider "hashicorp/aws -v v3.23.0"

    Thanks for a lot

    Output: m1-terraform-provider-helper install hashicorp/aws -v v3.23.0 Getting provider data from terraform registry Getting source code... Compiling... FATA[0047] Bash execution did not run successfully: exit status 2

    Expected Behavior

    I don't know, because it's the first time I try this application.

    Actual Behavior

    m1-terraform-provider-helper install hashicorp/aws -v v3.23.0 Getting provider data from terraform registry Getting source code... Compiling... FATA[0047] Bash execution did not run successfully: exit status 2

    Steps to Reproduce (including precondition)

    {Please write here}

    Screenshot on This Problem (if possible)

    image

    Your Environment

    • OS: Monterrey 12.5
    • m1-terraform-provider-helper version: Current version: 0.7.4%
    opened by swt-yoromero 8
  • Install command should notify users when a lockfile needs to be upgraded

    Install command should notify users when a lockfile needs to be upgraded

    With the newest v0.7.0 version this tool now has the capability to add the hashes of the locally compiled providers to the lockfile.

    Whenever a user runs the install command, the users should be notified if there is an already existing lockfile and whether it should be updated (to not run into the terraform init issue with the checksums)

    enhancement good first issue 
    opened by Junkern 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    github-actions
    .github/workflows/build.yml
    • actions/checkout v3
    • actions/setup-go v3
    • goreleaser/goreleaser-action v3
    .github/workflows/lint.yml
    • actions/checkout v3
    • actions/setup-go v3
    • golangci/golangci-lint-action v3
    .github/workflows/release.yml
    • actions/checkout v3
    • actions/setup-go v3
    • goreleaser/goreleaser-action v3
    .github/workflows/test.yml
    • actions/checkout v3
    • actions/setup-go v3
    • jandelgado/gcov2lcov-action v1.0.9
    • coverallsapp/github-action 1.1.3
    • actions/checkout v3
    • actions/setup-go v3
    gomod
    go.mod
    • go 1.18
    • github.com/go-git/go-git/v5 v5.4.2
    • github.com/hashicorp/go-version v1.6.0
    • github.com/hashicorp/hcl/v2 v2.13.0
    • github.com/jarcoal/httpmock v1.2.0
    • github.com/spf13/cobra v1.5.0
    • github.com/zclconf/go-cty v1.10.0
    • golang.org/x/mod v0.5.1
    • github.com/sirupsen/logrus v1.9.0

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Fix build command for version 2.x of AWS provider

    Fix build command for version 2.x of AWS provider

    Underlying issue: https://github.com/golang/go/issues/51706

    What does this do / why do we need it?

    This fixes the install of the AWS provider 2.x due to a bug in Go sys module

    How this PR fixes the problem?

    Updates the sys module before running the various build commands, only for the command used to compile the AWS provider

    What should your reviewer look out for in this PR?

    N/A

    Check lists

    • [ ] Test passed
    • [ ] Coding style (indentation, etc)

    Which issue(s) does this PR fix?

    N/A

    opened by et304383 6
  • Error: Failed to install provider

    Error: Failed to install provider

    Receiving the error Error: Failed to install provider when installing hashicorp/template in a repo which uses aws provider. Below is the exact error.

    │ Error: Failed to install provider
    │ 
    │ Error while installing hashicorp/template v2.2.0: the local package for
    │ registry.terraform.io/hashicorp/template 2.2.0 doesn't match any of the
    │ checksums previously recorded in the dependency lock file (this might be
    │ because the available checksums are for packages targeting different
    │ platforms)
    

    Following is the command that I used.

    m1-terraform-provider-helper install hashicorp/template -v v2.2.0
    

    Expected Behavior

    When using the command the build generated should match the checksum in the lock file.

    Actual Behavior

    The generated build is not matching the checksum in lock file

    Steps to Reproduce (including precondition)

    1. Run m1-terraform-provider-helper install hashicorp/template -v v2.2.0
    2. Run terraform init
    3. The error is generated at the end of above command

    Screenshot on This Problem (if possible)

    image

    Output after running terraform init

    Your Environment

    • OS: MacOS Monterey 12.2.1
    • m1-terraform-provider-helper version: Latest, installed yesterday
    opened by nishant-ci 14
Releases(0.7.5)
Owner
kreuzwerker GmbH
We touch running systems
kreuzwerker GmbH
Reads from existing Cloud Providers (reverse Terraform) and generates your infrastructure as code on Terraform configuration

TerraCognita Imports your current Cloud infrastructure to an Infrastructure As Code Terraform configuration (HCL) or/and to a Terraform State. At Cycl

Cycloid 1.2k Aug 12, 2022
Dapper is a CLI toolkit for compiling, deploying, and managing Algorand applications

??️ Dapper Decentralized Application Manager for the Algorand Blockchain Dappman is a Golang CLI toolkit for compiling, deploying, and managing Algora

Connor 0 Feb 11, 2022
An easy-to-use cli tool for downloading manga

mangodl Download and search manga right from the terminal! Report Bug || Request Feature Table of Contents About the Project Built With Getting Starte

null 139 Aug 7, 2022
`tfx` is a standalone CLI for Terraform Cloud and Terraform Enterprise.

TFx CLI tfx is a standalone CLI for Terraform Cloud and Terraform Enterprise. The initial focus of tfx is to execute the API-Driven workflow for a Wor

Tom Straub 40 Aug 3, 2022
📱🥴 TikTok terminal client for browsing & downloading videos

tiktik ?? ?? - TikTok Terminal Client Name inspiration - this yt vid Huge Thanks to Egor who wrote the parsing part Installation ?? go get -u github.c

Ilya Revenko 74 Aug 8, 2022
A very simple command line tool for downloading YouTube videos.

GoTube Overview This repository contains a single-file implementation of YouTube video downloader written in Go. It does not require any third-party p

Jimmy Yang 185 May 15, 2022
"steal" NFTs by downloading them via OpenSea api ;)

go-NFThief "steal" NFTs by downloading them via OpenSea api. now you don't have to manually screenshot them ;) Options to: download a collection via c

null 1 Apr 11, 2022
Oui - MAC Address CLI Toolkit

oui MAC Address CLI Toolkit Installation macOS $ brew tap thatmattlove/oui $ bre

Matt Love 25 May 16, 2022
Hermit - uniform tooling for Linux and Mac

Hermit installs tools for software projects in self-contained, isolated sets, so your team, your contributors, and your CI have the same consistent tooling.

Cash App 332 Aug 13, 2022
Rclone ("rsync for cloud storage") is a command line program to sync files and directories to and from different cloud storage providers.

Rclone ("rsync for cloud storage") is a command line program to sync files and directories to and from different cloud storage providers.

rclone 34.2k Aug 16, 2022
Rclone ("rsync for cloud storage") is a command-line program to sync files and directories to and from different cloud storage providers.

Website | Documentation | Download | Contributing | Changelog | Installation | Forum Rclone Rclone ("rsync for cloud storage") is a command-line progr

null 0 Nov 5, 2021
Termial remote (mac) for Sony Bravia TV

Sony Bravia terminal remote Environment variables HOST: [....] PSK: [....] Configure the Bravia TV Todo: Scan network for a Bravia device Move and git

Emil 1 Nov 26, 2021
Service for read & update MAC OUI list

manufacturer-parser Service written on Golang to get actual MAC OUI list from here and store to MongoDB. Needed for dealt with actual list in Wimark O

WiMark Systems 0 Dec 29, 2021
Run your MapReduce workloads as a single binary on a single machine with multiple CPUs and high memory. Pricing of a lot of small machines vs heavy machines is the same on most cloud providers.

gomap Run your MapReduce workloads as a single binary on a single machine with multiple CPUs and high memory. Pricing of a lot of small machines vs he

null 20 May 1, 2022
The simple and easy-to-use program designed to watch user activity for Cloud Providers.

Cloud Agent The simple and easy-to-use program is designed to watch user activity and possible orphan clusters for Cloud Providers: Gardener GCP (work

Filip Strózik 3 Jun 6, 2022
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.

?? Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染

Gookit 1.2k Aug 10, 2022
A CLI command to parse Terraform execution result and notify it to Backlog

tf2b Fork of mercari/tfnotify tf2b parses Terraform commands' execution result and applies it to an arbitrary template and then notifies it to Backlog

Yuichi Watanabe 1 Oct 15, 2021
CLI to migrate Terraform Configuration and State

tfmigrator CLI CLI to migrate Terraform Configuration and State. The migration feature is implemented with tfmigrator/tfmigrator, so please see the do

null 29 Jun 2, 2022
A CLI Tool to easily generate your Terraform configuration

Tf Tf is a command line tool to easily generate your Terraform configuration with an interactive prompt. Inspiration Boredom in Covid-19 Installation

Gowtham Munukutla 19 Jul 26, 2022