Skip to content

Commit

Permalink
feat: OB-37376 merge cf stacks for push and pull by adding poller rol…
Browse files Browse the repository at this point in the history
…e to stack
  • Loading branch information
obs-gh-virjramakrishnan committed Oct 22, 2024
1 parent 9fddba1 commit 714554d
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion apps/stack/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ Metadata:
default: CloudWatch Metrics
Parameters:
- MetricStreamFilterUri
- Label:
default: Cloudwatch Metrics Poller
Parameters:
- ObserveAwsAccountId
- DatastreamIds
- Label:
default: Forwarder Options
Parameters:
Expand Down Expand Up @@ -150,6 +155,18 @@ Parameters:
Description: >-
The token used to retrieve metric configuration.
Default: ''
ObserveAwsAccountId:
Type: String
Description: Observe AWS Account ID which will be allowed to assume role.
AllowedPattern: '\d*'
Default: ''
DatastreamIds:
Type: CommaDelimitedList
Description: Datastream IDs where data will be ingested to.
This ensures Observe cannot assume this role outside
of this context.
AllowedPattern: \d*
Default: ''
SourceBucketNames:
Type: CommaDelimitedList
Description: >-
Expand Down Expand Up @@ -214,7 +231,10 @@ Conditions:
- !Equals
- !Ref DatasourceID
- ""

EnableMetricsPoller: !Not
- !Equals
- !Ref ObserveAwsAccountId
- ""
Resources:
Topic:
Type: "AWS::SNS::Topic"
Expand Down Expand Up @@ -378,6 +398,22 @@ Resources:
- UseStackName
- !Sub "${AWS::StackName}-MetricStream"
- !Sub "${NameOverride}-MetricStream"
MetricsPoller:
Type: AWS::Serverless::Application
Condition: EnableMetricsPoller
Properties:
Location: ../externalrole/template.yaml
NotificationARNs:
- !Ref Topic
Parameters:
ObserveAwsAccountId: !Ref ObserveAwsAccountId
AllowedActions: >-
cloudwatch:GetMetricData,cloudwatch:ListMetrics,tag:GetResources
DatastreamIds: !Join [",", !Ref DatastreamIds]
NameOverride: !If
- UseStackName
- !Sub "${AWS::StackName}-MetricsPoller"
- !Sub "${NameOverride}-MetricsPoller"
Outputs:
BucketName:
Description: >-
Expand Down

0 comments on commit 714554d

Please sign in to comment.