forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See [CHANGELOG](https://github.com/aws/aws-cdk/blob/bump/1.47.0/CHANGELOG.md)
- Loading branch information
Showing
136 changed files
with
5,069 additions
and
2,027 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"tools/*" | ||
], | ||
"rejectCycles": "true", | ||
"version": "1.46.0" | ||
"version": "1.47.0" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
import '@aws-cdk/assert/jest'; | ||
import {} from '../lib'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as path from 'path'; | ||
import * as appsync from '../lib'; | ||
|
||
test('No tests are specified for this package', () => { | ||
expect(true).toBe(true); | ||
test('should not throw an Error', () => { | ||
// Given | ||
const stack = new cdk.Stack(); | ||
|
||
// When | ||
const when = () => { | ||
new appsync.GraphQLApi(stack, 'api', { | ||
authorizationConfig: {}, | ||
name: 'api', | ||
schemaDefinitionFile: path.join(__dirname, 'schema.graphql'), | ||
}); | ||
}; | ||
|
||
// Then | ||
expect(when).not.toThrow(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { IResource, Resource } from '@aws-cdk/core'; | ||
import { IAlarmAction } from './alarm-action'; | ||
|
||
/** | ||
* Interface for Alarm Rule. | ||
*/ | ||
export interface IAlarmRule { | ||
|
||
/** | ||
* serialized representation of Alarm Rule to be used when building the Composite Alarm resource. | ||
*/ | ||
renderAlarmRule(): string; | ||
|
||
} | ||
|
||
/** | ||
* Represents a CloudWatch Alarm | ||
*/ | ||
export interface IAlarm extends IAlarmRule, IResource { | ||
/** | ||
* Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo) | ||
* | ||
* @attribute | ||
*/ | ||
readonly alarmArn: string; | ||
|
||
/** | ||
* Name of the alarm | ||
* | ||
* @attribute | ||
*/ | ||
readonly alarmName: string; | ||
} | ||
|
||
/** | ||
* The base class for Alarm and CompositeAlarm resources. | ||
*/ | ||
export abstract class AlarmBase extends Resource implements IAlarm { | ||
|
||
/** | ||
* @attribute | ||
*/ | ||
public abstract readonly alarmArn: string; | ||
public abstract readonly alarmName: string; | ||
|
||
protected alarmActionArns?: string[]; | ||
protected insufficientDataActionArns?: string[]; | ||
protected okActionArns?: string[]; | ||
|
||
/** | ||
* AlarmRule indicating ALARM state for Alarm. | ||
*/ | ||
public renderAlarmRule(): string { | ||
return `ALARM(${this.alarmArn})`; | ||
} | ||
|
||
/** | ||
* Trigger this action if the alarm fires | ||
* | ||
* Typically the ARN of an SNS topic or ARN of an AutoScaling policy. | ||
*/ | ||
public addAlarmAction(...actions: IAlarmAction[]) { | ||
if (this.alarmActionArns === undefined) { | ||
this.alarmActionArns = []; | ||
} | ||
|
||
this.alarmActionArns.push(...actions.map(a => a.bind(this, this).alarmActionArn)); | ||
} | ||
|
||
/** | ||
* Trigger this action if there is insufficient data to evaluate the alarm | ||
* | ||
* Typically the ARN of an SNS topic or ARN of an AutoScaling policy. | ||
*/ | ||
public addInsufficientDataAction(...actions: IAlarmAction[]) { | ||
if (this.insufficientDataActionArns === undefined) { | ||
this.insufficientDataActionArns = []; | ||
} | ||
|
||
this.insufficientDataActionArns.push(...actions.map(a => a.bind(this, this).alarmActionArn)); | ||
} | ||
|
||
/** | ||
* Trigger this action if the alarm returns from breaching state into ok state | ||
* | ||
* Typically the ARN of an SNS topic or ARN of an AutoScaling policy. | ||
*/ | ||
public addOkAction(...actions: IAlarmAction[]) { | ||
if (this.okActionArns === undefined) { | ||
this.okActionArns = []; | ||
} | ||
|
||
this.okActionArns.push(...actions.map(a => a.bind(this, this).alarmActionArn)); | ||
} | ||
|
||
} |
Oops, something went wrong.