Skip to content

Commit

Permalink
feat: Updates OnlineArchive and AlertConfiguration with latest change…
Browse files Browse the repository at this point in the history
…s in CFN (#333)
  • Loading branch information
oarbusi authored Jul 25, 2024
1 parent 9092aef commit 100e4b7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 189 deletions.
142 changes: 15 additions & 127 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions examples/l1-resources/online-archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface AtlasStackProps {
readonly profile: string;
readonly collName: string;
readonly dbName: string;
readonly clusterName: string;
}

export class CdkTestingStack extends cdk.Stack {
Expand All @@ -21,6 +22,7 @@ export class CdkTestingStack extends cdk.Stack {
projectId: atlasProps.projId,
collName: atlasProps.collName,
dbName: atlasProps.dbName,
clusterName: atlasProps.clusterName,
criteria: {
type: CriteriaViewType.DATE,
dateFormat: 'ISODATE',
Expand All @@ -36,19 +38,21 @@ export class CdkTestingStack extends cdk.Stack {

getContextProps(): AtlasStackProps {
const projId = this.node.tryGetContext('projId');
if (!projId){
if (!projId) {
throw "No context value specified for projId. Please specify via the cdk context."
}
const collName = this.node.tryGetContext('collName');
const profile = this.node.tryGetContext('profile') ?? 'default';
const dbName = this.node.tryGetContext('dbName');
const clusterName = this.node.tryGetContext('clusterName');


return {
projId,
profile,
collName,
dbName
dbName,
clusterName
}
}
}
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export {
CriteriaViewDateFormat,
CriteriaViewType,
PartitionFieldView,
PartitionFieldViewFieldType,
ScheduleView,
ScheduleViewType,
} from "./l1-resources/online-archive";
Expand Down
29 changes: 5 additions & 24 deletions src/l1-resources/alert-configuration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ export interface CfnAlertConfigurationProps {
*/
readonly profile?: string;

/**
* Date and time when MongoDB Cloud created the alert configuration. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
*
* @schema CfnAlertConfigurationProps#Created
*/
readonly created?: string;

/**
* Event type that triggers an alert.
*
Expand Down Expand Up @@ -84,7 +77,6 @@ export function toJson_CfnAlertConfigurationProps(
}
const result = {
Profile: obj.profile,
Created: obj.created,
EventTypeName: obj.eventTypeName,
ProjectId: obj.projectId,
Matchers: obj.matchers?.map((y) => toJson_Matcher(y)),
Expand Down Expand Up @@ -279,20 +271,6 @@ export interface NotificationView {
*/
readonly emailEnabled?: boolean;

/**
* 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"'.
*
* @schema NotificationView#FlowName
*/
readonly flowName?: string;

/**
* 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.
*
* @schema NotificationView#FlowdockApiToken
*/
readonly flowdockApiToken?: string;

/**
* Number of minutes to wait between successive notifications. MongoDB Cloud sends notifications until someone acknowledges the unacknowledged alert.
*
Expand Down Expand Up @@ -458,8 +436,6 @@ export function toJson_NotificationView(
DelayMin: obj.delayMin,
EmailAddress: obj.emailAddress,
EmailEnabled: obj.emailEnabled,
FlowName: obj.flowName,
FlowdockApiToken: obj.flowdockApiToken,
IntervalMin: obj.intervalMin,
MicrosoftTeamsWebhookUrl: obj.microsoftTeamsWebhookUrl,
MobileNumber: obj.mobileNumber,
Expand Down Expand Up @@ -756,6 +732,10 @@ export class CfnAlertConfiguration extends cdk.CfnResource {
* Attribute `MongoDB::Atlas::AlertConfiguration.Updated`
*/
public readonly attrUpdated: string;
/**
* Attribute `MongoDB::Atlas::AlertConfiguration.Created`
*/
public readonly attrCreated: string;

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

0 comments on commit 100e4b7

Please sign in to comment.