AWS::Cassandra::Keyspace
You can use the AWS::Cassandra::Keyspace
resource to create a new keyspace
in Amazon Keyspaces (for Apache Cassandra). For more information, see Create a
keyspace and a table in the Amazon Keyspaces
Developer Guide.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Cassandra::Keyspace", "Properties" : { "KeyspaceName" :
String
, "Tags" :[ Tag, ... ]
} }
YAML
Type: AWS::Cassandra::Keyspace Properties: KeyspaceName:
String
Tags:- Tag
Properties
KeyspaceName
-
The name of the keyspace to be created. The keyspace name is case sensitive. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the keyspace name. For more information, see Name type.
Length constraints: Minimum length of 3. Maximum length of 255.
Pattern:
^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$
Required: No
Type: String
Update requires: Replacement
Tags
-
A list of key-value pair tags to be attached to the resource.
Required: No
Type: List of Tag
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the name of the keyspace. For example:
{ "Ref": "MyNewKeyspace" }
For more information about using the Ref
function, see Ref.
Examples
Create a new keyspace
The following example creates a new keyspace named
MyNewKeyspace
with the following tags: {'key1':'val1', 'key2':'val2'}
.
JSON
{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MyNewKeyspace": { "Type": "AWS::Cassandra::Keyspace", "Properties": { "KeyspaceName": "MyNewKeyspace", "Tags": [{"Key":"tag1","Value":"val1"}, {"Key":"tag2","Value":"val2"}] } } } }
YAML
AWSTemplateFormatVersion: 2010-09-09 Resources: MyNewKeyspace: Type: AWS::Cassandra::Keyspace Properties: KeyspaceName: MyNewKeyspace Tags: - Key: tag1 Value: val1 - Key: tag2 Value: val2