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

Add metrics aws sns policy logic #155

Merged
merged 4 commits into from
Jul 14, 2023
Merged

Conversation

mattp0
Copy link
Contributor

@mattp0 mattp0 commented Jul 13, 2023

This adds some missing outputs that are exposed by the cumulus module. I was attempting to add the policy generation for the metrics team to have SNS subscribe permissions. This change is optional to other DAACs but the cumulus resources that are created for reporting do not have the ability by default to be subscribed to by the metrics AWS accounts.

Some information can be found here https://wiki.earthdata.nasa.gov/display/METS/2.+(Tenant)+Shipping+Logs+To+Cloud+Metrics'+AWS+Account

The outputs I decided to refresh since I was in the account. I got the current list from here https://github.com/nasa/cumulus/blob/v15.0.3/tf-modules/cumulus/outputs.tf

  • Added change log entry
  • Tested

This creates the ability for DAACs to add maturity specific accounts to the policy via the metrics_es_aws_account_id variable.

@lindsleycj
Copy link
Collaborator

I don't have any problem with this as long as @mikedorfman is also ok. For us early Cumulus adopters, we had a manual session with the Metrics team to set up their subscriptions. I was such a newbie to AWS I really didn't understand what they were doing. I don't remember them needing to add a policy, but it was pretty much magic to me at the time.

@lindsleycj
Copy link
Collaborator

I was looking through my old notes, the metrics team had me send them subscription requests from my SNS topics to their SQS queues. I guess that got around the IAM permissons.

@mikedorfman
Copy link
Collaborator

Interesting. These subscriptions work in our account, but their setup predates my time at NSIDC, so I'm not entirely sure how they were set up (likely similar to the process you describe above @lindsleycj). I have a task to completely tear down and rebuilt SIT coming up maybe next PI (as a DR test and to see what may have been applied manually in the console) - so this may become useful then.

These changes look good to me, especially considering the default behavior is to not deploy the policy.

@mattp0
Copy link
Contributor Author

mattp0 commented Jul 14, 2023

Interesting, I wonder what the subtle difference is. Maybe they can make the subscription as code this way?

cumulus/policy.tf Show resolved Hide resolved
cumulus/policy.tf Outdated Show resolved Hide resolved
cumulus/policy.tf Outdated Show resolved Hide resolved
@mattp0 mattp0 merged commit 6d73109 into master Jul 14, 2023
2 checks passed
@mattp0 mattp0 deleted the mrp/feature/sns-collection-topic branch July 14, 2023 22:47
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.

4 participants