thinkinglabs / aws-iam-policy

A TypeScript Node.js module to manipulate AWS IAM Policy documents
MIT License
17 stars 2 forks source link

PolicyDocument should allow setting Id #29

Open gabegorelick opened 1 week ago

gabegorelick commented 1 week ago

The Id element is used by some services. For example, here's a KMS key generated by CloudTrail that includes an Id:

image

It's currently not possible to represent such a policy with a PolicyDocument. Instead, you have to convert the PolicyDocument to JSON and then append the Id field yourself.

See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_id.html.

tdpauw commented 1 week ago

Absolutely. Good point. Thank you.