Skip to content

Commit 60f9950

Browse files
Nnaga1jennyhliuJkovarik
authored
Release 15.0.2 (#3349)
* backport PR * finalizing docs and changing remaining groups * 15.1.0 release * doc updates * PR feedback + testing changes * Revert "doc updates" This reverts commit 5037012. * PR feedback * reverting change * Revert "update changelog" This reverts commit ae4627c. * reverting changes * PR feedback * removing EgressLambda from doc * Update xml2js 0.4.22->0.5 strict (#3330) (#3339) * Update xml2js 0.4.22->0.5 strict * Address GHSA-776f-qx25-q3cc/update allow list * Update CHANGELOG * Update package pins to 0.5.0 for xmljs Co-authored-by: Jonathan Kovarik <[email protected]> * PR feedback * PR feedback * PR feedback * fixing documentation linting * PR feedback * PR feedback * PR feedback * adding variables to tf-modules/workflow * PR feedback * PR feedback * reverting previous change * CUMULUS-3121/3120 v15.1.0 backport (#3346) * backport PR * finalizing docs and changing remaining groups * PR feedback + testing changes * PR feedback * reverting change * Revert "update changelog" This reverts commit ae4627c. * reverting changes * PR feedback * removing EgressLambda from doc * Update xml2js 0.4.22->0.5 strict (#3330) (#3339) * Update xml2js 0.4.22->0.5 strict * Address GHSA-776f-qx25-q3cc/update allow list * Update CHANGELOG * Update package pins to 0.5.0 for xmljs Co-authored-by: Jonathan Kovarik <[email protected]> * PR feedback * PR feedback * PR feedback * fixing documentation linting * PR feedback * PR feedback * PR feedback * adding variables to tf-modules/workflow * PR feedback * PR feedback * reverting previous change --------- Co-authored-by: jennyhliu <[email protected]> Co-authored-by: Jonathan Kovarik <[email protected]> * changing version number * small fixes * small fix --------- Co-authored-by: jennyhliu <[email protected]> Co-authored-by: Jonathan Kovarik <[email protected]>
1 parent fb73047 commit 60f9950

File tree

107 files changed

+597
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+597
-485
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77
## Unreleased
88

9+
## [v15.0.2] 2023-04-25
10+
11+
### Fixed
12+
13+
- **CUMULUS-3120**
14+
- Fixed a bug by adding in `default_log_retention_periods` and `cloudwatch_log_retention_periods`
15+
to Cumulus modules so they can be used during deployment for configuring cloudwatch retention periods
16+
- Updated cloudwatch retention documentation to reflect the bugfix changes
17+
918
## [v15.0.1] 2023-04-20
1019

1120
### Changed
@@ -6896,7 +6905,8 @@ Note: There was an issue publishing 1.12.0. Upgrade to 1.12.1.
68966905

68976906
## [v1.0.0] - 2018-02-23
68986907

6899-
[unreleased]: https://github.com/nasa/cumulus/compare/v15.0.1...HEAD
6908+
[unreleased]: https://github.com/nasa/cumulus/compare/v15.0.2...HEAD
6909+
[v15.0.2]: https://github.com/nasa/cumulus/compare/v15.0.1...v15.0.2
69006910
[v15.0.1]: https://github.com/nasa/cumulus/compare/v15.0.0...v15.0.1
69016911
[v15.0.0]: https://github.com/nasa/cumulus/compare/v14.1.0...v15.0.0
69026912
[v14.1.0]: https://github.com/nasa/cumulus/compare/v14.0.0...v14.1.0

docs/configuration/cloudwatch-retention.md

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,44 +35,68 @@ Changing the log retention policy in the AWS Management Console is a fairly simp
3535

3636
## Terraform
3737

38-
The `cumulus` module exposes values for configuration of log retention for
39-
cloudwatch log groups (in days). A configurable map of `cloudwatch_log_retention_periods` currently supports the following variables:
40-
41-
- cumulus-tf_egress_lambda_log_retention
42-
- archive_private_api_log_retention
43-
- archive_api_log_retention
44-
- archive_async_operation_log_retention
45-
- archive_granule_files_cache_updater_log_retention
46-
- archive_publish_executions_log_retention
47-
- archive_publish_granule_log_retention
48-
- archive_publish_pdrs_log_retention
49-
- archive_replay_sqs_messages_log_retention
50-
- cumulus_distribution_api_log_retention
51-
- cumulus_ecs_service_default_log_retention
52-
- ingest_discover_pdrs_task_log_retention
53-
- ingest_hyrax_metadata_updates_task_log_retention
54-
- ingest_parse_pdr_task_log_retention
55-
- ingest_post_to_cmr_task_log_retention
56-
- ingest_queue_pdrs_task_log_retention
57-
- ingest_queue_workflow_task_log_retention
58-
- ingest_sync_granule_task_log_retention
59-
- ingest_update_cmr_access_constraints_task_log_retention
60-
61-
In order to configure this value for the cloudwatch log group, the variable for the retention period for the respective group should be in the form of:
62-
63-
```hcl
64-
<cumulus_module>_<cloudwatch_log_group>_log_retention: <log_retention>
65-
type = number
38+
Cumulus modules create cloudwatch log groups and manage log retention for a subset of lambdas and tasks. These log groups have a default log retention time, but, there are two optional variables which can be set to change the default retention period for all or specific Cumulus managed cloudwatch log groups through deployment. For cloudwatch log groups which are not managed by Cumulus modules, the retention period is indefinite or `Never Expire` by AWS, cloudwatch log configurations for all Cumulus lambdas and tasks will be added in a future release.
39+
40+
There are optional variables that can be set during deployment of cumulus modules to configure
41+
the retention period (in days) of cloudwatch log groups for lambdas and tasks which the `cumulus`, `cumulus_distribution`, and `cumulus_ecs_service` modules supports (using the `cumulus` module as an example):
42+
43+
```tf
44+
module "cumulus" {
45+
# ... other variables
46+
default_log_retention_days = var.default_log_retention_days
47+
cloudwatch_log_retention_periods = var.cloudwatch_log_retention_periods
48+
}
49+
```
50+
51+
By setting the below variables in `terraform.tfvars` and deploying, the cloudwatch log groups will be instantiated or updated with the new retention value.
52+
53+
### default_log_retention_periods
54+
55+
The variable `default_log_retention_days` can be configured in order to set the default log retention for all cloudwatch log groups managed by Cumulus in case a custom value isn't used. The log groups will use this value for their retention, and if this value is not set either, the retention will default to 30 days. For example, if a user would like their log groups of the Cumulus module to have a retention period of one year, deploy the respective modules with the variable in the example below.
56+
57+
#### Example
58+
59+
```tf
60+
default_log_retention_periods = 365
6661
```
6762

68-
An example, in the case of configuring the retention period for the `parse_pdr_task` `aws_cloudwatch_log_group`:
63+
### cloudwatch_log_retention_periods
64+
65+
The retention period (in days) of cloudwatch log groups for specific lambdas and tasks can be set
66+
during deployment using the `cloudwatch_log_retention_periods` terraform map variable. In order to
67+
configure these values for respective cloudwatch log groups, uncomment the `cloudwatch_log_retention_periods` variable and add the retention values listed below corresponding to the group's retention you want to change. The following values are supported correlating to their lambda/task name, (i.e. "/aws/lambda/prefix-DiscoverPdrs" would have the retention variable "DiscoverPdrs" )
68+
69+
- ApiEndpoints
70+
- AsyncOperationEcsLogs
71+
- DiscoverPdrs
72+
- DistributionApiEndpoints
73+
- EcsLogs
74+
- granuleFilesCacheUpdater
75+
- HyraxMetadataUpdates
76+
- ParsePdr
77+
- PostToCmr
78+
- PrivateApiLambda
79+
- publishExecutions
80+
- publishGranules
81+
- publishPdrs
82+
- QueuePdrs
83+
- QueueWorkflow
84+
- replaySqsMessages
85+
- SyncGranule
86+
- UpdateCmrAccessConstraints
87+
88+
:::note
89+
90+
`EcsLogs` is used for all cumulus_ecs_service tasks cloudwatch log groups
91+
92+
:::
6993

70-
### Example
94+
#### Example
7195

7296
```tf
7397
cloudwatch_log_retention_periods = {
74-
ingest_parse_pdr_task_log_retention = 365
98+
ParsePdr = 365
7599
}
76100
```
77101

78-
Additionally, the variable `default_log_retention_days` can be configured separately during deployment in order to set the default log retention for the cloudwatch log groups in case a custom value isn't used. The log groups will use this value for their retention value, and if this value is not set either, the retention will default to 30 days.
102+
The retention periods are the number of days you'd like to retain the logs in the specified log group for. There is a list of possible values available in the [aws logs documentation](https://docs.aws.amazon.com/cli/latest/reference/logs/put-retention-policy.html).

example/cumulus-tf/cumulus_distribution.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ module "cumulus_distribution" {
4040
system_bucket = var.system_bucket
4141
tags = local.tags
4242
vpc_id = local.vpc_id
43+
default_log_retention_days = var.default_log_retention_days
44+
cloudwatch_log_retention_periods = var.cloudwatch_log_retention_periods
4345
}

example/cumulus-tf/ecs_hello_world_workflow.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ module "hello_world_service" {
2222

2323
cpu = 400
2424
memory_reservation = 700
25+
default_log_retention_days = var.default_log_retention_days
26+
cloudwatch_log_retention_periods = var.cloudwatch_log_retention_periods
2527

2628
environment = {
2729
AWS_DEFAULT_REGION = data.aws_region.current.name

example/cumulus-tf/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ module "cumulus" {
159159
es_index_shards = var.es_index_shards
160160

161161
dynamo_tables = merge(data.terraform_remote_state.data_persistence.outputs.dynamo_tables, var.optional_dynamo_tables)
162+
default_log_retention_days = var.default_log_retention_days
163+
cloudwatch_log_retention_periods = var.cloudwatch_log_retention_periods
162164

163165
# Archive API settings
164166
token_secret = var.token_secret

example/cumulus-tf/python_processing_workflow.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ data "aws_ecr_repository" "cumulus_test_ingest_process" {
1010

1111
module "python_test_ingest_processing_service" {
1212
source = "../../tf-modules/cumulus_ecs_service"
13-
13+
default_log_retention_days = var.default_log_retention_days
14+
cloudwatch_log_retention_periods = var.cloudwatch_log_retention_periods
1415
prefix = var.prefix
1516
name = "PythonTestIngestProcess"
1617
tags = local.tags

example/cumulus-tf/terraform.tfvars.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ csdap_host_url = "csdap host url"
6969
deploy_cumulus_distribution = true
7070

7171
# Optional, uncomment if needed, these variables are for configuring the cloudwatch log group's retention periods
72+
# default_log_retention_days = 30
7273
# cloudwatch_log_retention_periods = {
73-
# <module>_<cloudwatch_log_group_name>_log_retention = 365
74+
# <lambda function or task name> = 365
7475
# }
7576
#
76-
# default_log_retention_days = 30
7777

7878
# Optional. Uncomment if using Cumulus Distribution.
7979
# toggle this after deployed to put the correct port in. (and hosts and config)

example/cumulus-tf/thin_egress_app.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ resource "aws_cloudwatch_log_subscription_filter" "egress_api_gateway_log_subscr
6363
resource "aws_cloudwatch_log_group" "egress_lambda_log_group" {
6464
count = (var.log_destination_arn != null) ? 1 : 0
6565
name = "/aws/lambda/${module.thin_egress_app.egress_lambda_name}"
66-
retention_in_days = lookup(var.cloudwatch_log_retention_periods, "cumulus-tf_egress_lambda_log_retention", var.default_log_retention_days)
66+
retention_in_days = lookup(var.cloudwatch_log_retention_periods, "thin-egress-app-EgressLambda", var.default_log_retention_days)
6767
tags = var.tags
6868
}
6969

example/cumulus-tf/variables.tf

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Required
22

3-
variable "cloudwatch_log_retention_periods" {
4-
type = map(number)
5-
description = "number of days logs will be retained for the respective cloudwatch log group, in the form of <module>_<cloudwatch_log_group_name>_log_retention"
6-
default = {}
7-
}
8-
93
variable "cmr_client_id" {
104
type = string
115
}
@@ -56,12 +50,6 @@ variable "csdap_host_url" {
5650
description = "The csdap host url"
5751
}
5852

59-
variable "default_log_retention_days" {
60-
type = number
61-
default = 30
62-
description = "default value that user chooses for their log retention periods"
63-
}
64-
6553
variable "launchpad_api" {
6654
type = string
6755
default = "launchpadApi"
@@ -440,3 +428,34 @@ variable "subnets_tag_name" {
440428
type = string
441429
default = "Private application us-east-1a *"
442430
}
431+
432+
variable "cloudwatch_log_retention_periods" {
433+
type = map(number)
434+
description = "retention periods for the respective cloudwatch log group, these values will be used instead of default retention days"
435+
default = {
436+
thin-egress-app-EgressLambda = 7
437+
ApiEndpoints = 7
438+
AsyncOperationEcsLogs = 7
439+
DiscoverPdrs = 7
440+
DistributionApiEndpoints = 7
441+
EcsLogs = 7
442+
granuleFilesCacheUpdater = 7
443+
HyraxMetadataUpdates = 7
444+
ParsePdr = 7
445+
PostToCmr = 7
446+
PrivateApiLambda = 7
447+
publishExecutions = 7
448+
publishGranules = 7
449+
QueuePdrs = 7
450+
QueueWorkflow = 7
451+
replaySqsMessages = 7
452+
SyncGranule = 7
453+
UpdateCmrAccessConstraints = 7
454+
}
455+
}
456+
457+
variable "default_log_retention_days" {
458+
type = number
459+
default = 14
460+
description = "default value that user chooses for their log retention periods"
461+
}

example/lambdas/asyncOperations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cumulus/test-async-operations",
3-
"version": "15.0.1",
3+
"version": "15.0.2",
44
"description": "AsyncOperations Test Lambda",
55
"main": "index.js",
66
"private": true,

0 commit comments

Comments
 (0)