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 #6821

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 bb8099b into hashicorp:master Jul 21, 2020
@ghost
Copy link

ghost commented Aug 21, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant