-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IAM: Problems sythesizing a role that can read from an SQS queue #622
Comments
Removing the line: |
|
Yeah, that is the way. Another unfortunate case of a too broad type declaration? |
Seems unintuitive, since I can do |
I guess right now you have to be unfortunately aware of whether you're using a low-level class (will need you to use |
A number methods were allowing 'any's in places where they easily lead to passing the wrong object. - `role.attachManagedPolicy` - Various methods on `PolicyStatement`. By restrictinig the types to what we actually expect (or `string`s) these mistakes will be harder to make. Fixes #622, doesn't completely resolve but helps with #621.
A number methods were allowing `any`s in places where they easily led to passing the wrong object. - `role.attachManagedPolicy()`, expected an `Arn` but it was possible to pass it a `Policy` object by mistake. - Various methods on `PolicyStatement`. Notably: `addResource()` which is supposed to take an `Arn` but it was too easy to pass it a resource object by mistake. By restrictinig the types to what we actually expect these mistakes will be harder to make (at the expense of slightly more code when passing raw strings). Most likely breakage consumers will see: - `addResource("*")`, replace with `addAllResources()`. - `addResource("some-arn")`, replace with `new Arn("some-arn")`. - `new ServicePrincipal(new FnConcat(...))`, replace with `new ServicePrincipal(new FnConcat(...).toString())`. Fixes #622, doesn't completely resolve but helps with #621.
Java code:
Expected Behavior: Create a role with a policy that allows reading from the queue.
Actual Behavior:
The text was updated successfully, but these errors were encountered: