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

Generalise log bucket policy for other log sources #68

Closed

Conversation

anthonyhashemi
Copy link
Contributor

Generalise log bucket policy for other log sources such as cloudfront distributions (see https://github.com/nationalarchives/da-ayr-terraform/pull/237)

s3_logs/main.tf Outdated
@@ -1,8 +1,32 @@

data "aws_iam_policy_document" "policy_document" {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now this is defined at the s3_logs module level, when using this directly insteas of via the s3 module, users get the extra restrictions outlined in default_log_bucket_policy.json.tpl by default.

See https://github.com/nationalarchives/da-ayr-terraform/pull/237 for example

@anthonyhashemi anthonyhashemi force-pushed the generalise-log-bucket-policy-for-other-sources branch from 8ed4d1b to f36e8cc Compare October 1, 2024 14:04
@@ -13,7 +13,7 @@
"Resource": "arn:aws:s3:::${log_bucket_name}/*",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:s3:::${bucket_name}"
"aws:SourceArn": "${source_arn}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass in source_arn as opposed to making it specific to s3 bucket sources only

@anthonyhashemi anthonyhashemi force-pushed the generalise-log-bucket-policy-for-other-sources branch 4 times, most recently from 12f3009 to 0caf17f Compare October 2, 2024 10:39
…nd s3 logging modules and output the policy document to attach it outside to deal with scenarios of circular dependency
@anthonyhashemi anthonyhashemi force-pushed the generalise-log-bucket-policy-for-other-sources branch from 0caf17f to ecb097a Compare October 2, 2024 10:42
@anthonyhashemi
Copy link
Contributor Author

CLosing in favour of #69 as no longer needed generalising log bucket policy for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant