Skip to content

Commit

Permalink
fixes for pre-commit hook
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Devyatkin <[email protected]>
  • Loading branch information
Andrey9kin committed Nov 20, 2024
1 parent 3fb1fef commit c445ad4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
14 changes: 7 additions & 7 deletions examples/complete_exapmle/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ locals {

# Creation of IAM resources for Chatbot
module "chatbot_role" {
source = "./modules/iam"
source = "../../modules/iam"
}


# Configuration of Slack workspace and topics to channels mapping
module "chatbot_slack_workspace" {
source = "./modules/slack_workspace"
source = "../../modules/slack_workspace"

workspace_id = local.slack.workspace_id

Expand All @@ -36,7 +36,7 @@ module "chatbot_slack_workspace" {

# Reservations utilization alert
module "reservations_alerts" {
source = "./modules/reservations"
source = "../../modules/reservations"

# Threshold, if utilization is less than 90% - alert will be triggered
threshold = "90"
Expand All @@ -45,7 +45,7 @@ module "reservations_alerts" {

# Savings plans utilization alert
module "savings_plans_alerts" {
source = "./modules/savings_plans"
source = "../../modules/savings_plans"

# Threshold, if utilization is less than 40% - alert will be triggered
threshold = "40"
Expand All @@ -55,7 +55,7 @@ module "savings_plans_alerts" {

# It will automatically create budget, with notifications for 100%, 150% and 200% of limit amount for forecasted and actual costs
module "budget_alerts" {
source = "./modules/budget_alerts"
source = "../../modules/budget_alerts"

limit_amount = "10000"

Expand All @@ -64,7 +64,7 @@ module "budget_alerts" {
}

module "eventbridge_alerts" {
source = "./modules/eventbridge"
source = "../../modules/eventbridge"

# It will create eventbridge rule and send all GuardDuty findings to Slack
create_guardduty_findings_rule = true
Expand All @@ -77,7 +77,7 @@ module "eventbridge_alerts" {


module "cost_anomaly_detection" {
source = "./modules/cost_anomaly_detection"
source = "../../modules/cost_anomaly_detection"

# https://docs.aws.amazon.com/cost-management/latest/userguide/cad-alert-chime.html

Expand Down
12 changes: 6 additions & 6 deletions examples/two_workspaces_example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ locals {

# Optional Automatic creation Chatbot IAM role
module "chatbot_role" {
source = "./modules/iam"
source = "../../modules/iam"
}


# Configuration of Slack workspace and topics to channels mapping
module "chatbot_budget_slack_workspace" {
source = "./modules/slack_workspace"
source = "../../modules/slack_workspace"

workspace_id = local.budget.workspace_id

Expand All @@ -47,7 +47,7 @@ module "chatbot_budget_slack_workspace" {
}

module "chatbot_prod_slack_workspace" {
source = "./modules/slack_workspace"
source = "../../modules/slack_workspace"

workspace_id = local.security.workspace_id

Expand All @@ -65,7 +65,7 @@ module "chatbot_prod_slack_workspace" {

# It will automatically create budget, with notifications for 100%, 150% and 200% of limit amount for forecasted and actual costs
module "budget_alerts" {
source = "./modules/budget_alerts"
source = "../../modules/budget_alerts"

limit_amount = "10000"

Expand All @@ -74,7 +74,7 @@ module "budget_alerts" {
}

module "cost_anomaly_detection" {
source = "./modules/cost_anomaly_detection"
source = "../../modules/cost_anomaly_detection"

# https://docs.aws.amazon.com/cost-management/latest/userguide/cad-alert-chime.html

Expand All @@ -90,7 +90,7 @@ module "cost_anomaly_detection" {
}

module "eventbridge_alerts" {
source = "./modules/eventbridge"
source = "../../modules/eventbridge"

# create_guardduty_findings_rule will create eventbridge rule and send all GuardDuty findings to Slack
create_guardduty_findings_rule = true
Expand Down
6 changes: 4 additions & 2 deletions modules/budget_alerts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This module allows you to create a budget alert with a single line of code. It a

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

## Modules

Expand All @@ -30,11 +30,13 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_auto_adjust"></a> [auto\_adjust](#input\_auto\_adjust) | Auto adjust budget based on historical values | `bool` | `true` | no |
| <a name="input_budget_adjustment_period"></a> [budget\_adjustment\_period](#input\_budget\_adjustment\_period) | Number of month to look back for historical values | `number` | `6` | no |
| <a name="input_create"></a> [create](#input\_create) | (Optional) Controls if budget should be created. | `bool` | `true` | no |
| <a name="input_limit_amount"></a> [limit\_amount](#input\_limit\_amount) | (Required) The amount of cost or usage being measured for a budget. | `string` | n/a | yes |
| <a name="input_limit_unit"></a> [limit\_unit](#input\_limit\_unit) | (Optional) The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. | `string` | `"USD"` | no |
| <a name="input_name"></a> [name](#input\_name) | (Optional) The name of a budget. Unique within accounts. | `string` | `"cost-budget-alerts"` | no |
| <a name="input_notification_on_threshold_percentage"></a> [notification\_on\_threshold\_percentage](#input\_notification\_on\_threshold\_percentage) | (Optional) The percentage of the budget threshold to notify. With default values, notifications will be sent at 100%, 150%, and 200% of the budget `limit_amount`. | `list(number)` | <pre>[<br> 100,<br> 150,<br> 200<br>]</pre> | no |
| <a name="input_notification_on_threshold_percentage"></a> [notification\_on\_threshold\_percentage](#input\_notification\_on\_threshold\_percentage) | (Optional) The percentage of the budget threshold to notify. With default values, notifications will be sent at 100%, 150%, and 200% of the budget `limit_amount`. | `list(number)` | <pre>[<br/> 100,<br/> 150,<br/> 200<br/>]</pre> | no |
| <a name="input_subscriber_email_addresses"></a> [subscriber\_email\_addresses](#input\_subscriber\_email\_addresses) | (Optional) E-Mail addresses to notify. Either this or subscriber\_sns\_topic\_arns is required. | `list(string)` | `[]` | no |
| <a name="input_subscriber_sns_topic_arns"></a> [subscriber\_sns\_topic\_arns](#input\_subscriber\_sns\_topic\_arns) | (Optional) SNS topics to notify. Either this or subscriber\_email\_addresses is required. | `list(string)` | `[]` | no |
| <a name="input_time_period_start"></a> [time\_period\_start](#input\_time\_period\_start) | (Optional) The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: 2023-01-01\_00:00. | `string` | `"2023-01-01_00:00"` | no |
Expand Down
4 changes: 2 additions & 2 deletions modules/cost_anomaly_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This module creates a cost anomaly detection alert with default values. You need

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

## Modules

Expand All @@ -33,7 +33,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_anomaly_monitor_name"></a> [anomaly\_monitor\_name](#input\_anomaly\_monitor\_name) | (Optional) The name of the anomaly monitor. | `string` | `"AWSServiceMonitor"` | no |
| <a name="input_anomaly_subscription_name"></a> [anomaly\_subscription\_name](#input\_anomaly\_subscription\_name) | (Optional) The name of the anomaly subscription. | `string` | `"AWSServiceSubscription"` | no |
| <a name="input_frequency"></a> [frequency](#input\_frequency) | (Optional) The frequency that anomaly reports are sent. Valid Values: DAILY \| IMMEDIATE \| WEEKLY.<br> Daily or weekly frequencies only support Email subscriptions<br> Immediate frequencies support a max of one subscriber | `string` | `"DAILY"` | no |
| <a name="input_frequency"></a> [frequency](#input\_frequency) | (Optional) The frequency that anomaly reports are sent. Valid Values: DAILY \| IMMEDIATE \| WEEKLY.<br/> Daily or weekly frequencies only support Email subscriptions<br/> Immediate frequencies support a max of one subscriber | `string` | `"DAILY"` | no |
| <a name="input_subscriber_email_addresses"></a> [subscriber\_email\_addresses](#input\_subscriber\_email\_addresses) | (Optional) E-Mail addresses to notify. Either this or subscriber\_sns\_topic\_arns is required. | `list(string)` | `[]` | no |
| <a name="input_subscriber_sns_topic_arns"></a> [subscriber\_sns\_topic\_arns](#input\_subscriber\_sns\_topic\_arns) | (Optional) SNS topics to notify. Either this or subscriber\_email\_addresses is required. | `list(string)` | `[]` | no |
| <a name="input_threshold"></a> [threshold](#input\_threshold) | (Required) The dollar value that triggers a notification if the threshold is exceeded. | `string` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion modules/eventbridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This alert creates two CloudWatch event rules that send notifications to an SNS

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

## Modules

Expand Down
4 changes: 2 additions & 2 deletions modules/reservations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Required only 2 values:

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

## Modules

Expand All @@ -37,7 +37,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_create"></a> [create](#input\_create) | (Optional) Controls if budget should be created. | `bool` | `true` | no |
| <a name="input_name"></a> [name](#input\_name) | (Optional) The name of a budget. Unique within accounts. | `string` | `"ri-utilization-budget-alerts"` | no |
| <a name="input_services"></a> [services](#input\_services) | (Optional) List of services to send alerts for. Defaults to all services. | `list(string)` | <pre>[<br> "Amazon Elasticsearch Service",<br> "Amazon Relational Database Service",<br> "Amazon Redshift",<br> "Amazon Elastic Compute Cloud - Compute",<br> "Amazon ElastiCache",<br> "Amazon OpenSearch Service"<br>]</pre> | no |
| <a name="input_services"></a> [services](#input\_services) | (Optional) List of services to send alerts for. Defaults to all services. | `list(string)` | <pre>[<br/> "Amazon Elasticsearch Service",<br/> "Amazon Relational Database Service",<br/> "Amazon Redshift",<br/> "Amazon Elastic Compute Cloud - Compute",<br/> "Amazon ElastiCache",<br/> "Amazon OpenSearch Service"<br/>]</pre> | no |
| <a name="input_subscriber_email_addresses"></a> [subscriber\_email\_addresses](#input\_subscriber\_email\_addresses) | (Optional) E-Mail addresses to notify. Either this or subscriber\_sns\_topic\_arns is required. | `list(string)` | `[]` | no |
| <a name="input_subscriber_sns_topic_arns"></a> [subscriber\_sns\_topic\_arns](#input\_subscriber\_sns\_topic\_arns) | (Optional) SNS topics to notify. Either this or subscriber\_email\_addresses is required. | `list(string)` | `[]` | no |
| <a name="input_threshold"></a> [threshold](#input\_threshold) | (Optional) Threshold when the notification should be sent. | `number` | `90` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/savings_plans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Required only 2 values:

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

## Modules

Expand Down
6 changes: 3 additions & 3 deletions modules/slack_workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This module gives you a better way to configure your Slack workspace with AWS Ch

| Name | Version |
|------|---------|
| <a name="provider_awscc"></a> [awscc](#provider\_awscc) | 0.68.0 |
| <a name="provider_awscc"></a> [awscc](#provider\_awscc) | 1.20.0 |

## Modules

Expand All @@ -31,8 +31,8 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_channels_config"></a> [channels\_config](#input\_channels\_config) | (Required) The list of Slack channel configurations. Each configuration block supports fields documented below.<br><br> configuration\_name - (Required) The name of the configuration<br> iam\_role\_arn - (Required) The ARN of the IAM role that defines the permissions for AWS Chatbot<br> slack\_channel\_id - (Required) The id of the Slack channel<br> sns\_topic\_arns - (Optional) ARNs of SNS topics which delivers notifications to AWS Chatbot, for example CloudWatch alarm notifications.<br> guardrail\_policies - (Optional) The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed 'AdministratorAccess' policy is applied as a default if this is not set.<br> logging\_level - (Optional) Specifies the logging level for this configuration:ERROR,INFO or NONE. This property affects the log entries pushed to Amazon CloudWatch logs<br> user\_role\_required - (Optional) Enables use of a user role requirement in your chat configuration | <pre>map(<br> object({<br> configuration_name = optional(string)<br> iam_role_arn = optional(string)<br> slack_channel_id = string<br> sns_topic_arns = list(string)<br> guardrail_policies = optional(list(string))<br> logging_level = optional(string)<br> user_role_required = optional(bool)<br> })<br> )</pre> | n/a | yes |
| <a name="input_default_guardrail_policies"></a> [default\_guardrail\_policies](#input\_default\_guardrail\_policies) | Default guardrail policies to apply to all channels | `list(string)` | <pre>[<br> "arn:aws:iam::aws:policy/ReadOnlyAccess"<br>]</pre> | no |
| <a name="input_channels_config"></a> [channels\_config](#input\_channels\_config) | (Required) The list of Slack channel configurations. Each configuration block supports fields documented below.<br/><br/> configuration\_name - (Required) The name of the configuration<br/> iam\_role\_arn - (Required) The ARN of the IAM role that defines the permissions for AWS Chatbot<br/> slack\_channel\_id - (Required) The id of the Slack channel<br/> sns\_topic\_arns - (Optional) ARNs of SNS topics which delivers notifications to AWS Chatbot, for example CloudWatch alarm notifications.<br/> guardrail\_policies - (Optional) The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed 'AdministratorAccess' policy is applied as a default if this is not set.<br/> logging\_level - (Optional) Specifies the logging level for this configuration:ERROR,INFO or NONE. This property affects the log entries pushed to Amazon CloudWatch logs<br/> user\_role\_required - (Optional) Enables use of a user role requirement in your chat configuration | <pre>map(<br/> object({<br/> configuration_name = optional(string)<br/> iam_role_arn = optional(string)<br/> slack_channel_id = string<br/> sns_topic_arns = list(string)<br/> guardrail_policies = optional(list(string))<br/> logging_level = optional(string)<br/> user_role_required = optional(bool)<br/> })<br/> )</pre> | n/a | yes |
| <a name="input_default_guardrail_policies"></a> [default\_guardrail\_policies](#input\_default\_guardrail\_policies) | Default guardrail policies to apply to all channels | `list(string)` | <pre>[<br/> "arn:aws:iam::aws:policy/ReadOnlyAccess"<br/>]</pre> | no |
| <a name="input_default_iam_role_arn"></a> [default\_iam\_role\_arn](#input\_default\_iam\_role\_arn) | Default IAM role to apply to all channels | `string` | `""` | no |
| <a name="input_default_logging_level"></a> [default\_logging\_level](#input\_default\_logging\_level) | Default logging level to apply to all channels | `string` | `"NONE"` | no |
| <a name="input_default_sns_topic_arns"></a> [default\_sns\_topic\_arns](#input\_default\_sns\_topic\_arns) | Default SNS topic ARNs to apply to all channels | `list(string)` | `[]` | no |
Expand Down

0 comments on commit c445ad4

Please sign in to comment.