Terraform-provider-aws: Amazon Managed Apache Cassandra Service

Created on 10 Dec 2019  路  5Comments  路  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Since one week, AWS released Managed Apache Cassandra service in a couple of regions: https://aws.amazon.com/mcs/. Obviously, I can't find anything in the Terraform docs, so I'm assuming that this still needs to be implemented. If this is the case, I would like to contribute. Please have a look at the potential Terraform configuration below.

New or Affected Resource(s)

I'm not sure which existing resources are affected by this but new resources could be named:

  • aws_mcs_keyspace
  • aws_mcs_table

Potential Terraform Configuration

"aws_mcs_keyspace" "example" {
     name = "mcs-keyspace-example"
     exists = "true"
     region = "eu-north-1"
     replication {
         class = "SingleRegionStrategy"
     }
}

"aws_mcs_table" "example" {
   name = "mcs-table-example"
   keyspace_arn = "${aws_mcs_keyspace.example.arn}"
   exists = "true"
   fields {
       columns {
            name = "name",
            type = "text",
       }
       columns {
            name = "email",
            type = "text",
       }
   }
   primary_key = ["email", "name"]
   # clustering key?
}

References

new-resource upstream

Most helpful comment

Amazon Keyspaces (for Apache Cassandra) is now generally available:

No support in the AWS SDK yet though.

All 5 comments

Hi @markvdlaan93 馃憢 Thank you for submitting this.

At this current time, AWS has not released an API or SDK for this new service:

Without these, we cannot implement support for this AWS service in Terraform. Please reach out to AWS Support or your account managers to ask about API support.

Hi Everyone !
I am also looking for terraform documentation for setting up mcs. Please let us know if we have any
Thanks,
Anurag

Amazon Keyspaces (for Apache Cassandra) is now generally available:

No support in the AWS SDK yet though.

It appears some sort of integration with an IAM user might be necessary since that's where one would create a Cassandra credential that's used by clients to connect.

Hey all,

I was battling with this today and wanted to share my solution in case it's helpful for anyone else. I ended up using CloudFormation _via_ Terraform as follows to create a keyspace and a table:

main.tf

provider "aws" {
  region = "eu-central-1"
  version = "~> 3.0"
}

resource "aws_cloudformation_stack" "keyspaces" {
  name = "my-keyspace"

  template_body = file("./keyspace.yaml")
}

keyspace.yaml

AWSTemplateFormatVersion: 2010-09-09
Resources:
  MyKeyspace:
    Type: AWS::Cassandra::Keyspace
    Properties:
      KeyspaceName: abc

  MyTable:
    Type: AWS::Cassandra::Table
    DependsOn: MyKeyspace
    Properties:
      KeyspaceName: abc
      TableName: my_table
      PartitionKeyColumns:
        - ColumnName: id
          ColumnType: TEXT
      BillingMode:
        Mode: ON_DEMAND

NOTE: Column changes aren't currently supported by CloudFormation, so once your table has been created, you can't change it with Terraform/CloudFormation.

Was this page helpful?
0 / 5 - 0 ratings