create_space
async
¶
create_space(
name: str,
domain_id: DomainId,
data_access_role_arn: Arn,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
identity_center_configuration: Optional[SpaceIdentityCenterConfiguration] = 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.
-
identity_center_configuration(Optional[SpaceIdentityCenterConfiguration], default:None) –Identity Center settings for this space. Omit to use the space's Region.
-
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.
>>> await 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/async_cloud_watch_omni.py
1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 | |