cdk-real-drift 0.3.14 → 0.4.1

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/README.md CHANGED
@@ -698,6 +698,11 @@ covers them. **If you never run `revert`, cdkrd needs no write permissions at al
698
698
  `ses:DescribeReceiptRuleSet`, `ses:DescribeReceiptRule`, `ses:ListReceiptFilters`
699
699
  (the SES inbound receipt-rule family — `ReceiptRuleSet` / `ReceiptRule` /
700
700
  `ReceiptFilter` — has no Cloud Control handlers),
701
+ `acm:DescribeCertificate` + `acm:ListTagsForCertificate` (read an
702
+ `AWS::CertificateManager::Certificate` — the ACM registry type ships no Cloud
703
+ Control read handler, so every cert was silently skipped, including an
704
+ out-of-band `Options.CertificateTransparencyLoggingPreference` flip or an
705
+ out-of-band deletion of a cert an ALB / CloudFront / API domain still references),
701
706
  `glue:GetTable`, `logs:DescribeMetricFilters`, `scheduler:GetSchedule`,
702
707
  `cloudwatch:DescribeAnomalyDetectors` (reads an
703
708
  `AWS::CloudWatch::AnomalyDetector` — NON_PROVISIONABLE, no Cloud Control
package/dist/cli.js CHANGED
@@ -21,6 +21,7 @@ import { DescribeEventBusCommand, EventBridgeClient, ListRulesCommand, PutPermis
21
21
  import { GetPolicyCommand, LambdaClient, ListAliasesCommand as ListAliasesCommand$1, ListEventSourceMappingsCommand, ListFunctionUrlConfigsCommand, ListVersionsByFunctionCommand } from "@aws-sdk/client-lambda";
22
22
  import { DescribeDBClustersCommand, DescribeDBInstancesCommand, RDSClient } from "@aws-sdk/client-rds";
23
23
  import { GetTopicAttributesCommand, ListSubscriptionsByTopicCommand, SNSClient, SetTopicAttributesCommand } from "@aws-sdk/client-sns";
24
+ import { ACMClient, DescribeCertificateCommand, ListTagsForCertificateCommand } from "@aws-sdk/client-acm";
24
25
  import { BudgetsClient, DescribeBudgetCommand } from "@aws-sdk/client-budgets";
25
26
  import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
26
27
  import { CognitoSyncClient, GetCognitoEventsCommand, SetCognitoEventsCommand } from "@aws-sdk/client-cognito-sync";
@@ -8296,7 +8297,36 @@ const readSesReceiptFilter = async ({ physicalId, declared, region }) => {
8296
8297
  } }
8297
8298
  } };
8298
8299
  };
8300
+ const ACM_DEFAULT_TRANSPARENCY = "ENABLED";
8301
+ const readAcmCertificate = async ({ physicalId, declared, region }) => {
8302
+ const arn = str$1(physicalId);
8303
+ if (!arn || !arn.startsWith("arn:")) return void 0;
8304
+ const c = new ACMClient({
8305
+ region,
8306
+ ...READ_RETRY
8307
+ });
8308
+ const cert = (await c.send(new DescribeCertificateCommand({ CertificateArn: arn }))).Certificate;
8309
+ if (!cert) return void 0;
8310
+ const model = {};
8311
+ if (str$1(cert.DomainName)) model.DomainName = cert.DomainName;
8312
+ if (str$1(cert.KeyAlgorithm)) model.KeyAlgorithm = cert.KeyAlgorithm;
8313
+ const declaresSans = Array.isArray(declared.SubjectAlternativeNames) && declared.SubjectAlternativeNames.length > 0;
8314
+ const sans = (cert.SubjectAlternativeNames ?? []).filter((s) => str$1(s) !== void 0);
8315
+ if (declaresSans && sans.length > 0) model.SubjectAlternativeNames = sans;
8316
+ const pref = str$1(cert.Options?.CertificateTransparencyLoggingPreference);
8317
+ const declaresOptions = declared.Options !== void 0 && declared.Options !== null && typeof declared.Options === "object";
8318
+ if (pref && (declaresOptions || pref !== ACM_DEFAULT_TRANSPARENCY)) model.Options = { CertificateTransparencyLoggingPreference: pref };
8319
+ try {
8320
+ const tags = ((await c.send(new ListTagsForCertificateCommand({ CertificateArn: arn }))).Tags ?? []).filter((tag) => str$1(tag.Key) !== void 0).map((tag) => ({
8321
+ Key: tag.Key,
8322
+ Value: tag.Value ?? ""
8323
+ }));
8324
+ if (tags.length > 0) model.Tags = tags;
8325
+ } catch {}
8326
+ return model;
8327
+ };
8299
8328
  const SDK_OVERRIDES = {
8329
+ "AWS::CertificateManager::Certificate": readAcmCertificate,
8300
8330
  "AWS::SES::ReceiptRuleSet": readSesReceiptRuleSet,
8301
8331
  "AWS::SES::ReceiptRule": readSesReceiptRule,
8302
8332
  "AWS::SES::ReceiptFilter": readSesReceiptFilter,
@@ -11847,9 +11877,24 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
11847
11877
  "AWS::RolesAnywhere::Profile\0AttributeMappings",
11848
11878
  "AWS::EC2::Subnet\0AssignIpv6AddressOnCreation",
11849
11879
  "AWS::EC2::Subnet\0PrivateDnsNameOptionsOnLaunch",
11850
- "AWS::EC2::Subnet\0EnableDns64"
11880
+ "AWS::EC2::Subnet\0EnableDns64",
11881
+ "AWS::EC2::ClientVpnEndpoint\0VpnPort",
11882
+ "AWS::EC2::ClientVpnEndpoint\0DisconnectOnSessionTimeout",
11883
+ "AWS::EC2::ClientVpnEndpoint\0SplitTunnel",
11884
+ "AWS::DocDB::DBCluster\0Port",
11885
+ "AWS::DocDB::DBCluster\0BackupRetentionPeriod",
11886
+ "AWS::DocDB::DBCluster\0DeletionProtection",
11887
+ "AWS::DocDB::DBInstance\0CACertificateIdentifier",
11888
+ "AWS::OpenSearchService::Domain\0SnapshotOptions",
11889
+ "AWS::OpenSearchService::Domain\0AdvancedOptions",
11890
+ "AWS::OpenSearchService::Domain\0IPAddressType",
11891
+ "AWS::OpenSearchService::Domain\0DeploymentStrategyOptions"
11851
11892
  ]);
11852
- const REVERT_SET_DEFAULT_VALUES = { "AWS::EC2::Subnet\0EnableDns64": false };
11893
+ const REVERT_SET_DEFAULT_VALUES = {
11894
+ "AWS::EC2::Subnet\0EnableDns64": false,
11895
+ "AWS::EC2::ClientVpnEndpoint\0SplitTunnel": false,
11896
+ "AWS::DocDB::DBCluster\0DeletionProtection": false
11897
+ };
11853
11898
  /**
11854
11899
  * A nested undeclared value (a live sub-key inside a declared object, R96/R98) — a dotted
11855
11900
  * path (`Conf.Destination`) or an identity-keyed array element (`Prop[<id>].sub`). Pure +