@mstuercke/pulumi-modules 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export declare const mstuercke: {
20
20
  };
21
21
  lambda: {
22
22
  NodeLambdaFunction: typeof import("./lambda/NodeLambdaFunction.ts").NodeLambdaFunction;
23
+ LambdaCronTrigger: typeof import("./lambda/LambdaCronTrigger.ts").LambdaCronTrigger;
23
24
  };
24
25
  mongodb: {
25
26
  MongoDBCustomInstance: typeof import("./mongodb/MongoDBCustomInstance.ts").MongoDBCustomInstance;
@@ -0,0 +1,17 @@
1
+ import { type CustomResourceOptions, type Input, type Output, Resource } from '@pulumi/pulumi';
2
+ export type LambdaCronTriggerArgs = {
3
+ name: string;
4
+ lambdaFunction: {
5
+ name: string;
6
+ arn: Input<string>;
7
+ };
8
+ cronExpression: `cron(${string} ${string} ${string} ${string} ? ${string})`;
9
+ lambdaExecutionInput?: object;
10
+ projectId: string;
11
+ };
12
+ export declare class LambdaCronTrigger extends Resource {
13
+ ruleName: string;
14
+ ruleArn: Output<string>;
15
+ constructor(args: LambdaCronTriggerArgs, opts?: CustomResourceOptions);
16
+ }
17
+ //# sourceMappingURL=LambdaCronTrigger.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { Resource } from '@pulumi/pulumi';
2
+ import { cloudwatch, lambda } from '@pulumi/aws';
3
+ export class LambdaCronTrigger extends Resource {
4
+ ruleName;
5
+ ruleArn;
6
+ constructor(args, opts) {
7
+ super('mstuercke:lambda:LambdaCronTrigger', args.name, false, undefined, opts);
8
+ const { name, lambdaFunction, cronExpression, lambdaExecutionInput, projectId } = args;
9
+ const trigger = new cloudwatch.EventRule('trigger', {
10
+ name,
11
+ scheduleExpression: cronExpression,
12
+ tags: {
13
+ project: projectId,
14
+ },
15
+ }, { parent: this });
16
+ new cloudwatch.EventTarget('target', {
17
+ targetId: lambdaFunction.name,
18
+ rule: trigger.name,
19
+ arn: lambdaFunction.arn,
20
+ input: JSON.stringify(lambdaExecutionInput),
21
+ }, { parent: this });
22
+ new lambda.Permission('execute-lambda-permission', {
23
+ action: 'lambda:InvokeFunction',
24
+ principal: 'events.amazonaws.com',
25
+ function: lambdaFunction.name,
26
+ sourceArn: trigger.arn,
27
+ }, { parent: this });
28
+ this.ruleName = args.name;
29
+ this.ruleArn = trigger.arn;
30
+ }
31
+ }
@@ -1,6 +1,9 @@
1
1
  import { NodeLambdaFunction } from './NodeLambdaFunction.ts';
2
+ import { LambdaCronTrigger } from './LambdaCronTrigger.ts';
2
3
  export * from './NodeLambdaFunction.ts';
4
+ export * from './LambdaCronTrigger.ts';
3
5
  export declare const lambda: {
4
6
  NodeLambdaFunction: typeof NodeLambdaFunction;
7
+ LambdaCronTrigger: typeof LambdaCronTrigger;
5
8
  };
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,8 @@
1
1
  import { NodeLambdaFunction } from "./NodeLambdaFunction.js";
2
+ import { LambdaCronTrigger } from "./LambdaCronTrigger.js";
2
3
  export * from "./NodeLambdaFunction.js";
4
+ export * from "./LambdaCronTrigger.js";
3
5
  export const lambda = {
4
6
  NodeLambdaFunction,
7
+ LambdaCronTrigger,
5
8
  };
@@ -1,5 +1,5 @@
1
1
  import { Resource } from '@pulumi/pulumi';
2
- import { FlexCluster, Project, ProjectIpAccessList, ServerlessInstance } from '@pulumi/mongodbatlas';
2
+ import { FlexCluster, Project, ProjectIpAccessList } from '@pulumi/mongodbatlas';
3
3
  export class MongoDBCustomInstance extends Resource {
4
4
  mongoProjectId;
5
5
  connectionString;
@@ -1,5 +1,5 @@
1
1
  import { output, Resource } from '@pulumi/pulumi';
2
- import { getFlexCluster, getProject, getServerlessInstance } from '@pulumi/mongodbatlas';
2
+ import { getFlexCluster, getProject } from '@pulumi/mongodbatlas';
3
3
  export class MongoDBDefaultInstance extends Resource {
4
4
  mongoProjectId;
5
5
  connectionString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstuercke/pulumi-modules",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "files": [
5
5
  "dist/**/!(*.test|*.fixture){.d.ts,.js}",
6
6
  "README.md"