get_space_data_access
async
¶
get_space_data_access(
space_id: SpaceId,
target_scopes: DataAccessTargetList,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
duration_seconds: Optional[int] = None,
audit_context: Optional[DataAccessAuditContext] = None,
) -> GetSpaceDataAccessOutput
Returns temporary credentials for working with data in a space, limited to the actions you request. The credentials allow only the requested actions that can be granted in the space and that your access grants allow. Requested actions that cannot be conferred are ignored rather than rejected.
Parameters:
-
space_id(SpaceId) –The unique ID of the space to return credentials for.
-
target_scopes(DataAccessTargetList) –The actions to include in the credentials, grouped by service.
-
duration_seconds(Optional[int], default:None) –The lifetime of the credentials, in seconds. Defaults to 3600.
-
audit_context(Optional[DataAccessAuditContext], default:None) –Caller-supplied key-value pairs that are recorded for auditing. They do not affect authorization or the permissions of the credentials.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
PolicyTooLargeException–The requested actions produce a credential that exceeds the maximum size. Request fewer actions.
-
ResourceNotFoundException–The specified resource does not exist.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Get data credentials for log queries The following example requests credentials that allow running log queries and reading metric data in a space. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.get_space_data_access(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', target_scopes=[{'actions': ['logs:StartQuery', 'logs:GetQueryResults']}, {'actions': ['cloudwatch:GetMetricData']}], duration_seconds=3600, audit_context={'source': 'logs-console'})
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 | |