From 983545f69019d30e246495cb0fa2fd7896ede19d Mon Sep 17 00:00:00 2001 From: Dmitry Kireev Date: Tue, 21 May 2024 10:47:42 +0000 Subject: [PATCH] Maintenance: - Updated README.md - Updated deprecated policy calls - Bumped minimal Terraform version - Added types to variables.tf --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++-- s3_website.tf | 7 ++++-- variables.tf | 17 +++++++++++++ versions.tf | 2 +- 4 files changed, 90 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 11af291..9538ba4 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ failover routing policy to S3 public website bucket with "Maintenance page" ``` module "route53-health-check" { source = "hazelops/route53-healthcheck/aws"" - version = "~> 1.0" - + env = "production" name = "my-monitoring" port = "80" @@ -32,3 +31,69 @@ module "route53-health-check" { } ``` Note: This module just creates a secondary Route53 record for failover routing policy. Creating a primary record is out of scope of this module. + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.1 | +| [aws](#requirement\_aws) | >= 3.0 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 3.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_route53_health_check.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_health_check) | resource | +| [aws_route53_record.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource | +| [aws_s3_bucket.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | +| [aws_s3_bucket_acl.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl) | resource | +| [aws_s3_bucket_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource | +| [aws_s3_bucket_website_configuration.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration) | resource | +| [aws_sns_topic.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource | +| [aws_sns_topic_subscription.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_subscription) | resource | +| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | +| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [cw\_alarm\_comparison\_operator](#input\_cw\_alarm\_comparison\_operator) | Comparison Operator of Cloudwatch metric alarm | `string` | `"LessThanThreshold"` | no | +| [cw\_alarm\_evaluation\_periods](#input\_cw\_alarm\_evaluation\_periods) | Evaluation periods of Cloudwatch metric alarm | `string` | `"1"` | no | +| [cw\_alarm\_metric\_name](#input\_cw\_alarm\_metric\_name) | Metric name of Cloudwatch metric alarm | `string` | `"HealthCheckStatus"` | no | +| [cw\_alarm\_namespace](#input\_cw\_alarm\_namespace) | Namespace of Cloudwatch metric alarm | `string` | `"AWS/Route53"` | no | +| [cw\_alarm\_period](#input\_cw\_alarm\_period) | Period of Cloudwatch metric alarm | `string` | `"60"` | no | +| [cw\_alarm\_statistic](#input\_cw\_alarm\_statistic) | Statistic of Cloudwatch metric alarm | `string` | `"Minimum"` | no | +| [cw\_alarm\_threshold](#input\_cw\_alarm\_threshold) | Threshold of Cloudwatch metric alarm | `string` | `"1"` | no | +| [cw\_alarm\_unit](#input\_cw\_alarm\_unit) | Unit of Cloudwatch metric alarm | `string` | `"None"` | no | +| [domain\_name](#input\_domain\_name) | n/a | `any` | n/a | yes | +| [enabled](#input\_enabled) | Gives ability to enable or disable a module | `bool` | `true` | no | +| [endpoint\_auto\_confirms](#input\_endpoint\_auto\_confirms) | Endpoint endpoint for SNS topic subscription, PagerDuty (https://events.pagerduty.com/integration//enqueue) | `bool` | `true` | no | +| [env](#input\_env) | n/a | `any` | n/a | yes | +| [failure\_threshold](#input\_failure\_threshold) | The number of consecutive health checks that an endpoint must pass or fail. | `string` | `"3"` | no | +| [fqdn](#input\_fqdn) | The FQDN of the endpoint to be monitored | `string` | n/a | yes | +| [name](#input\_name) | The name of the monitoring and name of the subscription service endpoint | `string` | n/a | yes | +| [port](#input\_port) | The port of the endpoint to be monitored | `string` | `"443"` | no | +| [r53\_failover\_enabled](#input\_r53\_failover\_enabled) | Enabling creating secondary Failover R53 Record | `bool` | `false` | no | +| [request\_interval](#input\_request\_interval) | The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request. | `string` | `"30"` | no | +| [resource\_path](#input\_resource\_path) | The path that you want Amazon Route 53 to request when performing health checks. | `string` | `"/"` | no | +| [subscription\_endpoint](#input\_subscription\_endpoint) | Endpoint endpoint for SNS topic subscription, PagerDuty, Slack etc. | `string` | n/a | yes | +| [subscription\_endpoint\_protocol](#input\_subscription\_endpoint\_protocol) | Endpoint protocol for SNS topic subscription | `string` | `"https"` | no | +| [type](#input\_type) | The protocol to use when performing health checks. Valid values are HTTP, HTTPS, HTTP\_STR\_MATCH, HTTPS\_STR\_MATCH, TCP, CALCULATED and CLOUDWATCH\_METRIC | `string` | `"HTTPS"` | no | + +## Outputs + +No outputs. + diff --git a/s3_website.tf b/s3_website.tf index b37a108..249ce20 100644 --- a/s3_website.tf +++ b/s3_website.tf @@ -7,7 +7,10 @@ resource "aws_s3_bucket" "this" { Terraform = "true" Name = "${var.env}-${var.name}" } +} +resource "aws_s3_bucket_policy" "this" { + bucket = aws_s3_bucket.this[0].id policy = <