create_space
¶
create_space(
name: str,
domain_id: DomainId,
data_access_role_arn: Arn,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
agent_core_evaluation_role_arn: Optional[Arn] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
tags: Optional[TagMap] = None,
client_token: Optional[ClientToken] = None,
) -> CreateSpaceOutput
Creates a space in a domain. Use GetSpace to retrieve the space, ListSpaces to enumerate spaces, UpdateSpace to modify it, and DeleteSpace to remove it.
Parameters:
-
name(str) –A name that identifies the space. Must be 3-64 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
-
domain_id(DomainId) –The ID of the domain to create the space in.
-
data_access_role_arn(Arn) –The ARN of the IAM role used for data access. The role must be in the caller's account.
-
agent_core_evaluation_role_arn(Optional[Arn], default:None) –The ARN of the IAM role used by AgentCore online evaluation. Must be in the caller's account. Omit if the space does not use AgentCore online evaluation.
-
encryption_configuration(Optional[EncryptionConfiguration], default:None) –How to encrypt the space's data at rest. Omit for service owned encryption, which is equivalent to passing
encryptionStrategyAWS_OWNED. -
tags(Optional[TagMap], default:None) –The tags to associate with the space.
-
client_token(Optional[ClientToken], default:None) –Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
ConflictException–The operation could not be completed because of a conflict with the current state of the resource.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceQuotaExceededException–A service quota was exceeded.
-
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:
Create a space The following example creates a space in a domain and encrypts its data at rest with a customer managed KMS key. The name must be 3-64 characters of lowercase letters, numbers, and hyphens. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.create_space(name='prod-observability', domain_id='d-1a2b3c4d5e', data_access_role_arn='arn:aws:iam::123456789012:role/CloudWatchSpaceDataAccessRole', agent_core_evaluation_role_arn='arn:aws:iam::123456789012:role/CloudWatchAgentCoreEvaluationRole', encryption_configuration={'encryptionStrategy': 'CUSTOMER_MANAGED', 'kmsKeyArn': 'arn:aws:kms:us-east-1:123456789012:key/1a2b3c4d-5e6f-4a3b-8c9d-0e1f2a3b4c5d'}, tags={'Team': 'observability'}, client_token='3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 | |