How to set Log Retention Expire to Log Group by boto3 or AWS CLI?

0

Hello, guys.

Thank you for your help in advance.

I would like to know how to set Log Retention Expire by boto3 or AWS CLI to Log Group.
If you know how to do that, please teach it to me.

Thank you.

koki-n
gefragt vor 4 Jahren863 Aufrufe
1 Antwort
1

Hello,

Both boto3 and AWS CLI support CloudWatch Logs put-retention-policy.

Boto3 put_retention_policy() documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.put_retention_policy

AWS CLI put-retention-policy documentation: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/logs/put-retention-policy.html

Best,
Kevin

AWS
beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen