Bootstrap FreeKB - Amazon Web Services (AWS) - Delete Flow Log using the AWS CLI
Amazon Web Services (AWS) - Delete Flow Log using the AWS CLI

Updated:   |  Amazon Web Services (AWS) articles

This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

The aws ec2 describe-flow-logs command can be used to list the Flow Logs you have created.

aws ec2 describe-flow-logs

 

Something like this should be returned.

[
    {
        "CreationTime": "2023-10-05T01:50:24.089000+00:00",
        "DeliverLogsPermissionArn": "arn:aws:iam::123456789012:role/publishFlowLogs",
        "DeliverLogsStatus": "SUCCESS",
        "FlowLogId": "fl-00f4bbdec6dd110c6",
        "FlowLogStatus": "ACTIVE",
        "LogGroupName": "RDSOSMetrics",
        "ResourceId": "vpc-0a9d4cb29e2748444",
        "TrafficType": "ALL",
        "LogDestinationType": "cloud-watch-logs",
        "LogFormat": "${version} ${account-id} ${interface-id} ${srcaddr} ${dstaddr} ${srcport} ${dstport} ${protocol} ${packets} ${bytes} ${start} ${end} ${action} ${log-status}",
        "Tags": [],
        "MaxAggregationInterval": 600
    }
]

 

Then the aws ec2 delete-flow-logs command can be used to delete the Flow Log.

aws ec2 delete-flow-logs --flow-log-id fl-00f4bbdec6dd110c6

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 9c6401 in the box below so that we can be sure you are a human.