Skip to content

Commit

Permalink
Add a new cloud watch trigger rule
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
  • Loading branch information
prudhvigodithi committed Apr 2, 2024
1 parent 22b889f commit 1c78060
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
implementation 'org.opensearch.client:opensearch-rest-high-level-client:2.11.0'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.2.1'
implementation 'software.amazon.awssdk:sts:2.21.33'
implementation 'software.amazon.awssdk:sts:2.25.21'
implementation 'io.github.acm19:aws-request-signing-apache-interceptor:2.3.1'

implementation 'com.amazonaws:aws-lambda-java-core:1.2.3'
Expand Down
8 changes: 7 additions & 1 deletion infrastructure/lib/stacks/metricsWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ export class OpenSearchMetricsWorkflowStack extends Stack {
stateMachineName: 'OpenSearchMetricsWorkflow'
})

new Rule(this, 'MetricsWorkflow', {
new Rule(this, 'MetricsWorkflow-11AM-PDT', {
schedule: Schedule.expression('cron(0 18 * * ? *)'),
targets: [new SfnStateMachine(opensearchMetricsWorkflow)],
});

// This rule is to ensure OpenSearch Dashboards does not show 0 values in visualizations when used now/d-now-1/d
new Rule(this, 'MetricsWorkflow-12AM-PDT', {
schedule: Schedule.expression('cron(0 7 * * ? *)'),
targets: [new SfnStateMachine(opensearchMetricsWorkflow)],
});
}

private createMetricsTask(scope: Construct, opensearchDomainStack: OpenSearchDomainStack,
Expand Down

0 comments on commit 1c78060

Please sign in to comment.