quidproquo-actionprocessor-awslambda 0.0.135 → 0.0.137

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.
@@ -14,3 +14,7 @@ export declare const getCFExportNameSnsTopicArnFromConfig: (eventBusName: string
14
14
  export declare const getCFExportNameDistributionIdArnFromConfig: (webEntryName: string, qpqConfig: QPQConfig, serviceOverride?: string, applicationOverride?: string) => string;
15
15
  export declare const getCFExportNameWebsocketApiIdFromConfig: (websocketApiName: string, qpqConfig: QPQConfig, serviceOverride?: string, applicationOverride?: string) => string;
16
16
  export declare const getEventBusSnsTopicArn: (eventBusName: string, qpqConfig: QPQConfig, module: string, environment: string, application: string, feature?: string) => string;
17
+ export declare const getBaseStackName: (qpqConfig: QPQConfig) => string;
18
+ export declare const getInfStackName: (qpqConfig: QPQConfig) => string;
19
+ export declare const getWebStackName: (qpqConfig: QPQConfig) => string;
20
+ export declare const getApiStackName: (qpqConfig: QPQConfig) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEventBusSnsTopicArn = exports.getCFExportNameWebsocketApiIdFromConfig = exports.getCFExportNameDistributionIdArnFromConfig = exports.getCFExportNameSnsTopicArnFromConfig = exports.getCFExportNameApiKeyIdFromConfig = exports.getCFExportNameUserPoolClientIdFromConfig = exports.getCFExportNameUserPoolIdFromConfig = exports.getKvsDynamoTableNameFromConfig = exports.getQpqRuntimeResourceNameFromConfig = exports.getQpqRuntimeResourceName = exports.getConfigRuntimeResourceNameFromConfigWithServiceOverride = exports.getConfigRuntimeResourceNameFromConfig = exports.getConfigRuntimeResourceName = exports.getGlobalQpqRuntimeResourceName = exports.getGlobalConfigRuntimeResourceName = void 0;
3
+ exports.getApiStackName = exports.getWebStackName = exports.getInfStackName = exports.getBaseStackName = exports.getEventBusSnsTopicArn = exports.getCFExportNameWebsocketApiIdFromConfig = exports.getCFExportNameDistributionIdArnFromConfig = exports.getCFExportNameSnsTopicArnFromConfig = exports.getCFExportNameApiKeyIdFromConfig = exports.getCFExportNameUserPoolClientIdFromConfig = exports.getCFExportNameUserPoolIdFromConfig = exports.getKvsDynamoTableNameFromConfig = exports.getQpqRuntimeResourceNameFromConfig = exports.getQpqRuntimeResourceName = exports.getConfigRuntimeResourceNameFromConfigWithServiceOverride = exports.getConfigRuntimeResourceNameFromConfig = exports.getConfigRuntimeResourceName = exports.getGlobalQpqRuntimeResourceName = exports.getGlobalConfigRuntimeResourceName = void 0;
4
4
  const quidproquo_core_1 = require("quidproquo-core");
5
5
  const quidproquo_config_aws_1 = require("quidproquo-config-aws");
6
6
  const getGlobalConfigRuntimeResourceName = (resourceName, application, environment, feature) => {
@@ -122,3 +122,27 @@ const getEventBusSnsTopicArn = (eventBusName, qpqConfig, module, environment, ap
122
122
  return `arn:aws:sns:${region}:${awsAccountId}:${topicName}`;
123
123
  };
124
124
  exports.getEventBusSnsTopicArn = getEventBusSnsTopicArn;
125
+ const getBaseStackName = (qpqConfig) => {
126
+ const appName = quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
127
+ const moduleName = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
128
+ const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
129
+ const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
130
+ const baseName = `${appName}-${moduleName}-${environment}`;
131
+ if (feature) {
132
+ return `${baseName}-${feature}`;
133
+ }
134
+ return baseName;
135
+ };
136
+ exports.getBaseStackName = getBaseStackName;
137
+ const getInfStackName = (qpqConfig) => {
138
+ return `${(0, exports.getBaseStackName)(qpqConfig)}-inf`;
139
+ };
140
+ exports.getInfStackName = getInfStackName;
141
+ const getWebStackName = (qpqConfig) => {
142
+ return `${(0, exports.getBaseStackName)(qpqConfig)}-web`;
143
+ };
144
+ exports.getWebStackName = getWebStackName;
145
+ const getApiStackName = (qpqConfig) => {
146
+ return `${(0, exports.getBaseStackName)(qpqConfig)}-api`;
147
+ };
148
+ exports.getApiStackName = getApiStackName;
@@ -0,0 +1,5 @@
1
+ import { ConfigGetGlobalActionProcessor, QPQConfig } from 'quidproquo-core';
2
+ declare const _default: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-core/Config/GetGlobal": ConfigGetGlobalActionProcessor<any>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const getProcessConfigActionType = (qpqConfig) => {
14
+ return ({ globalName }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const globalValue = quidproquo_core_1.qpqCoreUtils.getGlobalConfigValue(qpqConfig, globalName);
16
+ return (0, quidproquo_core_1.actionResult)(globalValue);
17
+ });
18
+ };
19
+ exports.default = (qpqConfig) => {
20
+ return {
21
+ [quidproquo_core_1.ConfigActionType.GetGlobal]: getProcessConfigActionType(qpqConfig),
22
+ };
23
+ };
@@ -0,0 +1,5 @@
1
+ import { ConfigSetParameterActionProcessor, QPQConfig } from 'quidproquo-core';
2
+ declare const _default: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-core/Config/SetParameter": ConfigSetParameterActionProcessor;
4
+ };
5
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
14
+ const setParameter_1 = require("../../../logic/parametersManager/setParameter");
15
+ const getProcessConfigSetParameter = (qpqConfig) => {
16
+ return ({ parameterName, parameterValue }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const awsParameterKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(parameterName, qpqConfig);
18
+ yield (0, setParameter_1.setParameter)(awsParameterKey, quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig), parameterValue);
19
+ return (0, quidproquo_core_1.actionResult)(void 0);
20
+ });
21
+ };
22
+ exports.default = (qpqConfig) => {
23
+ return {
24
+ [quidproquo_core_1.ConfigActionType.SetParameter]: getProcessConfigSetParameter(qpqConfig),
25
+ };
26
+ };
@@ -1,5 +1,7 @@
1
1
  import { QPQConfig } from 'quidproquo-core';
