Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(secure-onboarding): Adding AccountFeature Resource #508

Merged
merged 4 commits into from
May 2, 2024

Conversation

ravinadhruve10
Copy link
Contributor

Change summary:

  • Adding new Account Feature resource with schema and CRUD operations
    in parity with Cloudauth Account and AccountComponent resource.
  • Adding the respective client and support for new resource type.
  • Added TF ACC tests for the new resource type.
  • Added docs md for the new resource.

@ravinadhruve10
Copy link
Contributor Author

ravinadhruve10 commented May 1, 2024

A heads-up - the TF acceptance tests in other envs are known to fail, until the BE changes are released in all envs.
Keeping it in Draft until then, but the changes are ready for review.

PS: those envs will likely have dangling resources requiring to be cleaned up though.

TF acc test results in stg:

$  TF_ACC=1 go test -v resource_sysdig_secure_cloud_auth_account_feature_test.go
=== RUN   TestAccSecureCloudAuthAccountFeature
=== PAUSE TestAccSecureCloudAuthAccountFeature
=== RUN   TestAccSecureCloudAuthAccountFeatureWithFlags
=== PAUSE TestAccSecureCloudAuthAccountFeatureWithFlags
=== CONT  TestAccSecureCloudAuthAccountFeature
=== CONT  TestAccSecureCloudAuthAccountFeatureWithFlags
2024/05/01 12:58:24 [DEBUG] POST https://secure-staging.sysdig.com/api/cloudauth/v1/accounts
2024/05/01 12:58:24 [DEBUG] POST https://secure-staging.sysdig.com/api/cloudauth/v1/accounts
2024/05/01 12:58:24 [DEBUG] POST https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c/components
2024/05/01 12:58:24 [DEBUG] POST https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40/components
2024/05/01 12:58:25 [DEBUG] PUT https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c/feature/FEATURE_SECURE_CONFIG_POSTURE
2024/05/01 12:58:25 [DEBUG] PUT https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40/feature/FEATURE_SECURE_AGENTLESS_SCANNING
2024/05/01 12:58:25 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c?decrypt=true
2024/05/01 12:58:25 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40?decrypt=true
2024/05/01 12:58:25 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40/components/COMPONENT_SERVICE_PRINCIPAL/secure-scanning
2024/05/01 12:58:25 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c/components/COMPONENT_SERVICE_PRINCIPAL/secure-posture
2024/05/01 12:58:25 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40/feature/FEATURE_SECURE_AGENTLESS_SCANNING
2024/05/01 12:58:25 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c/feature/FEATURE_SECURE_CONFIG_POSTURE
2024/05/01 12:58:26 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40?decrypt=true
2024/05/01 12:58:26 [DEBUG] GET https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c?decrypt=true
2024/05/01 12:58:26 [DEBUG] DELETE https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40/feature/FEATURE_SECURE_AGENTLESS_SCANNING
2024/05/01 12:58:26 [DEBUG] DELETE https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40/components/COMPONENT_SERVICE_PRINCIPAL/secure-scanning
2024/05/01 12:58:26 [DEBUG] DELETE https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c/feature/FEATURE_SECURE_CONFIG_POSTURE
2024/05/01 12:58:27 [DEBUG] DELETE https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c/components/COMPONENT_SERVICE_PRINCIPAL/secure-posture
2024/05/01 12:58:27 [DEBUG] DELETE https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/a05ca0f9-8a45-4818-b419-8dfed5b0a62c
2024/05/01 12:58:27 [DEBUG] DELETE https://secure-staging.sysdig.com/api/cloudauth/v1/accounts/23a3bb83-1646-4e43-87ad-f4cb73bbee40
--- PASS: TestAccSecureCloudAuthAccountFeatureWithFlags (3.31s)
--- PASS: TestAccSecureCloudAuthAccountFeature (3.43s)
PASS
ok  	command-line-arguments	3.770s

Copy link
Contributor

@cgeers cgeers left a comment

Choose a reason for hiding this comment

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

This looks good to me. Everything I'd expect to see. Nicely done.

sysdig/internal/client/v2/cloudauth_account_feature.go Outdated Show resolved Hide resolved
@cgeers cgeers marked this pull request as ready for review May 1, 2024 20:15
@ravinadhruve10
Copy link
Contributor Author

This looks good to me. Everything I'd expect to see. Nicely done.

Awesome, thanks! And thanks @haresh-suresh for making the base changes. :)

haresh-suresh and others added 4 commits May 2, 2024 09:46
Change summary:
----------------
- Adding new Account Feature resource with schema and CRUD operations
  in parity with Cloudauth Account and AccountComponent resource.
- Adding the respective client and support for new resource type.
- Added TF ACC tests for the new resource type.
- Added docs md for the new resource.
@cgeers cgeers force-pushed the add-feature-resource branch from d2c0ac9 to 7bc154a Compare May 2, 2024 14:46
@cgeers cgeers merged commit f681575 into master May 2, 2024
23 checks passed
@cgeers cgeers deleted the add-feature-resource branch May 2, 2024 15:02
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.

3 participants