From c28f5b3f931af31a996fd4364393d9210613b517 Mon Sep 17 00:00:00 2001 From: Diego Bonfigli Date: Fri, 26 Jan 2024 19:19:22 +0100 Subject: [PATCH] feat(scanning): deprecate legacy scanning engine resources (#474) --- sysdig/resource_sysdig_secure_scanningpolicies.go | 9 +++++---- ...resource_sysdig_secure_scanningpoliciesassignments.go | 9 +++++---- sysdig/resource_sysdig_secure_vulnerability_exception.go | 9 +++++---- ...esource_sysdig_secure_vulnerability_exception_list.go | 9 +++++---- website/docs/r/secure_scanning_policy.md | 4 ++-- website/docs/r/secure_scanning_policy_assignment.md | 6 +++--- website/docs/r/secure_vulnerability_exception.md | 6 +++--- website/docs/r/secure_vulnerability_exception_list.md | 6 +++--- 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/sysdig/resource_sysdig_secure_scanningpolicies.go b/sysdig/resource_sysdig_secure_scanningpolicies.go index 26cfafb7..72974927 100644 --- a/sysdig/resource_sysdig_secure_scanningpolicies.go +++ b/sysdig/resource_sysdig_secure_scanningpolicies.go @@ -15,10 +15,11 @@ func resourceSysdigSecureScanningPolicy() *schema.Resource { timeout := 5 * time.Minute return &schema.Resource{ - CreateContext: resourceSysdigScanningPolicyCreate, - ReadContext: resourceSysdigScanningPolicyRead, - UpdateContext: resourceSysdigScanningPolicyUpdate, - DeleteContext: resourceSysdigScanningPolicyDelete, + DeprecationMessage: "The legacy scanning engine has been deprecated. This resource will be removed in future releases.", + CreateContext: resourceSysdigScanningPolicyCreate, + ReadContext: resourceSysdigScanningPolicyRead, + UpdateContext: resourceSysdigScanningPolicyUpdate, + DeleteContext: resourceSysdigScanningPolicyDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/sysdig/resource_sysdig_secure_scanningpoliciesassignments.go b/sysdig/resource_sysdig_secure_scanningpoliciesassignments.go index d1531cf8..b5da72a9 100644 --- a/sysdig/resource_sysdig_secure_scanningpoliciesassignments.go +++ b/sysdig/resource_sysdig_secure_scanningpoliciesassignments.go @@ -16,10 +16,11 @@ func resourceSysdigSecureScanningPolicyAssignment() *schema.Resource { timeout := 5 * time.Minute return &schema.Resource{ - CreateContext: resourceSysdigScanningPolicyAssignmentCreate, - ReadContext: resourceSysdigScanningPolicyAssignmentRead, - UpdateContext: resourceSysdigScanningPolicyAssignmentUpdate, - DeleteContext: resourceSysdigScanningPolicyAssignmentDelete, + DeprecationMessage: "The legacy scanning engine has been deprecated. This resource will be removed in future releases.", + CreateContext: resourceSysdigScanningPolicyAssignmentCreate, + ReadContext: resourceSysdigScanningPolicyAssignmentRead, + UpdateContext: resourceSysdigScanningPolicyAssignmentUpdate, + DeleteContext: resourceSysdigScanningPolicyAssignmentDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/sysdig/resource_sysdig_secure_vulnerability_exception.go b/sysdig/resource_sysdig_secure_vulnerability_exception.go index c98b39c4..ded358b0 100644 --- a/sysdig/resource_sysdig_secure_vulnerability_exception.go +++ b/sysdig/resource_sysdig_secure_vulnerability_exception.go @@ -16,10 +16,11 @@ func resourceSysdigSecureVulnerabilityException() *schema.Resource { timeout := 5 * time.Minute return &schema.Resource{ - CreateContext: resourceSysdigVulnerabilityExceptionCreate, - ReadContext: resourceSysdigVulnerabilityExceptionRead, - UpdateContext: resourceSysdigVulnerabilityExceptionUpdate, - DeleteContext: resourceSysdigVulnerabilityExceptionDelete, + DeprecationMessage: "The legacy scanning engine has been deprecated. This resource will be removed in future releases.", + CreateContext: resourceSysdigVulnerabilityExceptionCreate, + ReadContext: resourceSysdigVulnerabilityExceptionRead, + UpdateContext: resourceSysdigVulnerabilityExceptionUpdate, + DeleteContext: resourceSysdigVulnerabilityExceptionDelete, Importer: &schema.ResourceImporter{ StateContext: func(ctx context.Context, data *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.SplitN(data.Id(), "/", 2) diff --git a/sysdig/resource_sysdig_secure_vulnerability_exception_list.go b/sysdig/resource_sysdig_secure_vulnerability_exception_list.go index 782da053..febaf68b 100644 --- a/sysdig/resource_sysdig_secure_vulnerability_exception_list.go +++ b/sysdig/resource_sysdig_secure_vulnerability_exception_list.go @@ -14,10 +14,11 @@ func resourceSysdigSecureVulnerabilityExceptionList() *schema.Resource { timeout := 5 * time.Minute return &schema.Resource{ - CreateContext: resourceSysdigVulnerabilityExceptionListCreate, - ReadContext: resourceSysdigVulnerabilityExceptionListRead, - UpdateContext: resourceSysdigVulnerabilityExceptionListUpdate, - DeleteContext: resourceSysdigVulnerabilityExceptionListDelete, + DeprecationMessage: "The legacy scanning engine has been deprecated. This resource will be removed in future releases.", + CreateContext: resourceSysdigVulnerabilityExceptionListCreate, + ReadContext: resourceSysdigVulnerabilityExceptionListRead, + UpdateContext: resourceSysdigVulnerabilityExceptionListUpdate, + DeleteContext: resourceSysdigVulnerabilityExceptionListDelete, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, diff --git a/website/docs/r/secure_scanning_policy.md b/website/docs/r/secure_scanning_policy.md index fe6072fd..4f52f8e4 100644 --- a/website/docs/r/secure_scanning_policy.md +++ b/website/docs/r/secure_scanning_policy.md @@ -8,9 +8,9 @@ description: |- # Resource: sysdig_secure_scanning_policy -Creates a Sysdig Secure Policy. +Creates a Sysdig Secure Policy (legacy scanning engine). --> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. +-> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. ## Example Usage diff --git a/website/docs/r/secure_scanning_policy_assignment.md b/website/docs/r/secure_scanning_policy_assignment.md index f03642b7..82ebafda 100644 --- a/website/docs/r/secure_scanning_policy_assignment.md +++ b/website/docs/r/secure_scanning_policy_assignment.md @@ -8,9 +8,9 @@ description: |- # Resource: sysdig_secure_scanning_policy_assignment -Creates a Sysdig Secure Policy Assignment. +Creates a Sysdig Secure Policy Assignment (legacy scanning engine). --> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. +-> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. ## Example Usage @@ -52,7 +52,7 @@ resource "sysdig_secure_scanning_policy_assignment" "assignment_example" { policy_ids = [sysdig_secure_scanning_policy.scanning_policy_example.id, "default"] } - + } ``` diff --git a/website/docs/r/secure_vulnerability_exception.md b/website/docs/r/secure_vulnerability_exception.md index 44118b4b..974a3f80 100644 --- a/website/docs/r/secure_vulnerability_exception.md +++ b/website/docs/r/secure_vulnerability_exception.md @@ -8,9 +8,9 @@ description: |- # Resource: sysdig_secure_vulnerability_exception -Creates a Sysdig Secure Vulnerability Exception. +Creates a Sysdig Secure Vulnerability Exception (legacy scanning engine). --> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. +-> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. ## Example Usage @@ -60,4 +60,4 @@ Vulnerability exception can be imported using the ID of the exception list, and ``` $ terraform import sysdig_secure_vulnerability_exception.example vulnexception_1iTWe5s3qFivOW4jcj5X8nnG3hn/vulnexceptionitem_1n1HL7la7LyJFAzr0DEc0hVbnFU -``` \ No newline at end of file +``` diff --git a/website/docs/r/secure_vulnerability_exception_list.md b/website/docs/r/secure_vulnerability_exception_list.md index f8e0b442..e04a813d 100644 --- a/website/docs/r/secure_vulnerability_exception_list.md +++ b/website/docs/r/secure_vulnerability_exception_list.md @@ -8,9 +8,9 @@ description: |- # Resource: sysdig_secure_vulnerability_exception_list -Creates a Sysdig Secure Vulnerability Exception list that will hold all the vulnerability exceptions. +Creates a Sysdig Secure Vulnerability Exception list that will hold all the vulnerability exceptions (legacy scanning engine). --> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. +-> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository. ## Example Usage @@ -37,4 +37,4 @@ Vulnerability exception lists can be imported using the ID, e.g. ``` $ terraform import sysdig_secure_vulnerability_exception_list.example vulnexception_1iTWe5s3qFivOW4jcj5X8nnG3hn -``` \ No newline at end of file +```