2
2
  declare const _default: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-core/Config/SetParameter": import("quidproquo-core").ConfigSetParameterActionProcessor;
4
+ "@quidproquo-core/Config/GetGlobal": import("quidproquo-core").ConfigGetGlobalActionProcessor<any>;
3
5
  "@quidproquo-core/Config/GetSecret": import("quidproquo-core").ConfigGetSecretActionProcessor;
4
6
  "@quidproquo-core/Config/GetParameters": import("quidproquo-core").ConfigGetParametersActionProcessor;
5
7
  "@quidproquo-core/Config/GetParameter": import("quidproquo-core").ConfigGetParameterActionProcessor;
@@ -6,4 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const getConfigGetParameterActionProcessor_1 = __importDefault(require("./getConfigGetParameterActionProcessor"));
7
7
  const getConfigGetParametersActionProcessor_1 = __importDefault(require("./getConfigGetParametersActionProcessor"));
8
8
  const getConfigGetSecretActionProcessor_1 = __importDefault(require("./getConfigGetSecretActionProcessor"));
9
- exports.default = (qpqConfig) => (Object.assign(Object.assign(Object.assign({}, (0, getConfigGetParameterActionProcessor_1.default)(qpqConfig)), (0, getConfigGetParametersActionProcessor_1.default)(qpqConfig)), (0, getConfigGetSecretActionProcessor_1.default)(qpqConfig)));
9
+ const getConfigGetGlobalActionProcessor_1 = __importDefault(require("./getConfigGetGlobalActionProcessor"));
10
+ const getConfigSetParameterActionProcessor_1 = __importDefault(require("./getConfigSetParameterActionProcessor"));
11
+ exports.default = (qpqConfig) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, getConfigGetParameterActionProcessor_1.default)(qpqConfig)), (0, getConfigGetParametersActionProcessor_1.default)(qpqConfig)), (0, getConfigGetSecretActionProcessor_1.default)(qpqConfig)), (0, getConfigGetGlobalActionProcessor_1.default)(qpqConfig)), (0, getConfigSetParameterActionProcessor_1.default)(qpqConfig)));
@@ -0,0 +1,18 @@
1
+ import { QPQConfig, MatchStoryResult, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor, DeployEvent } from 'quidproquo-core';
2
+ import { EventBridgeEvent, Context } from 'aws-lambda';
3
+ interface CloudFormationEventDetail {
4
+ 'stack-id': string;
5
+ 'status-details': {
6
+ status: string;
7
+ 'status-reason': string;
8
+ };
9
+ }
10
+ type EventInput = [EventBridgeEvent<"CloudFormation Stack Status Change", CloudFormationEventDetail>, Context];
11
+ type MatchResult = MatchStoryResult<any, any>;
12
+ declare const _default: (qpqConfig: QPQConfig) => {
13
+ "@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<EventInput, DeployEvent>;
14
+ "@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<void, DeployEvent, void>;
15
+ "@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<DeployEvent, MatchResult, boolean>;
16
+ "@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<DeployEvent, MatchResult>;
17
+ };
18
+ export default _default;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const awsNamingUtils_1 = require("../../../awsNamingUtils");
14
+ const deployTypeMap = {
15
+ 'UPDATE_COMPLETE': quidproquo_core_1.DeployEventStatusType.Update,
16
+ 'CREATE_COMPLETE': quidproquo_core_1.DeployEventStatusType.Create,
17
+ 'DELETE_COMPLETE': quidproquo_core_1.DeployEventStatusType.Delete,
18
+ };
19
+ // TODO: Don't use Globals like this
20
+ const GLOBAL_DEPLOY_EVENT_NAME = process.env.deployEventConfigName;
21
+ const getProcessTransformEventParams = (qpqConfig) => {
22
+ return ({ eventParams: [event, context] }) => __awaiter(void 0, void 0, void 0, function* () {
23
+ const status = event.detail['status-details'].status || '';
24
+ const stackId = event.detail['stack-id'];
25
+ const regex = /:stack\/([^\/]+)/;
26
+ const match = stackId.match(regex);
27
+ const stackName = match && match[1] ? match[1] : '';
28
+ const transformedEventParams = {
29
+ deployEventType: quidproquo_core_1.DeployEventType.Unknown,
30
+ deployEventStatusType: deployTypeMap[status] || quidproquo_core_1.DeployEventStatusType.Unknown,
31
+ };
32
+ if (stackName === (0, awsNamingUtils_1.getApiStackName)(qpqConfig)) {
33
+ transformedEventParams.deployEventType = quidproquo_core_1.DeployEventType.Api;
34
+ }
35
+ else if (stackName === (0, awsNamingUtils_1.getWebStackName)(qpqConfig)) {
36
+ transformedEventParams.deployEventType = quidproquo_core_1.DeployEventType.Web;
37
+ }
38
+ console.log("transformedEventParams", transformedEventParams);
39
+ return (0, quidproquo_core_1.actionResult)(transformedEventParams);
40
+ });
41
+ };
42
+ const getProcessTransformResponseResult = (qpqConfig) => {
43
+ // We might need to JSON.stringify the body.
44
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
45
+ // always success
46
+ return (0, quidproquo_core_1.actionResult)(void 0);
47
+ });
48
+ };
49
+ const getProcessAutoRespond = (qpqConfig) => {
50
+ return ({ transformedEventParams }) => __awaiter(void 0, void 0, void 0, function* () {
51
+ // exit if we don't know what deploy type this is, probably another stack
52
+ return (0, quidproquo_core_1.actionResult)(transformedEventParams.deployEventType === quidproquo_core_1.DeployEventType.Unknown ||
53
+ transformedEventParams.deployEventStatusType === quidproquo_core_1.DeployEventStatusType.Unknown);
54
+ });
55
+ };
56
+ const getProcessMatchStory = (qpqConfig) => {
57
+ const deployConfig = quidproquo_core_1.qpqCoreUtils.getDeployEventConfigs(qpqConfig).find(c => c.name === GLOBAL_DEPLOY_EVENT_NAME);
58
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
59
+ if (!deployConfig) {
60
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Could not find deploy event config ${GLOBAL_DEPLOY_EVENT_NAME}`);
61
+ }
62
+ return (0, quidproquo_core_1.actionResult)({
63
+ src: deployConfig.src.src,
64
+ runtime: deployConfig.src.runtime
65
+ });
66
+ });
67
+ };
68
+ exports.default = (qpqConfig) => {
69
+ return {
70
+ [quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(qpqConfig),
71
+ [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
72
+ [quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(qpqConfig),
73
+ [quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(qpqConfig),
74
+ };
75
+ };
@@ -1,10 +1,13 @@
1
1
  export { default as getConfigGetSecretActionProcessor } from './config/getConfigGetSecretActionProcessor';
2
2
  export { default as getConfigGetParameterActionProcessor } from './config/getConfigGetParameterActionProcessor';
3
3
  export { default as getConfigGetParametersActionProcessor } from './config/getConfigGetParametersActionProcessor';
4
+ export { default as getConfigGetGlobalActionProcessor } from './config/getConfigGetGlobalActionProcessor';
5
+ export { default as getConfigSetParameterActionProcessor } from './config/getConfigSetParameterActionProcessor';
4
6
  export { default as getAPIGatewayEventActionProcessor } from './event/getAPIGatewayEventActionProcessor';
5
7
  export { default as getCloudFrontOriginRequestEventActionProcessor } from './event/getCloudFrontOriginRequestEventActionProcessor';
6
8
  export { default as getSQSEventRecordActionProcessor } from './event/getSQSEventRecordActionProcessor';
7
9
  export { default as getServiceFunctionExecuteEventActionProcessor } from './event/getServiceFunctionExecuteEventActionProcessor';
10
+ export { default as getEventBridgeEventStackDeployActionProcessor } from './event/getEventBridgeEventStackDeployActionProcessor';
8
11
  export { default as getEventBridgeEventActionProcessor } from './event/getEventBridgeEventActionProcessor';
9
12
  export { default as getLambdaCognitoCustomMessage } from './event/getLambdaCognitoCustomMessage';
10
13
  export { default as getWebsocketAPIGatewayEventActionProcessor } from './event/getWebsocketAPIGatewayEventActionProcessor';
@@ -3,13 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getEventBusActionProcessor = exports.getUserDirectoryActionProcessor = exports.getQueueActionProcessor = exports.getKeyValueStoreActionProcessor = exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getWebsocketAPIGatewayEventActionProcessor = exports.getLambdaCognitoCustomMessage = exports.getEventBridgeEventActionProcessor = exports.getServiceFunctionExecuteEventActionProcessor = exports.getSQSEventRecordActionProcessor = exports.getCloudFrontOriginRequestEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
6
+ exports.getEventBusActionProcessor = exports.getUserDirectoryActionProcessor = exports.getQueueActionProcessor = exports.getKeyValueStoreActionProcessor = exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getWebsocketAPIGatewayEventActionProcessor = exports.getLambdaCognitoCustomMessage = exports.getEventBridgeEventActionProcessor = exports.getEventBridgeEventStackDeployActionProcessor = exports.getServiceFunctionExecuteEventActionProcessor = exports.getSQSEventRecordActionProcessor = exports.getCloudFrontOriginRequestEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigSetParameterActionProcessor = exports.getConfigGetGlobalActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
7
7
  var getConfigGetSecretActionProcessor_1 = require("./config/getConfigGetSecretActionProcessor");
8
8
  Object.defineProperty(exports, "getConfigGetSecretActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetSecretActionProcessor_1).default; } });
9
9
  var getConfigGetParameterActionProcessor_1 = require("./config/getConfigGetParameterActionProcessor");
10
10
  Object.defineProperty(exports, "getConfigGetParameterActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetParameterActionProcessor_1).default; } });
11
11
  var getConfigGetParametersActionProcessor_1 = require("./config/getConfigGetParametersActionProcessor");
12
12
  Object.defineProperty(exports, "getConfigGetParametersActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetParametersActionProcessor_1).default; } });
13
+ var getConfigGetGlobalActionProcessor_1 = require("./config/getConfigGetGlobalActionProcessor");
14
+ Object.defineProperty(exports, "getConfigGetGlobalActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetGlobalActionProcessor_1).default; } });
15
+ var getConfigSetParameterActionProcessor_1 = require("./config/getConfigSetParameterActionProcessor");
16
+ Object.defineProperty(exports, "getConfigSetParameterActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigSetParameterActionProcessor_1).default; } });
13
17
  var getAPIGatewayEventActionProcessor_1 = require("./event/getAPIGatewayEventActionProcessor");
14
18
  Object.defineProperty(exports, "getAPIGatewayEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getAPIGatewayEventActionProcessor_1).default; } });
15
19
  var getCloudFrontOriginRequestEventActionProcessor_1 = require("./event/getCloudFrontOriginRequestEventActionProcessor");
@@ -18,6 +22,8 @@ var getSQSEventRecordActionProcessor_1 = require("./event/getSQSEventRecordActio
18
22
  Object.defineProperty(exports, "getSQSEventRecordActionProcessor", { enumerable: true, get: function () { return __importDefault(getSQSEventRecordActionProcessor_1).default; } });
19
23
  var getServiceFunctionExecuteEventActionProcessor_1 = require("./event/getServiceFunctionExecuteEventActionProcessor");
20
24
  Object.defineProperty(exports, "getServiceFunctionExecuteEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getServiceFunctionExecuteEventActionProcessor_1).default; } });
25
+ var getEventBridgeEventStackDeployActionProcessor_1 = require("./event/getEventBridgeEventStackDeployActionProcessor");
26
+ Object.defineProperty(exports, "getEventBridgeEventStackDeployActionProcessor", { enumerable: true, get: function () { return __importDefault(getEventBridgeEventStackDeployActionProcessor_1).default; } });
21
27
  var getEventBridgeEventActionProcessor_1 = require("./event/getEventBridgeEventActionProcessor");
22
28
  Object.defineProperty(exports, "getEventBridgeEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getEventBridgeEventActionProcessor_1).default; } });
23
29
  var getLambdaCognitoCustomMessage_1 = require("./event/getLambdaCognitoCustomMessage");
@@ -0,0 +1 @@
1
+ export declare const setParameter: (parameterName: string, region: string, value: string) => Promise<void>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.setParameter = void 0;
13
+ const client_ssm_1 = require("@aws-sdk/client-ssm");
14
+ const setParameter = (parameterName, region, value) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const smClient = new client_ssm_1.SSMClient({
16
+ region,
17
+ });
18
+ yield smClient.send(new client_ssm_1.PutParameterCommand({
19
+ Name: parameterName,
20
+ Value: value,
21
+ Overwrite: true,
22
+ Type: client_ssm_1.ParameterType.STRING
23
+ }));
24
+ });
25
+ exports.setParameter = setParameter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-awslambda",
3
- "version": "0.0.135",
3
+ "version": "0.0.137",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "types": "./lib/commonjs/index.d.js",