Skip to content

feat(zone): add Zone resource for Secure#609

Merged
vojindj merged 17 commits intomasterfrom
SP-4514
Mar 20, 2025
Merged

feat(zone): add Zone resource for Secure#609
vojindj merged 17 commits intomasterfrom
SP-4514

Conversation

@vojindj
Copy link
Copy Markdown
Collaborator

@vojindj vojindj commented Mar 11, 2025

No description provided.

@vojindj vojindj marked this pull request as ready for review March 12, 2025 15:45
Comment thread sysdig/internal/client/v2/zones.go Outdated
Copy link
Copy Markdown

@luzeno luzeno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but it would be better to get some more experienced review

Comment thread sysdig/resource_sysdig_secure_zone.go Outdated
Computed: true,
},
SchemaScopesKey: {
Optional: true,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't know terraform well.
Is this resource related to the new platform zones?
Because if it is, scopes are mandatory, and they can be 1 or more.
On L:52 I see MaxItems:1 .
Also scopes ids are missing 🤔
This is an example response from staging:

// ....
"scopes": [
    {
        "id": 439653,
        "rules": "",
        "targetType": "azure"
    },
    {
        "id": 439654,
        "rules": "",
        "targetType": "kubernetes"
    },
    {
        "id": 439655,
        "rules": "",
        "targetType": "host"
    }
]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for checking! yes, this resource is for creating new platform zones, but since it's only for secure currently it is named like other secure resources.
I changed scopes to be required field and also I added id as a field for scope... nice catch! 👍
MaxItems:1 is for "scopes" field - we can have only one of those. MinItems: 1 is set for "scope", because we need at least one of them.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed scopes to simplify the schema

@vojindj vojindj merged commit 631a98d into master Mar 20, 2025
23 checks passed
@vojindj vojindj deleted the SP-4514 branch March 20, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants