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

provider/triton: Add insecure_skip_tls_verify #14077

Merged
merged 2 commits into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions builtin/providers/triton/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ func Provider() terraform.ResourceProvider {
Required: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{"TRITON_KEY_ID", "SDC_KEY_ID"}, ""),
},

"insecure_skip_tls_verify": {
Type: schema.TypeBool,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("TRITON_SKIP_TLS_VERIFY", ""),
},
},

ResourcesMap: map[string]*schema.Resource{
Expand All @@ -56,10 +62,11 @@ func Provider() terraform.ResourceProvider {
}

type Config struct {
Account string
KeyMaterial string
KeyID string
URL string
Account string
KeyMaterial string
KeyID string
URL string
InsecureSkipTLSVerify bool
}

func (c Config) validate() error {
Expand Down Expand Up @@ -98,6 +105,10 @@ func (c Config) getTritonClient() (*triton.Client, error) {
return nil, errwrap.Wrapf("Error Creating Triton Client: {{err}}", err)
}

if c.InsecureSkipTLSVerify {
client.InsecureSkipTLSVerify()
}

return client, nil
}

Expand All @@ -106,6 +117,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
Account: d.Get("account").(string),
URL: d.Get("url").(string),
KeyID: d.Get("key_id").(string),

InsecureSkipTLSVerify: d.Get("insecure_skip_tls_verify").(bool),
}

if keyMaterial, ok := d.GetOk("key_material"); ok {
Expand Down
28 changes: 15 additions & 13 deletions vendor/github.com/joyent/triton-go/accounts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions vendor/github.com/joyent/triton-go/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions vendor/github.com/joyent/triton-go/datacenters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/joyent/triton-go/fabrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions vendor/github.com/joyent/triton-go/firewall.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vendor/github.com/joyent/triton-go/images.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/joyent/triton-go/keys.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 47 additions & 3 deletions vendor/github.com/joyent/triton-go/machines.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/joyent/triton-go/networks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2341,16 +2341,16 @@
"revisionTime": "2016-06-16T18:50:15Z"
},
{
"checksumSHA1": "2HimxaJVVp2QDVQ0570L71Zd5s4=",
"checksumSHA1": "XsjyaC6eTHUy/n0iuR46TZcgAK8=",
"path": "github.com/joyent/triton-go",
"revision": "5db9e2b6a4c1f7ffd2a7e7aa625f42dba956608c",
"revisionTime": "2017-04-12T23:23:58Z"
"revision": "c73729fd38522591909a371c8180ca7090a59ab9",
"revisionTime": "2017-04-28T18:47:44Z"
},
{
"checksumSHA1": "QzUqkCSn/ZHyIK346xb9V6EBw9U=",
"path": "github.com/joyent/triton-go/authentication",
"revision": "66b31a94af28a65e902423879a2820ea34b773fb",
"revisionTime": "2017-03-31T18:12:29Z"
"revision": "c73729fd38522591909a371c8180ca7090a59ab9",
"revisionTime": "2017-04-28T18:47:44Z"
},
{
"checksumSHA1": "YhQcOsGx8r2S/jkJ0Qt4cZ5BLCU=",
Expand Down
1 change: 1 addition & 0 deletions website/source/docs/providers/triton/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ The following arguments are supported in the `provider` block:
* `key_material` - (Optional) This is the private key of an SSH key associated with the Triton account to be used. If this is not set, the private key corresponding to the fingerprint in `key_id` must be available via an SSH Agent.
* `key_id` - (Required) This is the fingerprint of the public key matching the key specified in `key_path`. It can be obtained via the command `ssh-keygen -l -E md5 -f /path/to/key`
* `url` - (Optional) This is the URL to the Triton API endpoint. It is required if using a private installation of Triton. The default is to use the Joyent public cloud us-west-1 endpoint. Valid public cloud endpoints include: `us-east-1`, `us-east-2`, `us-east-3`, `us-sw-1`, `us-west-1`, `eu-ams-1`
* `insecure_skip_tls_verify` (Optional - defaults to false) This allows skipping TLS verification of the Triton endpoint. It is useful when connecting to a temporary Triton installation such as Cloud-On-A-Laptop which does not generally use a certificate signed by a trusted root CA.