-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
apps/stack/template.yaml
Outdated
default: Cloudwatch Metrics Poller | ||
Parameters: | ||
- ObserveAwsAccountId | ||
- AllowedActions |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
d8102ab
to
1a600c3
Compare
apps/stack/template.yaml
Outdated
@@ -378,6 +398,22 @@ Resources: | |||
- UseStackName | |||
- !Sub "${AWS::StackName}-MetricStream" | |||
- !Sub "${NameOverride}-MetricStream" | |||
MetricsPoller: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
1a600c3
to
714554d
Compare
@@ -378,6 +398,22 @@ Resources: | |||
- UseStackName | |||
- !Sub "${AWS::StackName}-MetricStream" | |||
- !Sub "${NameOverride}-MetricStream" | |||
MetricsPoller: | |||
Type: AWS::Serverless::Application |
There was a problem hiding this comment.
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?
714554d
to
46761a7
Compare
…e to stack