@lambda-kata/cdk 0.1.3-rc.75 → 0.1.3-rc.77
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.
|
@@ -97,7 +97,24 @@ export interface SnapStartActivatorConfig {
|
|
|
97
97
|
* @default 'kata'
|
|
98
98
|
*/
|
|
99
99
|
aliasName?: string;
|
|
100
|
+
/**
|
|
101
|
+
* @internal Override pre-publish delay in milliseconds (for testing only).
|
|
102
|
+
* @default 3000
|
|
103
|
+
*/
|
|
104
|
+
_prePublishDelayMs?: number;
|
|
105
|
+
/**
|
|
106
|
+
* @internal Override retry delay in milliseconds (for testing only).
|
|
107
|
+
* @default 5000
|
|
108
|
+
*/
|
|
109
|
+
_retryDelayMs?: number;
|
|
100
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Sleep for specified milliseconds.
|
|
113
|
+
* @internal Exported for testability — tests can jest.spyOn to avoid real delays.
|
|
114
|
+
*/
|
|
115
|
+
export declare const _testable: {
|
|
116
|
+
sleep(ms: number): Promise<void>;
|
|
117
|
+
};
|
|
101
118
|
/**
|
|
102
119
|
* Activates SnapStart on a Lambda function.
|
|
103
120
|
*
|
|
@@ -105,10 +122,14 @@ export interface SnapStartActivatorConfig {
|
|
|
105
122
|
* 1. Ensures function is Active
|
|
106
123
|
* 2. Enables SnapStart configuration
|
|
107
124
|
* 3. Waits for configuration update
|
|
108
|
-
* 4. Publishes new version
|
|
125
|
+
* 4. Publishes new version (with retry on snapshot failure)
|
|
109
126
|
* 5. Waits for snapshot creation
|
|
110
127
|
* 6. Creates/updates alias
|
|
111
128
|
*
|
|
129
|
+
* Steps 3+4 are wrapped in a retry loop: on State: Failed, a new version
|
|
130
|
+
* is published (up to MAX_PUBLISH_RETRIES attempts) to handle transient
|
|
131
|
+
* initialization failures during snapshot creation.
|
|
132
|
+
*
|
|
112
133
|
* @param lambdaClient - AWS Lambda client
|
|
113
134
|
* @param functionName - Name or ARN of the Lambda function
|
|
114
135
|
* @param config - Optional configuration
|
|
@@ -97,12 +97,11 @@ export declare class SnapStartActivator extends Construct {
|
|
|
97
97
|
constructor(scope: Construct, id: string, props: SnapStartActivatorProps);
|
|
98
98
|
/**
|
|
99
99
|
* Creates the Lambda function that handles Custom Resource events.
|
|
100
|
+
* Permissions are passed via initialPolicy to ensure they are part of the
|
|
101
|
+
* role creation (not a separate AWS::IAM::Policy resource), preventing
|
|
102
|
+
* IAM propagation race conditions.
|
|
100
103
|
*/
|
|
101
104
|
private createProviderFunction;
|
|
102
|
-
/**
|
|
103
|
-
* Grants necessary permissions to the provider function.
|
|
104
|
-
*/
|
|
105
|
-
private grantPermissions;
|
|
106
105
|
/**
|
|
107
106
|
* Generates the inline handler code for the Custom Resource.
|
|
108
107
|
*
|
package/package.json
CHANGED