TritonDataCenter / terraform-provider-triton

Terraform Joyent Triton provider
https://www.terraform.io/docs/providers/triton/
Mozilla Public License 2.0
15 stars 24 forks source link

provider/triton: Add support for RBAC #75

Closed stack72 closed 6 years ago

stack72 commented 6 years ago

Fixes: #67

Triton API allows authentication by either a named account or via the main account

Named Account (new functionality)

env | grep SDC
SDC_TESTING=true
SDC_KEY_ID=aa:a1:50:b0:07:52:7b:6b:3c:ad:11:e1:dd:41:7e:08
SDC_ACCOUNT=stack72_joyent
SDC_URL=https://us-sw-1.api.joyentcloud.com
SDC_KEY_MATERIAL=-----BEGIN RSA PRIVATE KEY-----
SDC_USER=newuser

terraform-provider-triton [add-support-for-rbac●] % acctests triton TestAccTritonMachine_basic
=== RUN   TestAccTritonMachine_basic
--- PASS: TestAccTritonMachine_basic (96.47s)
PASS
ok      github.com/terraform-providers/terraform-provider-triton/triton 96.493s

The existing functionality (main account) still works as expected:

% env | grep SDC
SDC_TESTING=true
SDC_KEY_ID=40:9d:d3:f9:0b:86:62:48:f4:2e:a5:8e:43:00:2a:9b
SDC_ACCOUNT=stack72_joyent
SDC_URL=https://us-sw-1.api.joyentcloud.com

terraform-provider-triton [add-support-for-rbac●] % acctests triton TestAccTritonMachine_basic
=== RUN   TestAccTritonMachine_basic
--- PASS: TestAccTritonMachine_basic (123.65s)
PASS
ok      github.com/terraform-providers/terraform-provider-triton/triton 123.670s