@go-to-k/cdkd 0.50.0 → 0.50.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.
package/dist/cli.js CHANGED
@@ -9130,9 +9130,7 @@ var IAMRoleProvider = class {
9130
9130
  const result = {};
9131
9131
  if (role.RoleName !== void 0)
9132
9132
  result["RoleName"] = role.RoleName;
9133
- if (role.Description !== void 0 && role.Description !== "") {
9134
- result["Description"] = role.Description;
9135
- }
9133
+ result["Description"] = role.Description ?? "";
9136
9134
  if (role.MaxSessionDuration !== void 0) {
9137
9135
  result["MaxSessionDuration"] = role.MaxSessionDuration;
9138
9136
  }
@@ -9155,8 +9153,7 @@ var IAMRoleProvider = class {
9155
9153
  new ListAttachedRolePoliciesCommand({ RoleName: physicalId })
9156
9154
  );
9157
9155
  const arns = (attached.AttachedPolicies ?? []).map((p) => p.PolicyArn).filter((arn) => !!arn);
9158
- if (arns.length > 0)
9159
- result["ManagedPolicyArns"] = arns;
9156
+ result["ManagedPolicyArns"] = arns;
9160
9157
  } catch (err) {
9161
9158
  if (!(err instanceof NoSuchEntityException))
9162
9159
  throw err;
@@ -9962,8 +9959,7 @@ var IAMInstanceProfileProvider = class {
9962
9959
  if (profile.Path !== void 0)
9963
9960
  result["Path"] = profile.Path;
9964
9961
  const roleNames = (profile.Roles ?? []).map((r) => r.RoleName).filter((n) => !!n);
9965
- if (roleNames.length > 0)
9966
- result["Roles"] = roleNames;
9962
+ result["Roles"] = roleNames;
9967
9963
  return result;
9968
9964
  }
9969
9965
  /**
@@ -11086,8 +11082,7 @@ var IAMUserGroupProvider = class {
11086
11082
  new ListAttachedUserPoliciesCommand({ UserName: physicalId })
11087
11083
  );
11088
11084
  const arns = (attached.AttachedPolicies ?? []).map((p) => p.PolicyArn).filter((arn) => !!arn);
11089
- if (arns.length > 0)
11090
- result["ManagedPolicyArns"] = arns;
11085
+ result["ManagedPolicyArns"] = arns;
11091
11086
  } catch (err) {
11092
11087
  if (!(err instanceof NoSuchEntityException4))
11093
11088
  throw err;
@@ -11097,8 +11092,7 @@ var IAMUserGroupProvider = class {
11097
11092
  new ListGroupsForUserCommand({ UserName: physicalId })
11098
11093
  );
11099
11094
  const names = (groups.Groups ?? []).map((g) => g.GroupName).filter((n) => !!n);
11100
- if (names.length > 0)
11101
- result["Groups"] = names;
11095
+ result["Groups"] = names;
11102
11096
  } catch (err) {
11103
11097
  if (!(err instanceof NoSuchEntityException4))
11104
11098
  throw err;
@@ -11127,8 +11121,7 @@ var IAMUserGroupProvider = class {
11127
11121
  new ListAttachedGroupPoliciesCommand({ GroupName: physicalId })
11128
11122
  );
11129
11123
  const arns = (attached.AttachedPolicies ?? []).map((p) => p.PolicyArn).filter((arn) => !!arn);
11130
- if (arns.length > 0)
11131
- result["ManagedPolicyArns"] = arns;
11124
+ result["ManagedPolicyArns"] = arns;
11132
11125
  } catch (err) {
11133
11126
  if (!(err instanceof NoSuchEntityException4))
11134
11127
  throw err;
@@ -12143,35 +12136,33 @@ var S3BucketProvider = class {
12143
12136
  };
12144
12137
  {
12145
12138
  const resp = await this.s3Client.send(new GetBucketVersioningCommand({ Bucket: physicalId }));
12146
- if (resp.Status) {
12147
- result["VersioningConfiguration"] = { Status: resp.Status };
12148
- }
12139
+ result["VersioningConfiguration"] = { Status: resp.Status ?? "Suspended" };
12149
12140
  }
12150
12141
  try {
12151
12142
  const resp = await this.s3Client.send(new GetBucketEncryptionCommand({ Bucket: physicalId }));
12152
- const rules = resp.ServerSideEncryptionConfiguration?.Rules;
12153
- if (rules && rules.length > 0) {
12154
- result["BucketEncryption"] = {
12155
- ServerSideEncryptionConfiguration: rules.map((rule) => {
12156
- const out = {};
12157
- const sse = rule.ApplyServerSideEncryptionByDefault;
12158
- if (sse) {
12159
- const sseOut = {};
12160
- if (sse.SSEAlgorithm !== void 0)
12161
- sseOut["SSEAlgorithm"] = sse.SSEAlgorithm;
12162
- if (sse.KMSMasterKeyID !== void 0)
12163
- sseOut["KMSMasterKeyID"] = sse.KMSMasterKeyID;
12164
- out["ServerSideEncryptionByDefault"] = sseOut;
12165
- }
12166
- if (rule.BucketKeyEnabled !== void 0)
12167
- out["BucketKeyEnabled"] = rule.BucketKeyEnabled;
12168
- return out;
12169
- })
12170
- };
12171
- }
12143
+ const rules = resp.ServerSideEncryptionConfiguration?.Rules ?? [];
12144
+ result["BucketEncryption"] = {
12145
+ ServerSideEncryptionConfiguration: rules.map((rule) => {
12146
+ const out = {};
12147
+ const sse = rule.ApplyServerSideEncryptionByDefault;
12148
+ if (sse) {
12149
+ const sseOut = {};
12150
+ if (sse.SSEAlgorithm !== void 0)
12151
+ sseOut["SSEAlgorithm"] = sse.SSEAlgorithm;
12152
+ if (sse.KMSMasterKeyID !== void 0)
12153
+ sseOut["KMSMasterKeyID"] = sse.KMSMasterKeyID;
12154
+ out["ServerSideEncryptionByDefault"] = sseOut;
12155
+ }
12156
+ if (rule.BucketKeyEnabled !== void 0)
12157
+ out["BucketKeyEnabled"] = rule.BucketKeyEnabled;
12158
+ return out;
12159
+ })
12160
+ };
12172
12161
  } catch (err) {
12173
12162
  const e = err;
12174
- if (e.name !== "ServerSideEncryptionConfigurationNotFoundError") {
12163
+ if (e.name === "ServerSideEncryptionConfigurationNotFoundError") {
12164
+ result["BucketEncryption"] = { ServerSideEncryptionConfiguration: [] };
12165
+ } else {
12175
12166
  throw err;
12176
12167
  }
12177
12168
  }
@@ -12180,24 +12171,22 @@ var S3BucketProvider = class {
12180
12171
  new GetPublicAccessBlockCommand({ Bucket: physicalId })
12181
12172
  );
12182
12173
  const cfg = resp.PublicAccessBlockConfiguration;
12183
- if (cfg) {
12184
- const out = {};
12185
- if (cfg.BlockPublicAcls !== void 0)
12186
- out["BlockPublicAcls"] = cfg.BlockPublicAcls;
12187
- if (cfg.BlockPublicPolicy !== void 0)
12188
- out["BlockPublicPolicy"] = cfg.BlockPublicPolicy;
12189
- if (cfg.IgnorePublicAcls !== void 0)
12190
- out["IgnorePublicAcls"] = cfg.IgnorePublicAcls;
12191
- if (cfg.RestrictPublicBuckets !== void 0) {
12192
- out["RestrictPublicBuckets"] = cfg.RestrictPublicBuckets;
12193
- }
12194
- if (Object.keys(out).length > 0) {
12195
- result["PublicAccessBlockConfiguration"] = out;
12196
- }
12197
- }
12174
+ result["PublicAccessBlockConfiguration"] = {
12175
+ BlockPublicAcls: cfg?.BlockPublicAcls ?? false,
12176
+ BlockPublicPolicy: cfg?.BlockPublicPolicy ?? false,
12177
+ IgnorePublicAcls: cfg?.IgnorePublicAcls ?? false,
12178
+ RestrictPublicBuckets: cfg?.RestrictPublicBuckets ?? false
12179
+ };
12198
12180
  } catch (err) {
12199
12181
  const e = err;
12200
- if (e.name !== "NoSuchPublicAccessBlockConfiguration") {
12182
+ if (e.name === "NoSuchPublicAccessBlockConfiguration") {
12183
+ result["PublicAccessBlockConfiguration"] = {
12184
+ BlockPublicAcls: false,
12185
+ BlockPublicPolicy: false,
12186
+ IgnorePublicAcls: false,
12187
+ RestrictPublicBuckets: false
12188
+ };
12189
+ } else {
12201
12190
  throw err;
12202
12191
  }
12203
12192
  }
@@ -12874,9 +12863,7 @@ var SQSQueueProvider = class {
12874
12863
  "FifoThroughputLimit"
12875
12864
  ];
12876
12865
  for (const key of str) {
12877
- const v = attributes[key];
12878
- if (v !== void 0)
12879
- result[key] = v;
12866
+ result[key] = attributes[key] ?? "";
12880
12867
  }
12881
12868
  if (attributes["RedrivePolicy"]) {
12882
12869
  try {
@@ -12884,6 +12871,8 @@ var SQSQueueProvider = class {
12884
12871
  } catch {
12885
12872
  result["RedrivePolicy"] = attributes["RedrivePolicy"];
12886
12873
  }
12874
+ } else {
12875
+ result["RedrivePolicy"] = {};
12887
12876
  }
12888
12877
  try {
12889
12878
  const tagsResp = await this.sqsClient.send(
@@ -13563,9 +13552,7 @@ var SNSTopicProvider = class {
13563
13552
  "FifoThroughputScope"
13564
13553
  ];
13565
13554
  for (const key of str) {
13566
- const v = attrs[key];
13567
- if (v !== void 0 && v !== "")
13568
- result[key] = v;
13555
+ result[key] = attrs[key] ?? "";
13569
13556
  }
13570
13557
  for (const key of ["ArchivePolicy", "DataProtectionPolicy"]) {
13571
13558
  const v = attrs[key];
@@ -14834,39 +14821,24 @@ var LambdaFunctionProvider = class {
14834
14821
  result["Timeout"] = cfg.Timeout;
14835
14822
  if (cfg.MemorySize !== void 0)
14836
14823
  result["MemorySize"] = cfg.MemorySize;
14837
- if (cfg.Description !== void 0 && cfg.Description !== "") {
14838
- result["Description"] = cfg.Description;
14839
- }
14840
- if (cfg.Environment?.Variables) {
14841
- result["Environment"] = { Variables: cfg.Environment.Variables };
14842
- }
14843
- if (cfg.Layers && cfg.Layers.length > 0) {
14844
- result["Layers"] = cfg.Layers.map((l) => l.Arn).filter((arn) => !!arn);
14845
- }
14846
- if (cfg.Architectures && cfg.Architectures.length > 0) {
14847
- result["Architectures"] = [...cfg.Architectures];
14848
- }
14824
+ result["Description"] = cfg.Description ?? "";
14825
+ result["Environment"] = { Variables: cfg.Environment?.Variables ?? {} };
14826
+ result["Layers"] = (cfg.Layers ?? []).map((l) => l.Arn).filter((arn) => !!arn);
14827
+ result["Architectures"] = cfg.Architectures ? [...cfg.Architectures] : [];
14849
14828
  if (cfg.PackageType !== void 0)
14850
14829
  result["PackageType"] = cfg.PackageType;
14851
- if (cfg.TracingConfig?.Mode !== void 0) {
14852
- result["TracingConfig"] = { Mode: cfg.TracingConfig.Mode };
14853
- }
14830
+ result["TracingConfig"] = { Mode: cfg.TracingConfig?.Mode ?? "PassThrough" };
14854
14831
  if (cfg.EphemeralStorage?.Size !== void 0) {
14855
14832
  result["EphemeralStorage"] = { Size: cfg.EphemeralStorage.Size };
14856
14833
  }
14857
- if (cfg.VpcConfig) {
14858
- const vpc = {};
14859
- if (cfg.VpcConfig.SubnetIds)
14860
- vpc["SubnetIds"] = [...cfg.VpcConfig.SubnetIds];
14861
- if (cfg.VpcConfig.SecurityGroupIds) {
14862
- vpc["SecurityGroupIds"] = [...cfg.VpcConfig.SecurityGroupIds];
14863
- }
14864
- if (cfg.VpcConfig.Ipv6AllowedForDualStack !== void 0) {
14865
- vpc["Ipv6AllowedForDualStack"] = cfg.VpcConfig.Ipv6AllowedForDualStack;
14866
- }
14867
- if (Object.keys(vpc).length > 0)
14868
- result["VpcConfig"] = vpc;
14834
+ const vpc = {
14835
+ SubnetIds: cfg.VpcConfig?.SubnetIds ? [...cfg.VpcConfig.SubnetIds] : [],
14836
+ SecurityGroupIds: cfg.VpcConfig?.SecurityGroupIds ? [...cfg.VpcConfig.SecurityGroupIds] : []
14837
+ };
14838
+ if (cfg.VpcConfig?.Ipv6AllowedForDualStack !== void 0) {
14839
+ vpc["Ipv6AllowedForDualStack"] = cfg.VpcConfig.Ipv6AllowedForDualStack;
14869
14840
  }
14841
+ result["VpcConfig"] = vpc;
14870
14842
  const tags = normalizeAwsTagsToCfn(resp.Tags);
14871
14843
  result["Tags"] = tags;
14872
14844
  return result;
@@ -15439,24 +15411,18 @@ var LambdaUrlProvider = class {
15439
15411
  result["AuthType"] = resp.AuthType;
15440
15412
  if (resp.InvokeMode !== void 0)
15441
15413
  result["InvokeMode"] = resp.InvokeMode;
15442
- if (resp.Cors !== void 0) {
15443
- const cors = {};
15444
- if (resp.Cors.AllowOrigins)
15445
- cors["AllowOrigins"] = [...resp.Cors.AllowOrigins];
15446
- if (resp.Cors.AllowMethods)
15447
- cors["AllowMethods"] = [...resp.Cors.AllowMethods];
15448
- if (resp.Cors.AllowHeaders)
15449
- cors["AllowHeaders"] = [...resp.Cors.AllowHeaders];
15450
- if (resp.Cors.ExposeHeaders)
15451
- cors["ExposeHeaders"] = [...resp.Cors.ExposeHeaders];
15452
- if (resp.Cors.MaxAge !== void 0)
15453
- cors["MaxAge"] = resp.Cors.MaxAge;
15454
- if (resp.Cors.AllowCredentials !== void 0) {
15455
- cors["AllowCredentials"] = resp.Cors.AllowCredentials;
15456
- }
15457
- if (Object.keys(cors).length > 0)
15458
- result["Cors"] = cors;
15414
+ const cors = {
15415
+ AllowOrigins: resp.Cors?.AllowOrigins ? [...resp.Cors.AllowOrigins] : [],
15416
+ AllowMethods: resp.Cors?.AllowMethods ? [...resp.Cors.AllowMethods] : [],
15417
+ AllowHeaders: resp.Cors?.AllowHeaders ? [...resp.Cors.AllowHeaders] : [],
15418
+ ExposeHeaders: resp.Cors?.ExposeHeaders ? [...resp.Cors.ExposeHeaders] : []
15419
+ };
15420
+ if (resp.Cors?.MaxAge !== void 0)
15421
+ cors["MaxAge"] = resp.Cors.MaxAge;
15422
+ if (resp.Cors?.AllowCredentials !== void 0) {
15423
+ cors["AllowCredentials"] = resp.Cors.AllowCredentials;
15459
15424
  }
15425
+ result["Cors"] = cors;
15460
15426
  return result;
15461
15427
  }
15462
15428
  /**
@@ -15785,12 +15751,8 @@ var LambdaEventSourceMappingProvider = class {
15785
15751
  if (resp.TumblingWindowInSeconds !== void 0) {
15786
15752
  result["TumblingWindowInSeconds"] = resp.TumblingWindowInSeconds;
15787
15753
  }
15788
- if (resp.FunctionResponseTypes !== void 0 && resp.FunctionResponseTypes.length > 0) {
15789
- result["FunctionResponseTypes"] = [...resp.FunctionResponseTypes];
15790
- }
15791
- if (resp.SourceAccessConfigurations !== void 0 && resp.SourceAccessConfigurations.length > 0) {
15792
- result["SourceAccessConfigurations"] = resp.SourceAccessConfigurations;
15793
- }
15754
+ result["FunctionResponseTypes"] = resp.FunctionResponseTypes ? [...resp.FunctionResponseTypes] : [];
15755
+ result["SourceAccessConfigurations"] = resp.SourceAccessConfigurations ?? [];
15794
15756
  if (resp.SelfManagedEventSource !== void 0) {
15795
15757
  result["SelfManagedEventSource"] = resp.SelfManagedEventSource;
15796
15758
  }
@@ -16410,24 +16372,17 @@ var DynamoDBTableProvider = class {
16410
16372
  StreamViewType: table.StreamSpecification.StreamViewType
16411
16373
  };
16412
16374
  }
16413
- if (table.GlobalSecondaryIndexes && table.GlobalSecondaryIndexes.length > 0) {
16414
- result["GlobalSecondaryIndexes"] = table.GlobalSecondaryIndexes;
16415
- }
16416
- if (table.LocalSecondaryIndexes && table.LocalSecondaryIndexes.length > 0) {
16417
- result["LocalSecondaryIndexes"] = table.LocalSecondaryIndexes;
16418
- }
16419
- if (table.SSEDescription) {
16420
- const sse = {};
16421
- if (table.SSEDescription.Status === "ENABLED")
16422
- sse["SSEEnabled"] = true;
16423
- if (table.SSEDescription.KMSMasterKeyArn !== void 0) {
16424
- sse["KMSMasterKeyId"] = table.SSEDescription.KMSMasterKeyArn;
16425
- }
16426
- if (table.SSEDescription.SSEType !== void 0)
16427
- sse["SSEType"] = table.SSEDescription.SSEType;
16428
- if (Object.keys(sse).length > 0)
16429
- result["SSESpecification"] = sse;
16375
+ result["GlobalSecondaryIndexes"] = table.GlobalSecondaryIndexes ?? [];
16376
+ result["LocalSecondaryIndexes"] = table.LocalSecondaryIndexes ?? [];
16377
+ const sse = {
16378
+ SSEEnabled: table.SSEDescription?.Status === "ENABLED"
16379
+ };
16380
+ if (table.SSEDescription?.KMSMasterKeyArn !== void 0) {
16381
+ sse["KMSMasterKeyId"] = table.SSEDescription.KMSMasterKeyArn;
16430
16382
  }
16383
+ if (table.SSEDescription?.SSEType !== void 0)
16384
+ sse["SSEType"] = table.SSEDescription.SSEType;
16385
+ result["SSESpecification"] = sse;
16431
16386
  if (table.DeletionProtectionEnabled !== void 0) {
16432
16387
  result["DeletionProtectionEnabled"] = table.DeletionProtectionEnabled;
16433
16388
  }
@@ -16791,8 +16746,7 @@ var LogsLogGroupProvider = class {
16791
16746
  const result = {};
16792
16747
  if (found.logGroupName !== void 0)
16793
16748
  result["LogGroupName"] = found.logGroupName;
16794
- if (found.kmsKeyId !== void 0)
16795
- result["KmsKeyId"] = found.kmsKeyId;
16749
+ result["KmsKeyId"] = found.kmsKeyId ?? "";
16796
16750
  if (found.retentionInDays !== void 0) {
16797
16751
  result["RetentionInDays"] = found.retentionInDays;
16798
16752
  }
@@ -17134,15 +17088,10 @@ var CloudWatchAlarmProvider = class {
17134
17088
  const result = {};
17135
17089
  if (alarm.AlarmName !== void 0)
17136
17090
  result["AlarmName"] = alarm.AlarmName;
17137
- if (alarm.AlarmDescription !== void 0 && alarm.AlarmDescription !== "") {
17138
- result["AlarmDescription"] = alarm.AlarmDescription;
17139
- }
17140
- if (alarm.MetricName !== void 0)
17141
- result["MetricName"] = alarm.MetricName;
17142
- if (alarm.Namespace !== void 0)
17143
- result["Namespace"] = alarm.Namespace;
17144
- if (alarm.Statistic !== void 0)
17145
- result["Statistic"] = alarm.Statistic;
17091
+ result["AlarmDescription"] = alarm.AlarmDescription ?? "";
17092
+ result["MetricName"] = alarm.MetricName ?? "";
17093
+ result["Namespace"] = alarm.Namespace ?? "";
17094
+ result["Statistic"] = alarm.Statistic ?? "";
17146
17095
  if (alarm.ComparisonOperator !== void 0) {
17147
17096
  result["ComparisonOperator"] = alarm.ComparisonOperator;
17148
17097
  }
@@ -17156,31 +17105,17 @@ var CloudWatchAlarmProvider = class {
17156
17105
  if (alarm.DatapointsToAlarm !== void 0) {
17157
17106
  result["DatapointsToAlarm"] = alarm.DatapointsToAlarm;
17158
17107
  }
17159
- if (alarm.ActionsEnabled !== void 0)
17160
- result["ActionsEnabled"] = alarm.ActionsEnabled;
17161
- if (alarm.AlarmActions && alarm.AlarmActions.length > 0) {
17162
- result["AlarmActions"] = [...alarm.AlarmActions];
17163
- }
17164
- if (alarm.OKActions && alarm.OKActions.length > 0) {
17165
- result["OKActions"] = [...alarm.OKActions];
17166
- }
17167
- if (alarm.InsufficientDataActions && alarm.InsufficientDataActions.length > 0) {
17168
- result["InsufficientDataActions"] = [...alarm.InsufficientDataActions];
17169
- }
17170
- if (alarm.TreatMissingData !== void 0) {
17171
- result["TreatMissingData"] = alarm.TreatMissingData;
17172
- }
17173
- if (alarm.Unit !== void 0)
17174
- result["Unit"] = alarm.Unit;
17175
- if (alarm.Dimensions && alarm.Dimensions.length > 0) {
17176
- result["Dimensions"] = alarm.Dimensions.map((d) => ({
17177
- ...d.Name !== void 0 ? { Name: d.Name } : {},
17178
- ...d.Value !== void 0 ? { Value: d.Value } : {}
17179
- }));
17180
- }
17181
- if (alarm.Metrics && alarm.Metrics.length > 0) {
17182
- result["Metrics"] = alarm.Metrics.map((m) => m);
17183
- }
17108
+ result["ActionsEnabled"] = alarm.ActionsEnabled ?? true;
17109
+ result["AlarmActions"] = alarm.AlarmActions ? [...alarm.AlarmActions] : [];
17110
+ result["OKActions"] = alarm.OKActions ? [...alarm.OKActions] : [];
17111
+ result["InsufficientDataActions"] = alarm.InsufficientDataActions ? [...alarm.InsufficientDataActions] : [];
17112
+ result["TreatMissingData"] = alarm.TreatMissingData ?? "";
17113
+ result["Unit"] = alarm.Unit ?? "";
17114
+ result["Dimensions"] = (alarm.Dimensions ?? []).map((d) => ({
17115
+ ...d.Name !== void 0 ? { Name: d.Name } : {},
17116
+ ...d.Value !== void 0 ? { Value: d.Value } : {}
17117
+ }));
17118
+ result["Metrics"] = (alarm.Metrics ?? []).map((m) => m);
17184
17119
  if (alarm.AlarmArn) {
17185
17120
  try {
17186
17121
  const tagsResp = await this.cloudWatchClient.send(
@@ -17545,21 +17480,16 @@ var SecretsManagerSecretProvider = class {
17545
17480
  const result = {};
17546
17481
  if (resp.Name !== void 0)
17547
17482
  result["Name"] = resp.Name;
17548
- if (resp.Description !== void 0 && resp.Description !== "") {
17549
- result["Description"] = resp.Description;
17550
- }
17551
- if (resp.KmsKeyId !== void 0)
17552
- result["KmsKeyId"] = resp.KmsKeyId;
17553
- if (resp.ReplicationStatus && resp.ReplicationStatus.length > 0) {
17554
- result["ReplicaRegions"] = resp.ReplicationStatus.map((r) => {
17555
- const out = {};
17556
- if (r.Region)
17557
- out["Region"] = r.Region;
17558
- if (r.KmsKeyId)
17559
- out["KmsKeyId"] = r.KmsKeyId;
17560
- return out;
17561
- });
17562
- }
17483
+ result["Description"] = resp.Description ?? "";
17484
+ result["KmsKeyId"] = resp.KmsKeyId ?? "";
17485
+ result["ReplicaRegions"] = (resp.ReplicationStatus ?? []).map((r) => {
17486
+ const out = {};
17487
+ if (r.Region)
17488
+ out["Region"] = r.Region;
17489
+ if (r.KmsKeyId)
17490
+ out["KmsKeyId"] = r.KmsKeyId;
17491
+ return out;
17492
+ });
17563
17493
  const tags = normalizeAwsTagsToCfn(resp.Tags);
17564
17494
  result["Tags"] = tags;
17565
17495
  return result;
@@ -17902,16 +17832,10 @@ var SSMParameterProvider = class {
17902
17832
  })
17903
17833
  );
17904
17834
  const meta = desc.Parameters?.[0];
17905
- if (meta) {
17906
- if (meta.Description !== void 0 && meta.Description !== "") {
17907
- result["Description"] = meta.Description;
17908
- }
17909
- if (meta.AllowedPattern !== void 0 && meta.AllowedPattern !== "") {
17910
- result["AllowedPattern"] = meta.AllowedPattern;
17911
- }
17912
- if (meta.Tier !== void 0) {
17913
- result["Tier"] = meta.Tier;
17914
- }
17835
+ result["Description"] = meta?.Description ?? "";
17836
+ result["AllowedPattern"] = meta?.AllowedPattern ?? "";
17837
+ if (meta?.Tier !== void 0) {
17838
+ result["Tier"] = meta.Tier;
17915
17839
  }
17916
17840
  } catch {
17917
17841
  }
@@ -18295,9 +18219,7 @@ var EventBridgeRuleProvider = class {
18295
18219
  const result = {};
18296
18220
  if (resp.Name !== void 0)
18297
18221
  result["Name"] = resp.Name;
18298
- if (resp.Description !== void 0 && resp.Description !== "") {
18299
- result["Description"] = resp.Description;
18300
- }
18222
+ result["Description"] = resp.Description ?? "";
18301
18223
  if (resp.EventBusName !== void 0 && resp.EventBusName !== "default") {
18302
18224
  result["EventBusName"] = resp.EventBusName;
18303
18225
  }
@@ -18322,9 +18244,7 @@ var EventBridgeRuleProvider = class {
18322
18244
  ...eventBusName && eventBusName !== "default" ? { EventBusName: eventBusName } : {}
18323
18245
  })
18324
18246
  );
18325
- if (targetsResp.Targets && targetsResp.Targets.length > 0) {
18326
- result["Targets"] = targetsResp.Targets;
18327
- }
18247
+ result["Targets"] = targetsResp.Targets ?? [];
18328
18248
  } catch (err) {
18329
18249
  if (!(err instanceof ResourceNotFoundException9)) {
18330
18250
  throw err;
@@ -18729,15 +18649,9 @@ var EventBridgeBusProvider = class {
18729
18649
  const result = {};
18730
18650
  if (resp.Name !== void 0)
18731
18651
  result["Name"] = resp.Name;
18732
- if (resp.Description !== void 0 && resp.Description !== "") {
18733
- result["Description"] = resp.Description;
18734
- }
18735
- if (resp.KmsKeyIdentifier !== void 0) {
18736
- result["KmsKeyIdentifier"] = resp.KmsKeyIdentifier;
18737
- }
18738
- if (resp.DeadLetterConfig?.Arn) {
18739
- result["DeadLetterConfig"] = { Arn: resp.DeadLetterConfig.Arn };
18740
- }
18652
+ result["Description"] = resp.Description ?? "";
18653
+ result["KmsKeyIdentifier"] = resp.KmsKeyIdentifier ?? "";
18654
+ result["DeadLetterConfig"] = { Arn: resp.DeadLetterConfig?.Arn ?? "" };
18741
18655
  if (resp.Policy) {
18742
18656
  try {
18743
18657
  result["Policy"] = JSON.parse(resp.Policy);
@@ -24259,9 +24173,7 @@ var AgentCoreRuntimeProvider = class {
24259
24173
  if (resp.networkConfiguration !== void 0) {
24260
24174
  result["NetworkConfiguration"] = camelToPascalCaseKeys(resp.networkConfiguration);
24261
24175
  }
24262
- if (resp.description !== void 0 && resp.description !== "") {
24263
- result["Description"] = resp.description;
24264
- }
24176
+ result["Description"] = resp.description ?? "";
24265
24177
  if (resp.authorizerConfiguration !== void 0) {
24266
24178
  result["AuthorizerConfiguration"] = camelToPascalCaseKeys(resp.authorizerConfiguration);
24267
24179
  }
@@ -24539,15 +24451,15 @@ var StepFunctionsProvider = class {
24539
24451
  result["Definition"] = resp.definition;
24540
24452
  }
24541
24453
  }
24542
- if (resp.loggingConfiguration) {
24454
+ {
24543
24455
  const lc = {};
24544
- if (resp.loggingConfiguration.level !== void 0) {
24456
+ if (resp.loggingConfiguration?.level !== void 0) {
24545
24457
  lc["Level"] = resp.loggingConfiguration.level;
24546
24458
  }
24547
- if (resp.loggingConfiguration.includeExecutionData !== void 0) {
24459
+ if (resp.loggingConfiguration?.includeExecutionData !== void 0) {
24548
24460
  lc["IncludeExecutionData"] = resp.loggingConfiguration.includeExecutionData;
24549
24461
  }
24550
- if (resp.loggingConfiguration.destinations) {
24462
+ if (resp.loggingConfiguration?.destinations) {
24551
24463
  lc["Destinations"] = resp.loggingConfiguration.destinations.map((d) => {
24552
24464
  const inner = {};
24553
24465
  if (d.cloudWatchLogsLogGroup?.logGroupArn) {
@@ -24558,25 +24470,21 @@ var StepFunctionsProvider = class {
24558
24470
  return inner;
24559
24471
  });
24560
24472
  }
24561
- if (Object.keys(lc).length > 0)
24562
- result["LoggingConfiguration"] = lc;
24563
- }
24564
- if (resp.tracingConfiguration?.enabled !== void 0) {
24565
- result["TracingConfiguration"] = { Enabled: resp.tracingConfiguration.enabled };
24473
+ result["LoggingConfiguration"] = lc;
24566
24474
  }
24567
- if (resp.encryptionConfiguration) {
24475
+ result["TracingConfiguration"] = { Enabled: resp.tracingConfiguration?.enabled ?? false };
24476
+ {
24568
24477
  const ec = {};
24569
- if (resp.encryptionConfiguration.type !== void 0) {
24478
+ if (resp.encryptionConfiguration?.type !== void 0) {
24570
24479
  ec["Type"] = resp.encryptionConfiguration.type;
24571
24480
  }
24572
- if (resp.encryptionConfiguration.kmsKeyId !== void 0) {
24481
+ if (resp.encryptionConfiguration?.kmsKeyId !== void 0) {
24573
24482
  ec["KmsKeyId"] = resp.encryptionConfiguration.kmsKeyId;
24574
24483
  }
24575
- if (resp.encryptionConfiguration.kmsDataKeyReusePeriodSeconds !== void 0) {
24484
+ if (resp.encryptionConfiguration?.kmsDataKeyReusePeriodSeconds !== void 0) {
24576
24485
  ec["KmsDataKeyReusePeriodSeconds"] = resp.encryptionConfiguration.kmsDataKeyReusePeriodSeconds;
24577
24486
  }
24578
- if (Object.keys(ec).length > 0)
24579
- result["EncryptionConfiguration"] = ec;
24487
+ result["EncryptionConfiguration"] = ec;
24580
24488
  }
24581
24489
  try {
24582
24490
  const tagsResp = await this.getClient().send(
@@ -25460,20 +25368,14 @@ var ECSProvider = class {
25460
25368
  if (!c || !c.clusterName)
25461
25369
  return void 0;
25462
25370
  const result = { ClusterName: c.clusterName };
25463
- if (c.capacityProviders && c.capacityProviders.length > 0) {
25464
- result["CapacityProviders"] = [...c.capacityProviders];
25465
- }
25466
- if (c.defaultCapacityProviderStrategy && c.defaultCapacityProviderStrategy.length > 0) {
25467
- result["DefaultCapacityProviderStrategy"] = c.defaultCapacityProviderStrategy;
25468
- }
25371
+ result["CapacityProviders"] = c.capacityProviders ? [...c.capacityProviders] : [];
25372
+ result["DefaultCapacityProviderStrategy"] = c.defaultCapacityProviderStrategy ?? [];
25469
25373
  if (c.configuration)
25470
25374
  result["Configuration"] = c.configuration;
25471
- if (c.settings && c.settings.length > 0) {
25472
- result["ClusterSettings"] = c.settings.map((s) => ({
25473
- Name: s.name,
25474
- Value: s.value
25475
- }));
25476
- }
25375
+ result["ClusterSettings"] = (c.settings ?? []).map((s) => ({
25376
+ Name: s.name,
25377
+ Value: s.value
25378
+ }));
25477
25379
  const tags = normalizeAwsTagsToCfn(c.tags);
25478
25380
  result["Tags"] = tags;
25479
25381
  return result;
@@ -25527,23 +25429,13 @@ var ECSProvider = class {
25527
25429
  }
25528
25430
  if (s.networkConfiguration)
25529
25431
  result["NetworkConfiguration"] = s.networkConfiguration;
25530
- if (s.loadBalancers && s.loadBalancers.length > 0) {
25531
- result["LoadBalancers"] = s.loadBalancers;
25532
- }
25533
- if (s.capacityProviderStrategy && s.capacityProviderStrategy.length > 0) {
25534
- result["CapacityProviderStrategy"] = s.capacityProviderStrategy;
25535
- }
25432
+ result["LoadBalancers"] = s.loadBalancers ?? [];
25433
+ result["CapacityProviderStrategy"] = s.capacityProviderStrategy ?? [];
25536
25434
  if (s.deploymentConfiguration)
25537
25435
  result["DeploymentConfiguration"] = s.deploymentConfiguration;
25538
- if (s.placementConstraints && s.placementConstraints.length > 0) {
25539
- result["PlacementConstraints"] = s.placementConstraints;
25540
- }
25541
- if (s.placementStrategy && s.placementStrategy.length > 0) {
25542
- result["PlacementStrategy"] = s.placementStrategy;
25543
- }
25544
- if (s.serviceRegistries && s.serviceRegistries.length > 0) {
25545
- result["ServiceRegistries"] = s.serviceRegistries;
25546
- }
25436
+ result["PlacementConstraints"] = s.placementConstraints ?? [];
25437
+ result["PlacementStrategy"] = s.placementStrategy ?? [];
25438
+ result["ServiceRegistries"] = s.serviceRegistries ?? [];
25547
25439
  const tags = normalizeAwsTagsToCfn(s.tags);
25548
25440
  result["Tags"] = tags;
25549
25441
  return result;
@@ -25569,18 +25461,13 @@ var ECSProvider = class {
25569
25461
  result["Memory"] = td.memory;
25570
25462
  if (td.networkMode !== void 0)
25571
25463
  result["NetworkMode"] = td.networkMode;
25572
- if (td.requiresCompatibilities && td.requiresCompatibilities.length > 0) {
25573
- result["RequiresCompatibilities"] = [...td.requiresCompatibilities];
25574
- }
25464
+ result["RequiresCompatibilities"] = td.requiresCompatibilities ? [...td.requiresCompatibilities] : [];
25575
25465
  if (td.executionRoleArn !== void 0)
25576
25466
  result["ExecutionRoleArn"] = td.executionRoleArn;
25577
25467
  if (td.taskRoleArn !== void 0)
25578
25468
  result["TaskRoleArn"] = td.taskRoleArn;
25579
- if (td.volumes && td.volumes.length > 0)
25580
- result["Volumes"] = td.volumes;
25581
- if (td.placementConstraints && td.placementConstraints.length > 0) {
25582
- result["PlacementConstraints"] = td.placementConstraints;
25583
- }
25469
+ result["Volumes"] = td.volumes ?? [];
25470
+ result["PlacementConstraints"] = td.placementConstraints ?? [];
25584
25471
  if (td.runtimePlatform)
25585
25472
  result["RuntimePlatform"] = td.runtimePlatform;
25586
25473
  if (td.proxyConfiguration)
@@ -25592,9 +25479,7 @@ var ECSProvider = class {
25592
25479
  if (td.ephemeralStorage?.sizeInGiB !== void 0) {
25593
25480
  result["EphemeralStorage"] = { SizeInGiB: td.ephemeralStorage.sizeInGiB };
25594
25481
  }
25595
- if (td.containerDefinitions && td.containerDefinitions.length > 0) {
25596
- result["ContainerDefinitions"] = td.containerDefinitions;
25597
- }
25482
+ result["ContainerDefinitions"] = td.containerDefinitions ?? [];
25598
25483
  const tags = normalizeAwsTagsToCfn(resp.tags);
25599
25484
  result["Tags"] = tags;
25600
25485
  return result;
@@ -26260,16 +26145,9 @@ var ELBv2Provider = class {
26260
26145
  const result = {};
26261
26146
  if (lb.LoadBalancerName !== void 0)
26262
26147
  result["Name"] = lb.LoadBalancerName;
26263
- if (lb.AvailabilityZones && lb.AvailabilityZones.length > 0) {
26264
- const subnets = lb.AvailabilityZones.map((az) => az.SubnetId).filter(
26265
- (id) => !!id
26266
- );
26267
- if (subnets.length > 0)
26268
- result["Subnets"] = subnets;
26269
- }
26270
- if (lb.SecurityGroups && lb.SecurityGroups.length > 0) {
26271
- result["SecurityGroups"] = [...lb.SecurityGroups];
26272
- }
26148
+ const subnets = (lb.AvailabilityZones ?? []).map((az) => az.SubnetId).filter((id) => !!id);
26149
+ result["Subnets"] = subnets;
26150
+ result["SecurityGroups"] = lb.SecurityGroups ? [...lb.SecurityGroups] : [];
26273
26151
  if (lb.Scheme !== void 0)
26274
26152
  result["Scheme"] = lb.Scheme;
26275
26153
  if (lb.Type !== void 0)
@@ -26326,15 +26204,12 @@ var ELBv2Provider = class {
26326
26204
  if (tg.UnhealthyThresholdCount !== void 0) {
26327
26205
  result["UnhealthyThresholdCount"] = tg.UnhealthyThresholdCount;
26328
26206
  }
26329
- if (tg.Matcher) {
26330
- const matcher = {};
26331
- if (tg.Matcher.HttpCode !== void 0)
26332
- matcher["HttpCode"] = tg.Matcher.HttpCode;
26333
- if (tg.Matcher.GrpcCode !== void 0)
26334
- matcher["GrpcCode"] = tg.Matcher.GrpcCode;
26335
- if (Object.keys(matcher).length > 0)
26336
- result["Matcher"] = matcher;
26337
- }
26207
+ const matcher = {};
26208
+ if (tg.Matcher?.HttpCode !== void 0)
26209
+ matcher["HttpCode"] = tg.Matcher.HttpCode;
26210
+ if (tg.Matcher?.GrpcCode !== void 0)
26211
+ matcher["GrpcCode"] = tg.Matcher.GrpcCode;
26212
+ result["Matcher"] = matcher;
26338
26213
  await this.attachTags(result, physicalId);
26339
26214
  return result;
26340
26215
  }
@@ -26362,21 +26237,17 @@ var ELBv2Provider = class {
26362
26237
  result["Protocol"] = listener.Protocol;
26363
26238
  if (listener.SslPolicy !== void 0)
26364
26239
  result["SslPolicy"] = listener.SslPolicy;
26365
- if (listener.Certificates && listener.Certificates.length > 0) {
26366
- result["Certificates"] = listener.Certificates.map((c) => {
26367
- const out = {};
26368
- if (c.CertificateArn !== void 0)
26369
- out["CertificateArn"] = c.CertificateArn;
26370
- if (c.IsDefault !== void 0)
26371
- out["IsDefault"] = c.IsDefault;
26372
- return out;
26373
- });
26374
- }
26375
- if (listener.DefaultActions && listener.DefaultActions.length > 0) {
26376
- result["DefaultActions"] = listener.DefaultActions.map(
26377
- (a) => a
26378
- );
26379
- }
26240
+ result["Certificates"] = (listener.Certificates ?? []).map((c) => {
26241
+ const out = {};
26242
+ if (c.CertificateArn !== void 0)
26243
+ out["CertificateArn"] = c.CertificateArn;
26244
+ if (c.IsDefault !== void 0)
26245
+ out["IsDefault"] = c.IsDefault;
26246
+ return out;
26247
+ });
26248
+ result["DefaultActions"] = (listener.DefaultActions ?? []).map(
26249
+ (a) => a
26250
+ );
26380
26251
  await this.attachTags(result, physicalId);
26381
26252
  return result;
26382
26253
  }
@@ -27223,11 +27094,7 @@ var RDSProvider = class {
27223
27094
  result["DatabaseName"] = cluster.DatabaseName;
27224
27095
  if (cluster.Port !== void 0)
27225
27096
  result["Port"] = cluster.Port;
27226
- if (cluster.VpcSecurityGroups && cluster.VpcSecurityGroups.length > 0) {
27227
- result["VpcSecurityGroupIds"] = cluster.VpcSecurityGroups.map(
27228
- (sg) => sg.VpcSecurityGroupId
27229
- ).filter((id) => !!id);
27230
- }
27097
+ result["VpcSecurityGroupIds"] = (cluster.VpcSecurityGroups ?? []).map((sg) => sg.VpcSecurityGroupId).filter((id) => !!id);
27231
27098
  if (cluster.DBSubnetGroup !== void 0)
27232
27099
  result["DBSubnetGroupName"] = cluster.DBSubnetGroup;
27233
27100
  if (cluster.StorageEncrypted !== void 0) {
@@ -27241,16 +27108,15 @@ var RDSProvider = class {
27241
27108
  if (cluster.DeletionProtection !== void 0) {
27242
27109
  result["DeletionProtection"] = cluster.DeletionProtection;
27243
27110
  }
27244
- if (cluster.ServerlessV2ScalingConfiguration) {
27111
+ {
27245
27112
  const sc = {};
27246
- if (cluster.ServerlessV2ScalingConfiguration.MinCapacity !== void 0) {
27113
+ if (cluster.ServerlessV2ScalingConfiguration?.MinCapacity !== void 0) {
27247
27114
  sc["MinCapacity"] = cluster.ServerlessV2ScalingConfiguration.MinCapacity;
27248
27115
  }
27249
- if (cluster.ServerlessV2ScalingConfiguration.MaxCapacity !== void 0) {
27116
+ if (cluster.ServerlessV2ScalingConfiguration?.MaxCapacity !== void 0) {
27250
27117
  sc["MaxCapacity"] = cluster.ServerlessV2ScalingConfiguration.MaxCapacity;
27251
27118
  }
27252
- if (Object.keys(sc).length > 0)
27253
- result["ServerlessV2ScalingConfiguration"] = sc;
27119
+ result["ServerlessV2ScalingConfiguration"] = sc;
27254
27120
  }
27255
27121
  if (cluster.DBClusterArn)
27256
27122
  await this.attachTags(result, cluster.DBClusterArn);
@@ -27276,11 +27142,7 @@ var RDSProvider = class {
27276
27142
  if (sg.DBSubnetGroupDescription !== void 0) {
27277
27143
  result["DBSubnetGroupDescription"] = sg.DBSubnetGroupDescription;
27278
27144
  }
27279
- if (sg.Subnets && sg.Subnets.length > 0) {
27280
- result["SubnetIds"] = sg.Subnets.map((s) => s.SubnetIdentifier).filter(
27281
- (id) => !!id
27282
- );
27283
- }
27145
+ result["SubnetIds"] = (sg.Subnets ?? []).map((s) => s.SubnetIdentifier).filter((id) => !!id);
27284
27146
  if (sg.DBSubnetGroupArn)
27285
27147
  await this.attachTags(result, sg.DBSubnetGroupArn);
27286
27148
  return result;
@@ -28119,35 +27981,30 @@ var Route53Provider = class {
28119
27981
  const result = {};
28120
27982
  if (resp.HostedZone.Name !== void 0)
28121
27983
  result["Name"] = resp.HostedZone.Name;
28122
- if (resp.HostedZone.Config) {
28123
- const cfg = {};
28124
- if (resp.HostedZone.Config.Comment !== void 0) {
28125
- cfg["Comment"] = resp.HostedZone.Config.Comment;
28126
- }
28127
- if (resp.HostedZone.Config.PrivateZone !== void 0) {
27984
+ {
27985
+ const cfg = {
27986
+ Comment: resp.HostedZone.Config?.Comment ?? ""
27987
+ };
27988
+ if (resp.HostedZone.Config?.PrivateZone !== void 0) {
28128
27989
  cfg["PrivateZone"] = resp.HostedZone.Config.PrivateZone;
28129
27990
  }
28130
- if (Object.keys(cfg).length > 0)
28131
- result["HostedZoneConfig"] = cfg;
28132
- }
28133
- if (resp.VPCs && resp.VPCs.length > 0) {
28134
- result["VPCs"] = resp.VPCs.map((v) => {
28135
- const out = {};
28136
- if (v.VPCId !== void 0)
28137
- out["VPCId"] = v.VPCId;
28138
- if (v.VPCRegion !== void 0)
28139
- out["VPCRegion"] = v.VPCRegion;
28140
- return out;
28141
- });
27991
+ result["HostedZoneConfig"] = cfg;
28142
27992
  }
27993
+ result["VPCs"] = (resp.VPCs ?? []).map((v) => {
27994
+ const out = {};
27995
+ if (v.VPCId !== void 0)
27996
+ out["VPCId"] = v.VPCId;
27997
+ if (v.VPCRegion !== void 0)
27998
+ out["VPCRegion"] = v.VPCRegion;
27999
+ return out;
28000
+ });
28143
28001
  const idTail = physicalId.replace(/^\/hostedzone\//, "");
28144
28002
  try {
28145
28003
  const tagsResp = await this.getClient().send(
28146
28004
  new ListTagsForResourceCommand11({ ResourceType: "hostedzone", ResourceId: idTail })
28147
28005
  );
28148
28006
  const tags = normalizeAwsTagsToCfn(tagsResp.ResourceTagSet?.Tags);
28149
- if (tags.length > 0)
28150
- result["HostedZoneTags"] = tags;
28007
+ result["HostedZoneTags"] = tags;
28151
28008
  } catch (err) {
28152
28009
  this.logger.debug(
28153
28010
  `Route53 ListTagsForResource(${idTail}) failed: ${err instanceof Error ? err.message : String(err)}`
@@ -28187,11 +28044,7 @@ var Route53Provider = class {
28187
28044
  };
28188
28045
  if (recordSet.TTL !== void 0)
28189
28046
  result["TTL"] = recordSet.TTL;
28190
- if (recordSet.ResourceRecords && recordSet.ResourceRecords.length > 0) {
28191
- result["ResourceRecords"] = recordSet.ResourceRecords.map((r) => r.Value).filter(
28192
- (v) => typeof v === "string"
28193
- );
28194
- }
28047
+ result["ResourceRecords"] = (recordSet.ResourceRecords ?? []).map((r) => r.Value).filter((v) => typeof v === "string");
28195
28048
  if (recordSet.AliasTarget) {
28196
28049
  const at = {};
28197
28050
  if (recordSet.AliasTarget.HostedZoneId !== void 0) {
@@ -28229,8 +28082,7 @@ var Route53Provider = class {
28229
28082
  if (recordSet.GeoLocation.SubdivisionCode !== void 0) {
28230
28083
  geo["SubdivisionCode"] = recordSet.GeoLocation.SubdivisionCode;
28231
28084
  }
28232
- if (Object.keys(geo).length > 0)
28233
- result["GeoLocation"] = geo;
28085
+ result["GeoLocation"] = geo;
28234
28086
  }
28235
28087
  return result;
28236
28088
  }
@@ -28564,30 +28416,22 @@ var WAFv2WebACLProvider = class {
28564
28416
  if (webACL.Name !== void 0)
28565
28417
  result["Name"] = webACL.Name;
28566
28418
  result["Scope"] = scope;
28567
- if (webACL.Description !== void 0 && webACL.Description !== "") {
28568
- result["Description"] = webACL.Description;
28569
- }
28419
+ result["Description"] = webACL.Description ?? "";
28570
28420
  if (webACL.DefaultAction) {
28571
28421
  result["DefaultAction"] = webACL.DefaultAction;
28572
28422
  }
28573
- if (webACL.Rules && webACL.Rules.length > 0) {
28574
- result["Rules"] = webACL.Rules.map((r) => r);
28575
- }
28423
+ result["Rules"] = (webACL.Rules ?? []).map((r) => r);
28576
28424
  if (webACL.VisibilityConfig) {
28577
28425
  result["VisibilityConfig"] = webACL.VisibilityConfig;
28578
28426
  }
28579
- if (webACL.CustomResponseBodies && Object.keys(webACL.CustomResponseBodies).length > 0) {
28580
- result["CustomResponseBodies"] = webACL.CustomResponseBodies;
28581
- }
28427
+ result["CustomResponseBodies"] = webACL.CustomResponseBodies ?? {};
28582
28428
  if (webACL.CaptchaConfig) {
28583
28429
  result["CaptchaConfig"] = webACL.CaptchaConfig;
28584
28430
  }
28585
28431
  if (webACL.ChallengeConfig) {
28586
28432
  result["ChallengeConfig"] = webACL.ChallengeConfig;
28587
28433
  }
28588
- if (webACL.TokenDomains && webACL.TokenDomains.length > 0) {
28589
- result["TokenDomains"] = [...webACL.TokenDomains];
28590
- }
28434
+ result["TokenDomains"] = webACL.TokenDomains ? [...webACL.TokenDomains] : [];
28591
28435
  if (webACL.AssociationConfig) {
28592
28436
  result["AssociationConfig"] = webACL.AssociationConfig;
28593
28437
  }
@@ -29679,13 +29523,8 @@ var ElastiCacheProvider = class {
29679
29523
  if (cluster.CacheNodes?.[0]?.Endpoint?.Port !== void 0) {
29680
29524
  result["Port"] = cluster.CacheNodes[0].Endpoint.Port;
29681
29525
  }
29682
- if (cluster.SecurityGroups && cluster.SecurityGroups.length > 0) {
29683
- const ids = cluster.SecurityGroups.map((sg) => sg.SecurityGroupId).filter(
29684
- (id) => !!id
29685
- );
29686
- if (ids.length > 0)
29687
- result["VpcSecurityGroupIds"] = ids;
29688
- }
29526
+ const sgIds = (cluster.SecurityGroups ?? []).map((sg) => sg.SecurityGroupId).filter((id) => !!id);
29527
+ result["VpcSecurityGroupIds"] = sgIds;
29689
29528
  if (cluster.ARN)
29690
29529
  await this.attachTags(result, cluster.ARN);
29691
29530
  return result;
@@ -29711,11 +29550,8 @@ var ElastiCacheProvider = class {
29711
29550
  if (group.CacheSubnetGroupDescription !== void 0) {
29712
29551
  result["CacheSubnetGroupDescription"] = group.CacheSubnetGroupDescription;
29713
29552
  }
29714
- if (group.Subnets && group.Subnets.length > 0) {
29715
- const ids = group.Subnets.map((s) => s.SubnetIdentifier).filter((id) => !!id);
29716
- if (ids.length > 0)
29717
- result["SubnetIds"] = ids;
29718
- }
29553
+ const subnetIds = (group.Subnets ?? []).map((s) => s.SubnetIdentifier).filter((id) => !!id);
29554
+ result["SubnetIds"] = subnetIds;
29719
29555
  if (group.ARN)
29720
29556
  await this.attachTags(result, group.ARN);
29721
29557
  return result;
@@ -30251,9 +30087,7 @@ var ServiceDiscoveryProvider = class {
30251
30087
  const result = {};
30252
30088
  if (ns.Name !== void 0)
30253
30089
  result["Name"] = ns.Name;
30254
- if (ns.Description !== void 0 && ns.Description !== "") {
30255
- result["Description"] = ns.Description;
30256
- }
30090
+ result["Description"] = ns.Description ?? "";
30257
30091
  if (ns.Arn)
30258
30092
  await this.attachTags(result, ns.Arn);
30259
30093
  return result;
@@ -30275,9 +30109,7 @@ var ServiceDiscoveryProvider = class {
30275
30109
  result["Name"] = svc.Name;
30276
30110
  if (svc.NamespaceId !== void 0)
30277
30111
  result["NamespaceId"] = svc.NamespaceId;
30278
- if (svc.Description !== void 0 && svc.Description !== "") {
30279
- result["Description"] = svc.Description;
30280
- }
30112
+ result["Description"] = svc.Description ?? "";
30281
30113
  if (svc.Type !== void 0)
30282
30114
  result["Type"] = svc.Type;
30283
30115
  if (svc.DnsConfig) {
@@ -31656,14 +31488,10 @@ var GlueProvider = class {
31656
31488
  const dbInput = {};
31657
31489
  if (db.Name !== void 0)
31658
31490
  dbInput["Name"] = db.Name;
31659
- if (db.Description !== void 0 && db.Description !== "") {
31660
- dbInput["Description"] = db.Description;
31661
- }
31491
+ dbInput["Description"] = db.Description ?? "";
31662
31492
  if (db.LocationUri !== void 0)
31663
31493
  dbInput["LocationUri"] = db.LocationUri;
31664
- if (db.Parameters && Object.keys(db.Parameters).length > 0) {
31665
- dbInput["Parameters"] = db.Parameters;
31666
- }
31494
+ dbInput["Parameters"] = db.Parameters ?? {};
31667
31495
  return { DatabaseInput: dbInput };
31668
31496
  }
31669
31497
  async readTable(physicalId) {
@@ -31686,23 +31514,17 @@ var GlueProvider = class {
31686
31514
  const tableInput = {};
31687
31515
  if (table.Name !== void 0)
31688
31516
  tableInput["Name"] = table.Name;
31689
- if (table.Description !== void 0 && table.Description !== "") {
31690
- tableInput["Description"] = table.Description;
31691
- }
31517
+ tableInput["Description"] = table.Description ?? "";
31692
31518
  if (table.Owner !== void 0)
31693
31519
  tableInput["Owner"] = table.Owner;
31694
31520
  if (table.Retention !== void 0)
31695
31521
  tableInput["Retention"] = table.Retention;
31696
31522
  if (table.TableType !== void 0)
31697
31523
  tableInput["TableType"] = table.TableType;
31698
- if (table.PartitionKeys && table.PartitionKeys.length > 0) {
31699
- tableInput["PartitionKeys"] = table.PartitionKeys.map(
31700
- (k) => k
31701
- );
31702
- }
31703
- if (table.Parameters && Object.keys(table.Parameters).length > 0) {
31704
- tableInput["Parameters"] = table.Parameters;
31705
- }
31524
+ tableInput["PartitionKeys"] = (table.PartitionKeys ?? []).map(
31525
+ (k) => k
31526
+ );
31527
+ tableInput["Parameters"] = table.Parameters ?? {};
31706
31528
  if (table.StorageDescriptor) {
31707
31529
  tableInput["StorageDescriptor"] = table.StorageDescriptor;
31708
31530
  }
@@ -32304,9 +32126,7 @@ var KMSProvider = class {
32304
32126
  if (!md)
32305
32127
  return void 0;
32306
32128
  const result = {};
32307
- if (md.Description !== void 0 && md.Description !== "") {
32308
- result["Description"] = md.Description;
32309
- }
32129
+ result["Description"] = md.Description ?? "";
32310
32130
  if (md.KeySpec !== void 0)
32311
32131
  result["KeySpec"] = md.KeySpec;
32312
32132
  if (md.KeyUsage !== void 0)
@@ -32756,8 +32576,10 @@ var KinesisStreamProvider = class {
32756
32576
  if (stream.RetentionPeriodHours !== void 0) {
32757
32577
  result["RetentionPeriodHours"] = stream.RetentionPeriodHours;
32758
32578
  }
32759
- if (stream.EncryptionType !== void 0 && stream.EncryptionType !== "NONE") {
32760
- const encryption = { EncryptionType: stream.EncryptionType };
32579
+ {
32580
+ const encryption = {
32581
+ EncryptionType: stream.EncryptionType ?? "NONE"
32582
+ };
32761
32583
  if (stream.KeyId !== void 0)
32762
32584
  encryption["KeyId"] = stream.KeyId;
32763
32585
  result["StreamEncryption"] = encryption;
@@ -33337,20 +33159,18 @@ var EFSProvider = class {
33337
33159
  const resp = await this.getClient().send(
33338
33160
  new DescribeLifecycleConfigurationCommand({ FileSystemId: physicalId })
33339
33161
  );
33340
- const policies = resp.LifecyclePolicies;
33341
- if (policies && policies.length > 0) {
33342
- result["LifecyclePolicies"] = policies.map((p) => {
33343
- const out = {};
33344
- if (p.TransitionToIA !== void 0)
33345
- out["TransitionToIA"] = p.TransitionToIA;
33346
- if (p.TransitionToPrimaryStorageClass !== void 0) {
33347
- out["TransitionToPrimaryStorageClass"] = p.TransitionToPrimaryStorageClass;
33348
- }
33349
- if (p.TransitionToArchive !== void 0)
33350
- out["TransitionToArchive"] = p.TransitionToArchive;
33351
- return out;
33352
- });
33353
- }
33162
+ const policies = resp.LifecyclePolicies ?? [];
33163
+ result["LifecyclePolicies"] = policies.map((p) => {
33164
+ const out = {};
33165
+ if (p.TransitionToIA !== void 0)
33166
+ out["TransitionToIA"] = p.TransitionToIA;
33167
+ if (p.TransitionToPrimaryStorageClass !== void 0) {
33168
+ out["TransitionToPrimaryStorageClass"] = p.TransitionToPrimaryStorageClass;
33169
+ }
33170
+ if (p.TransitionToArchive !== void 0)
33171
+ out["TransitionToArchive"] = p.TransitionToArchive;
33172
+ return out;
33173
+ });
33354
33174
  } catch (err) {
33355
33175
  if (err instanceof FileSystemNotFound)
33356
33176
  return void 0;
@@ -33370,8 +33190,7 @@ var EFSProvider = class {
33370
33190
  return void 0;
33371
33191
  }
33372
33192
  const tags = normalizeAwsTagsToCfn(fs.Tags);
33373
- if (tags.length > 0)
33374
- result["FileSystemTags"] = tags;
33193
+ result["FileSystemTags"] = tags;
33375
33194
  return result;
33376
33195
  }
33377
33196
  async readAccessPoint(physicalId) {
@@ -34371,11 +34190,9 @@ var CloudTrailProvider = class {
34371
34190
  const sel = await this.getClient().send(
34372
34191
  new GetEventSelectorsCommand({ TrailName: physicalId })
34373
34192
  );
34374
- if (sel.EventSelectors && sel.EventSelectors.length > 0) {
34375
- result["EventSelectors"] = sel.EventSelectors.map(
34376
- (es) => es
34377
- );
34378
- }
34193
+ result["EventSelectors"] = (sel.EventSelectors ?? []).map(
34194
+ (es) => es
34195
+ );
34379
34196
  } catch {
34380
34197
  }
34381
34198
  if (trail.TrailARN) {
@@ -34747,105 +34564,93 @@ var CodeBuildProvider = class {
34747
34564
  const result = {};
34748
34565
  if (project.name !== void 0)
34749
34566
  result["Name"] = project.name;
34750
- if (project.description !== void 0 && project.description !== "") {
34751
- result["Description"] = project.description;
34752
- }
34753
- if (project.serviceRole !== void 0)
34754
- result["ServiceRole"] = project.serviceRole;
34567
+ result["Description"] = project.description ?? "";
34568
+ result["ServiceRole"] = project.serviceRole ?? "";
34755
34569
  if (project.timeoutInMinutes !== void 0) {
34756
34570
  result["TimeoutInMinutes"] = project.timeoutInMinutes;
34757
34571
  }
34758
34572
  if (project.queuedTimeoutInMinutes !== void 0) {
34759
34573
  result["QueuedTimeoutInMinutes"] = project.queuedTimeoutInMinutes;
34760
34574
  }
34761
- if (project.encryptionKey !== void 0)
34762
- result["EncryptionKey"] = project.encryptionKey;
34575
+ result["EncryptionKey"] = project.encryptionKey ?? "";
34763
34576
  if (project.concurrentBuildLimit !== void 0) {
34764
34577
  result["ConcurrentBuildLimit"] = project.concurrentBuildLimit;
34765
34578
  }
34766
- if (project.badge?.badgeEnabled !== void 0) {
34767
- result["BadgeEnabled"] = project.badge.badgeEnabled;
34768
- }
34769
- if (project.sourceVersion !== void 0)
34770
- result["SourceVersion"] = project.sourceVersion;
34771
- if (project.source) {
34579
+ result["BadgeEnabled"] = project.badge?.badgeEnabled ?? false;
34580
+ result["SourceVersion"] = project.sourceVersion ?? "";
34581
+ {
34772
34582
  const src = {};
34773
- if (project.source.type !== void 0)
34583
+ if (project.source?.type !== void 0)
34774
34584
  src["Type"] = project.source.type;
34775
- if (project.source.location !== void 0)
34585
+ if (project.source?.location !== void 0)
34776
34586
  src["Location"] = project.source.location;
34777
- if (project.source.buildspec !== void 0)
34587
+ if (project.source?.buildspec !== void 0)
34778
34588
  src["BuildSpec"] = project.source.buildspec;
34779
- if (project.source.gitCloneDepth !== void 0) {
34589
+ if (project.source?.gitCloneDepth !== void 0) {
34780
34590
  src["GitCloneDepth"] = project.source.gitCloneDepth;
34781
34591
  }
34782
- if (project.source.insecureSsl !== void 0)
34592
+ if (project.source?.insecureSsl !== void 0)
34783
34593
  src["InsecureSsl"] = project.source.insecureSsl;
34784
- if (project.source.reportBuildStatus !== void 0) {
34594
+ if (project.source?.reportBuildStatus !== void 0) {
34785
34595
  src["ReportBuildStatus"] = project.source.reportBuildStatus;
34786
34596
  }
34787
- if (Object.keys(src).length > 0)
34788
- result["Source"] = src;
34597
+ result["Source"] = src;
34789
34598
  }
34790
- if (project.artifacts) {
34599
+ {
34791
34600
  const art = {};
34792
- if (project.artifacts.type !== void 0)
34601
+ if (project.artifacts?.type !== void 0)
34793
34602
  art["Type"] = project.artifacts.type;
34794
- if (project.artifacts.location !== void 0)
34603
+ if (project.artifacts?.location !== void 0)
34795
34604
  art["Location"] = project.artifacts.location;
34796
- if (project.artifacts.path !== void 0)
34605
+ if (project.artifacts?.path !== void 0)
34797
34606
  art["Path"] = project.artifacts.path;
34798
- if (project.artifacts.name !== void 0)
34607
+ if (project.artifacts?.name !== void 0)
34799
34608
  art["Name"] = project.artifacts.name;
34800
- if (project.artifacts.namespaceType !== void 0) {
34609
+ if (project.artifacts?.namespaceType !== void 0) {
34801
34610
  art["NamespaceType"] = project.artifacts.namespaceType;
34802
34611
  }
34803
- if (project.artifacts.packaging !== void 0)
34612
+ if (project.artifacts?.packaging !== void 0)
34804
34613
  art["Packaging"] = project.artifacts.packaging;
34805
- if (project.artifacts.encryptionDisabled !== void 0) {
34614
+ if (project.artifacts?.encryptionDisabled !== void 0) {
34806
34615
  art["EncryptionDisabled"] = project.artifacts.encryptionDisabled;
34807
34616
  }
34808
- if (project.artifacts.overrideArtifactName !== void 0) {
34617
+ if (project.artifacts?.overrideArtifactName !== void 0) {
34809
34618
  art["OverrideArtifactName"] = project.artifacts.overrideArtifactName;
34810
34619
  }
34811
- if (project.artifacts.artifactIdentifier !== void 0) {
34620
+ if (project.artifacts?.artifactIdentifier !== void 0) {
34812
34621
  art["ArtifactIdentifier"] = project.artifacts.artifactIdentifier;
34813
34622
  }
34814
- if (Object.keys(art).length > 0)
34815
- result["Artifacts"] = art;
34623
+ result["Artifacts"] = art;
34816
34624
  }
34817
- if (project.environment) {
34625
+ {
34818
34626
  const env = {};
34819
- if (project.environment.type !== void 0)
34627
+ if (project.environment?.type !== void 0)
34820
34628
  env["Type"] = project.environment.type;
34821
- if (project.environment.image !== void 0)
34629
+ if (project.environment?.image !== void 0)
34822
34630
  env["Image"] = project.environment.image;
34823
- if (project.environment.computeType !== void 0) {
34631
+ if (project.environment?.computeType !== void 0) {
34824
34632
  env["ComputeType"] = project.environment.computeType;
34825
34633
  }
34826
- if (project.environment.privilegedMode !== void 0) {
34634
+ if (project.environment?.privilegedMode !== void 0) {
34827
34635
  env["PrivilegedMode"] = project.environment.privilegedMode;
34828
34636
  }
34829
- if (project.environment.imagePullCredentialsType !== void 0) {
34637
+ if (project.environment?.imagePullCredentialsType !== void 0) {
34830
34638
  env["ImagePullCredentialsType"] = project.environment.imagePullCredentialsType;
34831
34639
  }
34832
- if (project.environment.certificate !== void 0) {
34640
+ if (project.environment?.certificate !== void 0) {
34833
34641
  env["Certificate"] = project.environment.certificate;
34834
34642
  }
34835
- if (project.environment.environmentVariables && project.environment.environmentVariables.length > 0) {
34836
- env["EnvironmentVariables"] = project.environment.environmentVariables.map((ev) => {
34837
- const out = {};
34838
- if (ev.name !== void 0)
34839
- out["Name"] = ev.name;
34840
- if (ev.value !== void 0)
34841
- out["Value"] = ev.value;
34842
- if (ev.type !== void 0)
34843
- out["Type"] = ev.type;
34844
- return out;
34845
- });
34846
- }
34847
- if (Object.keys(env).length > 0)
34848
- result["Environment"] = env;
34643
+ env["EnvironmentVariables"] = (project.environment?.environmentVariables ?? []).map((ev) => {
34644
+ const out = {};
34645
+ if (ev.name !== void 0)
34646
+ out["Name"] = ev.name;
34647
+ if (ev.value !== void 0)
34648
+ out["Value"] = ev.value;
34649
+ if (ev.type !== void 0)
34650
+ out["Type"] = ev.type;
34651
+ return out;
34652
+ });
34653
+ result["Environment"] = env;
34849
34654
  }
34850
34655
  const tags = normalizeAwsTagsToCfn(project.tags);
34851
34656
  result["Tags"] = tags;
@@ -36406,24 +36211,17 @@ var ECRProvider = class {
36406
36211
  result["RepositoryName"] = r.repositoryName;
36407
36212
  if (r.imageTagMutability !== void 0)
36408
36213
  result["ImageTagMutability"] = r.imageTagMutability;
36409
- if (r.imageScanningConfiguration) {
36410
- const inner = {};
36411
- if (r.imageScanningConfiguration.scanOnPush !== void 0) {
36412
- inner["ScanOnPush"] = r.imageScanningConfiguration.scanOnPush;
36413
- }
36414
- if (Object.keys(inner).length > 0)
36415
- result["ImageScanningConfiguration"] = inner;
36416
- }
36417
- if (r.encryptionConfiguration) {
36418
- const inner = {};
36419
- if (r.encryptionConfiguration.encryptionType !== void 0) {
36420
- inner["EncryptionType"] = r.encryptionConfiguration.encryptionType;
36421
- }
36422
- if (r.encryptionConfiguration.kmsKey !== void 0) {
36423
- inner["KmsKey"] = r.encryptionConfiguration.kmsKey;
36214
+ result["ImageScanningConfiguration"] = {
36215
+ ScanOnPush: r.imageScanningConfiguration?.scanOnPush ?? false
36216
+ };
36217
+ {
36218
+ const enc = {
36219
+ EncryptionType: r.encryptionConfiguration?.encryptionType ?? "AES256"
36220
+ };
36221
+ if (r.encryptionConfiguration?.kmsKey !== void 0) {
36222
+ enc["KmsKey"] = r.encryptionConfiguration.kmsKey;
36424
36223
  }
36425
- if (Object.keys(inner).length > 0)
36426
- result["EncryptionConfiguration"] = inner;
36224
+ result["EncryptionConfiguration"] = enc;
36427
36225
  }
36428
36226
  try {
36429
36227
  const lp = await this.getClient().send(
@@ -42861,7 +42659,7 @@ function reorderArgs(argv) {
42861
42659
  }
42862
42660
  async function main() {
42863
42661
  const program = new Command14();
42864
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.0");
42662
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.2");
42865
42663
  program.addCommand(createBootstrapCommand());
42866
42664
  program.addCommand(createSynthCommand());
42867
42665
  program.addCommand(createListCommand());