S3Client.create_session
rboto-s3==0.4.0 · Service index · Types
Model summary (excerpt): Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets. For more information about Zonal endpoint API operations that include the Availability Zone in the request endpoint, see S3 Express One Zone APIs in the Amazon S3 User Guide . To make Zonal endpoint API requests on a...
Install and imports
from rboto import S3Client
from rboto_s3.types import (
CreateSessionOutput,
ServerSideEncryption,
SessionMode,
)
Signature
async def create_session(
*,
bucket: str,
session_mode: SessionMode | None = None,
server_side_encryption: ServerSideEncryption | None = None,
ssekms_key_id: str | None = None,
ssekms_encryption_context: str | None = None,
bucket_key_enabled: bool | None = None,
) -> CreateSessionOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
bucket |
Yes | The name of the bucket that you create a session for. |
session_mode |
No | Specifies the mode of the session that will be created, either ReadWrite or ReadOnly . If no session mode is specified, the default behavior attempts to create a session with the maximum allowable privilege. It will first attempt to create a ReadWrite session, and if that is not allowed by permissions, it will attempt to create a ReadOnly session. If neither session type is allowed, the... |
server_side_encryption |
No | The server-side encryption algorithm to use when you store objects in the directory bucket. For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). By default, Amazon S3 encrypts data with SSE-S3. For more information, see... |
ssekms_key_id |
No | If you specify x-amz-server-side-encryption with aws:kms , you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in... |
ssekms_encryption_context |
No | Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on... |
bucket_key_enabled |
No | Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS). S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general... |
Output
CreateSessionOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
server_side_encryption |
ServerSideEncryptionOutput | None |
Always present | ServerSideEncryptionOutput |
ssekms_key_id |
str | None |
Always present | — |
ssekms_encryption_context |
str | None |
Always present | — |
bucket_key_enabled |
bool | None |
Always present | — |
credentials |
SessionCredentialsOutput | None |
Always present | SessionCredentialsOutput |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
CreateSessionOutput, ServerSideEncryption, SessionMode
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_s3.exceptions:
Other service failures use the service base error; credential, transport and timeout failures use shared errors.