You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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):
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
66
61
```
67
62
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
+
:::
69
93
70
-
### Example
94
+
####Example
71
95
72
96
```tf
73
97
cloudwatch_log_retention_periods = {
74
-
ingest_parse_pdr_task_log_retention = 365
98
+
ParsePdr = 365
75
99
}
76
100
```
77
101
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).
Copy file name to clipboardExpand all lines: example/cumulus-tf/variables.tf
+31-12Lines changed: 31 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,5 @@
1
1
# Required
2
2
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
-
9
3
variable"cmr_client_id" {
10
4
type=string
11
5
}
@@ -56,12 +50,6 @@ variable "csdap_host_url" {
56
50
description="The csdap host url"
57
51
}
58
52
59
-
variable"default_log_retention_days" {
60
-
type=number
61
-
default=30
62
-
description="default value that user chooses for their log retention periods"
0 commit comments