-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into merge-back/2.37.1
- Loading branch information
Showing
105 changed files
with
5,769 additions
and
815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
packages/@aws-cdk/aws-cloudwatch-actions/test/integ.ssm-incident-alarm-action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; | ||
import * as ssmIncidents from '@aws-cdk/aws-ssmincidents'; | ||
import { App, Stack, StackProps } from '@aws-cdk/core'; | ||
import * as integ from '@aws-cdk/integ-tests'; | ||
|
||
import * as cloudwatchActions from '../lib'; | ||
|
||
class SsmIncidentAlarmActionIntegrationTestStack extends Stack { | ||
|
||
constructor(scope: App, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
const responsePlanName = 'test-response-plan'; | ||
|
||
new ssmIncidents.CfnResponsePlan(this, 'ResponsePlan', { | ||
name: responsePlanName, | ||
incidentTemplate: { | ||
title: 'Incident Title', | ||
impact: 1, | ||
}, | ||
}); | ||
|
||
const metric = new cloudwatch.Metric({ | ||
namespace: 'CDK/Test', | ||
metricName: 'Metric', | ||
label: 'Metric [AVG: ${AVG}]', | ||
}); | ||
|
||
const alarm = new cloudwatch.Alarm(this, 'Alarm1', { | ||
metric, | ||
threshold: 100, | ||
evaluationPeriods: 3, | ||
}); | ||
|
||
alarm.addAlarmAction(new cloudwatchActions.SsmIncidentAction(responsePlanName)); | ||
} | ||
} | ||
|
||
const app = new App(); | ||
|
||
const stack = new SsmIncidentAlarmActionIntegrationTestStack(app, 'SsmIncidentAlarmActionIntegrationTestStack'); | ||
|
||
new integ.IntegTest(app, 'SsmIncidentManagerAlarmActionTest', { | ||
testCases: [stack], | ||
}); | ||
|
||
app.synth(); |
55 changes: 55 additions & 0 deletions
55
...dent-alarm-action.integ.snapshot/SsmIncidentAlarmActionIntegrationTestStack.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"Resources": { | ||
"ResponsePlan": { | ||
"Type": "AWS::SSMIncidents::ResponsePlan", | ||
"Properties": { | ||
"IncidentTemplate": { | ||
"Impact": 1, | ||
"Title": "Incident Title" | ||
}, | ||
"Name": "test-response-plan" | ||
} | ||
}, | ||
"Alarm1F9009D71": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanOrEqualToThreshold", | ||
"EvaluationPeriods": 3, | ||
"AlarmActions": [ | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":ssm-incidents::", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":response-plan/test-response-plan" | ||
] | ||
] | ||
} | ||
], | ||
"Metrics": [ | ||
{ | ||
"Id": "m1", | ||
"Label": "Metric [AVG: ${AVG}]", | ||
"MetricStat": { | ||
"Metric": { | ||
"MetricName": "Metric", | ||
"Namespace": "CDK/Test" | ||
}, | ||
"Period": 300, | ||
"Stat": "Average" | ||
}, | ||
"ReturnData": true | ||
} | ||
], | ||
"Threshold": 100 | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...g.snapshot/SsmIncidentManagerAlarmActionTestDefaultTestDeployAssert9DC05EC0.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
1 change: 1 addition & 0 deletions
1
...ges/@aws-cdk/aws-cloudwatch-actions/test/ssm-incident-alarm-action.integ.snapshot/cdk.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"20.0.0"} |
11 changes: 11 additions & 0 deletions
11
.../@aws-cdk/aws-cloudwatch-actions/test/ssm-incident-alarm-action.integ.snapshot/integ.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "20.0.0", | ||
"testCases": { | ||
"SsmIncidentManagerAlarmActionTest/DefaultTest": { | ||
"stacks": [ | ||
"SsmIncidentAlarmActionIntegrationTestStack" | ||
], | ||
"assertionStack": "SsmIncidentManagerAlarmActionTestDefaultTestDeployAssert9DC05EC0" | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...ws-cdk/aws-cloudwatch-actions/test/ssm-incident-alarm-action.integ.snapshot/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"version": "20.0.0", | ||
"artifacts": { | ||
"Tree": { | ||
"type": "cdk:tree", | ||
"properties": { | ||
"file": "tree.json" | ||
} | ||
}, | ||
"SsmIncidentAlarmActionIntegrationTestStack": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://unknown-account/unknown-region", | ||
"properties": { | ||
"templateFile": "SsmIncidentAlarmActionIntegrationTestStack.template.json", | ||
"validateOnSynth": false | ||
}, | ||
"metadata": { | ||
"/SsmIncidentAlarmActionIntegrationTestStack/ResponsePlan": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "ResponsePlan" | ||
} | ||
], | ||
"/SsmIncidentAlarmActionIntegrationTestStack/Alarm1/Resource": [ | ||
{ | ||
"type": "aws:cdk:logicalId", | ||
"data": "Alarm1F9009D71" | ||
} | ||
] | ||
}, | ||
"displayName": "SsmIncidentAlarmActionIntegrationTestStack" | ||
}, | ||
"SsmIncidentManagerAlarmActionTestDefaultTestDeployAssert9DC05EC0": { | ||
"type": "aws:cloudformation:stack", | ||
"environment": "aws://unknown-account/unknown-region", | ||
"properties": { | ||
"templateFile": "SsmIncidentManagerAlarmActionTestDefaultTestDeployAssert9DC05EC0.template.json", | ||
"validateOnSynth": false | ||
}, | ||
"displayName": "SsmIncidentManagerAlarmActionTest/DefaultTest/DeployAssert" | ||
} | ||
} | ||
} |
Oops, something went wrong.