cli_binary_format - AWS SDKs and Tools

cli_binary_format

This setting applies only to AWS CLI commands.

Specifies how the AWS CLI version 2 interprets binary input parameters.

Details

Default value:

  • AWS CLI version 1 – raw-in-base64-out. In AWS CLI version 1 you can't change this setting.

  • AWS CLI version 2 – base64

Valid values:

  • base64 – An input parameter that is typed as a binary large object (BLOB) that accepts a base64-encoded string. To pass true binary content, put the content in a file and provide the file's path and name with the fileb:// prefix as the parameter's value. To pass base64-encoded text contained in a file, provide the file's path and name with the file:// prefix as the parameter's value.

  • raw-in-base64-out – Provides backward compatibility with the AWS CLI version 1 behavior where binary values must be passed literally.

This setting also affects how the AWS CLI version 2 handles input files that contain information for a binary parameter.

  • If you specify a binary value by referencing a file using the fileb:// prefix notation, the AWS CLI (both versions 1 and 2) always handles the file as raw binary content and doesn't attempt to convert the value.

  • If you specify a binary value by referencing a file using the file:// prefix notation, the AWS CLI version 2 handles the file according to the current cli_binary_format setting. If that setting's value is base64 (the default when not explicitly set), the CLI handles the file as base64-encoded text. If that setting's value is raw-in-base64-out, the AWS CLI version 2 handles the file as raw binary content. The AWS CLI version 1 always handles a file referenced by file:// as raw binary content.

Ways to set this value

Location Supported Example
config file Yes
cli_binary_format = raw-in-base64-out
credentials file -
Environment variable -
AWS CLI parameter Yes
--cli-binary-format raw-in-base64-out

Compatibility with AWS SDKS and tools