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

Add support for Cloud Asset feeds #2284

Conversation

modular-magician
Copy link
Collaborator

Added resources for the Cloud Asset Inventory feeds. The feeds requires the billing project to be passed on via the X-Goog-User-Project HTTP header. In order to accomplish this without modifying the current transport logic, I have added a pre_create custom code hook right before the sendRequestWithTimeout function. It would be preferable to provide a proper option to do this without abusing the UserProjectOverride field.

This API is weird in the sense that the feed payload needs to be sent under a feed attribute, but in the HTTP response the payload is directly in the body. I solved this by moving the feed under a feed attribute in the pre_commit and pre_update hooks.

Release Note Template for Downstream PRs (will be copied)

`google_cloud_asset_organization_feed`
`google_cloud_asset_folder_feed`
`google_cloud_asset_project_feed`

Derived from GoogleCloudPlatform/magic-modules#3750

* Added pre_create custom code hook

* Adding the google_cloud_asset_project_feed resource type

* Move the pre_create override further down. We need the provect var to be available by then.

* Get the variables from the test environment

* Just update the project variable, not the whole data structure.

* Add the google_cloud_asset_folder_feed resource type

* Adding the google_cloud_asset_organization_feed resource type

* Remove blank lines to avoid unecessary diffs

* Just noticed the attributes in the output destination were not marked as required.

* Fix linter error

* Update copyright

* Add enum for contentType parameter

* Moving folder and org id to params block

* Removing unnecessary autogen_async flag

* Moving the obj structure code to an encoder

* Added folder_id computed attribute

* Rename project to billing_project in folder and org feeds for consistency across resources and with gcloud command

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit 24f778a into hashicorp:master Jul 21, 2020
@modular-magician modular-magician deleted the downstream-pr-f9a00a958506df8d13b66531819b31bd8f2dc108 branch November 16, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant