Skip to content

Conversation

@isivaselvan
Copy link
Collaborator

Description

Implemented Policy Set Parameters API Specs

https://developer.hashicorp.com/terraform/cloud-docs/api-docs/policy-set-params

Feature contains:

  • list() --> Listing all parameters
  • create() --> Creating new policy set parameter
  • read() --> Show the parameter
  • update() --> update the parameter
  • delete() --> Delete the parameter
  • _policy_set_parameter_from( --> Helper method to return the policy set parameter
  • Unit test cases added at tests/units/test_policy_set_parameter.py
  • examples added at examples/policy_set_parameter.py

Testing plan

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

> python examples/policy_set_parameter.py --policy-set-id polset-6q**

================================================================================
Listing parameters for policy set: polset-6q*
================================================================================
- var-pmb**
  Key: test_parameter
  Value: ***SENSITIVE***
  Category: policy-set
  Sensitive: True

- var-Qam7**
  Key: test_param
  Value: completely_new_value
  Category: policy-set
  Sensitive: False

- var-nDM**
  Key: test_param_15
  Value: test_value_15
  Category: policy-set
  Sensitive: False


> python examples/policy_set_parameter.py --policy-set-id polset-6q** --create --key pr_test_param --value "test_for_pr" --sensitive

================================================================================
Creating new parameter with key: pr_test_param
================================================================================
Created parameter: var-Peyot6Q6DUgo9MF4
  Key: pr_test_param
  Value: ***SENSITIVE***
  Category: policy-set
  Sensitive: True

================================================================================
Listing parameters after creation
================================================================================
- pr_test_param: ***SENSITIVE*** (sensitive=True)
- test_parameter: ***SENSITIVE*** (sensitive=True)
- test_param: completely_new_value (sensitive=False)
- test_param_15: test_value_15 (sensitive=False)


> python examples/policy_set_parameter.py --policy-set-id polset-6q** --read --parameter-id var-Peyot**

================================================================================
Reading parameter: var-Peyot6Q6DUgo9MF4
================================================================================
Parameter ID: var-Peyot**
  Key: pr_test_param
  Value: ***SENSITIVE***
  Category: policy-set
  Sensitive: True


> python examples/policy_set_parameter.py --policy-set-id polset-6q** --update --parameter-id var-nDM3SmWt* --key "restored_param_15"

================================================================================
Updating parameter: var-nDM3SmWt*
================================================================================
Before update:
  Key: updated_param_key
  Value: test_value_15
  Sensitive: False

After update:
  Key: restored_param_15
  Value: test_value_15
  Sensitive: False


> python examples/policy_set_parameter.py --policy-set-id polset-6q** --delete --parameter-id var-Peyot6Q6*

================================================================================
Deleting parameter: var-Peyot6Q6*
================================================================================
Parameter to delete:
  ID: var-Peyot6Q6*
  Key: pr_test_param
  Value: ***SENSITIVE***
  Sensitive: True

Successfully deleted parameter: var-Peyot6Q6*

Rollback Plan

Changes to Security Controls

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

If you have any questions, please contact your direct supervisor, GRC (#team-grc), or the PCI working group (#proj-pci-reboot). You can also find more information at PCI Compliance.

@isivaselvan isivaselvan requested a review from a team as a code owner November 26, 2025 08:33
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Nov 26, 2025

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@isivaselvan isivaselvan merged commit 5959bfd into next-0.1.1 Dec 1, 2025
11 checks passed
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.

2 participants