Skip to content

Commit

Permalink
feat(vpc_lb): Add XLARGE to the throughput_type (#490)
Browse files Browse the repository at this point in the history
* feat(vpc_lb): Add XLARGE to the throughput_type

* fix(vpc_lb): Modify log
  • Loading branch information
youngmn authored Dec 10, 2024
1 parent 9936d69 commit 0c7e118
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/resources/lb.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The following arguments are supported:
* `subnet_no_list` - (Required) A list of IDs in the associated Subnets.
* `network_type` - (Optional) The network type of load balancer to create. Accepted values: `PUBLIC` | `PRIVATE`. Default: `PUBLIC`.
* `idle_timeout` - (Optional) The time in seconds that the idle timeout. Valid only if the load balancer type is not `NETWORK`. Default: 60.
* `throughput_type` - (Optional) The performance type code of load balancer. `SMALL` | `MEDIUM` | `LARGE` | `DYNAMIC`. If the `type` is `APPLICATION` or `NETWORK_PROXY` Options : `SMALL` | `MEDIUM` | `LARGE`, Default : `SMALL`. If the `type` is `NETWORK` Options : `DYNAMIC`, Default : `DYNAMIC`.
* `throughput_type` - (Optional) The performance type code of load balancer. `SMALL` | `MEDIUM` | `LARGE` | `DYNAMIC` | `XLARGE`. If the `type` is `APPLICATION` or `NETWORK_PROXY` Options : `SMALL` | `MEDIUM` | `LARGE` | `XLARGE`, Default : `SMALL`. If the `type` is `NETWORK` Options : `DYNAMIC`, Default : `DYNAMIC`.
* `description` - (Optional) The description of the load balancer.

## Attributes Reference
Expand Down
11 changes: 6 additions & 5 deletions internal/service/loadbalancer/lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"

"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/terraform-providers/terraform-provider-ncloud/internal/common"
. "github.com/terraform-providers/terraform-provider-ncloud/internal/common"
"github.com/terraform-providers/terraform-provider-ncloud/internal/conn"
"github.com/terraform-providers/terraform-provider-ncloud/internal/framework"
Expand Down Expand Up @@ -123,7 +124,7 @@ func (l *lbResource) Schema(ctx context.Context, req resource.SchemaRequest, res
Optional: true,
Computed: true,
Validators: []validator.String{
stringvalidator.OneOf("SMALL", "MEDIUM", "LARGE", "DYNAMIC"),
stringvalidator.OneOf("SMALL", "MEDIUM", "LARGE", "DYNAMIC", "XLARGE"),
},
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
Expand Down Expand Up @@ -268,7 +269,7 @@ func (l *lbResource) Create(ctx context.Context, req resource.CreateRequest, res

reqParams.VpcNo = subnetList[0].VpcNo

LogCommonRequest("createLoadBalancerInstance", reqParams)
tflog.Info(ctx, "CreateLoadBalancerInstance reqParams="+common.MarshalUncheckedString(reqParams))
createResp, err := l.config.Client.Vloadbalancer.V2Api.CreateLoadBalancerInstance(reqParams)
if err != nil {
LogErrorResponse("createLoadBalancerInstance", err, reqParams)
Expand All @@ -278,7 +279,7 @@ func (l *lbResource) Create(ctx context.Context, req resource.CreateRequest, res
)
return
}
LogResponse("createLoadBalancerInstance", createResp)
tflog.Info(ctx, "CreateLoadBalancerInstance response="+common.MarshalUncheckedString(createResp))

if err := waitForLoadBalancerActive(ctx, l.config, ncloud.StringValue(createResp.LoadBalancerInstanceList[0].LoadBalancerInstanceNo)); err != nil {
resp.Diagnostics.AddError(
Expand Down Expand Up @@ -481,14 +482,14 @@ func GetFwVpcLoadBalancer(ctx context.Context, config *conn.ProviderConfig, id s
RegionCode: &config.RegionCode,
LoadBalancerInstanceNo: ncloud.String(id),
}
LogCommonRequest("getLoadBalancerInstanceDetail", reqParams)
tflog.Info(ctx, "GetLoadBalancerInstanceDetail reqParams="+MarshalUncheckedString(reqParams))

resp, err := config.Client.Vloadbalancer.V2Api.GetLoadBalancerInstanceDetail(reqParams)
if err != nil {
LogErrorResponse("getLoadBalancerInstanceDetail", err, reqParams)
return nil, err
}
LogResponse("getLoadBalancerInstanceDetail", resp)
tflog.Info(ctx, "GetLoadBalancerInstanceDetail response="+MarshalUncheckedString(resp))

if len(resp.LoadBalancerInstanceList) < 1 {
return nil, nil
Expand Down

0 comments on commit 0c7e118

Please sign in to comment.