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

feat: OB-37376 merge cf stacks for push and pull by adding poller rol… #342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

obs-gh-virjramakrishnan
Copy link
Collaborator

…e to stack

default: Cloudwatch Metrics Poller
Parameters:
- ObserveAwsAccountId
- AllowedActions
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we taking this in as a param? shouldn't we know what we need?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great point, let me fix that.

AllowedActions:
Type: CommaDelimitedList
Description: IAM actions that Observe account is allowed to execute.
DatastreamIds:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this check going to happen on the poller side? its not happening in the sam app side right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

are you referring to the validity of the ObserveAwsAccountId? I thought this would happen based on the frontend passing in correct input. I'll hardcode AllowedActions

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I mean why do they need to know datastreamIds at all? The whole point is to just add an iam policy and allow our poller iam role to assume it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is because of how AWS recommends allowing other accounts to access your resources: see here. It seems that it is possible to do this process without having an external id, but it is not recommended. This is also how the poller works currently - we pass in the datastreamIds (terraform) and then we use it to assume roles. We take it as input here and use it to get credentials we can use in our polling. So the stack here is just checking that the request is coming from our backend.

@obs-gh-virjramakrishnan obs-gh-virjramakrishnan force-pushed the viraj/merge-stacks branch 4 times, most recently from d8102ab to 1a600c3 Compare October 21, 2024 17:21
@@ -378,6 +398,22 @@ Resources:
- UseStackName
- !Sub "${AWS::StackName}-MetricStream"
- !Sub "${NameOverride}-MetricStream"
MetricsPoller:
Copy link
Contributor

Choose a reason for hiding this comment

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

im fairly confused, why are we creating a poller in their AWS account? The aws metrics poller runs in our backend?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I think this is a naming thing - what we are creating here is just the role and policy. Will update to MetricsPollerRole to reflect.

@@ -378,6 +398,22 @@ Resources:
- UseStackName
- !Sub "${AWS::StackName}-MetricStream"
- !Sub "${NameOverride}-MetricStream"
MetricsPoller:
Type: AWS::Serverless::Application
Copy link
Contributor

@obs-gh-alexlew obs-gh-alexlew Oct 22, 2024

Choose a reason for hiding this comment

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

so this "application" is just a role and a policy? and you've already added that to the stack?

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.

2 participants