Skip to content

Commit

Permalink
Add subnet_id support to CCE node (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
niuzhenguo authored Mar 23, 2020
1 parent d2f970f commit d256405
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/terraform-plugin-sdk v1.0.0
github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94
github.com/huaweicloud/golangsdk v0.0.0-20200323070305-98b64a3f37ba
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a
github.com/mitchellh/go-homedir v1.1.0
github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ=
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94 h1:3MKOAqfBneQCxf7+GMMql6n+JIvE+rmdgtjoM1IhDWc=
github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200323070305-98b64a3f37ba h1:eTQZkCooySmxShTy8boiZ69ueUNNNRxBWjt9T35sp8c=
github.com/huaweicloud/golangsdk v0.0.0-20200323070305-98b64a3f37ba/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
Expand Down
10 changes: 10 additions & 0 deletions huaweicloud/resource_huaweicloud_cce_node_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ func resourceCCENodeV3() *schema.Resource {
}
},
},
"subnet_id": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"private_ip": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -349,6 +354,11 @@ func resourceCCENodeV3Create(d *schema.ResourceData, meta interface{}) error {
},
BillingMode: d.Get("billing_mode").(int),
Count: 1,
NodeNicSpec: nodes.NodeNicSpec{
PrimaryNic: nodes.PrimaryNic{
SubnetId: d.Get("subnet_id").(string),
},
},
ExtendParam: nodes.ExtendParam{
ChargingMode: d.Get("extend_param_charging_mode").(int),
EcsPerformanceType: d.Get("ecs_performance_type").(string),
Expand Down

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

18 changes: 18 additions & 0 deletions vendor/github.com/huaweicloud/golangsdk/openstack/client.go

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ github.com/hashicorp/terraform-plugin-sdk/internal/svchost
github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth
# github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d
github.com/hashicorp/yamux
# github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94
# github.com/huaweicloud/golangsdk v0.0.0-20200323070305-98b64a3f37ba
github.com/huaweicloud/golangsdk
github.com/huaweicloud/golangsdk/openstack
github.com/huaweicloud/golangsdk/openstack/antiddos/v1/antiddos
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/cce_nodes_v3.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ If the eip_ids parameter is configured, you do not need to configure the eip_cou
* `postinstall` - (Optional) Script required after installation. The input value can be a Base64 encoded string or not.
Changing this parameter will create a new resource.

* `subnet_id` - (Optional) The ID of the subnet to which the NIC belongs. Changing this parameter will create a new resource.

**root_volume** **- (Required)** It corresponds to the system disk related configuration. Changing this parameter will create a new resource.

* `size` - (Required) Disk size in GB.
Expand Down

0 comments on commit d256405

Please sign in to comment.