{"id":20317890,"url":"https://github.com/crowdsecurity/terraform-aws-crowdsec-serverless","last_synced_at":"2026-03-19T15:14:26.892Z","repository":{"id":103354862,"uuid":"428591343","full_name":"crowdsecurity/terraform-aws-crowdsec-serverless","owner":"crowdsecurity","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-03T09:46:56.000Z","size":2107,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-01T16:39:21.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crowdsecurity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-16T09:24:01.000Z","updated_at":"2024-07-29T10:20:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"f17f92e7-ca48-482b-9aba-ec3d3ce75d69","html_url":"https://github.com/crowdsecurity/terraform-aws-crowdsec-serverless","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdsecurity%2Fterraform-aws-crowdsec-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdsecurity%2Fterraform-aws-crowdsec-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdsecurity%2Fterraform-aws-crowdsec-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdsecurity%2Fterraform-aws-crowdsec-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdsecurity","download_url":"https://codeload.github.com/crowdsecurity/terraform-aws-crowdsec-serverless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241818899,"owners_count":20025212,"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":[],"created_at":"2024-11-14T18:36:55.545Z","updated_at":"2026-03-08T15:34:00.418Z","avatar_url":"https://github.com/crowdsecurity.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"This terraform module allows users to protect AWS serverless stacks using CrowdSec. It deploys CrowdSec in a ECS fargate container. This CrowdSec instance reads logs from CloudWatch and infers malevolent IPs. It then creates a lambda authorizer and binds it to the provided API gateway. This authorizer then blocks/captcha IPs inferred by CrowdSec.\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | 3.63.0 |\n| \u003ca name=\"provider_random\"\u003e\u003c/a\u003e [random](#provider\\_random) | 3.1.0 |\n| \u003ca name=\"provider_template\"\u003e\u003c/a\u003e [template](#provider\\_template) | 2.2.0 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_authorizer\"\u003e\u003c/a\u003e [authorizer](#module\\_authorizer) | terraform-aws-modules/lambda/aws | 2.17.0 |\n| \u003ca name=\"module_crowdsec-sg\"\u003e\u003c/a\u003e [crowdsec-sg](#module\\_crowdsec-sg) | terraform-aws-modules/security-group/aws | 4.3.0 |\n| \u003ca name=\"module_vpc\"\u003e\u003c/a\u003e [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | n/a |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_api_gateway_authorizer.gateway_authorizer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_authorizer) | resource |\n| [aws_apigatewayv2_authorizer.gateway_authorizer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_authorizer) | resource |\n| [aws_cloudwatch_log_group.crowdsec-lapi](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |\n| [aws_db_subnet_group.dbsubnet](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource |\n| [aws_ecs_cluster.crowdsec-lapi](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_cluster) | resource |\n| [aws_ecs_service.crowdsec-service](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service) | resource |\n| [aws_ecs_task_definition.crowdsec-lapi](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition) | resource |\n| [aws_iam_role.ecs_task_execution_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role_policy.lapi-cloudwatch-policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |\n| [aws_iam_role_policy.lapi-exec-policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |\n| [aws_rds_cluster.csdb](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster) | resource |\n| [aws_service_discovery_private_dns_namespace.crowdsec](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/service_discovery_private_dns_namespace) | resource |\n| [aws_service_discovery_service.crowdsec](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/service_discovery_service) | resource |\n| [random_password.bouncer_key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |\n| [random_password.csdbpassword](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |\n| [aws_availability_zones.az](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source |\n| [aws_iam_policy_document.ecs_task_execution_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |\n| [template_file.cs_acquis](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | data source |\n| [template_file.cs_config](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | data source |\n\n**Notes**\n- Depending upon your input `create_vpc` this module may create a VPC and subnets\n- RDS is created and used by CrowdSec to persist decisions, alerts, keys etc.\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_acquis\"\u003e\u003c/a\u003e [acquis](#input\\_acquis) | Path to acquis file. | `string` | `\"\"` | no |\n| \u003ca name=\"input_aws_apigateway_api_execution_arn\"\u003e\u003c/a\u003e [aws\\_apigateway\\_api\\_execution\\_arn](#input\\_aws\\_apigateway\\_api\\_execution\\_arn) | Execution ARN of api gateway to deploy crowdsec powered authorizer | `string` | `\"\"` | no |\n| \u003ca name=\"input_aws_apigateway_id\"\u003e\u003c/a\u003e [aws\\_apigateway\\_id](#input\\_aws\\_apigateway\\_id) | ID of api gateway to deploy crowdsec powered authorizer | `string` | `\"\"` | no |\n| \u003ca name=\"input_aws_apigateway_v2_api_execution_arn\"\u003e\u003c/a\u003e [aws\\_apigateway\\_v2\\_api\\_execution\\_arn](#input\\_aws\\_apigateway\\_v2\\_api\\_execution\\_arn) | Execution ARN of api gateway v2 to deploy crowdsec powered authorizer | `string` | `\"\"` | no |\n| \u003ca name=\"input_aws_apigateway_v2_id\"\u003e\u003c/a\u003e [aws\\_apigateway\\_v2\\_id](#input\\_aws\\_apigateway\\_v2\\_id) | ID of api gateway v2 to deploy crowdsec powered authorizer | `string` | `\"\"` | no |\n| \u003ca name=\"input_captcha_secret\"\u003e\u003c/a\u003e [captcha\\_secret](#input\\_captcha\\_secret) | Recaptcha secret key | `string` | n/a | yes |\n| \u003ca name=\"input_cloudwatch_group_name\"\u003e\u003c/a\u003e [cloudwatch\\_group\\_name](#input\\_cloudwatch\\_group\\_name) | Cloudwatch group to read logs | `string` | n/a | yes |\n| \u003ca name=\"input_collections\"\u003e\u003c/a\u003e [collections](#input\\_collections) | Collections to install. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_config\"\u003e\u003c/a\u003e [config](#input\\_config) | Path to file containing custom Crowdsec configration | `string` | `\"\"` | no |\n| \u003ca name=\"input_create_vpc\"\u003e\u003c/a\u003e [create\\_vpc](#input\\_create\\_vpc) | Whether to create a separate VPC to deploy CrowdSec infra in | `bool` | `true` | no |\n| \u003ca name=\"input_crowdsec_cpu\"\u003e\u003c/a\u003e [crowdsec\\_cpu](#input\\_crowdsec\\_cpu) | Amount of vCPU units for CrowdSec task. | `number` | `256` | no |\n| \u003ca name=\"input_crowdsec_memory\"\u003e\u003c/a\u003e [crowdsec\\_memory](#input\\_crowdsec\\_memory) | Amount of memory for CrowdSec task | `number` | `512` | no |\n| \u003ca name=\"input_enable_v1_authorizer\"\u003e\u003c/a\u003e [enable\\_v1\\_authorizer](#input\\_enable\\_v1\\_authorizer) | Create authorizer for REST api gateway | `bool` | `false` | no |\n| \u003ca name=\"input_enable_v2_authorizer\"\u003e\u003c/a\u003e [enable\\_v2\\_authorizer](#input\\_enable\\_v2\\_authorizer) | Create authorizer for HTTP api gateway | `bool` | `false` | no |\n| \u003ca name=\"input_parsers\"\u003e\u003c/a\u003e [parsers](#input\\_parsers) | Parsers to install. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_private_subnets\"\u003e\u003c/a\u003e [private\\_subnets](#input\\_private\\_subnets) | Private subnets to deploy CrowdSec infra in. Atleast 2 subnets should be provided, each in distinct AZ. MUST HAVE internet access. Not required if create\\_vpc=true | `list(string)` | `[]` | no |\n| \u003ca name=\"input_profiles\"\u003e\u003c/a\u003e [profiles](#input\\_profiles) | Path to file containing custom Crowdsec profiles | `string` | `\"\"` | no |\n| \u003ca name=\"input_scenarios\"\u003e\u003c/a\u003e [scenarios](#input\\_scenarios) | List of scenarios to install | `list(string)` | `[]` | no |\n| \u003ca name=\"input_vpc_id\"\u003e\u003c/a\u003e [vpc\\_id](#input\\_vpc\\_id) | ID of VPC to deploy CrowdSec related infra in. Not required if create\\_vpc=true | `string` | `\"\"` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_aws_apigatewayv1_authorizer_id\"\u003e\u003c/a\u003e [aws\\_apigatewayv1\\_authorizer\\_id](#output\\_aws\\_apigatewayv1\\_authorizer\\_id) | n/a |\n| \u003ca name=\"output_aws_apigatewayv2_authorizer_id\"\u003e\u003c/a\u003e [aws\\_apigatewayv2\\_authorizer\\_id](#output\\_aws\\_apigatewayv2\\_authorizer\\_id) | n/a |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdsecurity%2Fterraform-aws-crowdsec-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdsecurity%2Fterraform-aws-crowdsec-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdsecurity%2Fterraform-aws-crowdsec-serverless/lists"}