udondan / iam-floyd

AWS IAM policy statement generator with fluent interface
https://iam-floyd.readthedocs.io/
Apache License 2.0
540 stars 19 forks source link

Accept CDK constructs in `on_*` methods. #146

Open gshpychka opened 2 years ago

gshpychka commented 2 years ago

It would be great if we could pass a CDK construct in the on_* methods, instead of passing all the ARN parts. The boilerplate feels unnecessary.

udondan commented 2 years ago

It's a nice idea but I don't see a viable solution.

How would floyd know if a construct has an ARN and what is the properties name without manually implementing every available CDK construct?

Manually implementing every single construct seems to be a huge amount of work and the benefit is rather small, because passing an ARN is pretty straight forward, e.g. for a Lambda function: .on(fn.functionArn).