We have a multi-state Terraform configuration for an AWS Organisation. In one state, we create organisation policies and in another state we want to attach those policies to accounts/OUs.
I’m having an issue working out how we can lookup the organisation policy to be used as an attachment, as there doesn’t seem to be a data resoruce. The AWS organization data block allows you to see the policy types that are enabled but doesn’t seem to list the actual policies.
How can I get the Policy ID using the AWS Provider, when module output is unavailable?