aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 78 forks source link

Write-CWEPermission returns InvalidOperation: Policy size would be larger than the maximum allowed #148

Closed idomingo closed 3 years ago

idomingo commented 4 years ago

The cmd Write-CWEPermission fails with the message: InvalidOperation: Policy size would be larger than the maximum allowed. Aparently, in the sdk version i'm running, there is some kind of validation before running the command. The existing policy for the default event bus is large, but adding a new account is allowed, it does not reach any limit.

Expected Behavior

The equivalent command in the aws sdk for linux is aws events put-permission. It works with the same parameters in the same account. Same with aws sdk for python, boto3. The equivalent command works. Adding the account manually in the aws console also works fine.

Steps to Reproduce (for bugs)

Write-CWEPermission -Principal "123456789012" -StatementId "MyID" -Action "events:PutEvents"

Your Environment

AWS Tools for Windows PowerShell Version 4.0.4.0

Amazon Web Services SDK for .NET Core Runtime Version 3.3.104.22

ashishdhingra commented 3 years ago

Hi @idomingo,

Good afternoon.

I was going through issue backlog and came across this one. Somehow, the below PowerShell command works fine for me:

Write-CWEPermission -Principal 139480602983 -StatementId "MyID" -Action "events:PutEvents"

After executing above statement, I'm able to see the above account permissions under CloudWatch -> Event Buses.

Could you please elaborate on the existing policy for default event bus, may be that's the missing piece here?

Thanks, Ashish

github-actions[bot] commented 3 years ago

This issue has not recieved a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.