boto3
boto3 copied to clipboard
Add option to output the 'CLI skeleton'
Describe the feature
Sorry if this or similar exists, but I couldn't find it.
I think it would be convenient to be able to supply a dry_run=True or print_skeleton_only=True or similar argument (default False for current behaviour) that, instead of actually making the API request, returns the aws --generate-cli-skeleton structure, populated with whatever other values were given as arguments to that particular invocation.
For example:
bucket_website = boto3.resource("s3").BucketWebsite("foobar")
bucket_website.put(WebsiteConfiguration={"ErrorDocument": {"Key": "en/404/index.html"}}, dry_run=True)
would not actually apply that configuration, but instead return:
{
"Bucket": "foobar",
"ChecksumAlgorithm": "SHA1",
"WebsiteConfiguration": {
"ErrorDocument": {
"Key": "en/404/index.html"
}
}
(and perhaps whatever other values as appropriate)
Use Case
A management command that runs in-cluster but without the necessary IAM permission to perform this action, it would be convenient to print the full input for the operator (or script that does have permission) to then run with aws --cli-input-json.
Proposed Solution
No response
Other Information
No response
Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
SDK version used
1.24.38
Environment details (OS name and version, etc.)
N/A
Thanks @OJFord for the feature request, I'd like to get the team's input. Others can 👍 your issue if they are also interested in this feature.