cdk-real-drift 0.23.1 → 0.23.3
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 +70 -18
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1956,6 +1956,7 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
|
|
|
1956
1956
|
region: opts.region,
|
|
1957
1957
|
kmsAliasTargets: opts.kmsAliasTargets,
|
|
1958
1958
|
oaiCanonicalIds: opts.oaiCanonicalIds,
|
|
1959
|
+
...Object.keys(opts.stackTags ?? {}).length > 0 && (Array.isArray(liveRaw.Tags) || Array.isArray(liveRaw.TagSpecifications)) ? { stackTags: opts.stackTags } : {},
|
|
1959
1960
|
...sgSibling && resource.physicalId ? { siblingSgRules: { [resource.physicalId]: sgSibling } } : {},
|
|
1960
1961
|
...bucketNotif ? { bucketNotificationManaged: bucketNotif } : {},
|
|
1961
1962
|
...eipSiblingId ? { siblingEipAssociations: [eipSiblingId] } : {},
|
|
@@ -2686,6 +2687,12 @@ const KNOWN_DEFAULTS = {
|
|
|
2686
2687
|
TransportProtocol: "udp",
|
|
2687
2688
|
SessionTimeoutHours: 24
|
|
2688
2689
|
},
|
|
2690
|
+
"AWS::EC2::CapacityReservation": {
|
|
2691
|
+
Tenancy: "default",
|
|
2692
|
+
EndDateType: "unlimited",
|
|
2693
|
+
EndDate: "null",
|
|
2694
|
+
InstanceMatchCriteria: "open"
|
|
2695
|
+
},
|
|
2689
2696
|
"AWS::DAX::Cluster": {
|
|
2690
2697
|
ClusterEndpointEncryptionType: "NONE",
|
|
2691
2698
|
ParameterGroupName: "default.dax1.0"
|
|
@@ -3358,6 +3365,8 @@ const GENERATED_PATHS = {
|
|
|
3358
3365
|
const CONTEXT_DEFAULTS = { "AWS::EC2::VPCEndpointService": { SupportedRegions: "regionList" } };
|
|
3359
3366
|
const CONTEXT_ARN_DEFAULTS = {
|
|
3360
3367
|
"AWS::ResourceExplorer2::View": { Scope: "arn:{partition}:iam::{accountId}:root" },
|
|
3368
|
+
"AWS::GuardDuty::ThreatEntitySet": { ExpectedBucketOwner: "{accountId}" },
|
|
3369
|
+
"AWS::GuardDuty::TrustedEntitySet": { ExpectedBucketOwner: "{accountId}" },
|
|
3361
3370
|
"AWS::KinesisVideo::Stream": { KmsKeyId: "arn:{partition}:kms:{region}:{accountId}:alias/aws/kinesisvideo" },
|
|
3362
3371
|
"AWS::AutoScaling::AutoScalingGroup": { ServiceLinkedRoleARN: "arn:{partition}:iam::{accountId}:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling" },
|
|
3363
3372
|
"AWS::CloudFormation::StackSet": { AdministrationRoleARN: "arn:{partition}:iam::{accountId}:role/AWSCloudFormationStackSetAdministrationRole" },
|
|
@@ -3584,7 +3593,11 @@ function isAllEbGeneratedGroups(value) {
|
|
|
3584
3593
|
}
|
|
3585
3594
|
const EB_INSTANCE_TYPES_DEFAULT_BY_ARCH = {
|
|
3586
3595
|
x86_64: new Set(["t3.micro", "t3.small"]),
|
|
3587
|
-
arm64: new Set([
|
|
3596
|
+
arm64: new Set([
|
|
3597
|
+
"t4g.micro",
|
|
3598
|
+
"t4g.small",
|
|
3599
|
+
"t4g.large"
|
|
3600
|
+
])
|
|
3588
3601
|
};
|
|
3589
3602
|
function ebInstanceTypesDefaultSet(supportedArchitectures) {
|
|
3590
3603
|
const arch = typeof supportedArchitectures === "string" && supportedArchitectures.trim() !== "" ? supportedArchitectures.split(",")[0]?.trim() : "x86_64";
|
|
@@ -3709,6 +3722,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
3709
3722
|
"AWS::AmazonMQ::Broker": new Set(["MaintenanceWindowStartTime", "SubnetIds"]),
|
|
3710
3723
|
"AWS::EC2::InstanceConnectEndpoint": new Set(["SecurityGroupIds"]),
|
|
3711
3724
|
"AWS::EC2::EIPAssociation": new Set(["PrivateIpAddress", "EIP"]),
|
|
3725
|
+
"AWS::EC2::CapacityReservation": new Set(["AvailabilityZoneId"]),
|
|
3712
3726
|
"AWS::EC2::Instance": new Set([
|
|
3713
3727
|
"PrivateIpAddress",
|
|
3714
3728
|
"CpuOptions",
|
|
@@ -3929,14 +3943,16 @@ const ELB_TG_ATTRIBUTE_DEFAULTS_BY_PROTOCOL = {
|
|
|
3929
3943
|
"deregistration_delay.connection_termination.enabled": "true",
|
|
3930
3944
|
"proxy_protocol_v2.enabled": "false",
|
|
3931
3945
|
"target_health_state.unhealthy.connection_termination.enabled": "true",
|
|
3932
|
-
"target_health_state.unhealthy.draining_interval_seconds": "0"
|
|
3946
|
+
"target_health_state.unhealthy.draining_interval_seconds": "0",
|
|
3947
|
+
"preserve_client_ip.enabled": "true"
|
|
3933
3948
|
},
|
|
3934
3949
|
TCP_UDP: {
|
|
3935
3950
|
"stickiness.type": "source_ip",
|
|
3936
3951
|
"deregistration_delay.connection_termination.enabled": "true",
|
|
3937
3952
|
"proxy_protocol_v2.enabled": "false",
|
|
3938
3953
|
"target_health_state.unhealthy.connection_termination.enabled": "true",
|
|
3939
|
-
"target_health_state.unhealthy.draining_interval_seconds": "0"
|
|
3954
|
+
"target_health_state.unhealthy.draining_interval_seconds": "0",
|
|
3955
|
+
"preserve_client_ip.enabled": "true"
|
|
3940
3956
|
}
|
|
3941
3957
|
};
|
|
3942
3958
|
const ELB_TG_ATTRIBUTE_DEFAULTS_BY_TARGET_TYPE = {
|
|
@@ -5798,30 +5814,62 @@ function canonicalizeBaselineForCompare(v, resourceType, path) {
|
|
|
5798
5814
|
//#region src/normalize/stack-tags.ts
|
|
5799
5815
|
const declaredTagKeys = (declared) => {
|
|
5800
5816
|
const out = /* @__PURE__ */ new Set();
|
|
5801
|
-
const
|
|
5802
|
-
|
|
5803
|
-
const
|
|
5804
|
-
|
|
5805
|
-
|
|
5817
|
+
const collect = (tags) => {
|
|
5818
|
+
if (!Array.isArray(tags)) return;
|
|
5819
|
+
for (const t of tags) {
|
|
5820
|
+
const k = t?.Key;
|
|
5821
|
+
if (typeof k === "string") out.add(k);
|
|
5822
|
+
}
|
|
5823
|
+
};
|
|
5824
|
+
const d = declared;
|
|
5825
|
+
collect(d?.Tags);
|
|
5826
|
+
const specs = d?.TagSpecifications;
|
|
5827
|
+
if (Array.isArray(specs)) for (const spec of specs) collect(spec?.Tags);
|
|
5806
5828
|
return out;
|
|
5807
5829
|
};
|
|
5808
5830
|
const subtractPropagatedStackTags = (live, stackTags, declaredKeys) => {
|
|
5809
5831
|
if (Object.keys(stackTags).length === 0) return live;
|
|
5810
|
-
const
|
|
5811
|
-
if (!Array.isArray(tags)) return live;
|
|
5812
|
-
const filtered = tags.filter((t) => {
|
|
5832
|
+
const keepTag = (t) => {
|
|
5813
5833
|
if (!t || typeof t !== "object") return true;
|
|
5814
5834
|
const key = t.Key;
|
|
5815
5835
|
const value = t.Value;
|
|
5816
5836
|
if (typeof key !== "string") return true;
|
|
5817
5837
|
if (declaredKeys.has(key)) return true;
|
|
5818
5838
|
return !(key in stackTags && stackTags[key] === value);
|
|
5819
|
-
});
|
|
5820
|
-
if (filtered.length === tags.length) return live;
|
|
5821
|
-
return {
|
|
5822
|
-
...live,
|
|
5823
|
-
Tags: filtered
|
|
5824
5839
|
};
|
|
5840
|
+
let out = live;
|
|
5841
|
+
const tags = live.Tags;
|
|
5842
|
+
if (Array.isArray(tags)) {
|
|
5843
|
+
const filtered = tags.filter(keepTag);
|
|
5844
|
+
if (filtered.length !== tags.length) out = {
|
|
5845
|
+
...out,
|
|
5846
|
+
Tags: filtered
|
|
5847
|
+
};
|
|
5848
|
+
}
|
|
5849
|
+
const specs = out.TagSpecifications;
|
|
5850
|
+
if (Array.isArray(specs)) {
|
|
5851
|
+
let changed = false;
|
|
5852
|
+
const filteredSpecs = specs.map((spec) => {
|
|
5853
|
+
const specTags = spec?.Tags;
|
|
5854
|
+
if (!Array.isArray(specTags)) return spec;
|
|
5855
|
+
const filtered = specTags.filter(keepTag);
|
|
5856
|
+
if (filtered.length === specTags.length) return spec;
|
|
5857
|
+
changed = true;
|
|
5858
|
+
return {
|
|
5859
|
+
...spec,
|
|
5860
|
+
Tags: filtered
|
|
5861
|
+
};
|
|
5862
|
+
}).filter((spec) => {
|
|
5863
|
+
const specTags = spec?.Tags;
|
|
5864
|
+
return !(Array.isArray(specTags) && specTags.length === 0);
|
|
5865
|
+
});
|
|
5866
|
+
if (changed || filteredSpecs.length !== specs.length) {
|
|
5867
|
+
out = { ...out };
|
|
5868
|
+
if (filteredSpecs.length === 0) delete out.TagSpecifications;
|
|
5869
|
+
else out.TagSpecifications = filteredSpecs;
|
|
5870
|
+
}
|
|
5871
|
+
}
|
|
5872
|
+
return out;
|
|
5825
5873
|
};
|
|
5826
5874
|
|
|
5827
5875
|
//#endregion
|
|
@@ -5920,8 +5968,8 @@ function elbAttributeDefaultsFor(resourceType, declared, live) {
|
|
|
5920
5968
|
const targetType = declared.TargetType ?? live.TargetType;
|
|
5921
5969
|
return {
|
|
5922
5970
|
...shared,
|
|
5923
|
-
...typeof
|
|
5924
|
-
...typeof
|
|
5971
|
+
...typeof targetType === "string" ? ELB_TG_ATTRIBUTE_DEFAULTS_BY_TARGET_TYPE[targetType] ?? {} : {},
|
|
5972
|
+
...typeof protocol === "string" ? ELB_TG_ATTRIBUTE_DEFAULTS_BY_PROTOCOL[protocol] ?? {} : {}
|
|
5925
5973
|
};
|
|
5926
5974
|
}
|
|
5927
5975
|
return shared;
|
|
@@ -19443,6 +19491,8 @@ const CC_REVERTABLE_DESPITE_READ_OVERRIDE = new Set([
|
|
|
19443
19491
|
"AWS::EC2::EIP"
|
|
19444
19492
|
]);
|
|
19445
19493
|
const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
19494
|
+
"AWS::EC2::CapacityReservation\0InstanceMatchCriteria",
|
|
19495
|
+
"AWS::EC2::CapacityReservation\0EndDateType",
|
|
19446
19496
|
"AWS::DLM::LifecyclePolicy\0RetainInterval",
|
|
19447
19497
|
"AWS::DLM::LifecyclePolicy\0CreateInterval",
|
|
19448
19498
|
"AWS::IAM::Role\0MaxSessionDuration",
|
|
@@ -19480,6 +19530,8 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
|
19480
19530
|
"AWS::ApiGateway::RestApi\0DisableExecuteApiEndpoint",
|
|
19481
19531
|
"AWS::Cognito::UserPoolClient\0RefreshTokenValidity",
|
|
19482
19532
|
"AWS::RUM::AppMonitor\0CustomEvents",
|
|
19533
|
+
"AWS::RUM::AppMonitor\0AppMonitorConfiguration",
|
|
19534
|
+
"AWS::GuardDuty::Filter\0Action",
|
|
19483
19535
|
"AWS::ServiceCatalog::TagOption\0Active",
|
|
19484
19536
|
"AWS::VpcLattice::ResourceConfiguration\0AllowAssociationToSharableServiceNetwork",
|
|
19485
19537
|
"AWS::Backup::RestoreTestingPlan\0StartWindowHours",
|