Skip to content

Commit

Permalink
- ADD
Browse files Browse the repository at this point in the history
  - README.md for modules.
- FIX
  - some modules fixed aws provider version.
- BUG
  - fixed bug for some modules.
  • Loading branch information
y-miyazaki committed Apr 4, 2022
1 parent dc651ab commit 321a4cb
Show file tree
Hide file tree
Showing 88 changed files with 3,738 additions and 27 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
rev: v3.2.0
hooks:
- id: trailing-whitespace
exclude: README.*.md
exclude: README*.md
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
Expand All @@ -18,11 +18,11 @@ repos:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_tfsec
- id: terraform_docs
args:
- --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc.
- --hook-config=--add-to-existing-file=true # Boolean. true or false
- --hook-config=--create-file-if-not-exist=true # Boolean. true or false
# - id: terraform_docs
# args:
# - --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc.
# - --hook-config=--add-to-existing-file=true # Boolean. true or false
# - --hook-config=--create-file-if-not-exist=true # Boolean. true or false
# - repo: https://github.com/zricethezav/gitleaks
# rev: v7.6.0
# hooks:
Expand Down
43 changes: 43 additions & 0 deletions modules/aws/recipes/budgets/create-v4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

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

## Providers

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

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_budgets_budget.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/budgets_budget) | resource |
| [aws_cloudwatch_event_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |
| [aws_cloudwatch_event_target.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |
| [aws_default_tags.provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_budgets_budget"></a> [aws\_budgets\_budget](#input\_aws\_budgets\_budget) | (Required) Provides a budgets budget resource. Budgets use the cost visualisation provided by Cost Explorer to show you the status of your budgets, to provide forecasts of your estimated costs, and to track your AWS usage, including your free tier usage. | <pre>object(<br> {<br> # The name of a budget. Unique within accounts.<br> name = string<br> # Whether this budget tracks monetary cost or usage.<br> budget_type = string<br> # Map of Cost Filters key/value pairs to apply to the budget.<br> cost_filter = list(any)<br> # The amount of cost or usage being measured for a budget.<br> limit_amount = string<br> # Object containing Budget Notifications. Can be used multiple times to define more than one budget notification<br> notification = list(any)<br> }<br> )</pre> | n/a | yes |
| <a name="input_aws_cloudwatch_event_rule"></a> [aws\_cloudwatch\_event\_rule](#input\_aws\_cloudwatch\_event\_rule) | (Optional) Provides an EventBridge Rule resource. | <pre>object(<br> {<br> # The name of the rule. If omitted, Terraform will assign a random, unique name. Conflicts with name_prefix.<br> name = string<br> # The scheduling expression. For example, cron(0 20 * * ? *) or rate(5 minutes). At least one of schedule_expression or event_pattern is required. Can only be used on the default event bus.<br> schedule_expression = string<br> # The description of the rule.<br> description = string<br> # Whether the rule should be enabled (defaults to true).<br> is_enabled = bool<br> }<br> )</pre> | <pre>{<br> "description": "This cloudwatch event used for Budgets.",<br> "is_enabled": true,<br> "name": "budgets-cloudwatch-event-rule",<br> "schedule_expression": "cron(0 9 * * ? *)"<br>}</pre> | no |
| <a name="input_aws_cloudwatch_event_target"></a> [aws\_cloudwatch\_event\_target](#input\_aws\_cloudwatch\_event\_target) | (Required) Provides an EventBridge Target resource. | <pre>object(<br> {<br> # The Amazon Resource Name (ARN) associated of the target.<br> arn = string<br> }<br> )</pre> | n/a | yes |
| <a name="input_is_enabled"></a> [is\_enabled](#input\_is\_enabled) | (Optional) A boolean flag to enable/disable Budgets. Defaults true. | `bool` | `true` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) Key-value map of resource tags. | `map(any)` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_arn"></a> [arn](#output\_arn) | The Amazon Resource Name (ARN) of the rule |
<!-- END_TF_DOCS -->
45 changes: 45 additions & 0 deletions modules/aws/recipes/budgets/create/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

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

## Providers

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

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_budgets_budget.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/budgets_budget) | resource |
| [aws_cloudwatch_event_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |
| [aws_cloudwatch_event_target.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |
| [aws_default_tags.provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_budgets_budget"></a> [aws\_budgets\_budget](#input\_aws\_budgets\_budget) | (Required) Provides a budgets budget resource. Budgets use the cost visualisation provided by Cost Explorer to show you the status of your budgets, to provide forecasts of your estimated costs, and to track your AWS usage, including your free tier usage. | <pre>object(<br> {<br> # The name of a budget. Unique within accounts.<br> name = string<br> # Whether this budget tracks monetary cost or usage.<br> budget_type = string<br> # Map of Cost Filters key/value pairs to apply to the budget.<br> cost_filters = map(any)<br> # The amount of cost or usage being measured for a budget.<br> limit_amount = string<br> # Object containing Budget Notifications. Can be used multiple times to define more than one budget notification<br> notification = list(any)<br> }<br> )</pre> | n/a | yes |
| <a name="input_aws_cloudwatch_event_rule"></a> [aws\_cloudwatch\_event\_rule](#input\_aws\_cloudwatch\_event\_rule) | (Optional) Provides an EventBridge Rule resource. | <pre>object(<br> {<br> # The name of the rule. If omitted, Terraform will assign a random, unique name. Conflicts with name_prefix.<br> name = string<br> # The scheduling expression. For example, cron(0 20 * * ? *) or rate(5 minutes). At least one of schedule_expression or event_pattern is required. Can only be used on the default event bus.<br> schedule_expression = string<br> # The description of the rule.<br> description = string<br> # Whether the rule should be enabled (defaults to true).<br> is_enabled = bool<br> }<br> )</pre> | <pre>{<br> "description": "This cloudwatch event used for Budgets.",<br> "is_enabled": true,<br> "name": "budgets-cloudwatch-event-rule",<br> "schedule_expression": "cron(0 9 * * ? *)"<br>}</pre> | no |
| <a name="input_aws_cloudwatch_event_target"></a> [aws\_cloudwatch\_event\_target](#input\_aws\_cloudwatch\_event\_target) | (Required) Provides an EventBridge Target resource. | <pre>object(<br> {<br> # The Amazon Resource Name (ARN) associated of the target.<br> arn = string<br> }<br> )</pre> | n/a | yes |
| <a name="input_is_enabled"></a> [is\_enabled](#input\_is\_enabled) | (Optional) A boolean flag to enable/disable Budgets. Defaults true. | `bool` | `true` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) Key-value map of resource tags. | `map(any)` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_arn"></a> [arn](#output\_arn) | The Amazon Resource Name (ARN) of the rule |
<!-- END_TF_DOCS -->
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 1 addition & 1 deletion modules/aws/recipes/budgets/create/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">=3.0.0"
version = "~>3.75"
}
}
}
38 changes: 38 additions & 0 deletions modules/aws/recipes/cloudwatch/alarm/log/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

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

## Providers

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

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_cloudwatch_log_metric_filter.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_metric_filter) | resource |
| [aws_cloudwatch_metric_alarm.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource |
| [aws_default_tags.provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_cloudwatch_log_metric_filter"></a> [aws\_cloudwatch\_log\_metric\_filter](#input\_aws\_cloudwatch\_log\_metric\_filter) | (Required) aws\_cloudwatch\_log\_metric\_filter. | `list(any)` | n/a | yes |
| <a name="input_aws_cloudwatch_metric_alarm"></a> [aws\_cloudwatch\_metric\_alarm](#input\_aws\_cloudwatch\_metric\_alarm) | (Required) aws\_cloudwatch\_metric\_alarm. | `list(any)` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A mapping of tags to assign to the resource. | `map(any)` | `null` | no |

## Outputs

No outputs.
<!-- END_TF_DOCS -->
36 changes: 36 additions & 0 deletions modules/aws/recipes/cloudwatch/alarm/metric/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

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

## Providers

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

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_cloudwatch_metric_alarm.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource |
| [aws_default_tags.provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_cloudwatch_metric_alarm"></a> [aws\_cloudwatch\_metric\_alarm](#input\_aws\_cloudwatch\_metric\_alarm) | (Optional) aws\_cloudwatch\_metric\_alarm. | <pre>list(object(<br> {<br> # The descriptive name for the alarm. This name must be unique within the user's AWS account<br> alarm_name = string<br> # The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold. Additionally, the values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold, and GreaterThanUpperThreshold are used only for alarms based on anomaly detection models.<br> comparison_operator = string<br> # The number of periods over which data is compared to the specified threshold.<br> evaluation_periods = string<br> # The name for the alarm's associated metric. See docs for supported metrics.<br> metric_name = string<br> # The namespace for the alarm's associated metric. See docs for the list of namespaces. See docs for supported metrics.<br> namespace = string<br> # The period in seconds over which the specified statistic is applied.<br> period = number<br> # The statistic to apply to the alarm's associated metric. Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum<br> statistic = string<br> # The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.<br> threshold = string<br> # If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.<br> threshold_metric_id = string<br> # Indicates whether or not actions should be executed during any changes to the alarm's state. Defaults to true.<br> actions_enabled = bool<br> # The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).<br> alarm_actions = list(string)<br> # The description for the alarm.<br> alarm_description = string<br> # The number of datapoints that must be breaching to trigger the alarm.<br> datapoints_to_alarm = string<br> # The dimensions for the alarm's associated metric. For the list of available dimensions see the AWS documentation here.<br> dimensions = map(any)<br> # The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).<br> insufficient_data_actions = list(string)<br> # The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).<br> ok_actions = list(string)<br> # The unit for the alarm's associated metric.<br> unit = string<br> # The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.<br> extended_statistic = string<br> # Sets how this alarm is to handle missing data points. The following values are supported: missing, ignore, breaching and notBreaching. Defaults to missing.<br> treat_missing_data = string<br> # Used only for alarms based on percentiles. If you specify ignore, the alarm state will not change during periods with too few data points to be statistically significant. If you specify evaluate or omit this parameter, the alarm will always be evaluated and possibly change state no matter how many data points are available. The following values are supported: ignore, and evaluate.<br> evaluate_low_sample_count_percentiles = string<br> # Enables you to create an alarm based on a metric math expression. You may specify at most 20.<br> metric_query = list(any)<br> }<br> )<br> )</pre> | `[]` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A mapping of tags to assign to the resource. | `map(any)` | `null` | no |

## Outputs

No outputs.
<!-- END_TF_DOCS -->
Loading

0 comments on commit 321a4cb

Please sign in to comment.