Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS org compatible when Org ID is after AWSLogs prefix #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions resources/partitioner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ def main():
)
)

if resp["CommonPrefixes"][0]["Prefix"] != log_path_prefix + "AWSLogs/":
if resp["CommonPrefixes"][0]["Prefix"] != "AWSLogs/" + log_path_prefix:
exit(
"ERROR: S3 bucket path is incorrect. Ensure you have logs at s3://{bucket}/{path}/AWSLogs".format(
bucket=config["s3_bucket_containing_logs"], path=log_path_prefix
)
)

# Identify all accounts in this bucket and what their prefix paths are
log_path_prefix = log_path_prefix + "AWSLogs/"
log_path_prefix = "AWSLogs/" + log_path_prefix
resp = s3.list_objects_v2(
Bucket=config["s3_bucket_containing_logs"],
Prefix=log_path_prefix,
Expand Down Expand Up @@ -329,4 +329,4 @@ def main():
# Handler for lambda
def handler(event, context):
return main()