scottwinkler / terraform-provider-shell

Terraform provider for executing shell commands and saving output to state file
Mozilla Public License 2.0
279 stars 60 forks source link

Add to terraform provider registry #57

Closed scottwinkler closed 4 years ago

scottwinkler commented 4 years ago

Now that there is an official provider registry, this provider should be added

Zordrak commented 4 years ago

Going out of my mind trying to convert an existing project that uses this plugin as a local file from 0.12 to 0.13. Big thumbs up for pre-compiling and putting on the remote registry.

pacon-vib commented 4 years ago

I initially got a bit confused reading the Terraform 0.13 documentation. I got the shell provider working by curling it off GitHub, unzipping it and putting it under .terraform/plugins/registry.terraform.io/hashicorp/shell/1.7.0/linux_amd64/. So Terraform labels it "hashicorp/shell", but it works, and that's the main thing, right?

@scottwinkler I'm currently using your provider on a project to wrap some PowerShell scripts. If I can be of any assistance in getting the provider into the registry please let me know.

As I understand it the requirements are:

I think this is a one-off job, and then the Registry automatically gets notified via webhook when you put out new releases.

The instructions are here: https://www.terraform.io/docs/registry/providers/publishing.html

scottwinkler commented 4 years ago

it is now on the provider registry but you need Terraform 0.13 to get it. here is a sample configuration: link: https://registry.terraform.io/providers/scottwinkler/shell

terraform {
  required_providers {
    shell = {
      source = "scottwinkler/shell"
      version = "1.7.1"
    }
  }
}

data "shell_script" "weather" {
  lifecycle_commands {
    read = <<-EOF
        echo "{\"SanFrancisco\": \"$(curl wttr.in/SanFrancisco?format="%l:+%c+%t")\"}"
    EOF
  }
}
pacon-vib commented 4 years ago

I cannot thank you enough Scott. This is gonna be awesome.

Zordrak commented 4 years ago

Big thanks! I can finally dump the binary from my repo and all the ugly custom provider management!