pulumi / pulumi-aws-native

AWS Native Provider for Pulumi
Apache License 2.0
94 stars 17 forks source link

Consider adding constants for IAM actions #700

Open jen20 opened 6 years ago

jen20 commented 6 years ago

When building policies as JSON objects, it would be nice to have the set of available actions exported as constants from the pulumi-aws library. There are three primary benefits I see:

1) Constants should help reduce the occurrence of typos rendering policies invalid if constants are used, while not preventing raw strings being used where necessary (e.g. for wildcards, or for services not yet supported)

2) The available range of actions becomes more discoverable via auto-completion in editors and IDEs

3) Static analysis could be applied in an IDE using "Find Usages" and so forth, which would be useful in larger code bases.

It would be best to generate the constants from some machine-readable source if possible, though I don't know off-hand if such a source exists.

jen20 commented 6 years ago

It appears that no list of this is published by AWS in machine-readable format, but an enterprising developer has put together a script to extract it from the HTML/JS of the IAM Policy Builder:

https://github.com/rvedotrc/aws-iam-reference and https://github.com/rvedotrc/aws-iam-reference/blob/master/all-actions.txt

jen20 commented 6 years ago

Unfortunately that mechanism does not result in a complete list: all of the neptune-db actions are missing. I didn't check for others, but it doesn't look like that will be a suitable way to get a complete list.

lukehoban commented 1 year ago

It's somewhat unlikely this will be added to the aws library itself at this point - but moving to AWS-native where this might be a more natural addition. Also plausible this could make sense to add to a component package like aws-iam?