Export flow logs to an Amazon S3 Bucket

I found the instructions on Amazon’s website to be useless. This is what worked for me Define some variables bucket=my-bucket region=us-east-1 log-group-name=primary-nat prefix=my-prefix taskname=my-task start-epoch=1516255200000 end-epoch=1516860000000 Create the bucket aws s3 mb s3://$bucket --region $region Create the Policy cat <<'EOF' > ./policy.json { "Version": "2012-10-17", "Statement": [ { "Action": "s3:GetBucketAcl", "Effect": "Allow", "Resource": "arn:aws:s3:::replace-bucket", "Principal":... » read more