@iyio/aws 0.5.12 → 0.5.13

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.
@@ -1,4 +1,5 @@
1
- export * from './lib/aws-auth';
2
1
  export * from './lib/AwsHttpRequestSigner';
3
2
  export * from './lib/_modules.aws';
4
3
  export * from './lib/_types.aws';
4
+ export * from './lib/aws-auth';
5
+ export * from './lib/cdk-custom-resource-types';
package/esm/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
- export * from './lib/aws-auth';
2
1
  export * from './lib/AwsHttpRequestSigner';
3
2
  export * from './lib/_modules.aws';
4
3
  export * from './lib/_types.aws';
4
+ export * from './lib/aws-auth';
5
+ export * from './lib/cdk-custom-resource-types';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/aws/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/aws/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,103 @@
1
+ import { CloudFormationCustomResourceEventCommon } from "aws-lambda";
2
+ /**
3
+ * Signature for the `onEvent` handler, which is called when a lifecycle event occurs.
4
+ */
5
+ export type OnEventHandler = (event: OnEventRequest) => Promise<OnEventResponse | undefined>;
6
+ /**
7
+ * Signature for the `isComplete` handler, which is called to detemrine if the
8
+ * event handling is complete. As long as this method returns `IsComplete:
9
+ * false`, the handler will be called (based on the rety policy defined by the
10
+ * provider) until a timeout occurs, an error is thrown or until it returns
11
+ * `true`.
12
+ */
13
+ export type IsCompleteHandler = (event: IsCompleteRequest) => Promise<IsCompleteResponse>;
14
+ /**
15
+ * The object passed to the user-defined `onEvent` handler.
16
+ */
17
+ export interface OnEventRequest extends CloudFormationCustomResourceEventCommon {
18
+ /**
19
+ * The request type is set by the AWS CloudFormation stack operation
20
+ * (create-stack, update-stack, or delete-stack) that was initiated by the
21
+ * template developer for the stack that contains the custom resource.
22
+ */
23
+ readonly RequestType: 'Create' | 'Update' | 'Delete';
24
+ /**
25
+ * Used only for Update requests. Contains the resource properties that were
26
+ * declared previous to the update request.
27
+ */
28
+ readonly OldResourceProperties?: {
29
+ [key: string]: any;
30
+ };
31
+ /**
32
+ * A required custom resource provider-defined physical ID that is unique for
33
+ * that provider.
34
+ *
35
+ * Always sent with 'Update' and 'Delete' requests; never sent with 'Create'.
36
+ */
37
+ readonly PhysicalResourceId?: string;
38
+ }
39
+ /**
40
+ * The object returned from the user-defined `onEvent` handler.
41
+ */
42
+ export interface OnEventResponse {
43
+ /**
44
+ * A required custom resource provider-defined physical ID that is unique for
45
+ * that provider.
46
+ *
47
+ * In order to reduce the chance for mistakes, all event types MUST return
48
+ * with `PhysicalResourceId`.
49
+ *
50
+ * - For `Create`, this will be the user-defined or generated physical
51
+ * resource ID.
52
+ * - For `Update`, if the returned PhysicalResourceId is different value from
53
+ * the current one, it means that the old physical resource needs to be
54
+ * deleted, and CloudFormation will immediately send a `Delete` event with
55
+ * the old physical ID.
56
+ * - For `Delete`, this must be the same value received in the event.
57
+ *
58
+ * @default - for "Create" requests, defaults to the event's RequestId, for
59
+ * "Update" and "Delete", defaults to the current `PhysicalResourceId`.
60
+ */
61
+ readonly PhysicalResourceId?: string;
62
+ /**
63
+ * Resource attributes to return.
64
+ */
65
+ readonly Data?: {
66
+ [name: string]: any;
67
+ };
68
+ /**
69
+ * Custom fields returned from OnEvent will be passed to IsComplete.
70
+ */
71
+ readonly [key: string]: any;
72
+ /**
73
+ * Whether to mask the output of the custom resource when retrieved
74
+ * by using the `Fn::GetAtt` function. If set to `true`, all returned
75
+ * values are masked with asterisks (*****).
76
+ *
77
+ * @default false
78
+ */
79
+ readonly NoEcho?: boolean;
80
+ }
81
+ /**
82
+ * The input to the `isComplete` user defined handler.
83
+ */
84
+ export type IsCompleteRequest = OnEventRequest & OnEventResponse;
85
+ /**
86
+ * The output of the `isComplete` user-defined handler.
87
+ */
88
+ export interface IsCompleteResponse {
89
+ /**
90
+ * Indicates if the resource operation is complete or should we retry.
91
+ */
92
+ readonly IsComplete: boolean;
93
+ /**
94
+ * If present, overrides the PhysicalResourceId of OnEventResponse with the PhysicalResourceId of IsCompleteResponse.
95
+ */
96
+ readonly PhysicalResourceId?: string;
97
+ /**
98
+ * Additional/changes to resource attributes. This hash will be merged with the one returned from `OnEventResponse`.
99
+ */
100
+ readonly Data?: {
101
+ [name: string]: any;
102
+ };
103
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cdk-custom-resource-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdk-custom-resource-types.js","sourceRoot":"","sources":["../../../../../../packages/aws/src/lib/cdk-custom-resource-types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyio/aws",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "sideEffects": false,
5
5
  "dependencies": {
6
6
  "@aws-crypto/sha256-browser": ">=3.0.0",
@@ -13,7 +13,7 @@
13
13
  "zod": ">=3.22.4"
14
14
  },
15
15
  "peerDependencies": {
16
- "@iyio/common": "^0.5.12"
16
+ "@iyio/common": "^0.5.13"
17
17
  },
18
18
  "main": "./src/index.js",
19
19
  "types": "./src/index.d.ts",
package/src/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from './lib/aws-auth';
2
1
  export * from './lib/AwsHttpRequestSigner';
3
2
  export * from './lib/_modules.aws';
4
3
  export * from './lib/_types.aws';
4
+ export * from './lib/aws-auth';
5
+ export * from './lib/cdk-custom-resource-types';
package/src/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./lib/aws-auth"), exports);
5
4
  tslib_1.__exportStar(require("./lib/AwsHttpRequestSigner"), exports);
6
5
  tslib_1.__exportStar(require("./lib/_modules.aws"), exports);
7
6
  tslib_1.__exportStar(require("./lib/_types.aws"), exports);
7
+ tslib_1.__exportStar(require("./lib/aws-auth"), exports);
8
+ tslib_1.__exportStar(require("./lib/cdk-custom-resource-types"), exports);
8
9
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/aws/src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,qEAA2C;AAC3C,6DAAmC;AACnC,2DAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/aws/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAA2C;AAC3C,6DAAmC;AACnC,2DAAiC;AACjC,yDAA+B;AAC/B,0EAAgD"}
@@ -0,0 +1,103 @@
1
+ import { CloudFormationCustomResourceEventCommon } from "aws-lambda";
2
+ /**
3
+ * Signature for the `onEvent` handler, which is called when a lifecycle event occurs.
4
+ */
5
+ export type OnEventHandler = (event: OnEventRequest) => Promise<OnEventResponse | undefined>;
6
+ /**
7
+ * Signature for the `isComplete` handler, which is called to detemrine if the
8
+ * event handling is complete. As long as this method returns `IsComplete:
9
+ * false`, the handler will be called (based on the rety policy defined by the
10
+ * provider) until a timeout occurs, an error is thrown or until it returns
11
+ * `true`.
12
+ */
13
+ export type IsCompleteHandler = (event: IsCompleteRequest) => Promise<IsCompleteResponse>;
14
+ /**
15
+ * The object passed to the user-defined `onEvent` handler.
16
+ */
17
+ export interface OnEventRequest extends CloudFormationCustomResourceEventCommon {
18
+ /**
19
+ * The request type is set by the AWS CloudFormation stack operation
20
+ * (create-stack, update-stack, or delete-stack) that was initiated by the
21
+ * template developer for the stack that contains the custom resource.
22
+ */
23
+ readonly RequestType: 'Create' | 'Update' | 'Delete';
24
+ /**
25
+ * Used only for Update requests. Contains the resource properties that were
26
+ * declared previous to the update request.
27
+ */
28
+ readonly OldResourceProperties?: {
29
+ [key: string]: any;
30
+ };
31
+ /**
32
+ * A required custom resource provider-defined physical ID that is unique for
33
+ * that provider.
34
+ *
35
+ * Always sent with 'Update' and 'Delete' requests; never sent with 'Create'.
36
+ */
37
+ readonly PhysicalResourceId?: string;
38
+ }
39
+ /**
40
+ * The object returned from the user-defined `onEvent` handler.
41
+ */
42
+ export interface OnEventResponse {
43
+ /**
44
+ * A required custom resource provider-defined physical ID that is unique for
45
+ * that provider.
46
+ *
47
+ * In order to reduce the chance for mistakes, all event types MUST return
48
+ * with `PhysicalResourceId`.
49
+ *
50
+ * - For `Create`, this will be the user-defined or generated physical
51
+ * resource ID.
52
+ * - For `Update`, if the returned PhysicalResourceId is different value from
53
+ * the current one, it means that the old physical resource needs to be
54
+ * deleted, and CloudFormation will immediately send a `Delete` event with
55
+ * the old physical ID.
56
+ * - For `Delete`, this must be the same value received in the event.
57
+ *
58
+ * @default - for "Create" requests, defaults to the event's RequestId, for
59
+ * "Update" and "Delete", defaults to the current `PhysicalResourceId`.
60
+ */
61
+ readonly PhysicalResourceId?: string;
62
+ /**
63
+ * Resource attributes to return.
64
+ */
65
+ readonly Data?: {
66
+ [name: string]: any;
67
+ };
68
+ /**
69
+ * Custom fields returned from OnEvent will be passed to IsComplete.
70
+ */
71
+ readonly [key: string]: any;
72
+ /**
73
+ * Whether to mask the output of the custom resource when retrieved
74
+ * by using the `Fn::GetAtt` function. If set to `true`, all returned
75
+ * values are masked with asterisks (*****).
76
+ *
77
+ * @default false
78
+ */
79
+ readonly NoEcho?: boolean;
80
+ }
81
+ /**
82
+ * The input to the `isComplete` user defined handler.
83
+ */
84
+ export type IsCompleteRequest = OnEventRequest & OnEventResponse;
85
+ /**
86
+ * The output of the `isComplete` user-defined handler.
87
+ */
88
+ export interface IsCompleteResponse {
89
+ /**
90
+ * Indicates if the resource operation is complete or should we retry.
91
+ */
92
+ readonly IsComplete: boolean;
93
+ /**
94
+ * If present, overrides the PhysicalResourceId of OnEventResponse with the PhysicalResourceId of IsCompleteResponse.
95
+ */
96
+ readonly PhysicalResourceId?: string;
97
+ /**
98
+ * Additional/changes to resource attributes. This hash will be merged with the one returned from `OnEventResponse`.
99
+ */
100
+ readonly Data?: {
101
+ [name: string]: any;
102
+ };
103
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cdk-custom-resource-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdk-custom-resource-types.js","sourceRoot":"","sources":["../../../../../packages/aws/src/lib/cdk-custom-resource-types.ts"],"names":[],"mappings":""}