Skip to content

Commit

Permalink
Merge pull request #150 from megaport/feat/vxc-service-key
Browse files Browse the repository at this point in the history
feat: add service key to vxc input
  • Loading branch information
MegaportPhilipBrowne authored Sep 5, 2024
2 parents 89f3316 + eb93680 commit f5a9614
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/resources/vxc.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ resource "megaport_vxc" "transit_vxc" {
- `b_end_partner_config` (Attributes) The partner configuration of the B-End order configuration. (see [below for nested schema](#nestedatt--b_end_partner_config))
- `cost_centre` (String) A customer reference number to be included in billing information and invoices. Also known as the service level reference (SLR) number. Specify a unique identifying number for the product to be used for billing purposes, such as a cost center number or a unique customer ID. The service level reference number appears for each service under the Product section of the invoice. You can also edit this field for an existing service.
- `promo_code` (String) Promo code is an optional string that can be used to enter a promotional code for the service order. The code is not validated, so if the code doesn't exist or doesn't work for the service, the request will still be successful.
- `service_key` (String, Sensitive) The service key of the VXC.
- `shutdown` (Boolean) Temporarily shut down and re-enable the VXC. Valid values are true (shut down) and false (enabled). If not provided, it defaults to false (enabled).

### Read-Only
Expand Down
10 changes: 10 additions & 0 deletions internal/provider/vxc_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ type vxcResourceModel struct {
DistanceBand types.String `tfsdk:"distance_band"`
ProvisioningStatus types.String `tfsdk:"provisioning_status"`
PromoCode types.String `tfsdk:"promo_code"`
ServiceKey types.String `tfsdk:"service_key"`

SecondaryName types.String `tfsdk:"secondary_name"`
UsageAlgorithm types.String `tfsdk:"usage_algorithm"`
Expand Down Expand Up @@ -596,6 +597,14 @@ func (r *vxcResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *
int64planmodifier.UseStateForUnknown(),
},
},
"service_key": schema.StringAttribute{
Description: "The service key of the VXC.",
Optional: true,
Sensitive: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"product_name": schema.StringAttribute{
Description: "The name of the product.",
Required: true,
Expand Down Expand Up @@ -2025,6 +2034,7 @@ func (r *vxcResource) Create(ctx context.Context, req resource.CreateRequest, re
RateLimit: int(plan.RateLimit.ValueInt64()),
PromoCode: plan.PromoCode.ValueString(),
CostCentre: plan.CostCentre.ValueString(),
ServiceKey: plan.ServiceKey.ValueString(),

WaitForProvision: true,
WaitForTime: waitForTime,
Expand Down

0 comments on commit f5a9614

Please sign in to comment.