createSpace

abstract suspend fun createSpace(input: CreateSpaceRequest): CreateSpaceResponse

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.

Samples

// 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.
val resp = cloudWatchOmniClient.createSpace {
    name = "prod-observability"
    domainId = "d-1a2b3c4d5e"
    dataAccessRoleArn = "arn:aws:iam::123456789012:role/CloudWatchSpaceDataAccessRole"
    agentCoreEvaluationRoleArn = "arn:aws:iam::123456789012:role/CloudWatchAgentCoreEvaluationRole"
    encryptionConfiguration = EncryptionConfiguration {
        encryptionStrategy = EncryptionStrategy.fromValue("CUSTOMER_MANAGED")
        kmsKeyArn = "arn:aws:kms:us-east-1:123456789012:key/1a2b3c4d-5e6f-4a3b-8c9d-0e1f2a3b4c5d"
    }
    tags = mapOf<String, String>(
        "Team" to "observability"
    )
    clientToken = "3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73"
}