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(IAM Policy Management): add support for v2/policies API #4381

Merged
merged 5 commits into from
Mar 24, 2023

Conversation

swcolley
Copy link
Contributor

@swcolley swcolley commented Mar 1, 2023

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates: https://github.ibm.com/IAM/AM-issues/issues/926

This PR adds support for v2/policies which provides support for time-based conditions. For more information see: https://cloud.ibm.com/docs/account?topic=account-iam-time-based&interface=ui

Since there are so many tests and changes I'd appreciate a full review of the acceptance tests. I ran existing policy and the new tests in my local environment, but a full run of all tests would be appreciated.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccIBMIAMAccessGroupPolicyDataSource_Time_' 
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	36.379s

$ make testacc TESTARGS='-run=TestAccIBMIAMAccessGroupPolicy_With_Time_Based_Conditions' 
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	50.088s

@kavya498
Copy link
Collaborator

kavya498 commented Mar 9, 2023

Since you made changes to existing code and IAMPAP is widely used resource by most of the customers and users
Can you please attach results of all IAM PAP testcases. Want to make sure that nothing breaks.
Thanks.

@swcolley
Copy link
Contributor Author

Since you made changes to existing code and IAMPAP is widely used resource by most of the customers and users Can you please attach results of all IAM PAP testcases. Want to make sure that nothing breaks. Thanks.

Yes, I'll upload those as soon as I am able. Is there also a way for terraform team to run all of the acceptance tests? I think there are some that cannot pass using my person credentials (they conflict with existing admin tests, and they failed locally before I made any changes).

@hkantare
Copy link
Collaborator

@swcolley
No we are not running any accpetance tests now a days because the services has taken the ownership of respective res/ds

@hkantare
Copy link
Collaborator

Fix conflicts in go.mod and go.sum

@swcolley
Copy link
Contributor Author

User Policy All Tests

shaunsmacibm@Shauns-MBP terraform-provider-ibm % go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMUserPolicy -timeout 700m                 
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	450.424s

Access Group Policy All Tests

shaunsmacibm@Shauns-MBP terraform-provider-ibm % go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMAccessGroupPolicy -timeout 700m
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	513.116s

Trusted Profile Policy All Tests

shaunsmacibm@Shauns-MBP terraform-provider-ibm % go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMTrustedProfilePolicy -timeout 700m             
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	460.279s

Service Policy All Tests:

shaunsmacibm@Shauns-MBP terraform-provider-ibm % go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMServicePolicy -timeout 700m 
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	445.915s

Authorization Policy (no changes) All Tests:

shaunsmacibm@Shauns-MBP terraform-provider-ibm % go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMAuthorizationPolicy -timeout 700m
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	43.568s

Update markdown with info about rule_conditons and catch for updating v1/policy with rule/pattern
@swcolley
Copy link
Contributor Author

@hkantare @kavya498 I have pasted test info and updated the go.mod/go.sum

@hkantare
Copy link
Collaborator

Can we fix the conflict in go.sum

@swcolley
Copy link
Contributor Author

Can we fix the conflict in go.sum

Updated.

@hkantare hkantare merged commit b2fa9dd into IBM-Cloud:master Mar 24, 2023
omaraibrahim pushed a commit to omaraibrahim/terraform-provider-ibm that referenced this pull request Jul 20, 2023
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