carlin 5.0.1 → 5.0.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +14 -3
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -931,14 +931,25 @@ const cloudformation = () => {
931
931
  return cloudFormationClients[key];
932
932
  };
933
933
  /**
934
- * Stack waiters poll every 30 seconds by default. One hour matches the
935
- * timeout of the AWS SDK v2 waiters carlin used before.
934
+ * One hour matches the timeout of the AWS SDK v2 waiters carlin used before.
936
935
  */
937
936
  const STACK_WAITER_MAX_WAIT_TIME_IN_SECONDS = 3600;
937
+ /**
938
+ * The SDK's CloudFormation waiters default to `minDelay: 30` and
939
+ * `maxDelay: 120`: they check at 0s and 30s, then sleep a random 30–60s, a
940
+ * random 30–120s, and 120s from there on. A stack that finished right after a
941
+ * check sat unnoticed for up to two minutes, and a deploy that waits on another
942
+ * stack (`^deploy`) paid that once per stack. DescribeStacks every 5–15s stays
943
+ * far below CloudFormation's API limits.
944
+ */
945
+ const STACK_WAITER_MIN_DELAY_IN_SECONDS = 5;
946
+ const STACK_WAITER_MAX_DELAY_IN_SECONDS = 15;
938
947
  const getStackWaiterParams = () => {
939
948
  return {
940
949
  client: cloudformation(),
941
- maxWaitTime: STACK_WAITER_MAX_WAIT_TIME_IN_SECONDS
950
+ maxWaitTime: STACK_WAITER_MAX_WAIT_TIME_IN_SECONDS,
951
+ minDelay: STACK_WAITER_MIN_DELAY_IN_SECONDS,
952
+ maxDelay: STACK_WAITER_MAX_DELAY_IN_SECONDS
942
953
  };
943
954
  };
944
955
  const describeStacks = async ({ stackName } = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlin",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://ttoss.dev/docs/carlin/",
@@ -62,8 +62,8 @@
62
62
  "uglify-js": "^3.19.3",
63
63
  "yargs": "^18.2.0",
64
64
  "@ttoss/cloudformation": "^0.19.0",
65
- "@ttoss/config": "^3.0.0",
66
- "@ttoss/read-config-file": "^3.0.1"
65
+ "@ttoss/read-config-file": "^3.0.1",
66
+ "@ttoss/config": "^3.0.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/aws-lambda": "^8.10.164",