From 0c7e11833b34ec7366461a4d9d83ae4e6d6da156 Mon Sep 17 00:00:00 2001 From: youngmn <105404366+youngmn@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:00:55 +0900 Subject: [PATCH] feat(vpc_lb): Add XLARGE to the throughput_type (#490) * feat(vpc_lb): Add XLARGE to the throughput_type * fix(vpc_lb): Modify log --- docs/resources/lb.md | 2 +- internal/service/loadbalancer/lb.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/resources/lb.md b/docs/resources/lb.md index 6ebc53e00..8740ca6a3 100644 --- a/docs/resources/lb.md +++ b/docs/resources/lb.md @@ -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 diff --git a/internal/service/loadbalancer/lb.go b/internal/service/loadbalancer/lb.go index f8381da5c..fc9877fbd 100644 --- a/internal/service/loadbalancer/lb.go +++ b/internal/service/loadbalancer/lb.go @@ -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" @@ -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(), @@ -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) @@ -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( @@ -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