Skip to content

Commit 91f6e5a

Browse files
authored
Merge pull request #9 from trussworks/mb-10797-encrypt-cloudwatch
[MB-10797] encrypt cloudwatch logs
2 parents 1a70a36 + 202d55a commit 91f6e5a

File tree

6 files changed

+45
-15
lines changed

6 files changed

+45
-15
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
- auth:
55
password: $DOCKER_PASSWORD
66
username: $DOCKER_USERNAME
7-
image: trussworks/circleci:efb1042e31538677779971798e0912390f699e72
7+
image: trussworks/circleci:ea2483b4886b26b1006ae95e841497e61512b8c6
88
steps:
99
- checkout
1010
- restore_cache:

.markdownlintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"first-header-h1": false,
44
"first-line-h1": false,
55
"line_length": false,
6-
"no-multiple-blanks": false
6+
"no-multiple-blanks": false,
7+
"no-inline-html": false
78
}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
3+
rev: v4.0.1
44
hooks:
55
- id: check-json
66
- id: check-merge-conflict
@@ -12,12 +12,12 @@ repos:
1212
- id: trailing-whitespace
1313

1414
- repo: git://github.com/igorshubovych/markdownlint-cli
15-
rev: v0.26.0
15+
rev: v0.28.1
1616
hooks:
1717
- id: markdownlint
1818

1919
- repo: git://github.com/antonbabenko/pre-commit-terraform
20-
rev: v1.45.0
20+
rev: v1.50.0
2121
hooks:
2222
- id: terraform_docs
2323
- id: terraform_fmt

README.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,48 @@ module "trusted-advisor-refresh" {
3232

3333
| Name | Version |
3434
|------|---------|
35-
| terraform | >= 0.13.0 |
36-
| aws | >= 3.0 |
35+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
36+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
3737

3838
## Providers
3939

4040
| Name | Version |
4141
|------|---------|
42-
| aws | >= 3.0 |
42+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
43+
44+
## Modules
45+
46+
No modules.
47+
48+
## Resources
49+
50+
| Name | Type |
51+
|------|------|
52+
| [aws_cloudwatch_event_rule.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |
53+
| [aws_cloudwatch_event_target.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |
54+
| [aws_cloudwatch_log_group.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
55+
| [aws_iam_role.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
56+
| [aws_iam_role_policy.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
57+
| [aws_lambda_function.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |
58+
| [aws_lambda_permission.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |
59+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
60+
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
61+
| [aws_iam_policy_document.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
62+
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
63+
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
4364

4465
## Inputs
4566

4667
| Name | Description | Type | Default | Required |
4768
|------|-------------|------|---------|:--------:|
48-
| cloudwatch\_logs\_retention\_days | Number of days to keep logs in AWS CloudWatch. | `string` | `90` | no |
49-
| environment | Environment tag, e.g prod. | `any` | n/a | yes |
50-
| interval\_minutes | How often to update Trusted Advisor. | `string` | `60` | no |
51-
| s3\_bucket | The name of the S3 bucket used to store the Lambda builds. | `string` | n/a | yes |
52-
| version\_to\_deploy | The version the Lambda function to deploy. | `string` | n/a | yes |
69+
| <a name="input_cloudwatch_encryption_key_arn"></a> [cloudwatch\_encryption\_key\_arn](#input\_cloudwatch\_encryption\_key\_arn) | The arn of the encryption key to be used for the cloudwatch logs | `string` | `""` | no |
70+
| <a name="input_cloudwatch_logs_retention_days"></a> [cloudwatch\_logs\_retention\_days](#input\_cloudwatch\_logs\_retention\_days) | Number of days to keep logs in AWS CloudWatch. | `string` | `90` | no |
71+
| <a name="input_environment"></a> [environment](#input\_environment) | Environment tag, e.g prod. | `any` | n/a | yes |
72+
| <a name="input_interval_minutes"></a> [interval\_minutes](#input\_interval\_minutes) | How often to update Trusted Advisor. | `string` | `60` | no |
73+
| <a name="input_s3_bucket"></a> [s3\_bucket](#input\_s3\_bucket) | The name of the S3 bucket used to store the Lambda builds. | `string` | n/a | yes |
74+
| <a name="input_version_to_deploy"></a> [version\_to\_deploy](#input\_version\_to\_deploy) | The version the Lambda function to deploy. | `string` | n/a | yes |
5375

5476
## Outputs
5577

56-
No output.
57-
78+
No outputs.
5879
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ resource "aws_cloudwatch_log_group" "main" {
103103
Name = "${local.name}-${var.environment}"
104104
Environment = var.environment
105105
}
106+
107+
# set the key, else empty string
108+
kms_key_id = var.cloudwatch_encryption_key_arn
106109
}
107110

108111
#

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ variable "version_to_deploy" {
2424
type = string
2525
}
2626

27+
variable "cloudwatch_encryption_key_arn" {
28+
description = "The arn of the encryption key to be used for the cloudwatch logs"
29+
type = string
30+
default = ""
31+
}

0 commit comments

Comments
 (0)