Closed daniel-anova closed 2 years ago
Hi @daniel-anova , I think it's not a Terraform azure plugin's bug nor an Azure bug.
According to the cosmosdb document:
Apache Cassandra also has a concept of
compound keys
. A compoundprimary key
consists of more than one column; the first column is thepartition key
, and any additional columns are theclustering keys
For example, the following cosmosdb SQL:
CREATE TABLE uprofile.user (
user text,
id int,
message text,
PRIMARY KEY (user, id));
The partition key is user
and the cluster keys is [id
].
In your case the partition key and cluster key are same:
CREATE TABLE tfex-cosmos-cassandra-keyspace.testtable (
timestamp timestamp,
PRIMARY KEY (timestamp , timestamp ));
If you try to create a table with this SQL via portal you'll get exactly the same error:
In this case, just removing the cluster key should work.
@lonegunmanb thanks for the clarification. I see that second parameter in PRIMARY KEY
is the cluster key and not a second column for composite primary keys.
I'll close this issue down, thank you for you time.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureRM Provider) Version
Terraform v1.1.5 on linux_amd64
Affected Resource(s)
azurerm_cosmosdb_cassandra_table
Terraform Configuration Files
Debug Output
https://gist.github.com/daniel-anova/015778d85c0a76ac852e0a58acfcc03d
Expected Behaviour
azurerm should create the table successfuly.
Actual Behaviour
Table fails to create with the following error:
Commenting out the
cluster_key
block applying once, uncommenting it and applying again allows terraform to fully apply the table successfully.Steps to Reproduce
terraform apply