Created
          January 29, 2019 10:04 
        
      - 
      
- 
        Save grncdr/b80a698507c4dc981995fcb6df3beeeb to your computer and use it in GitHub Desktop. 
Revisions
- 
        grncdr created this gist Jan 29, 2019 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ #!/bin/sh PATTERN="my-app-production" RETENTION_IN_DAYS="30" for group_name in $(aws logs describe-log-groups | jq -r '.logGroups[]|.logGroupName' | grep $PATTERN); do aws logs put-retention-policy --log-group-name $group_name --retention-in-days $RETENTION_IN_DAYS; done