cf-terraforming icon indicating copy to clipboard operation
cf-terraforming copied to clipboard

Fix generation of cloudflare_access_application

Open hur opened this issue 1 year ago • 0 comments

Fixes https://github.com/cloudflare/cf-terraforming/issues/734

The Cloudflare API response for ListAccessApplications seems to contain much more policy-related data than is necessary to generate the Terraform manifests, which only require the policy IDs. writeAttrLine panics on this data as it is of unexpected format.

This PR remaps the policy data to only keep the IDs of the policies associated with each application.

I have tested this locally, but have not added any unit tests as they seem to require API key access for specific zones/accounts for the regeneration part. Happy to add some if there's any guidelines on the process.

hur avatar Aug 16 '24 16:08 hur