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
demandé il y a 4 ans855 vues
1 réponse
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
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions