-
Notifications
You must be signed in to change notification settings - Fork 1.8k
terraform suport for google_folder_service_identity #13462
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
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: see go/terraform-auto-test-runs to set up automatic test runs. @ScottSuarez, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. |
Tests analyticsTotal tests: 166 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Failing test are not related to my changes |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. |
1 similar comment
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. |
Tests analyticsTotal tests: 166 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Tests analyticsTotal tests: 166 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit perplexed by this resource. It seems like an imperative operation that will do a one time thing. From my read of the resource code. It isn't guaranteed to return the SA in question even which brings up it's usefulness in a terraform config.
- what happens if the service identity was already generated? Will this error out or no-op? Will it return the value for the SA? If not, how the customer expected to use this resource within their config and with other terraform resources?
mmv1/third_party/terraform/services/resourcemanager/resource_folder_service_identity.go.tmpl
Show resolved
Hide resolved
mmv1/third_party/terraform/services/resourcemanager/resource_folder_service_identity.go.tmpl
Show resolved
Hide resolved
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. |
Tests analyticsTotal tests: 166 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
If service identity already created, it returns existing service identity. There is already a project-level analog resource named google_project_service_identity which does the same. Yes, you are right. It is one time thing. But we might need it to configure the newly created folders. Here use case for it: I want to add terraform support for the folder level resource called PolicyOrchestratorForFolder. To create PolicyOrchestratorForFolder, I should have folder-level service account with granted permissions. Currently terraform supports only project-level service account creation. So, there is no way to add VCR tests for PolicyOrchestratorForFolder without those service accounts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the delay here. Hoping to get a formal review sometime today. I need to interact with the api directly to understand the IO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I believe this can be implemented through the generator and would prefer we do it there if possible.
exclude_delete can be true for this resource. The resource would also be marked as immutable.
for the read_url/self_link it would be the same as the create url.
/v1beta1/folders/--/services/osconfig.googleapis.com:generateServiceIdentity
Since if called multiple times this endpoint effectively serves as read only.
Could you give it a try and let me know if you have issues? I'm not going to excessively block on this if you strongly desire hand written. As a general philosophy we only add handwritten resources when the resource pattern is calls for it.
As is, all your current code does work
Also could you follow go/fix-missing-service-labels fix the failing check there? |
@ScottSuarez |
I'm tentatively approving. If you are in progress of writing mmv1 yaml we can wait. But I won't block, as mentioned above. Ultimately your team is managing this resource so I am okay merging. |
@ScottSuarez Thanks! You're absolutely right that our general preference is to implement resources via MMv1 when possible. But, with MMv1, I ran into a few challenges:
I need this resource to unblock VCR testing and support for PolicyOrchestratorForFolder, which depends on the existence of the service identity. Since Terraform doesn't currently support creation of folder-level service identities, this resource is essential to move that forward. I understand the philosophy of preferring MMv1 when feasible. And for now, I’d prefer to move forward with this version so we can unblock the PolicyOrchestratorForFolder work. Let me know if you have any concerns, otherwise I’d like to proceed with merging. |
merged ! :) |
683ee15
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.