Skip to content

Conversation

@etcart
Copy link
Collaborator

@etcart etcart commented Nov 23, 2025

configuration for cross-account permission to s3 buckets.
configured so that, if nothing is changed, nothing will change.
but a deployment can declare a consolidation_account_id (to not null) and it will add to
standard-buckets
protected-buckets
public-buckets
and workflow-buckets
a permission policy that allows read and write access to the declared account('s stack)
additionally deploy_name and maturity can be declared or left default, our current best guess of what those values will be

@tgoff
Copy link

tgoff commented Nov 24, 2025

This may be a good use case for S3 Access Points. We could create Access points under Consolidated control and then the DAAC side update would simply be to delegate the necessary control to the access point. See https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html#access-points-delegating-control

@etcart
Copy link
Collaborator Author

etcart commented Nov 24, 2025

ok, so the same basic shape of: add to each relevant bucket a bucket policy, but using this data access point conditional instead of specifying a principal

Copy link
Contributor

Choose a reason for hiding this comment

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

missing trailing new line on file

variable "consolidation_deploy_name" {
type = string
description = "deploy_name of relevant consolidation stack"
default = "willow"
Copy link
Contributor

Choose a reason for hiding this comment

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

what is willow?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think id be more in favor of not having a default here. Forgetting to set this resulting in stuff prefixed willow is unintuitive for users of CIRRUS. Probably better to let the TF fail if nothing is provided?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure, willow is currently the prefix of the consolidation stack(s)
which got named because I had to stand one up before people had made any decisions
but I can make it non-defaulted

Copy link
Contributor

Choose a reason for hiding this comment

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

Well if thats the prefix and its sticking around :D

Copy link
Contributor

Choose a reason for hiding this comment

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

missing newline at end of file

daac/policy.tf Outdated
Copy link
Contributor

@mattp0 mattp0 Nov 24, 2025

Choose a reason for hiding this comment

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

Sorry to be nitpicky here. There is a big mix of allow and Allow I think they should all be Allow in the Effect of the policy.

Copy link
Contributor

@mattp0 mattp0 left a comment

Choose a reason for hiding this comment

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

This looks good, I approved the tf lint to run. I had some what I would say is nitpicks but otherwise thanks for contributing!

@etcart
Copy link
Collaborator Author

etcart commented Dec 4, 2025

ok, we went down a bit of a rabbit hole on access points and also getting some "plays well with others" parsing right, but it's ready for re-review now. I believe everything previously present has been fixed and there's been a bit of cleanup generally

@etcart etcart requested a review from mattp0 December 8, 2025 14:49
Copy link
Contributor

@mattp0 mattp0 Dec 8, 2025

Choose a reason for hiding this comment

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

I think it would structurally be better to instead of manually merging the old distribution policy into your new one is to keep the iam_policy_document approach and rely on the policy document merging you can use https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#example-of-merging-source-documents

This makes it a bit more composable for the users in my opinion and a bit cleaner as far as extending policies in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea, that looks much cleaner

@etcart
Copy link
Collaborator Author

etcart commented Dec 10, 2025

hey Matt, I found an issue with how I was handling the oai's case, and fixed that, I thought I'd tested for it, but hadn't effectively

@etcart etcart merged commit 69c1153 into asfadmin:main Dec 10, 2025
3 checks passed
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.

3 participants