-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix CloudTrail handling of custom policy URLs. #1216
Conversation
This updates the CloudTrail customizations to stop making HTTP requests to fetch custom policies, instead relying on the updated behavior of the CLI to automatically handle file and URL parameters for custom commands. Before this fix, the CLI would fetch the data into a string, then the CloudTrail customization would try to fetch the string as if it were a URL, fail, and throw an error.
I like this change. Can you add a test that uses the To create the custom policy in a local file, you can create a temp file with |
f.write('{"Statement": []}') | ||
command = ( | ||
'cloudtrail create-subscription --s3-use-bucket foo ' | ||
'--name bar --s3-custom-policy file://{0}'.format(f.name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Kyle here. Let's verify that the policy we pass into the botocore layer is the value we expect.
Thanks! 🚢 |
Fix CloudTrail handling of custom policy URLs.
This updates the CloudTrail customizations to stop making HTTP requests
to fetch custom policies, instead relying on the updated behavior of the
CLI to automatically handle file and URL parameters for custom commands.
Before this fix, the CLI would fetch the data into a string, then the
CloudTrail customization would try to fetch the string as if it were
a URL, fail, and throw an error.
cc @jamesls @kyleknap