From 950c7421f67b9e0155287a9209d4af0bbae09754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bernacki?= Date: Wed, 6 Nov 2024 14:19:13 +0100 Subject: [PATCH] add force flag to schema --- docs/resources/smart_license.md | 14 +++++++++++++- internal/provider/resource_fmc_smart_license.go | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/resources/smart_license.md b/docs/resources/smart_license.md index 21c02a3c..4babd737 100644 --- a/docs/resources/smart_license.md +++ b/docs/resources/smart_license.md @@ -12,13 +12,24 @@ This resource can manage a Smart License. ## Example Usage -```terraform +Enable Evaluation Mode +```hcl +resource "fmc_smart_license" "example" { + registration_type = "EVALUATION" +} +``` + +Force to re-register with the provided token +```hcl resource "fmc_smart_license" "example" { registration_type = "REGISTER" token = "X2M3YmJlY..." + force = true } ``` +De-registration can be done with terraform destroy + ## Schema @@ -30,6 +41,7 @@ resource "fmc_smart_license" "example" { ### Optional - `domain` (String) The name of the FMC domain +- `force` (Boolean) Set to true to re-register smart license. - `token` (String) Registration token. ### Read-Only diff --git a/internal/provider/resource_fmc_smart_license.go b/internal/provider/resource_fmc_smart_license.go index cc71d7bf..3a4c89b9 100644 --- a/internal/provider/resource_fmc_smart_license.go +++ b/internal/provider/resource_fmc_smart_license.go @@ -90,6 +90,10 @@ func (r *SmartLicenseResource) Schema(ctx context.Context, req resource.SchemaRe MarkdownDescription: helpers.NewAttributeDescription("Status of a smart license.").String, Computed: true, }, + "force": schema.BoolAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Set to true to re-register smart license.").String, + Optional: true, + }, }, } }