Skip to content

Conversation

quixoticmonk
Copy link
Contributor

Description

Added support for projects under scope and workspace id exclusion support .
Closes #1684

Testing plan

  1. Use a TFE_TOKEN with access to create policysets
  2. Sample configuration. Set workspace_ids which need to be excluded and project ids which need to be in scope
resource "tfe_policy_set" "test" {
  name                    = "my-policy-set"
  description             = "A brand new policy set"
  organization            = "my-org-name"
  kind                    = "sentinel"
  policy_tool_version     = "0.24.1"
  policy_ids              = [tfe_sentinel_policy.test.id]
  project_ids             = [tfe_project.test.id]
  workspace_exclusion_ids = [tfe_workspace.excluded.id]
}

  1. Run terraform apply.

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTFEWorkspace" make testacc

...

Rollback Plan

Changes to Security Controls

@quixoticmonk quixoticmonk requested a review from a team as a code owner September 21, 2025 04:25
@quixoticmonk
Copy link
Contributor Author

  + resource "tfe_policy_set" "workspace_exclusions_only" {
      + agent_enabled           = (known after apply)
      + description             = "CIS AWS Policy Set with workspace exclusions only"
      + global                  = false
      + id                      = (known after apply)
      + kind                    = "sentinel"
      + name                    = "cis-aws-workspace-exclusions"
      + organization            = "####"
      + overridable             = false
      + policy_tool_version     = (known after apply)
      + project_ids             = (known after apply)
      + workspace_exclusion_ids = [
          + "ws-AZzNAnBF4rzfkktn",
        ]
      + workspace_ids           = (known after apply)

      + vcs_repo {
          + branch             = "main"
          + identifier         = "quixoticmonk/policy-library-CIS-Policy-Set-for-AWS-Terraform"
          + ingress_submodules = false
          + oauth_token_id     = "####"
        }
    }

Plan: 4 to add, 0 to change, 0 to destroy.

Apply complete! Resources: 4 added, 0 changed, 0 destroyed.
Screenshot 2025-09-21 at 12 51 42 AM Screenshot 2025-09-21 at 12 52 00 AM

@quixoticmonk
Copy link
Contributor Author

Fixed in #1822

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.

Add support for projects and workspace_exclusions to tfe_policy_set
1 participant