{"id":21725482,"url":"https://github.com/jameswoolfenden/terraform-aws-cassandra","last_synced_at":"2025-04-12T22:54:22.698Z","repository":{"id":42448486,"uuid":"46488354","full_name":"JamesWoolfenden/terraform-aws-cassandra","owner":"JamesWoolfenden","description":"A project to set up a Cassandra cluster in AWS","archived":false,"fork":false,"pushed_at":"2023-07-29T20:04:41.000Z","size":237,"stargazers_count":20,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T16:55:11.439Z","etag":null,"topics":["aws","cassandra","module","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesWoolfenden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2015-11-19T11:35:50.000Z","updated_at":"2024-04-23T08:50:29.000Z","dependencies_parsed_at":"2023-01-18T13:49:19.880Z","dependency_job_id":null,"html_url":"https://github.com/JamesWoolfenden/terraform-aws-cassandra","commit_stats":null,"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fterraform-aws-cassandra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fterraform-aws-cassandra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fterraform-aws-cassandra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesWoolfenden%2Fterraform-aws-cassandra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesWoolfenden","download_url":"https://codeload.github.com/JamesWoolfenden/terraform-aws-cassandra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643045,"owners_count":21138353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cassandra","module","terraform"],"created_at":"2024-11-26T03:18:09.994Z","updated_at":"2025-04-12T22:54:22.678Z","avatar_url":"https://github.com/JamesWoolfenden.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-cassandra\n\n[![Build Status](https://github.com/JamesWoolfenden/terraform-aws-cassandra/workflows/Verify%20and%20Bump/badge.svg?branch=master)](https://github.com/JamesWoolfenden/terraform-aws-cassandra)\n[![Latest Release](https://img.shields.io/github/release/JamesWoolfenden/terraform-aws-cassandra.svg)](https://github.com/JamesWoolfenden/terraform-aws-cassandra/releases/latest)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![checkov](https://img.shields.io/badge/checkov-verified-brightgreen)](https://www.checkov.io/)\n[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/jameswoolfenden/terraform-aws-cassandra/general)](https://www.bridgecrew.cloud/link/badge?vcs=github\u0026fullRepo=JamesWoolfenden%2Fterraform-aws-cassandra\u0026benchmark=INFRASTRUCTURE+SECURITY)\n[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/jameswoolfenden/terraform-aws-cassandra/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github\u0026fullRepo=JamesWoolfenden%2Fterraform-aws-cassandra\u0026benchmark=CIS+AWS+V1.2)\n[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/jameswoolfenden/terraform-aws-cassandra/pci)](https://www.bridgecrew.cloud/link/badge?vcs=github\u0026fullRepo=JamesWoolfenden%2Fterraform-aws-cassandra\u0026benchmark=PCI-DSS+V3.2)\n\nA project to set up infrastructure in AWS for an Apache Cassandra cluster. This module will create Cassandra on EC2 and auto-cluster all of its nodes.\n\n---\n\n![alt text](./diagram/cassandra.png)\nIt's 100% Open Source and licensed under the [APACHE2](LICENSE).\n\n## Usage\n\nThe folder **example/examplea** contains a complete sample illustration of how to use this module.\n\n```tree\n├───examplea\n│       data.tf\n│       examplea.auto.tfvars\n│       Makefile\n│       module.cassandra.tf\n│       outputs.tf\n│       provider.aws.tf\n│       variables.tf\n```\n\nAs a minimum, you must include a module reference in your template Terraform code e.g. **module.cassandra.tf**:\n\n```hcl\nmodule \"cassandra\" {\n  source            = \"JamesWoolfenden/cassandra/aws\"\n  version           = \"0.3.1\"\n  instance_type     = var.instance_type\n  subnet_ids        = data.aws_subnet_ids.subs.ids\n  #add the private ips\n  private_ips       = []\n  allowed_ranges    = [module.myip.cidr]\n  ssh-inbound-range = [module.myip.cidr]\n  ami               = local.ami\n  vpc_id            = tolist(data.aws_vpcs.main.ids)[0]\n}\n```\n\nYou will also need to define **variables.tf** and supply values **examplea.auto.tfvars**.\nYou'll need to adjust the values to your own.\nYou will also need to build a Cassandra AMI, see the Packer folder for that template.\nIf you want to test modules usage, execute Terraform in the examplea folder:\n\n```cli\ncd example/examplea\n✔ /mnt/c/code/jimw/aws/terraform-aws-cassandra/example/examplea [master|✚ 1⚑ 1]\n09:56 $ make init\nrm -rf .terraform/\nterraform init -reconfigure\nInitializing modules...\n- cassandra in ../..\nDownloading jameswoolfenden/ip/http 0.2.7 for myip...\n- myip in .terraform/modules/myip/terraform-http-ip-0.2.7\n\nInitializing the backend...\n\nInitializing provider plugins...\n- Checking for available provider plugins...\n- Downloading plugin for provider \"aws\" (hashicorp/aws) 2.54.0...\n\nTerraform has been successfully initialized!\n\nYou may now begin working with Terraform. Try running \"terraform plan\" to see\nany changes that are required for your infrastructure. All Terraform commands\nshould now work.\n\nIf you ever set or change modules or backend configuration for Terraform,\nrerun this command to reinitialize your working directory. If you forget, other\ncommands will detect it and remind you to do so if necessary.\n\nterraform apply\n....\n```\n\n## Costs\n\n```text\nmonthly cost estimate\n\nProject: .\n\n Name                                                   Monthly Qty  Unit            Monthly Cost\n\n module.cassandra.aws_instance.cassandra[0]\n ├─ Instance usage (Linux/UNIX, on-demand, t3.micro)            730  hours                  $8.61\n ├─ EC2 detailed monitoring                                       7  metrics                $2.10\n ├─ CPU credits                                                   0  vCPU-hours             $0.00\n └─ root_block_device\n    ├─ Storage (magnetic)                                       100  GB-months              $5.80\n    └─ I/O requests                                   Cost depends on usage: $0.06 per 1M request\n\n module.cassandra.aws_instance.cassandra[1]\n ├─ Instance usage (Linux/UNIX, on-demand, t3.micro)            730  hours                  $8.61\n ├─ EC2 detailed monitoring                                       7  metrics                $2.10\n ├─ CPU credits                                                   0  vCPU-hours             $0.00\n └─ root_block_device\n    ├─ Storage (magnetic)                                       100  GB-months              $5.80\n    └─ I/O requests                                   Cost depends on usage: $0.06 per 1M request\n\n module.cassandra.aws_instance.cassandra[2]\n ├─ Instance usage (Linux/UNIX, on-demand, t3.micro)            730  hours                  $8.61\n ├─ EC2 detailed monitoring                                       7  metrics                $2.10\n ├─ CPU credits                                                   0  vCPU-hours             $0.00\n └─ root_block_device\n    ├─ Storage (magnetic)                                       100  GB-months              $5.80\n    └─ I/O requests                                   Cost depends on usage: $0.06 per 1M request\n\n PROJECT TOTAL                                                                             $49.54\n```\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\nNo requirements.\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | n/a |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_instance.cassandra](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |\n| [aws_security_group.cassandra](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |\n| [aws_ami.ami](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_allowed_ranges\"\u003e\u003c/a\u003e [allowed\\_ranges](#input\\_allowed\\_ranges) | Allowed ranges that can access the cluster | `list(any)` | \u003cpre\u003e[\u003cbr\u003e  \"0.0.0.0/0\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_ami\"\u003e\u003c/a\u003e [ami](#input\\_ami) | Contains information to select desired AWS AMI | `any` | n/a | yes |\n| \u003ca name=\"input_config-file\"\u003e\u003c/a\u003e [config-file](#input\\_config-file) | n/a | `string` | `\"/etc/dse/cassandra/cassandra.yaml\"` | no |\n| \u003ca name=\"input_iam_instance_profile\"\u003e\u003c/a\u003e [iam\\_instance\\_profile](#input\\_iam\\_instance\\_profile) | n/a | `string` | `\"\"` | no |\n| \u003ca name=\"input_instance_type\"\u003e\u003c/a\u003e [instance\\_type](#input\\_instance\\_type) | aws instance type and class | `string` | n/a | yes |\n| \u003ca name=\"input_private_ips\"\u003e\u003c/a\u003e [private\\_ips](#input\\_private\\_ips) | List of ips for the cassandra nodes | `list(any)` | n/a | yes |\n| \u003ca name=\"input_ssh-inbound-range\"\u003e\u003c/a\u003e [ssh-inbound-range](#input\\_ssh-inbound-range) | CIDRs of address that are allowed to ssh in. | `list(any)` | n/a | yes |\n| \u003ca name=\"input_subnet_ids\"\u003e\u003c/a\u003e [subnet\\_ids](#input\\_subnet\\_ids) | List of subnet Ids | `list(any)` | n/a | yes |\n| \u003ca name=\"input_template-file\"\u003e\u003c/a\u003e [template-file](#input\\_template-file) | n/a | `string` | `\"cassandra.tmpl\"` | no |\n| \u003ca name=\"input_vpc_id\"\u003e\u003c/a\u003e [vpc\\_id](#input\\_vpc\\_id) | The id for the vpc | `string` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_instances\"\u003e\u003c/a\u003e [instances](#output\\_instances) | n/a |\n| \u003ca name=\"output_security_group\"\u003e\u003c/a\u003e [security\\_group](#output\\_security\\_group) | n/a |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Policy\n\n\u003c!-- BEGINNING OF PRE-COMMIT-PIKE DOCS HOOK --\u003e\nThe Terraform resource required is:\n\n```golang\nresource \"aws_iam_policy\" \"terraform_pike\" {\n  name_prefix = \"terraform_pike\"\n  path        = \"/\"\n  description = \"Pike Autogenerated policy from IAC\"\n\n  policy = jsonencode({\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"VisualEditor0\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ec2:AuthorizeSecurityGroupEgress\",\n                \"ec2:AuthorizeSecurityGroupIngress\",\n                \"ec2:CreateSecurityGroup\",\n                \"ec2:DeleteSecurityGroup\",\n                \"ec2:DescribeAccountAttributes\",\n                \"ec2:DescribeImages\",\n                \"ec2:DescribeInstanceAttribute\",\n                \"ec2:DescribeInstanceCreditSpecifications\",\n                \"ec2:DescribeInstanceTypes\",\n                \"ec2:DescribeInstances\",\n                \"ec2:DescribeNetworkInterfaces\",\n                \"ec2:DescribeSecurityGroups\",\n                \"ec2:DescribeTags\",\n                \"ec2:DescribeVolumes\",\n                \"ec2:ModifyInstanceAttribute\",\n                \"ec2:MonitorInstances\",\n                \"ec2:RevokeSecurityGroupEgress\",\n                \"ec2:RevokeSecurityGroupIngress\",\n                \"ec2:RunInstances\",\n                \"ec2:StartInstances\",\n                \"ec2:StopInstances\",\n                \"ec2:TerminateInstances\",\n                \"ec2:UnmonitorInstances\"\n            ],\n            \"Resource\": [\n                \"*\"\n            ]\n        }\n    ]\n})\n}\n\n\n```\n\u003c!-- END OF PRE-COMMIT-PIKE DOCS HOOK --\u003e\n## Related Projects\n\nCheck out these related projects.\n\n- [terraform-aws-codebuild](https://github.com/jameswoolfenden/terraform-aws-codebuild) - Making a Build pipeline\n\n## Help\n\n**Got a question?**\n\nFile a GitHub [issue](https://github.com/jameswoolfenden/terraform-aws-cassandra/issues).\n\n## Contributing\n\n### Bug Reports \u0026 Feature Requests\n\nPlease use the [issue tracker](https://github.com/jameswoolfenden/terraform-aws-cassandra/issues) to report any bugs or file feature requests.\n\n## Copyrights\n\nCopyright © 2019-2022 James Woolfenden\n\n## License\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nSee [LICENSE](LICENSE) for full details.\n\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership. The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License. You may obtain a copy of the License at\n\n\u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the License for the\nspecific language governing permissions and limitations\nunder the License.\n\n### Contributors\n\n[![James Woolfenden][jameswoolfenden_avatar]][jameswoolfenden_homepage]\u003cbr/\u003e[James Woolfenden][jameswoolfenden_homepage]\n\n[jameswoolfenden_homepage]: https://github.com/jameswoolfenden\n[jameswoolfenden_avatar]: https://github.com/jameswoolfenden.png?size=150\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameswoolfenden%2Fterraform-aws-cassandra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjameswoolfenden%2Fterraform-aws-cassandra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameswoolfenden%2Fterraform-aws-cassandra/lists"}