View a markdown version of this page

GetSpaceCredentialsForOrganization - Amazon CloudWatch Omni

GetSpaceCredentialsForOrganization

Returns temporary credentials for a space in an organization member account. The credentials are valid for one hour.

The caller must be the organization's management account or a delegated administrator with access to the target space. The target account must be an active member of the same organization as the domain, and the space must already exist.

Request Parameters

context

Context for credential resolution.

Type: SpaceCredentialRequestContext object

Required: Yes

credentialType

Selects which member-account credential to return. Set this to SPACE_OPERATION.

Type: String

Valid Values: SPACE_OPERATION

Required: Yes

Response Elements

The following element is returned by the service.

credentials

The temporary AWS credentials for the space.

Type: AwsCredentials object

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

The caller is not authorized to perform this action.

HTTP Status Code: 403

InternalServerException

An unexpected error occurred while processing the request.

errorCode

The error code associated with the internal error.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource does not exist.

errorCode

The error code associated with the failure.

resourceId

The identifier of the resource that could not be found. Not always present.

resourceType

The type of the resource that could not be found. Not always present.

HTTP Status Code: 404

ThrottlingException

The request was throttled due to exceeding the allowed request rate.

retryAfterSeconds

The number of seconds to wait before retrying the request. Not always present.

HTTP Status Code: 429

ValidationException

A parameter is specified incorrectly.

errorCode

The error code associated with the validation failure.

HTTP Status Code: 400

Examples

Get space credentials for an organization member account

The following example returns temporary, space-scoped AWS credentials for an existing space in an organization member account, selected by spaceId. The credentials are valid for one hour, as reflected by the expiration timestamp. Payloads are shown as JSON; on the wire they are CBOR-encoded.

Sample Request

{ "context": { "spaceId": "a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d" }, "credentialType": "SPACE_OPERATION" }

Sample Response

{ "credentials": { "accessKeyId": "ASIAIOSFODNN7EXAMPLE", "expiration": "2026-09-16T15:22:31Z", "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "sessionToken": "IQoJb3JpZ2luX2VjEXAMPLESESSIONTOKEN1234567890" } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: