get_space_data_access
¶
get_space_data_access(
space_id: SpaceId,
target_scopes: DataAccessTargetList,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = 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.
>>> 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/cloud_watch_omni.py
3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 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 | |