Skip to content

Commit 100e4b7

Browse files
authored
feat: Updates OnlineArchive and AlertConfiguration with latest changes in CFN (#333)
1 parent 9092aef commit 100e4b7

File tree

6 files changed

+29
-189
lines changed

6 files changed

+29
-189
lines changed

API.md

Lines changed: 15 additions & 127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/l1-resources/online-archive.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface AtlasStackProps {
88
readonly profile: string;
99
readonly collName: string;
1010
readonly dbName: string;
11+
readonly clusterName: string;
1112
}
1213

1314
export class CdkTestingStack extends cdk.Stack {
@@ -21,6 +22,7 @@ export class CdkTestingStack extends cdk.Stack {
2122
projectId: atlasProps.projId,
2223
collName: atlasProps.collName,
2324
dbName: atlasProps.dbName,
25+
clusterName: atlasProps.clusterName,
2426
criteria: {
2527
type: CriteriaViewType.DATE,
2628
dateFormat: 'ISODATE',
@@ -36,19 +38,21 @@ export class CdkTestingStack extends cdk.Stack {
3638

3739
getContextProps(): AtlasStackProps {
3840
const projId = this.node.tryGetContext('projId');
39-
if (!projId){
41+
if (!projId) {
4042
throw "No context value specified for projId. Please specify via the cdk context."
4143
}
4244
const collName = this.node.tryGetContext('collName');
4345
const profile = this.node.tryGetContext('profile') ?? 'default';
4446
const dbName = this.node.tryGetContext('dbName');
47+
const clusterName = this.node.tryGetContext('clusterName');
4548

4649

4750
return {
4851
projId,
4952
profile,
5053
collName,
51-
dbName
54+
dbName,
55+
clusterName
5256
}
5357
}
5458
}

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ export {
238238
CriteriaViewDateFormat,
239239
CriteriaViewType,
240240
PartitionFieldView,
241-
PartitionFieldViewFieldType,
242241
ScheduleView,
243242
ScheduleViewType,
244243
} from "./l1-resources/online-archive";

src/l1-resources/alert-configuration/index.ts

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ export interface CfnAlertConfigurationProps {
1515
*/
1616
readonly profile?: string;
1717

18-
/**
19-
* Date and time when MongoDB Cloud created the alert configuration. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
20-
*
21-
* @schema CfnAlertConfigurationProps#Created
22-
*/
23-
readonly created?: string;
24-
2518
/**
2619
* Event type that triggers an alert.
2720
*
@@ -84,7 +77,6 @@ export function toJson_CfnAlertConfigurationProps(
8477
}
8578
const result = {
8679
Profile: obj.profile,
87-
Created: obj.created,
8880
EventTypeName: obj.eventTypeName,
8981
ProjectId: obj.projectId,
9082
Matchers: obj.matchers?.map((y) => toJson_Matcher(y)),
@@ -279,20 +271,6 @@ export interface NotificationView {
279271
*/
280272
readonly emailEnabled?: boolean;
281273

282-
/**
283-
* Flowdock flow name to which MongoDB Cloud sends alert notifications. This name appears after the organization name in the Uniform Resource Locator (URL) path: 'www.flowdock.com/app/<organization-name>/<flow-name>'. The resource requires this parameter when '"notifications.typeName" : "FLOWDOCK"'.
284-
*
285-
* @schema NotificationView#FlowName
286-
*/
287-
readonly flowName?: string;
288-
289-
/**
290-
* Flowdock API token that MongoDB Cloud needs to send alert notifications to Flowdock. The resource requires this parameter when '"notifications.typeName" : "FLOWDOCK"'. If the token later becomes invalid, MongoDB Cloud sends an email to the project owners. If the token remains invalid, MongoDB Cloud removes the token.
291-
*
292-
* @schema NotificationView#FlowdockApiToken
293-
*/
294-
readonly flowdockApiToken?: string;
295-
296274
/**
297275
* Number of minutes to wait between successive notifications. MongoDB Cloud sends notifications until someone acknowledges the unacknowledged alert.
298276
*
@@ -458,8 +436,6 @@ export function toJson_NotificationView(
458436
DelayMin: obj.delayMin,
459437
EmailAddress: obj.emailAddress,
460438
EmailEnabled: obj.emailEnabled,
461-
FlowName: obj.flowName,
462-
FlowdockApiToken: obj.flowdockApiToken,
463439
IntervalMin: obj.intervalMin,
464440
MicrosoftTeamsWebhookUrl: obj.microsoftTeamsWebhookUrl,
465441
MobileNumber: obj.mobileNumber,
@@ -756,6 +732,10 @@ export class CfnAlertConfiguration extends cdk.CfnResource {
756732
* Attribute `MongoDB::Atlas::AlertConfiguration.Updated`
757733
*/
758734
public readonly attrUpdated: string;
735+
/**
736+
* Attribute `MongoDB::Atlas::AlertConfiguration.Created`
737+
*/
738+
public readonly attrCreated: string;
759739

760740
/**
761741
* Create a new `MongoDB::Atlas::AlertConfiguration`.
@@ -779,5 +759,6 @@ export class CfnAlertConfiguration extends cdk.CfnResource {
779759
this.attrId = cdk.Token.asString(this.getAtt("Id"));
780760
this.attrEnabled = this.getAtt("Enabled");
781761
this.attrUpdated = cdk.Token.asString(this.getAtt("Updated"));
762+
this.attrCreated = cdk.Token.asString(this.getAtt("Created"));
782763
}
783764
}

0 commit comments

Comments
 (0)