Skip to content

Commit

Permalink
feat: add eventbridge rule and sns topic
Browse files Browse the repository at this point in the history
  • Loading branch information
Wi11Shell committed Oct 4, 2024
1 parent 47e31e4 commit 2a2938d
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 38 deletions.
78 changes: 41 additions & 37 deletions infra/terraform/modules/service/README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,62 @@
<!-- BEGIN_TF_DOCS -->

## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0.0 |
| Name | Version |
| ------------------------------------------------------------------------ | -------- |
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement_aws) | >= 5.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0.0 |
| Name | Version |
| ------------------------------------------------ | -------- |
| <a name="provider_aws"></a> [aws](#provider_aws) | >= 5.0.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 5.0 |
| <a name="module_batch"></a> [batch](#module\_batch) | terraform-aws-modules/batch/aws | ~> 2.0 |
| <a name="module_cloudfront"></a> [cloudfront](#module\_cloudfront) | terraform-aws-modules/cloudfront/aws | ~> 3.4 |
| <a name="module_ecs_cluster"></a> [ecs\_cluster](#module\_ecs\_cluster) | terraform-aws-modules/ecs/aws//modules/cluster | ~> 5.10 |
| <a name="module_ecs_service"></a> [ecs\_service](#module\_ecs\_service) | terraform-aws-modules/ecs/aws//modules/service | ~> 5.10 |
| <a name="module_eventbridge"></a> [eventbridge](#module\_eventbridge) | terraform-aws-modules/eventbridge/aws | ~> 3.7 |
| <a name="module_log_bucket"></a> [log\_bucket](#module\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 4.0 |
| <a name="module_records"></a> [records](#module\_records) | terraform-aws-modules/route53/aws//modules/records | ~> 4.0 |
| <a name="module_route53_records"></a> [route53\_records](#module\_route53\_records) | terraform-aws-modules/acm/aws | ~> 5.0 |
| Name | Source | Version |
| -------------------------------------------------------------------------------- | -------------------------------------------------- | ------- |
| <a name="module_acm"></a> [acm](#module_acm) | terraform-aws-modules/acm/aws | ~> 5.0 |
| <a name="module_batch"></a> [batch](#module_batch) | terraform-aws-modules/batch/aws | ~> 2.0 |
| <a name="module_cloudfront"></a> [cloudfront](#module_cloudfront) | terraform-aws-modules/cloudfront/aws | ~> 3.4 |
| <a name="module_ecs_cluster"></a> [ecs_cluster](#module_ecs_cluster) | terraform-aws-modules/ecs/aws//modules/cluster | ~> 5.10 |
| <a name="module_ecs_service"></a> [ecs_service](#module_ecs_service) | terraform-aws-modules/ecs/aws//modules/service | ~> 5.10 |
| <a name="module_eventbridge"></a> [eventbridge](#module_eventbridge) | terraform-aws-modules/eventbridge/aws | ~> 3.7 |
| <a name="module_eventbridge_sns"></a> [eventbridge_sns](#module_eventbridge_sns) | terraform-aws-modules/eventbridge/aws | n/a |
| <a name="module_log_bucket"></a> [log_bucket](#module_log_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 4.0 |
| <a name="module_records"></a> [records](#module_records) | terraform-aws-modules/route53/aws//modules/records | ~> 4.0 |
| <a name="module_route53_records"></a> [route53_records](#module_route53_records) | terraform-aws-modules/acm/aws | ~> 5.0 |
| <a name="module_sns_batch_fail"></a> [sns_batch_fail](#module_sns_batch_fail) | terraform-aws-modules/sns/aws | n/a |

## Resources

| Name | Type |
|------|------|
| [aws_cloudfront_function.rewrite_uri](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_function) | resource |
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_lb_listener_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_rule) | resource |
| [aws_lb_target_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
| [aws_canonical_user_id.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/canonical_user_id) | data source |
| Name | Type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| [aws_cloudfront_function.rewrite_uri](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_function) | resource |
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_lb_listener_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_rule) | resource |
| [aws_lb_target_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
| [aws_canonical_user_id.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/canonical_user_id) | data source |
| [aws_cloudfront_log_delivery_canonical_user_id.cloudfront](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudfront_log_delivery_canonical_user_id) | data source |
| [aws_route53_zone.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
| [aws_s3_bucket.assets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |
| [aws_route53_zone.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
| [aws_s3_bucket.assets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_assets_version"></a> [assets\_version](#input\_assets\_version) | The version of the assets | `string` | n/a | yes |
| <a name="input_batch"></a> [batch](#input\_batch) | Configuration for the batch process | <pre>object({<br> version = string<br> repository = string<br> subnet_ids = list(string)<br> task_iam_role_statements = list(object({<br> effect = string<br> actions = list(string)<br> resources = list(string)<br> }))<br> jobs = list(object({<br> name = string<br> commands = list(string)<br> cpu = optional(number, 1)<br> memory = optional(number, 2048)<br> timeout = optional(number, 300)<br> schedule = optional(string, "")<br> }))<br> })</pre> | n/a | yes |
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | The domain name for the environment | `string` | n/a | yes |
| <a name="input_elasticache_url"></a> [elasticache\_url](#input\_elasticache\_url) | The URL of the Elasticache cluster | `string` | n/a | yes |
| <a name="input_environment"></a> [environment](#input\_environment) | The environment to deploy to | `string` | n/a | yes |
| <a name="input_legacy_environment"></a> [legacy\_environment](#input\_legacy\_environment) | The legacy environment to deploy use | `string` | n/a | yes |
| <a name="input_services"></a> [services](#input\_services) | The services to deploy | <pre>map(object({<br> version = string<br> repository = string<br> cpu = number<br> memory = number<br> task_iam_role_statements = list(object({<br> effect = string<br> actions = list(string)<br> resources = list(string)<br> }))<br> add_cdn_url_to_env = optional(bool, false)<br> lb_listener_arn = string<br> // The reason for this was to enable the parallel running of ECS and EC2 services.<br> // This boolean will control the flow of traffic. If `true`, traffic will go to ECS. If `false`, traffic will go to EC2.<br> // Can be removed when EC2 services are removed.<br> listener_rule_enable = optional(bool, true)<br> listener_rule_priority = optional(number, 10)<br> listener_rule_host_header = optional(string, "*")<br> security_group_ids = list(string)<br> subnet_ids = list(string)<br> vpc_id = optional(string, null)<br> }))</pre> | `{}` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The VPC ID | `string` | n/a | yes |
| Name | Description | Type | Default | Required |
| --------------------------------------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | :------: |
| <a name="input_assets_version"></a> [assets_version](#input_assets_version) | The version of the assets | `string` | n/a | yes |
| <a name="input_batch"></a> [batch](#input_batch) | Configuration for the batch process | <pre>object({<br/> version = string<br/> repository = string<br/> subnet_ids = list(string)<br/> task_iam_role_statements = list(object({<br/> effect = string<br/> actions = list(string)<br/> resources = list(string)<br/> }))<br/> jobs = list(object({<br/> name = string<br/> commands = list(string)<br/> cpu = optional(number, 1)<br/> memory = optional(number, 2048)<br/> timeout = optional(number, 300)<br/> schedule = optional(string, "")<br/> }))<br/> })</pre> | n/a | yes |
| <a name="input_domain_name"></a> [domain_name](#input_domain_name) | The domain name for the environment | `string` | n/a | yes |
| <a name="input_elasticache_url"></a> [elasticache_url](#input_elasticache_url) | The URL of the Elasticache cluster | `string` | n/a | yes |
| <a name="input_environment"></a> [environment](#input_environment) | The environment to deploy to | `string` | n/a | yes |
| <a name="input_legacy_environment"></a> [legacy_environment](#input_legacy_environment) | The legacy environment to deploy use | `string` | n/a | yes |
| <a name="input_services"></a> [services](#input_services) | The services to deploy | <pre>map(object({<br/> version = string<br/> repository = string<br/> cpu = number<br/> memory = number<br/> task_iam_role_statements = list(object({<br/> effect = string<br/> actions = list(string)<br/> resources = list(string)<br/> }))<br/> add_cdn_url_to_env = optional(bool, false)<br/> lb_listener_arn = string<br/> // The reason for this was to enable the parallel running of ECS and EC2 services.<br/> // This boolean will control the flow of traffic. If `true`, traffic will go to ECS. If `false`, traffic will go to EC2.<br/> // Can be removed when EC2 services are removed.<br/> listener_rule_enable = optional(bool, true)<br/> listener_rule_priority = optional(number, 10)<br/> listener_rule_host_header = optional(string, "\*")<br/> security_group_ids = list(string)<br/> subnet_ids = list(string)<br/> vpc_id = optional(string, null)<br/> }))</pre> | `{}` | no |
| <a name="input_vpc_id"></a> [vpc_id](#input_vpc_id) | The VPC ID | `string` | n/a | yes |

## Outputs

No outputs.

<!-- END_TF_DOCS -->
Loading

0 comments on commit 2a2938d

Please sign in to comment.