Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sysdig/data_source_sysdig_secure_posture_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (

func dataSourceSysdigSecurePostureZone() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceSysdigSecurePostureZoneRead,
DeprecationMessage: "sysdig_secure_posture_zone is deprecated and will be removed in a future version. Use sysdig_secure_zone instead.",
ReadContext: dataSourceSysdigSecurePostureZoneRead,

Schema: map[string]*schema.Schema{
"id": {
Expand Down
9 changes: 5 additions & 4 deletions sysdig/resource_sysdig_secure_posture_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ func resourceSysdigSecurePostureZone() *schema.Resource {
timeout := 5 * time.Minute

return &schema.Resource{
CreateContext: resourceCreateOrUpdatePostureZone,
UpdateContext: resourceCreateOrUpdatePostureZone,
DeleteContext: resourceSysdigSecurePostureZoneDelete,
ReadContext: resourceSysdigSecurePostureZoneRead,
DeprecationMessage: "sysdig_secure_posture_zone is deprecated and will be removed in a future version. Use sysdig_secure_zone instead.",
CreateContext: resourceCreateOrUpdatePostureZone,
UpdateContext: resourceCreateOrUpdatePostureZone,
DeleteContext: resourceSysdigSecurePostureZoneDelete,
ReadContext: resourceSysdigSecurePostureZoneRead,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/secure_posture_zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: |-

# sysdig_secure_posture_zone Data Source

~> **Deprecated:** `sysdig_secure_posture_zone` is deprecated and will be removed in a future version. Use [`sysdig_secure_zone`](secure_zone) instead.

The `sysdig_secure_posture_zone` data source allows you to retrieve information about a specific secure posture zone by its ID.

## Example Usage
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/secure_posture_zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: |-

# Resource: sysdig_secure_posture_zone

~> **Deprecated:** `sysdig_secure_posture_zone` is deprecated and will be removed in a future version. Use [`sysdig_secure_zone`](secure_zone) instead. Zone IDs are the same across both APIs, so existing zones can be adopted via `terraform import` without recreation.

Creates a Sysdig Secure Posture Zone.

-> **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.
Expand Down
45 changes: 45 additions & 0 deletions website/docs/r/secure_zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,51 @@ In addition to all arguments above, the following attributes are exported:
- `last_modified_by` - (Computed) By whom is last modification made.
- `last_updated` - (Computed) Timestamp of last modification of zone.

## Migrating from sysdig_secure_posture_zone

`sysdig_secure_posture_zone` is deprecated. Zone IDs are the same across both APIs, so the migration does not recreate the zone.

~> **Note:** `sysdig_secure_posture_zone` supports `policy_ids` to associate posture policies with a zone. `sysdig_secure_zone` does not manage policy assignments. Policy-to-zone associations must be managed separately.

1. Replace the `sysdig_secure_posture_zone` block with `sysdig_secure_zone` in your configuration, mapping `scopes { scope { ... } }` to top-level `scope` blocks. Note that `scope` is required in `sysdig_secure_zone`:

```terraform
# Before
resource "sysdig_secure_posture_zone" "example" {
name = "my-zone"
policy_ids = [123, 456]
scopes {
scope {
target_type = "aws"
rules = "account in (\"123456789\")"
}
}
}

# After
resource "sysdig_secure_zone" "example" {
name = "my-zone"
scope {
target_type = "aws"
rules = "account in (\"123456789\")"
}
}
```

2. Remove the old resource from Terraform state:

```
$ terraform state rm sysdig_secure_posture_zone.example
```

3. Import the existing zone into the new resource:

```
$ terraform import sysdig_secure_zone.example 12345
```

4. Run `terraform plan` to verify there are no unexpected changes.

## How state is managed (drift prevention)

When reading a zone from the API, the provider preserves the representation format from your configuration:
Expand Down
Loading