Ibm cloud infrastructure 如何使用Terraform创建软层Vlan?

Ibm cloud infrastructure 如何使用Terraform创建软层Vlan?,ibm-cloud-infrastructure,Ibm Cloud Infrastructure,我能够使用control.softlayer.com创建VLAN(我们已启用自动VLAN订购标志)。但是,当我尝试使用github slash ibm-bluemix.github.io/tf-ibm-docs/v0.3-tf-v0.9.3/r/infra_vlan.html中的Terraform提供程序时,我得到了一个错误。我使用的API密钥来自我的帐户,因此权限应该相同 以下是.tf文件的内容: resource "ibmcloud_infra_vlan" "dev_vlan_01" {

我能够使用control.softlayer.com创建VLAN(我们已启用自动VLAN订购标志)。但是,当我尝试使用github slash ibm-bluemix.github.io/tf-ibm-docs/v0.3-tf-v0.9.3/r/infra_vlan.html中的Terraform提供程序时,我得到了一个错误。我使用的API密钥来自我的帐户,因此权限应该相同

以下是.tf文件的内容:

resource "ibmcloud_infra_vlan" "dev_vlan_01" {
    name = "pancakes_dev_vlan_01"
    datacenter = "FRA02"
    type = "PRIVATE"
    subnet_size = 8
    router_hostname = "bcr01a.fra02"
}
以下是错误:

Error applying plan:

1 error(s) occurred:

* ibmcloud_infra_vlan.dev_vlan_01: 1 error(s) occurred:

* ibmcloud_infra_vlan.dev_vlan_01: Error creating vlan: SoftLayer_Exception_Public: Access Denied.  (HTTP 401)
my ~/.softlayer文件的内容包括:

[softlayer]
username = <username as it appears in users list in control.softlayer.com>
api_key = <api key as it appears both in my Profile page and in the users list>

以下是我落入的所有陷阱:

  • 帐户先决条件:只有来自SoftLayer的人在您的帐户上启用了自动VLAN订购时,这才有效
  • 凭证:您应该使用的“用户名”是您个人资料中的“API用户名”。来自的最新版本不尊重
    ~/.softlayer
    ,但我能够使用环境变量
    SL\u USERNAME
    SL\u API\u KEY
  • 大写:我在
    FRA02
    中将数据中心名称大写,这导致了terraform崩溃。切换到fra02使一切都很愉快
$ terraform apply
ibmcloud_infra_vlan.dev_vlan_01: Creating...
  child_resource_count: "" => "<computed>"
  datacenter:           "" => "FRA02"
  name:                 "" => "pancakes_dev_vlan_01"
  router_hostname:      "" => "bcr01a.fra02"
  softlayer_managed:    "" => "<computed>"
  subnet_size:          "" => "8"
  subnets.#:            "" => "<computed>"
  type:                 "" => "PRIVATE"
  vlan_number:          "" => "<computed>"
Error applying plan:

1 error(s) occurred:

* ibmcloud_infra_vlan.dev_vlan_01: 1 error(s) occurred:

* ibmcloud_infra_vlan.dev_vlan_01: unexpected EOF

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
panic: runtime error: invalid memory address or nil pointer dereference
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x17a61bb]
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: goroutine 68 [running]:
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: github.com/hashicorp/terraform/builtin/providers/ibmcloud.buildVlanProductOrderContainer(0xc4203b00e0, 0xc420392070, 0x1a293c6, 0x20, 0xc420349300, 0x0, 0xc42000e998)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /Users/akthakur/git/terraformgo/src/github.com/hashicorp/terraform/builtin/providers/ibmcloud/resource_ibmcloud_infra_vlan.go:386 +0x9fb
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: github.com/hashicorp/terraform/builtin/providers/ibmcloud.resourceIBMCloudInfraVlanCreate(0xc4203b00e0, 0x19b2c00, 0xc4203920e0, 0x0, 0x0)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /Users/akthakur/git/terraformgo/src/github.com/hashicorp/terraform/builtin/providers/ibmcloud/resource_ibmcloud_infra_vlan.go:125 +0x20b
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc42036ede0, 0xc420016f50, 0xc420396760, 0x19b2c00, 0xc4203920e0, 0x1, 0x28, 0xc4202adcb0)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /Users/akthakur/git/terraformgo/src/github.com/hashicorp/terraform/helper/schema/resource.go:186 +0x48d
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc4202b37a0, 0xc420016f00, 0xc420016f50, 0xc420396760, 0x213b000, 0x0, 0x0)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /Users/akthakur/git/terraformgo/src/github.com/hashicorp/terraform/helper/schema/provider.go:242 +0x9b
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc42034ed80, 0xc4203961c0, 0xc420349260, 0x0, 0x0)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /Users/akthakur/git/terraformgo/src/github.com/hashicorp/terraform/plugin/resource_provider.go:488 +0x57
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: reflect.Value.call(0xc42026d6e0, 0xc4202cad40, 0x13, 0x1a0662e, 0x4, 0xc420042f20, 0x3, 0x3, 0x0, 0x0, ...)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /usr/local/go/src/reflect/value.go:434 +0x91f
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: reflect.Value.Call(0xc42026d6e0, 0xc4202cad40, 0x13, 0xc4202c4720, 0x3, 0x3, 0x0, 0x0, 0x0)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /usr/local/go/src/reflect/value.go:302 +0xa4
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: net/rpc.(*service).call(0xc420362100, 0xc4203620c0, 0xc4203517f8, 0xc4202bb880, 0xc42034f500, 0x182db20, 0xc4203961c0, 0x16, 0x182db60, 0xc420349260, ...)
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /usr/local/go/src/net/rpc/server.go:387 +0x144
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64: created by net/rpc.(*Server).ServeCodec
2017/06/12 16:44:41 [DEBUG] plugin: terraform-provider-ibmcloud_darwin_amd64:   /usr/local/go/src/net/rpc/server.go:481 +0x404
2017/06/12 16:44:41 [DEBUG] root: eval: *terraform.EvalWriteState
2017/06/12 16:44:41 [DEBUG] root: eval: *terraform.EvalApplyProvisioners
2017/06/12 16:44:41 [DEBUG] root: eval: *terraform.EvalIf
2017/06/12 16:44:41 [DEBUG] root: eval: *terraform.EvalWriteState
2017/06/12 16:44:41 [DEBUG] root: eval: *terraform.EvalWriteDiff
2017/06/12 16:44:41 [DEBUG] root: eval: *terraform.EvalApplyPost
2017/06/12 16:44:41 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* ibmcloud_infra_vlan.dev_vlan_01: unexpected EOF
2017/06/12 16:44:41 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* ibmcloud_infra_vlan.dev_vlan_01: unexpected EOF
2017/06/12 16:44:41 [TRACE] [walkApply] Exiting eval tree: ibmcloud_infra_vlan.dev_vlan_01
2017/06/12 16:44:41 [DEBUG] dag/walk: upstream errored, not walking "provider.ibmcloud (close)"
2017/06/12 16:44:41 [DEBUG] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2017/06/12 16:44:41 [DEBUG] dag/walk: upstream errored, not walking "root"
2017/06/12 16:44:41 [TRACE] Preserving existing state lineage "91e8972c-40fa-4802-8117-e26fbd21cf8c"
2017/06/12 16:44:41 [TRACE] Preserving existing state lineage "91e8972c-40fa-4802-8117-e26fbd21cf8c"
2017/06/12 16:44:41 [DEBUG] plugin: /Users/mihasya/bin/terraform-provider-ibmcloud_darwin_amd64: plugin process exited
2017/06/12 16:44:41 [DEBUG] plugin: waiting for all plugin processes to complete...
2017/06/12 16:44:41 [WARN] plugin: error closing client during Kill: connection is shut down