@intentius/chant-lexicon-aws 0.124.30 → 0.124.32
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/actions/dynamodb.js +41 -0
- package/dist/actions/ecr.js +9 -0
- package/dist/actions/ecs.js +5 -0
- package/dist/actions/iam.js +3 -0
- package/dist/actions/index.js +9 -0
- package/dist/actions/lambda.js +11 -0
- package/dist/actions/logs.js +4 -0
- package/dist/actions/s3.js +40 -0
- package/dist/actions/sns.js +5 -0
- package/dist/actions/sqs.js +15 -0
- package/dist/agentcore/trace-fetch.d.ts.map +1 -1
- package/dist/agentcore/trace-fetch.js +472 -0
- package/dist/agentcore/trace-render.js +359 -0
- package/dist/ambient.js +148 -0
- package/dist/api/credential-chain.d.ts +30 -3
- package/dist/api/credential-chain.d.ts.map +1 -1
- package/dist/api/credential-chain.js +509 -0
- package/dist/api/read-client.d.ts +16 -43
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/api/read-client.js +458 -0
- package/dist/api/sigv4.d.ts +4 -4
- package/dist/api/sigv4.js +185 -0
- package/dist/behaviour-kinds.js +114 -0
- package/dist/caller-identity.d.ts +3 -5
- package/dist/caller-identity.d.ts.map +1 -1
- package/dist/caller-identity.js +146 -0
- package/dist/codegen/docs-cli.js +2 -0
- package/dist/codegen/docs.js +120 -0
- package/dist/codegen/enum-overlay.js +162 -0
- package/dist/codegen/extensions.js +139 -0
- package/dist/codegen/fallback.js +32 -0
- package/dist/codegen/generate-cli.js +15 -0
- package/dist/codegen/generate-lexicon.js +70 -0
- package/dist/codegen/generate-typescript.js +226 -0
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/generate.js +234 -0
- package/dist/codegen/naming.js +135 -0
- package/dist/codegen/package.js +67 -0
- package/dist/codegen/patches.d.ts +26 -1
- package/dist/codegen/patches.d.ts.map +1 -1
- package/dist/codegen/patches.js +90 -0
- package/dist/codegen/property-overlay.js +85 -0
- package/dist/codegen/property-overlay.json +1 -16
- package/dist/codegen/sam.js +402 -0
- package/dist/codegen/typecheck.js +4 -0
- package/dist/codegen/versions.js +31 -0
- package/dist/components/__tests__/mock-cloud-executor.js +326 -0
- package/dist/components/apply.d.ts +44 -1
- package/dist/components/apply.d.ts.map +1 -1
- package/dist/components/apply.js +752 -0
- package/dist/components/builders.js +37 -0
- package/dist/components/capability-plugin.js +66 -0
- package/dist/components/cloud-executor.d.ts +35 -0
- package/dist/components/cloud-executor.d.ts.map +1 -1
- package/dist/components/cloud-executor.js +576 -0
- package/dist/components/config-bom.js +207 -0
- package/dist/components/host-delivery.js +117 -0
- package/dist/components/index.js +18 -0
- package/dist/components/job-submission.js +77 -0
- package/dist/components/publish.js +234 -0
- package/dist/components/safety.js +62 -0
- package/dist/components/wait-aws.js +68 -0
- package/dist/composites/agentcore-agent.js +187 -0
- package/dist/composites/agentcore-trust-policy.js +13 -0
- package/dist/composites/alb-shared.js +84 -0
- package/dist/composites/bucket-deployment.js +93 -0
- package/dist/composites/catalog.js +2714 -0
- package/dist/composites/dynamodb-table.js +66 -0
- package/dist/composites/ec2-instance-bundle.js +75 -0
- package/dist/composites/ec2-instance-role.js +26 -0
- package/dist/composites/ecr-repository.js +64 -0
- package/dist/composites/ecs-trust-policy.js +10 -0
- package/dist/composites/efs-with-access-point.js +44 -0
- package/dist/composites/eks-cluster.js +118 -0
- package/dist/composites/fargate-alb.js +216 -0
- package/dist/composites/fargate-service.js +222 -0
- package/dist/composites/index.js +28 -0
- package/dist/composites/lambda-api.js +15 -0
- package/dist/composites/lambda-dynamodb.js +77 -0
- package/dist/composites/lambda-eventbridge.js +27 -0
- package/dist/composites/lambda-function.js +54 -0
- package/dist/composites/lambda-s3.js +93 -0
- package/dist/composites/lambda-sns.js +23 -0
- package/dist/composites/lambda-sqs.js +34 -0
- package/dist/composites/landing-zone.js +82 -0
- package/dist/composites/microvm-app.js +293 -0
- package/dist/composites/minimal-vpc.js +40 -0
- package/dist/composites/monitoring-stack.js +105 -0
- package/dist/composites/nlb-service.js +61 -0
- package/dist/composites/rds-instance.js +98 -0
- package/dist/composites/scheduled-lambda.js +28 -0
- package/dist/composites/solr-fargate-service.js +33 -0
- package/dist/composites/step-functions-workflow.js +78 -0
- package/dist/composites/vpc-default.js +132 -0
- package/dist/condition.js +43 -0
- package/dist/coverage.js +4 -0
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/deep-observe.js +709 -0
- package/dist/deep-topology.js +226 -0
- package/dist/default-tags.js +50 -0
- package/dist/defaults.js +85 -0
- package/dist/dependencies.js +269 -0
- package/dist/detect.js +21 -0
- package/dist/disruption.d.ts.map +1 -1
- package/dist/disruption.js +129 -0
- package/dist/effect-receipt-row.js +107 -0
- package/dist/generated/index.d.ts +1297 -82
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +12382 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +131 -0
- package/dist/identity-observe.d.ts.map +1 -1
- package/dist/identity-observe.js +127 -0
- package/dist/import/generator.js +757 -0
- package/dist/import/live-export.js +34 -0
- package/dist/import/parser.js +394 -0
- package/dist/index.js +69 -0
- package/dist/integrity.json +6 -6
- package/dist/intrinsics.js +393 -0
- package/dist/lint/audit-catalog.js +87 -0
- package/dist/lint/audit-lineage.js +150 -0
- package/dist/lint/post-synth/cf-refs.js +247 -0
- package/dist/lint/post-synth/cor020.js +60 -0
- package/dist/lint/post-synth/ext001.d.ts.map +1 -1
- package/dist/lint/post-synth/ext001.js +197 -0
- package/dist/lint/post-synth/index.js +124 -0
- package/dist/lint/post-synth/waw010.js +41 -0
- package/dist/lint/post-synth/waw011.js +41 -0
- package/dist/lint/post-synth/waw013.js +38 -0
- package/dist/lint/post-synth/waw014.js +42 -0
- package/dist/lint/post-synth/waw015.js +88 -0
- package/dist/lint/post-synth/waw016.d.ts.map +1 -1
- package/dist/lint/post-synth/waw016.js +116 -0
- package/dist/lint/post-synth/waw017.js +43 -0
- package/dist/lint/post-synth/waw018.js +61 -0
- package/dist/lint/post-synth/waw019.js +64 -0
- package/dist/lint/post-synth/waw020.js +56 -0
- package/dist/lint/post-synth/waw021.js +44 -0
- package/dist/lint/post-synth/waw022.js +36 -0
- package/dist/lint/post-synth/waw023.js +40 -0
- package/dist/lint/post-synth/waw024.js +46 -0
- package/dist/lint/post-synth/waw025.js +36 -0
- package/dist/lint/post-synth/waw026.js +38 -0
- package/dist/lint/post-synth/waw027.js +41 -0
- package/dist/lint/post-synth/waw028.js +39 -0
- package/dist/lint/post-synth/waw029.js +54 -0
- package/dist/lint/post-synth/waw030.js +282 -0
- package/dist/lint/post-synth/waw031.js +58 -0
- package/dist/lint/post-synth/waw032.js +45 -0
- package/dist/lint/post-synth/waw033.js +75 -0
- package/dist/lint/post-synth/waw034.js +52 -0
- package/dist/lint/post-synth/waw035.js +56 -0
- package/dist/lint/post-synth/waw036.js +79 -0
- package/dist/lint/post-synth/waw037.js +67 -0
- package/dist/lint/post-synth/waw038.js +42 -0
- package/dist/lint/post-synth/waw039.js +42 -0
- package/dist/lint/post-synth/waw040.js +45 -0
- package/dist/lint/post-synth/waw041.js +40 -0
- package/dist/lint/post-synth/waw042.js +99 -0
- package/dist/lint/post-synth/waw043.js +51 -0
- package/dist/lint/post-synth/waw044.js +64 -0
- package/dist/lint/post-synth/waw045.js +49 -0
- package/dist/lint/post-synth/waw046.js +52 -0
- package/dist/lint/post-synth/waw047.js +43 -0
- package/dist/lint/post-synth/waw048.js +40 -0
- package/dist/lint/post-synth/waw049.js +78 -0
- package/dist/lint/post-synth/waw050.js +44 -0
- package/dist/lint/post-synth/waw051.js +41 -0
- package/dist/lint/post-synth/waw052.js +43 -0
- package/dist/lint/post-synth/waw053.js +43 -0
- package/dist/lint/post-synth/waw054.js +41 -0
- package/dist/lint/post-synth/waw055.js +41 -0
- package/dist/lint/post-synth/waw056.js +65 -0
- package/dist/lint/post-synth/waw057.js +43 -0
- package/dist/lint/post-synth/waw058.js +61 -0
- package/dist/lint/post-synth/waw059.js +338 -0
- package/dist/lint/post-synth/waw060.js +83 -0
- package/dist/lint/post-synth/waw061.js +60 -0
- package/dist/lint/post-synth/waw062.js +0 -0
- package/dist/lint/post-synth/waw063.js +0 -0
- package/dist/lint/post-synth/waw064.js +45 -0
- package/dist/lint/post-synth/waw065.js +104 -0
- package/dist/lint/post-synth/waw066.js +145 -0
- package/dist/lint/post-synth/waw067.js +115 -0
- package/dist/lint/post-synth/waw068.js +69 -0
- package/dist/lint/post-synth/waw069.js +0 -0
- package/dist/lint/rules/hardcoded-region.js +38 -0
- package/dist/lint/rules/iam-wildcard.js +60 -0
- package/dist/lint/rules/index.js +6 -0
- package/dist/lint/rules/s3-encryption.js +60 -0
- package/dist/live-attrs.js +42 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +18 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +66 -0
- package/dist/manifest.json +1 -1
- package/dist/mapping.js +33 -0
- package/dist/meta.json +17359 -784
- package/dist/nested-stack.js +95 -0
- package/dist/okf/index.md +203 -0
- package/dist/okf/rules/EXT001.md +1 -0
- package/dist/okf/rules/WAW016.md +2 -0
- package/dist/okf/rules/WAW019.md +1 -0
- package/dist/okf/rules/WAW028.md +1 -0
- package/dist/okf/rules/WAW030.md +2 -0
- package/dist/okf/rules/WAW039.md +1 -0
- package/dist/okf/rules/WAW049.md +1 -0
- package/dist/okf/rules/WAW056.md +1 -0
- package/dist/okf/rules/WAW058.md +1 -0
- package/dist/okf/rules/WAW062.md +1 -0
- package/dist/okf/rules/WAW064.md +1 -0
- package/dist/okf/rules/WAW065.md +1 -0
- package/dist/okf/rules/WAW066.md +1 -0
- package/dist/okf/rules/WAW067.md +1 -0
- package/dist/okf/rules/WAW068.md +1 -0
- package/dist/okf/rules/WAW069.md +4 -0
- package/dist/okf/types/AIWorkloadConfig.md +23 -0
- package/dist/okf/types/ARCRegionSwitchPlan.md +1 -0
- package/dist/okf/types/AccountAccessApplication.md +28 -0
- package/dist/okf/types/AccountAccessEntitlement.md +22 -0
- package/dist/okf/types/ActionTarget.md +20 -0
- package/dist/okf/types/AdConfiguration.md +21 -0
- package/dist/okf/types/Adapter.md +26 -0
- package/dist/okf/types/AgentContext.md +35 -0
- package/dist/okf/types/AgentGoal.md +31 -0
- package/dist/okf/types/AgentProfile.md +34 -0
- package/dist/okf/types/Alarm.md +3 -1
- package/dist/okf/types/AlarmModel.md +14 -9
- package/dist/okf/types/AmplifyWebhook.md +25 -0
- package/dist/okf/types/ApiCache.md +8 -8
- package/dist/okf/types/ApiGatewayManagedOverrides.md +5 -5
- package/dist/okf/types/AppAuthorization.md +35 -0
- package/dist/okf/types/AppBlockBuilder.md +1 -0
- package/dist/okf/types/AppInstance.md +2 -2
- package/dist/okf/types/AppInstanceBot.md +2 -2
- package/dist/okf/types/AppStreamFleet.md +3 -2
- package/dist/okf/types/AppSyncApiKey.md +6 -6
- package/dist/okf/types/AppSyncType.md +22 -0
- package/dist/okf/types/ApplicationStatusCheck.md +36 -0
- package/dist/okf/types/ApplicationVersion.md +4 -1
- package/dist/okf/types/ApplicationsList.md +26 -0
- package/dist/okf/types/ApprovalPolicy.md +28 -0
- package/dist/okf/types/ArchiveRule.md +24 -0
- package/dist/okf/types/Asset.md +30 -0
- package/dist/okf/types/Backup.md +31 -0
- package/dist/okf/types/BedrockAgentCoreDataset.md +1 -1
- package/dist/okf/types/BedrockAgentCoreGateway.md +3 -0
- package/dist/okf/types/BedrockSession.md +28 -0
- package/dist/okf/types/BillEstimate.md +35 -0
- package/dist/okf/types/Brand.md +32 -0
- package/dist/okf/types/CallAnalyticsCategory.md +25 -0
- package/dist/okf/types/Campaign.md +28 -0
- package/dist/okf/types/CapacityProvider.md +30 -0
- package/dist/okf/types/Case.md +24 -0
- package/dist/okf/types/CertificateAssociation.md +13 -0
- package/dist/okf/types/ChangeSet.md +36 -0
- package/dist/okf/types/ChannelFlow.md +29 -0
- package/dist/okf/types/ChimeChannel.md +39 -0
- package/dist/okf/types/Classifier.md +6 -6
- package/dist/okf/types/ClientVpnAuthorizationRule.md +6 -6
- package/dist/okf/types/ClientVpnEndpoint.md +2 -0
- package/dist/okf/types/ClientVpnRoute.md +5 -5
- package/dist/okf/types/CloudConnector.md +29 -0
- package/dist/okf/types/Cluster.md +39 -0
- package/dist/okf/types/ClusterSchedulerConfig.md +30 -0
- package/dist/okf/types/CodeCommitRepository.md +12 -12
- package/dist/okf/types/CodeConnectionsHost.md +26 -0
- package/dist/okf/types/CodeRepository.md +5 -5
- package/dist/okf/types/CompositeAlarm.md +1 -0
- package/dist/okf/types/ComputeEnvironment.md +2 -0
- package/dist/okf/types/ComputeNodeGroup.md +1 -1
- package/dist/okf/types/ComputeQuota.md +34 -0
- package/dist/okf/types/ConfigRule.md +1 -1
- package/dist/okf/types/ConfigurationRecorder.md +7 -6
- package/dist/okf/types/ConnectAttachment.md +2 -0
- package/dist/okf/types/ConnectQueue.md +5 -1
- package/dist/okf/types/ConnectVocabulary.md +28 -0
- package/dist/okf/types/ConnectionType.md +24 -0
- package/dist/okf/types/ConsentPortal.md +33 -0
- package/dist/okf/types/ContactMethod.md +29 -0
- package/dist/okf/types/ContainerAssociation.md +26 -0
- package/dist/okf/types/ContainerFleet.md +1 -1
- package/dist/okf/types/ContainerGroupDefinition.md +1 -1
- package/dist/okf/types/Content.md +40 -0
- package/dist/okf/types/ContentAssociation.md +28 -0
- package/dist/okf/types/CustomDetectionRuleAssociation.md +28 -0
- package/dist/okf/types/CustomEntityType.md +4 -9
- package/dist/okf/types/Customization.md +22 -0
- package/dist/okf/types/CwIntegration.md +31 -0
- package/dist/okf/types/DAXParameterGroup.md +3 -8
- package/dist/okf/types/DAXSubnetGroup.md +0 -5
- package/dist/okf/types/DBClusterEndpoint.md +31 -0
- package/dist/okf/types/DBProxyTargetGroup.md +1 -0
- package/dist/okf/types/DBSnapshot.md +62 -0
- package/dist/okf/types/DLMLifecyclePolicy.md +12 -12
- package/dist/okf/types/DLPSetting.md +31 -0
- package/dist/okf/types/DMSInstanceProfile.md +1 -1
- package/dist/okf/types/DRSLaunchConfigurationTemplate.md +28 -0
- package/dist/okf/types/Daemon.md +1 -0
- package/dist/okf/types/DataExchangeDataSet.md +29 -0
- package/dist/okf/types/DataIntegrationFlow.md +27 -0
- package/dist/okf/types/DataMigration.md +1 -1
- package/dist/okf/types/DataProvider.md +2 -1
- package/dist/okf/types/DataQualityRuleset.md +6 -11
- package/dist/okf/types/DataSource.md +23 -0
- package/dist/okf/types/Dataset.md +20 -0
- package/dist/okf/types/DatasetIntegration.md +23 -0
- package/dist/okf/types/DbCluster.md +1 -1
- package/dist/okf/types/DbInstance.md +8 -2
- package/dist/okf/types/DeadlineBudget.md +29 -0
- package/dist/okf/types/DelegationSet.md +23 -0
- package/dist/okf/types/DeliveryChannel.md +6 -11
- package/dist/okf/types/DevOpsAgentAgentSpace.md +4 -0
- package/dist/okf/types/DevOpsAgentService.md +1 -0
- package/dist/okf/types/DevOpsAgentTrigger.md +28 -0
- package/dist/okf/types/DirectConnectGatewayAttachment.md +2 -0
- package/dist/okf/types/Directory.md +60 -0
- package/dist/okf/types/DocDBDBClusterParameterGroup.md +5 -10
- package/dist/okf/types/DocDBDBSubnetGroup.md +4 -9
- package/dist/okf/types/DocDBElasticClusterSnapshot.md +36 -0
- package/dist/okf/types/DocumentClassifierEndpoint.md +27 -0
- package/dist/okf/types/Domain.md +27 -0
- package/dist/okf/types/EKSCertificateAuthority.md +42 -0
- package/dist/okf/types/EKSCluster.md +8 -0
- package/dist/okf/types/EcSnapshot.md +66 -0
- package/dist/okf/types/EmailIdentityCertificate.md +15 -0
- package/dist/okf/types/EndpointConfig.md +14 -13
- package/dist/okf/types/EntityRecognizer.md +27 -0
- package/dist/okf/types/EntityRecognizerEndpoint.md +31 -0
- package/dist/okf/types/EnvironmentEC2.md +13 -13
- package/dist/okf/types/EvaluationForm.md +1 -0
- package/dist/okf/types/Evaluator.md +6 -2
- package/dist/okf/types/EventAction.md +26 -0
- package/dist/okf/types/EventRule.md +2 -0
- package/dist/okf/types/EventSource.md +30 -0
- package/dist/okf/types/EventTracker.md +22 -0
- package/dist/okf/types/EventsV2EventBus.md +28 -0
- package/dist/okf/types/EventsV2ResourcePolicy.md +19 -0
- package/dist/okf/types/EventsV2Subscriber.md +39 -0
- package/dist/okf/types/ExperimentDefinition.md +39 -0
- package/dist/okf/types/ExperimentRun.md +33 -0
- package/dist/okf/types/ExperimentTrialComponent.md +13 -11
- package/dist/okf/types/FHIRDatastore.md +3 -0
- package/dist/okf/types/FSxSnapshot.md +5 -5
- package/dist/okf/types/FSxVolume.md +9 -9
- package/dist/okf/types/FeaturedResultsSet.md +26 -0
- package/dist/okf/types/Feed.md +1 -0
- package/dist/okf/types/FieldLevelEncryptionConfig.md +25 -0
- package/dist/okf/types/FieldLevelEncryptionProfile.md +22 -0
- package/dist/okf/types/FileCache.md +45 -0
- package/dist/okf/types/Filter.md +27 -0
- package/dist/okf/types/Firewall.md +6 -0
- package/dist/okf/types/FlowMediaStream.md +28 -0
- package/dist/okf/types/FlowOutput.md +1 -0
- package/dist/okf/types/FpgaImage.md +38 -0
- package/dist/okf/types/Function.md +2 -2
- package/dist/okf/types/Gateway.md +41 -0
- package/dist/okf/types/GatewayClusterAssociations.md +23 -0
- package/dist/okf/types/GatewayRateLimit.md +26 -0
- package/dist/okf/types/GatewayRule.md +32 -0
- package/dist/okf/types/GlobalReplicationGroup.md +3 -0
- package/dist/okf/types/GlobalResolver.md +1 -1
- package/dist/okf/types/GlobalTable.md +1 -0
- package/dist/okf/types/GlueConnection.md +5 -4
- package/dist/okf/types/GlueSecurityConfiguration.md +1 -6
- package/dist/okf/types/GlueSession.md +38 -0
- package/dist/okf/types/GlueTable.md +5 -10
- package/dist/okf/types/GlueWorkflow.md +5 -10
- package/dist/okf/types/Group.md +27 -0
- package/dist/okf/types/Harness.md +1 -0
- package/dist/okf/types/HostKey.md +33 -0
- package/dist/okf/types/HostedZone.md +1 -0
- package/dist/okf/types/HttpApi.md +2 -0
- package/dist/okf/types/HttpNamespace.md +5 -5
- package/dist/okf/types/HubV2.md +1 -0
- package/dist/okf/types/HumanTaskUi.md +22 -0
- package/dist/okf/types/IPv4Pool.md +28 -0
- package/dist/okf/types/ImageBuilder.md +1 -0
- package/dist/okf/types/ImageBuilderImage.md +1 -1
- package/dist/okf/types/ImagePipeline.md +1 -1
- package/dist/okf/types/InferenceComponent.md +5 -1
- package/dist/okf/types/InfluxDBBackup.md +65 -0
- package/dist/okf/types/InfluxDBCluster.md +3 -0
- package/dist/okf/types/InfrastructureConfiguration.md +2 -0
- package/dist/okf/types/IngestionDestination.md +28 -0
- package/dist/okf/types/InputSecurityGroup.md +6 -4
- package/dist/okf/types/InspectorV2Connector.md +38 -0
- package/dist/okf/types/InstanceEventWindow.md +25 -0
- package/dist/okf/types/InstanceFleetConfig.md +10 -10
- package/dist/okf/types/InstanceGroupConfig.md +3 -3
- package/dist/okf/types/InstrumentationConfig.md +31 -0
- package/dist/okf/types/IntegrationAssociation.md +3 -0
- package/dist/okf/types/IoTSiteWiseApplication.md +34 -0
- package/dist/okf/types/IoTSiteWiseDataset.md +5 -2
- package/dist/okf/types/IoTSiteWiseTask.md +24 -0
- package/dist/okf/types/IpamExternalResourceVerificationToken.md +35 -0
- package/dist/okf/types/IpamInternetRegistryAssociation.md +32 -0
- package/dist/okf/types/Job.md +35 -0
- package/dist/okf/types/JobTemplate.md +26 -0
- package/dist/okf/types/KinesisChannel.md +31 -0
- package/dist/okf/types/KinesisStream.md +1 -0
- package/dist/okf/types/LambdaResourcePolicy.md +14 -0
- package/dist/okf/types/Lexicon.md +34 -0
- package/dist/okf/types/LicenseAssetGroup.md +23 -0
- package/dist/okf/types/LicenseConfiguration.md +33 -0
- package/dist/okf/types/LicenseServerEndpoint.md +32 -0
- package/dist/okf/types/LightsailKeyPair.md +29 -0
- package/dist/okf/types/LimitsProfile.md +27 -0
- package/dist/okf/types/LocationAzureBlob.md +2 -1
- package/dist/okf/types/LocationObjectStorage.md +1 -0
- package/dist/okf/types/LogAlarm.md +2 -0
- package/dist/okf/types/MGNConnector.md +23 -0
- package/dist/okf/types/MGNLaunchConfigurationTemplate.md +37 -0
- package/dist/okf/types/MLTransform.md +15 -15
- package/dist/okf/types/MWAAServerlessWorkflow.md +3 -0
- package/dist/okf/types/ManagedNotificationAccountContactAssociation.md +1 -0
- package/dist/okf/types/ManagedNotificationAdditionalChannelAssociation.md +1 -0
- package/dist/okf/types/MediaConvertJobTemplate.md +11 -13
- package/dist/okf/types/MediaConvertQueue.md +8 -10
- package/dist/okf/types/MediaInsightsPipelineConfiguration.md +28 -0
- package/dist/okf/types/MediaLiveInput.md +41 -18
- package/dist/okf/types/MediaPackageV2Channel.md +3 -0
- package/dist/okf/types/MediaPackageV2OriginEndpoint.md +1 -0
- package/dist/okf/types/MediaPipelineKinesisVideoStreamPool.md +28 -0
- package/dist/okf/types/MediaTailorFunction.md +27 -0
- package/dist/okf/types/MedicalVocabulary.md +21 -0
- package/dist/okf/types/Member.md +26 -0
- package/dist/okf/types/Memory.md +6 -0
- package/dist/okf/types/MemoryDBSnapshot.md +29 -0
- package/dist/okf/types/Metric.md +59 -0
- package/dist/okf/types/MetricAttribution.md +23 -0
- package/dist/okf/types/MicrosoftAD.md +11 -11
- package/dist/okf/types/MigrationProject.md +8 -1
- package/dist/okf/types/Monitor.md +26 -0
- package/dist/okf/types/NFSFileShare.md +44 -0
- package/dist/okf/types/NeptuneGraphGraph.md +1 -0
- package/dist/okf/types/NetworkConnector.md +4 -0
- package/dist/okf/types/NetworkFlowMonitorScope.md +23 -0
- package/dist/okf/types/NetworkMigrationDefinition.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerDeployment.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerPolicy.md +32 -0
- package/dist/okf/types/NetworkSecurityManagerScope.md +29 -0
- package/dist/okf/types/NotebookInstance.md +18 -18
- package/dist/okf/types/NotebookInstanceLifecycleConfig.md +6 -5
- package/dist/okf/types/NotifyConfiguration.md +35 -0
- package/dist/okf/types/OTelEnrichment.md +2 -0
- package/dist/okf/types/OnlineEvaluationConfig.md +0 -1
- package/dist/okf/types/OrganizationConfigRule.md +7 -7
- package/dist/okf/types/Outpost.md +32 -0
- package/dist/okf/types/ParallelData.md +40 -0
- package/dist/okf/types/Partition.md +5 -5
- package/dist/okf/types/PaymentConnector.md +4 -1
- package/dist/okf/types/Pentest.md +1 -0
- package/dist/okf/types/PerfReports.md +28 -0
- package/dist/okf/types/PermissionAssociation.md +30 -0
- package/dist/okf/types/PersonalizeDataset.md +1 -0
- package/dist/okf/types/PersonalizeDatasetGroup.md +1 -0
- package/dist/okf/types/PersonalizeSchema.md +1 -0
- package/dist/okf/types/Pipeline.md +25 -0
- package/dist/okf/types/PlaybackConfiguration.md +1 -0
- package/dist/okf/types/PolicyAssociation.md +1 -1
- package/dist/okf/types/PolicyGrant.md +2 -2
- package/dist/okf/types/PolicyPrincipalAttachment.md +2 -7
- package/dist/okf/types/PortalProduct.md +24 -0
- package/dist/okf/types/PrefetchSchedule.md +25 -0
- package/dist/okf/types/PricingPlanManagerSubscription.md +31 -0
- package/dist/okf/types/PrincipalAssociation.md +27 -0
- package/dist/okf/types/PrivateDnsNamespace.md +8 -8
- package/dist/okf/types/PrivateVirtualInterface.md +1 -0
- package/dist/okf/types/ProcurementPortalPreference.md +45 -0
- package/dist/okf/types/Program.md +33 -0
- package/dist/okf/types/ProjectMembership.md +1 -1
- package/dist/okf/types/ProtocolsList.md +26 -0
- package/dist/okf/types/PublicDnsNamespace.md +7 -7
- package/dist/okf/types/PublicVirtualInterface.md +1 -0
- package/dist/okf/types/QEV2IdcApplication.md +25 -0
- package/dist/okf/types/QueryLoggingConfig.md +21 -0
- package/dist/okf/types/QuerySuggestionsBlockList.md +25 -0
- package/dist/okf/types/QuickSightAssignment.md +24 -0
- package/dist/okf/types/RAMResourceAssociation.md +27 -0
- package/dist/okf/types/RDSClusterSnapshot.md +54 -0
- package/dist/okf/types/RDSDBParameterGroup.md +5 -0
- package/dist/okf/types/RDSDeployment.md +41 -0
- package/dist/okf/types/RcsAgent.md +38 -0
- package/dist/okf/types/ReceiptRule.md +5 -5
- package/dist/okf/types/ReceiptRuleSet.md +1 -6
- package/dist/okf/types/RecommenderFilter.md +27 -0
- package/dist/okf/types/RecommenderSchema.md +25 -0
- package/dist/okf/types/RecordSet.md +16 -22
- package/dist/okf/types/RecoveryPlan.md +28 -0
- package/dist/okf/types/RedshiftIdcApplication.md +31 -0
- package/dist/okf/types/RedshiftSnapshot.md +59 -0
- package/dist/okf/types/RegistrationAttachment.md +28 -0
- package/dist/okf/types/Registry.md +41 -0
- package/dist/okf/types/RegistryRecord.md +38 -0
- package/dist/okf/types/RelatedItem.md +24 -0
- package/dist/okf/types/ReplicationConfigurationTemplate.md +35 -0
- package/dist/okf/types/ReplicationSubnetGroup.md +4 -9
- package/dist/okf/types/ReplicationTask.md +14 -14
- package/dist/okf/types/ReportGenerator.md +29 -0
- package/dist/okf/types/ReportGroup.md +1 -3
- package/dist/okf/types/ResilienceHubV2Policy.md +1 -0
- package/dist/okf/types/ResilienceHubV2Service.md +1 -0
- package/dist/okf/types/ResourceConfiguration.md +1 -1
- package/dist/okf/types/ResourceMetricsConfiguration.md +21 -0
- package/dist/okf/types/RestApi.md +1 -0
- package/dist/okf/types/RetrievalInstruction.md +32 -0
- package/dist/okf/types/RouterOutput.md +1 -0
- package/dist/okf/types/Rule.md +31 -0
- package/dist/okf/types/RunCache.md +29 -0
- package/dist/okf/types/Runtime.md +2 -1
- package/dist/okf/types/SCNInstance.md +33 -0
- package/dist/okf/types/SDBDomain.md +2 -2
- package/dist/okf/types/SMBFileShare.md +49 -0
- package/dist/okf/types/SageMakerArtifact.md +27 -0
- package/dist/okf/types/SageMakerEndpoint.md +0 -1
- package/dist/okf/types/ScalableTarget.md +1 -0
- package/dist/okf/types/ScalingPlan.md +6 -6
- package/dist/okf/types/ScheduledReport.md +31 -0
- package/dist/okf/types/SecondaryNetwork.md +26 -0
- package/dist/okf/types/SecurityAgentArtifact.md +25 -0
- package/dist/okf/types/SecurityAgentIntegration.md +31 -0
- package/dist/okf/types/Server.md +1 -0
- package/dist/okf/types/ServerlessCache.md +2 -0
- package/dist/okf/types/ServerlessCacheSnapshot.md +31 -0
- package/dist/okf/types/ServerlessRepoApplication.md +32 -0
- package/dist/okf/types/ServiceDiscoveryInstance.md +3 -7
- package/dist/okf/types/SipMediaApplication.md +27 -0
- package/dist/okf/types/SiteToSiteVpnAttachment.md +2 -0
- package/dist/okf/types/SnapshotCopyGrant.md +20 -0
- package/dist/okf/types/Solution.md +1 -0
- package/dist/okf/types/SourceAssociation.md +25 -0
- package/dist/okf/types/SourceCredential.md +6 -6
- package/dist/okf/types/SourceNetwork.md +23 -0
- package/dist/okf/types/StackFleetAssociation.md +2 -7
- package/dist/okf/types/StorageTierPolicy.md +20 -0
- package/dist/okf/types/StorageVirtualMachine.md +9 -9
- package/dist/okf/types/Stream.md +28 -0
- package/dist/okf/types/SubnetCidrReservation.md +26 -0
- package/dist/okf/types/SubscriptionProvider.md +26 -0
- package/dist/okf/types/SupportPermit.md +29 -0
- package/dist/okf/types/Table.md +2 -1
- package/dist/okf/types/TableOptimizer.md +5 -10
- package/dist/okf/types/Tape.md +31 -0
- package/dist/okf/types/Template.md +36 -0
- package/dist/okf/types/Tenant.md +2 -0
- package/dist/okf/types/Terminology.md +39 -0
- package/dist/okf/types/Thesaurus.md +25 -0
- package/dist/okf/types/ThingPrincipalAttachment.md +3 -8
- package/dist/okf/types/Topic.md +1 -0
- package/dist/okf/types/TopicRuleDestination.md +1 -0
- package/dist/okf/types/TrafficPolicy.md +26 -0
- package/dist/okf/types/TrafficPolicyInstance.md +28 -0
- package/dist/okf/types/TranscribeVocabulary.md +27 -0
- package/dist/okf/types/TransitGatewayRouteTableAttachment.md +2 -0
- package/dist/okf/types/TransitVirtualInterface.md +1 -0
- package/dist/okf/types/Tunnel.md +25 -0
- package/dist/okf/types/UsageLimit.md +26 -0
- package/dist/okf/types/UseCase.md +23 -0
- package/dist/okf/types/User.md +47 -0
- package/dist/okf/types/VPCEndpoint.md +1 -1
- package/dist/okf/types/VPCEndpointService.md +6 -0
- package/dist/okf/types/VPCPeeringConnection.md +2 -2
- package/dist/okf/types/VPNConcentrator.md +1 -1
- package/dist/okf/types/VPNConnection.md +1 -1
- package/dist/okf/types/VerifiedDestinationNumber.md +25 -0
- package/dist/okf/types/View.md +27 -0
- package/dist/okf/types/VoiceConnector.md +30 -0
- package/dist/okf/types/Volume.md +44 -0
- package/dist/okf/types/Vpc.md +1 -1
- package/dist/okf/types/VpcAttachment.md +2 -0
- package/dist/okf/types/WebFunction.md +27 -0
- package/dist/okf/types/WebFunctionEndpoint.md +44 -0
- package/dist/okf/types/WebFunctionRevision.md +32 -0
- package/dist/okf/types/WickrNetwork.md +27 -0
- package/dist/okf/types/Worker.md +29 -0
- package/dist/okf/types/Workforce.md +26 -0
- package/dist/okf/types/Workload.md +35 -0
- package/dist/okf/types/WorkloadEstimate.md +35 -0
- package/dist/okf/types/Workspace.md +28 -0
- package/dist/okf/types/Workteam.md +8 -8
- package/dist/op/activities/aws-apply.js +214 -0
- package/dist/op/activities/floci.js +97 -0
- package/dist/op/activities/index.js +32 -0
- package/dist/op/builders.js +50 -0
- package/dist/ownership.js +52 -0
- package/dist/package-cli.js +25 -0
- package/dist/parameter.js +19 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1006 -0
- package/dist/properties.js +166 -0
- package/dist/pseudo.js +25 -0
- package/dist/receipt-store.d.ts.map +1 -1
- package/dist/receipt-store.js +233 -0
- package/dist/reference-catalog.js +106 -0
- package/dist/rules/ext001.ts +3 -3
- package/dist/rules/waw016.ts +2 -2
- package/dist/serializer.js +529 -0
- package/dist/spec/fetch.js +193 -0
- package/dist/spec/parse.js +259 -0
- package/dist/spec/pin.js +185 -0
- package/dist/spec/pinned-types.json +203 -0
- package/dist/stack-errors.js +14 -0
- package/dist/taggable.d.ts.map +1 -1
- package/dist/taggable.js +33 -0
- package/dist/teardown.js +199 -0
- package/dist/template-sections.js +53 -0
- package/dist/template-transform.js +50 -0
- package/dist/types/index.d.ts +18847 -1124
- package/dist/validate-cli.js +16 -0
- package/dist/validate.js +33 -0
- package/package.json +9 -9
- package/src/agentcore/trace-fetch.ts +2 -1
- package/src/api/credential-chain.ts +119 -9
- package/src/api/credential-isolation.test.ts +72 -0
- package/src/api/read-client-chain.test.ts +159 -0
- package/src/api/read-client.ts +42 -6
- package/src/api/sigv4.ts +4 -4
- package/src/caller-identity.ts +3 -5
- package/src/codegen/any-budget.test.ts +12 -2
- package/src/codegen/generate.ts +9 -0
- package/src/codegen/package.ts +2 -2
- package/src/codegen/patches.test.ts +95 -0
- package/src/codegen/patches.ts +53 -9
- package/src/codegen/property-overlay.json +1 -16
- package/src/components/apply.ts +218 -6
- package/src/components/cfn-plan-floci.e2e.test.ts +76 -0
- package/src/components/cfn-plan.test.ts +225 -16
- package/src/components/cloud-executor.ts +73 -25
- package/src/deep-observe.ts +2 -1
- package/src/disruption.ts +2 -1
- package/src/generated/index.d.ts +18847 -1124
- package/src/generated/index.ts +1376 -161
- package/src/generated/lexicon-aws.json +17359 -784
- package/src/identity-observe.ts +2 -1
- package/src/lint/post-synth/ext001.ts +3 -3
- package/src/lint/post-synth/waw016.ts +2 -2
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/plugin.ts +2 -1
- package/src/receipt-store.ts +2 -1
- package/src/spec/pin.ts +3 -3
- package/src/spec/pinned-types.json +203 -0
- package/src/taggable.ts +2 -2
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS CloudFormation generation pipeline — uses core generatePipeline
|
|
3
|
+
* with AWS-specific fetch, parse, naming, and generation callbacks.
|
|
4
|
+
*/
|
|
5
|
+
import { generatePipeline, writeGeneratedArtifacts, } from "@intentius/chant/codegen/generate";
|
|
6
|
+
import { fetchSchemaZip } from "../spec/fetch.js";
|
|
7
|
+
import { assertPinnedSpec } from "../spec/pin.js";
|
|
8
|
+
import { parseCFNSchema, cfnShortName } from "../spec/parse.js";
|
|
9
|
+
import { fetchCfnLintPatches, applyPatches } from "./patches.js";
|
|
10
|
+
import { fetchCfnLintExtensions, loadExtensionSchemas } from "./extensions.js";
|
|
11
|
+
import { applyEnumOverlay, assertOverlayCoverage, enumOverlayByType, enumOverlayEntries, redundantOverlayWarnings, } from "./enum-overlay.js";
|
|
12
|
+
import { applyPropertyOverlay, assertPropertyOverlayCoverage, propertyOverlayByType, propertyOverlayEntries, redundantPropertyOverlayWarnings, } from "./property-overlay.js";
|
|
13
|
+
import { samResources } from "./sam.js";
|
|
14
|
+
import { fallbackResources } from "./fallback.js";
|
|
15
|
+
import { NamingStrategy, publishedNames, propertyTypeName, extractDefName } from "./naming.js";
|
|
16
|
+
import { generateLexiconJSON, lambdaRuntimeDeprecations } from "./generate-lexicon.js";
|
|
17
|
+
import { generateTypeScriptDeclarations } from "./generate-typescript.js";
|
|
18
|
+
import { generateRuntimeIndex as coreGenerateRuntimeIndex, } from "@intentius/chant/codegen/generate-runtime-index";
|
|
19
|
+
// AWS-specific state shared between pipeline callbacks
|
|
20
|
+
let awsConstraints = new Map();
|
|
21
|
+
/** chant #1459 — spec type → already-published TS name, reset per `generate()` call. */
|
|
22
|
+
let awsReservedNames = {};
|
|
23
|
+
/**
|
|
24
|
+
* Curated enum overlay state (chant #1497), reset per `generate()` call.
|
|
25
|
+
*
|
|
26
|
+
* The overlay runs in `parseSchema` rather than `augmentSchemas` on purpose:
|
|
27
|
+
* `augmentSchemas` is skipped for a caller-supplied schema set because it
|
|
28
|
+
* fetches, and the overlay fetches nothing. Running it per schema keeps a
|
|
29
|
+
* fixture-driven run and a real run on the same code path.
|
|
30
|
+
*/
|
|
31
|
+
let awsOverlay = new Map();
|
|
32
|
+
let awsOverlayApplications = [];
|
|
33
|
+
let awsOverlaySeenTypes = new Set();
|
|
34
|
+
let awsOverlayStrict = false;
|
|
35
|
+
/** Backfilled properties (chant #3953), reset per `generate()` call; strictness and seen types are shared with the enum overlay. */
|
|
36
|
+
let awsPropertyOverlay = new Map();
|
|
37
|
+
let awsPropertyOverlayApplications = [];
|
|
38
|
+
const awsPipelineConfig = {
|
|
39
|
+
fetchSchemas: async (opts) => {
|
|
40
|
+
const schemas = await fetchSchemaZip(opts.force);
|
|
41
|
+
// #1390 — the registry schema has no version in its URL and is republished
|
|
42
|
+
// constantly, so without this any prepack regenerates against whatever
|
|
43
|
+
// CloudFormation shipped that morning.
|
|
44
|
+
assertPinnedSpec(schemas);
|
|
45
|
+
return schemas;
|
|
46
|
+
},
|
|
47
|
+
parseSchema: (typeName, data) => {
|
|
48
|
+
awsOverlaySeenTypes.add(typeName);
|
|
49
|
+
// Properties first, so an enum overlay entry could name a backfilled one.
|
|
50
|
+
const backfilled = applyPropertyOverlay(data, awsPropertyOverlay.get(typeName) ?? []);
|
|
51
|
+
awsPropertyOverlayApplications.push(...backfilled.applications);
|
|
52
|
+
const entries = awsOverlay.get(typeName) ?? [];
|
|
53
|
+
const overlaid = applyEnumOverlay(typeName, backfilled.data, entries, { strict: awsOverlayStrict });
|
|
54
|
+
awsOverlayApplications.push(...overlaid.applications);
|
|
55
|
+
const result = parseCFNSchema(overlaid.data);
|
|
56
|
+
if (!result.resource.typeName)
|
|
57
|
+
return null;
|
|
58
|
+
return result;
|
|
59
|
+
},
|
|
60
|
+
createNaming: (results) => new NamingStrategy(results, awsReservedNames),
|
|
61
|
+
augmentSchemas: async (schemas, opts, log) => {
|
|
62
|
+
const warnings = [];
|
|
63
|
+
// Fetch and apply cfn-lint patches
|
|
64
|
+
try {
|
|
65
|
+
log("Fetching cfn-lint patches...");
|
|
66
|
+
const patchesDir = await fetchCfnLintPatches(opts.force);
|
|
67
|
+
const { schemas: patched, stats } = applyPatches(schemas, patchesDir);
|
|
68
|
+
schemas = patched;
|
|
69
|
+
log(`Applied ${stats.patchesApplied} patches across ${stats.resourcesFixed} resources`);
|
|
70
|
+
for (const s of stats.skipped) {
|
|
71
|
+
log(`Skipped known-stale patch ${s.stale.typeName}/${s.stale.patchFile}: ${s.stale.reason} (${s.error.message})`);
|
|
72
|
+
}
|
|
73
|
+
for (const w of stats.warnings) {
|
|
74
|
+
warnings.push({ file: `${w.typeName}/${w.patchFile}`, error: w.error.message });
|
|
75
|
+
}
|
|
76
|
+
for (const r of stats.retirable) {
|
|
77
|
+
warnings.push({
|
|
78
|
+
file: `${r.typeName}/${r.patchFile}`,
|
|
79
|
+
error: `listed in KNOWN_STALE_PATCHES (src/codegen/patches.ts) but did not fail; retire the entry`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
log(`WARNING: failed to fetch cfn-lint patches: ${err}`);
|
|
85
|
+
}
|
|
86
|
+
// Fetch extension constraints (stored for use in generateRegistry)
|
|
87
|
+
try {
|
|
88
|
+
log("Fetching cfn-lint extensions...");
|
|
89
|
+
const extensionsDir = await fetchCfnLintExtensions(opts.force);
|
|
90
|
+
// We'll apply these later in generateRegistry — store them
|
|
91
|
+
// The parsedTypes set isn't available yet, so we load all and filter later
|
|
92
|
+
awsConstraints = loadExtensionSchemas(extensionsDir, new Set(schemas.keys()));
|
|
93
|
+
log(`Loaded extension constraints for ${awsConstraints.size} resource types`);
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
log(`WARNING: failed to fetch cfn-lint extensions: ${err}`);
|
|
97
|
+
awsConstraints = new Map();
|
|
98
|
+
}
|
|
99
|
+
return { schemas, warnings };
|
|
100
|
+
},
|
|
101
|
+
augmentResults: (results, _opts, log) => {
|
|
102
|
+
const warnings = [];
|
|
103
|
+
// Add SAM resources
|
|
104
|
+
results.push(...samResources());
|
|
105
|
+
log("Added SAM resources");
|
|
106
|
+
// Add fallback resources for missing priority types
|
|
107
|
+
const parsedTypes = new Set(results.map((r) => r.resource.typeName));
|
|
108
|
+
for (const fb of fallbackResources()) {
|
|
109
|
+
if (!parsedTypes.has(fb.resource.typeName)) {
|
|
110
|
+
results.push(fb);
|
|
111
|
+
parsedTypes.add(fb.resource.typeName);
|
|
112
|
+
warnings.push({
|
|
113
|
+
file: fb.resource.typeName,
|
|
114
|
+
error: `Priority resource missing from schema zip; using fallback`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Re-filter extension constraints now that we have the full type set
|
|
119
|
+
// (augmentSchemas loaded them before parsing, so we already have them)
|
|
120
|
+
// A curated enum that reached nothing is a stale entry (chant #1497), and
|
|
121
|
+
// the only place it can be noticed is here, once every schema has been seen.
|
|
122
|
+
assertOverlayCoverage(enumOverlayEntries(), awsOverlaySeenTypes, awsOverlayStrict);
|
|
123
|
+
const applied = awsOverlayApplications.filter((a) => a.outcome === "applied").length;
|
|
124
|
+
log(`Applied ${applied} curated enum overlay entries`);
|
|
125
|
+
warnings.push(...redundantOverlayWarnings(awsOverlayApplications));
|
|
126
|
+
assertPropertyOverlayCoverage(propertyOverlayEntries(), awsOverlaySeenTypes, awsOverlayStrict);
|
|
127
|
+
const backfilled = awsPropertyOverlayApplications.filter((a) => a.outcome === "applied").length;
|
|
128
|
+
log(`Backfilled ${backfilled} properties the pinned spec predates`);
|
|
129
|
+
warnings.push(...redundantPropertyOverlayWarnings(awsPropertyOverlayApplications));
|
|
130
|
+
log(`Total: ${results.length} resource schemas`);
|
|
131
|
+
return { results, warnings };
|
|
132
|
+
},
|
|
133
|
+
generateRegistry: (results, naming) => {
|
|
134
|
+
const runtimeDeprecations = lambdaRuntimeDeprecations();
|
|
135
|
+
return generateLexiconJSON(results, naming, awsConstraints, runtimeDeprecations);
|
|
136
|
+
},
|
|
137
|
+
generateTypes: (results, naming) => {
|
|
138
|
+
return generateTypeScriptDeclarations(results, naming);
|
|
139
|
+
},
|
|
140
|
+
generateRuntimeIndex: (results, naming) => {
|
|
141
|
+
return generateRuntimeIndex(results, naming);
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Run the full AWS generation pipeline.
|
|
146
|
+
*/
|
|
147
|
+
export async function generate(opts = {}) {
|
|
148
|
+
// Reset shared state
|
|
149
|
+
awsConstraints = new Map();
|
|
150
|
+
awsOverlay = enumOverlayByType();
|
|
151
|
+
awsOverlayApplications = [];
|
|
152
|
+
awsOverlaySeenTypes = new Set();
|
|
153
|
+
awsPropertyOverlay = propertyOverlayByType();
|
|
154
|
+
awsPropertyOverlayApplications = [];
|
|
155
|
+
// A fixture set is a trimmed subset, so an entry it never reaches is
|
|
156
|
+
// expected; a run over the real zip has no such excuse.
|
|
157
|
+
awsOverlayStrict = !opts.schemaSource;
|
|
158
|
+
// chant #1459 — names already published keep pointing at the types that
|
|
159
|
+
// published them. Skipped for a caller-supplied schema set, exactly as
|
|
160
|
+
// `augmentSchemas` is (see the pipeline's `opts.schemaSource` guard): a
|
|
161
|
+
// fixture run must depend on its fixtures, not on what the lexicon last
|
|
162
|
+
// shipped.
|
|
163
|
+
awsReservedNames = opts.schemaSource ? {} : publishedNames();
|
|
164
|
+
return generatePipeline(awsPipelineConfig, opts);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Write generated artifacts to disk.
|
|
168
|
+
*/
|
|
169
|
+
export function writeGeneratedFiles(result, baseDir) {
|
|
170
|
+
writeGeneratedArtifacts({
|
|
171
|
+
baseDir,
|
|
172
|
+
files: {
|
|
173
|
+
"lexicon-aws.json": result.lexiconJSON,
|
|
174
|
+
"index.d.ts": result.typesDTS,
|
|
175
|
+
"index.ts": result.indexTS,
|
|
176
|
+
"runtime.ts": [
|
|
177
|
+
"/**",
|
|
178
|
+
" * Runtime factory constructors — re-exported from core.",
|
|
179
|
+
" */",
|
|
180
|
+
'export { createResource, createProperty } from "@intentius/chant/runtime";',
|
|
181
|
+
"",
|
|
182
|
+
].join("\n"),
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Generate the runtime index.ts with factory constructor exports.
|
|
188
|
+
*/
|
|
189
|
+
function generateRuntimeIndex(results, naming) {
|
|
190
|
+
const resourceEntries = [];
|
|
191
|
+
const propertyEntries = [];
|
|
192
|
+
for (const r of results) {
|
|
193
|
+
const cfnType = r.resource.typeName;
|
|
194
|
+
const tsName = naming.resolve(cfnType);
|
|
195
|
+
if (!tsName)
|
|
196
|
+
continue;
|
|
197
|
+
// Build attrs map: TS key (underscores) → CF attr name (dots)
|
|
198
|
+
const attrs = {};
|
|
199
|
+
for (const a of r.resource.attributes) {
|
|
200
|
+
const tsKey = a.name.replace(/\./g, "_").replace(/\*/g, "Item"); // Subscribers.*.Status → Subscribers_Item_Status
|
|
201
|
+
attrs[tsKey] = a.name; // maps to "Endpoint.Address" for GetAtt
|
|
202
|
+
}
|
|
203
|
+
resourceEntries.push({ tsName, resourceType: cfnType, attrs });
|
|
204
|
+
for (const alias of naming.aliases(cfnType)) {
|
|
205
|
+
resourceEntries.push({ tsName: alias, resourceType: cfnType, attrs });
|
|
206
|
+
}
|
|
207
|
+
// Property types
|
|
208
|
+
const shortName = cfnShortName(cfnType);
|
|
209
|
+
const ptAliases = naming.propertyTypeAliases(cfnType);
|
|
210
|
+
for (const pt of r.propertyTypes) {
|
|
211
|
+
const defName = extractDefName(pt.name, shortName);
|
|
212
|
+
const ptName = propertyTypeName(tsName, defName);
|
|
213
|
+
const ptCfnType = `${cfnType}.${pt.specType}`;
|
|
214
|
+
propertyEntries.push({ tsName: ptName, resourceType: ptCfnType });
|
|
215
|
+
if (ptAliases) {
|
|
216
|
+
const aliasName = ptAliases.get(defName);
|
|
217
|
+
if (aliasName) {
|
|
218
|
+
propertyEntries.push({ tsName: aliasName, resourceType: ptCfnType });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return coreGenerateRuntimeIndex(resourceEntries, propertyEntries, {
|
|
224
|
+
lexiconName: "aws",
|
|
225
|
+
intrinsicReExports: {
|
|
226
|
+
names: ["Sub", "Ref", "GetAtt", "If", "Join", "Select", "Split", "Base64", "Equals", "And", "Or", "Not"],
|
|
227
|
+
from: "../intrinsics",
|
|
228
|
+
},
|
|
229
|
+
pseudoReExports: {
|
|
230
|
+
names: ["AWS", "StackName", "Region", "AccountId", "StackId", "URLSuffix", "NoValue", "NotificationARNs", "Partition"],
|
|
231
|
+
from: "../pseudo",
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS-specific naming configuration for the core NamingStrategy.
|
|
3
|
+
*
|
|
4
|
+
* The algorithm lives in core; only the data tables and helper functions
|
|
5
|
+
* for extracting names from AWS CloudFormation types are defined here.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { NamingStrategy as CoreNamingStrategy, reservedNamesFromSnapshot, } from "@intentius/chant/codegen/naming";
|
|
10
|
+
export { propertyTypeName, extractDefName } from "@intentius/chant/codegen/naming";
|
|
11
|
+
import { cfnShortName, cfnServiceName } from "../spec/parse.js";
|
|
12
|
+
/**
|
|
13
|
+
* Fixed TypeScript class names for backward compatibility.
|
|
14
|
+
*/
|
|
15
|
+
const priorityNames = {
|
|
16
|
+
"AWS::S3::Bucket": "Bucket",
|
|
17
|
+
"AWS::Lambda::Function": "Function",
|
|
18
|
+
"AWS::IAM::Role": "Role",
|
|
19
|
+
"AWS::IAM::Policy": "Policy",
|
|
20
|
+
"AWS::DynamoDB::Table": "Table",
|
|
21
|
+
"AWS::SQS::Queue": "Queue",
|
|
22
|
+
"AWS::SNS::Topic": "Topic",
|
|
23
|
+
"AWS::EC2::Instance": "Instance",
|
|
24
|
+
"AWS::EC2::SecurityGroup": "SecurityGroup",
|
|
25
|
+
"AWS::EC2::VPC": "Vpc",
|
|
26
|
+
"AWS::EC2::Subnet": "Subnet",
|
|
27
|
+
"AWS::CloudFormation::Stack": "Stack",
|
|
28
|
+
"AWS::CloudWatch::Alarm": "Alarm",
|
|
29
|
+
"AWS::Events::Rule": "EventRule",
|
|
30
|
+
"AWS::Logs::LogGroup": "LogGroup",
|
|
31
|
+
"AWS::ApiGateway::RestApi": "RestApi",
|
|
32
|
+
"AWS::ApiGatewayV2::Api": "HttpApi",
|
|
33
|
+
"AWS::ECS::Cluster": "EcsCluster",
|
|
34
|
+
"AWS::ECS::Service": "EcsService",
|
|
35
|
+
"AWS::ECS::TaskDefinition": "TaskDefinition",
|
|
36
|
+
"AWS::ElasticLoadBalancingV2::LoadBalancer": "LoadBalancer",
|
|
37
|
+
"AWS::ElasticLoadBalancingV2::TargetGroup": "TargetGroup",
|
|
38
|
+
"AWS::ElasticLoadBalancingV2::Listener": "Listener",
|
|
39
|
+
"AWS::RDS::DBInstance": "DbInstance",
|
|
40
|
+
"AWS::RDS::DBCluster": "DbCluster",
|
|
41
|
+
"AWS::StepFunctions::StateMachine": "StateMachine",
|
|
42
|
+
"AWS::KMS::Key": "KmsKey",
|
|
43
|
+
"AWS::SecretsManager::Secret": "Secret",
|
|
44
|
+
"AWS::SSM::Parameter": "SsmParameter",
|
|
45
|
+
"AWS::Lambda::Permission": "Permission",
|
|
46
|
+
"AWS::Lambda::LayerVersion": "LayerVersion",
|
|
47
|
+
"AWS::IAM::ManagedPolicy": "ManagedPolicy",
|
|
48
|
+
"AWS::IAM::InstanceProfile": "InstanceProfile",
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Additional TypeScript names beyond the primary priority name.
|
|
52
|
+
*/
|
|
53
|
+
const priorityAliases = {
|
|
54
|
+
"AWS::IAM::Policy": ["IamPolicy"],
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Property type aliases that must always be emitted for backward compat.
|
|
58
|
+
*/
|
|
59
|
+
const priorityPropertyAliases = {
|
|
60
|
+
"AWS::S3::Bucket": {
|
|
61
|
+
ServerSideEncryptionByDefault: "ServerSideEncryptionByDefault",
|
|
62
|
+
ServerSideEncryptionRule: "ServerSideEncryptionRule",
|
|
63
|
+
BucketEncryption: "BucketEncryption",
|
|
64
|
+
VersioningConfiguration: "VersioningConfiguration",
|
|
65
|
+
PublicAccessBlockConfiguration: "PublicAccessBlockConfiguration",
|
|
66
|
+
LoggingConfiguration: "LoggingConfiguration",
|
|
67
|
+
},
|
|
68
|
+
"AWS::Lambda::Function": {
|
|
69
|
+
Code: "Code",
|
|
70
|
+
Environment: "Environment",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Service name abbreviations for collision-resolved names.
|
|
75
|
+
*/
|
|
76
|
+
const serviceAbbreviations = {
|
|
77
|
+
ElasticLoadBalancingV2: "Elbv2",
|
|
78
|
+
CloudFormation: "Cfn",
|
|
79
|
+
CloudWatch: "Cw",
|
|
80
|
+
ApiGateway: "Apigw",
|
|
81
|
+
ApiGatewayV2: "Apigwv2",
|
|
82
|
+
SecretsManager: "Sm",
|
|
83
|
+
StepFunctions: "Sfn",
|
|
84
|
+
CertificateManager: "Acm",
|
|
85
|
+
ElasticLoadBalancing: "Elb",
|
|
86
|
+
CloudFront: "Cf",
|
|
87
|
+
ElastiCache: "Ec",
|
|
88
|
+
};
|
|
89
|
+
const awsNamingConfig = {
|
|
90
|
+
priorityNames,
|
|
91
|
+
priorityAliases,
|
|
92
|
+
priorityPropertyAliases,
|
|
93
|
+
serviceAbbreviations,
|
|
94
|
+
shortName: cfnShortName,
|
|
95
|
+
serviceName: cfnServiceName,
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* AWS-specific NamingStrategy — wraps the core algorithm with AWS data tables.
|
|
99
|
+
*/
|
|
100
|
+
export class NamingStrategy extends CoreNamingStrategy {
|
|
101
|
+
/**
|
|
102
|
+
* @param reservedNames chant #1459 — spec type → already-published TS name,
|
|
103
|
+
* normally {@link publishedNames}. Passed in rather than read here on
|
|
104
|
+
* purpose: a fixture-driven codegen run (`./snapshot.test.ts`) must not
|
|
105
|
+
* inherit the repo's real 1600-entry surface, or its output would depend on
|
|
106
|
+
* whatever the lexicon last shipped instead of on its fixtures.
|
|
107
|
+
*/
|
|
108
|
+
constructor(results, reservedNames = {}) {
|
|
109
|
+
const inputs = results.map((r) => ({
|
|
110
|
+
typeName: r.resource.typeName,
|
|
111
|
+
propertyTypes: r.propertyTypes,
|
|
112
|
+
}));
|
|
113
|
+
super(inputs, { ...awsNamingConfig, reservedNames });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Reserved names from the committed surface snapshot, or none when it cannot
|
|
118
|
+
* be read.
|
|
119
|
+
*
|
|
120
|
+
* Defensive: codegen must still run for a lexicon with no snapshot yet, and a
|
|
121
|
+
* missing or malformed snapshot should degrade to the previous naming
|
|
122
|
+
* behaviour rather than fail generation outright. `surface-diff` makes the
|
|
123
|
+
* consequence visible either way.
|
|
124
|
+
*/
|
|
125
|
+
export function publishedNames() {
|
|
126
|
+
try {
|
|
127
|
+
const snapshotPath = join(import.meta.dirname, "..", "..", "surface.snapshot.json");
|
|
128
|
+
if (!existsSync(snapshotPath))
|
|
129
|
+
return {};
|
|
130
|
+
return reservedNamesFromSnapshot(JSON.parse(readFileSync(snapshotPath, "utf-8")));
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS lexicon packaging — delegates to core packagePipeline
|
|
3
|
+
* with AWS-specific manifest building and skill collection.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync } from "fs";
|
|
6
|
+
import { awsPlugin } from "../plugin.js";
|
|
7
|
+
import { join, dirname } from "path";
|
|
8
|
+
import { moduleSourceDir } from "@intentius/chant/module-source";
|
|
9
|
+
import { packagePipeline, collectSkills, } from "@intentius/chant/codegen/package";
|
|
10
|
+
import { generate } from "./generate.js";
|
|
11
|
+
const pkgDir = dirname(moduleSourceDir(import.meta.url));
|
|
12
|
+
/**
|
|
13
|
+
* Map intrinsic name to its CloudFormation output key.
|
|
14
|
+
*/
|
|
15
|
+
function intrinsicOutputKey(name) {
|
|
16
|
+
switch (name) {
|
|
17
|
+
case "Ref": return "Ref";
|
|
18
|
+
default: return `Fn::${name}`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Package the AWS lexicon into a distributable BundleSpec.
|
|
23
|
+
*/
|
|
24
|
+
export async function packageLexicon(opts = {}) {
|
|
25
|
+
const pkgJson = JSON.parse(readFileSync(join(pkgDir, "..", "package.json"), "utf-8"));
|
|
26
|
+
return packagePipeline({
|
|
27
|
+
generate: (genOpts) => generate({ verbose: genOpts.verbose, force: genOpts.force }),
|
|
28
|
+
buildManifest: (_genResult) => {
|
|
29
|
+
// Lazy-import to avoid circular dependency
|
|
30
|
+
// Trust the plugin's own `isTag` registration (chant #1067) — this
|
|
31
|
+
// used to recompute `isTag: i.name === "Sub"` independently of
|
|
32
|
+
// ../plugin.ts, a second source of truth that could silently drift
|
|
33
|
+
// from the real registration (the exact shape of bug #1039 found).
|
|
34
|
+
const intrinsics = (awsPlugin.intrinsics?.() ?? []).map((i) => ({
|
|
35
|
+
name: i.name,
|
|
36
|
+
description: i.description,
|
|
37
|
+
outputKey: intrinsicOutputKey(i.name),
|
|
38
|
+
isTag: i.isTag,
|
|
39
|
+
// chant #1044 — carried through verbatim for the same reason as
|
|
40
|
+
// `isTag`: the packaged manifest is what a consumer reads to
|
|
41
|
+
// learn which intrinsics fold, so recomputing it here would be a
|
|
42
|
+
// second source of truth able to drift from ../plugin.ts.
|
|
43
|
+
foldsAsCall: i.foldsAsCall,
|
|
44
|
+
}));
|
|
45
|
+
const pseudoParams = awsPlugin.pseudoParameters?.() ?? [];
|
|
46
|
+
const pseudoParameters = {};
|
|
47
|
+
for (const p of pseudoParams) {
|
|
48
|
+
const shortName = p.split("::").pop();
|
|
49
|
+
pseudoParameters[shortName] = p;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
name: "aws",
|
|
53
|
+
version: pkgJson.version ?? "0.0.0",
|
|
54
|
+
chantVersion: ">=0.1.0",
|
|
55
|
+
namespace: "AWS",
|
|
56
|
+
intrinsics,
|
|
57
|
+
pseudoParameters,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
srcDir: pkgDir,
|
|
61
|
+
collectSkills: () => {
|
|
62
|
+
const skillDefs = awsPlugin.skills?.() ?? [];
|
|
63
|
+
return collectSkills(skillDefs);
|
|
64
|
+
},
|
|
65
|
+
version: pkgJson.version ?? "0.0.0",
|
|
66
|
+
}, opts);
|
|
67
|
+
}
|
|
@@ -5,15 +5,39 @@
|
|
|
5
5
|
* before parsing. This enriches the schemas with additional type information,
|
|
6
6
|
* enum values, and constraint fixes.
|
|
7
7
|
*/
|
|
8
|
+
declare const PATCH_FILES: readonly ["manual.json", "smithy.json", "format.json"];
|
|
8
9
|
export interface PatchWarning {
|
|
9
10
|
typeName: string;
|
|
10
11
|
patchFile: string;
|
|
11
12
|
error: Error;
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* A patch in the pinned cfn-lint release that is known not to apply to the
|
|
16
|
+
* pinned spec. Its failure is reported as a skip rather than a warning; an
|
|
17
|
+
* entry that applies again, or whose patch file is gone, is reported as
|
|
18
|
+
* retirable so the list cannot go stale.
|
|
19
|
+
*/
|
|
20
|
+
export interface StalePatch {
|
|
21
|
+
typeName: string;
|
|
22
|
+
patchFile: (typeof PATCH_FILES)[number];
|
|
23
|
+
/** The cfn-lint release the entry was checked against. */
|
|
24
|
+
cfnLint: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const KNOWN_STALE_PATCHES: readonly StalePatch[];
|
|
28
|
+
export interface PatchSkip {
|
|
29
|
+
stale: StalePatch;
|
|
30
|
+
error: Error;
|
|
31
|
+
}
|
|
13
32
|
export interface PatchStats {
|
|
14
33
|
patchesApplied: number;
|
|
15
34
|
resourcesFixed: number;
|
|
35
|
+
/** Failures not in `KNOWN_STALE_PATCHES`. */
|
|
16
36
|
warnings: PatchWarning[];
|
|
37
|
+
/** Failures listed in `KNOWN_STALE_PATCHES`. */
|
|
38
|
+
skipped: PatchSkip[];
|
|
39
|
+
/** `KNOWN_STALE_PATCHES` entries that did not fail: applied, or no such schema or patch file. */
|
|
40
|
+
retirable: StalePatch[];
|
|
17
41
|
}
|
|
18
42
|
/**
|
|
19
43
|
* Fetch cfn-lint patches from GitHub tarball and extract to cache.
|
|
@@ -25,7 +49,7 @@ export declare function fetchCfnLintPatches(force?: boolean): Promise<string>;
|
|
|
25
49
|
* For each schema, converts type name to directory name and applies
|
|
26
50
|
* manual.json, smithy.json, format.json in order.
|
|
27
51
|
*/
|
|
28
|
-
export declare function applyPatches(schemas: Map<string, Buffer>, patchesDir: string): {
|
|
52
|
+
export declare function applyPatches(schemas: Map<string, Buffer>, patchesDir: string, knownStale?: readonly StalePatch[]): {
|
|
29
53
|
schemas: Map<string, Buffer>;
|
|
30
54
|
stats: PatchStats;
|
|
31
55
|
};
|
|
@@ -34,4 +58,5 @@ export declare function applyPatches(schemas: Map<string, Buffer>, patchesDir: s
|
|
|
34
58
|
* AWS::S3::Bucket → aws_s3_bucket
|
|
35
59
|
*/
|
|
36
60
|
export declare function typeNameToPatchDir(typeName: string): string;
|
|
61
|
+
export {};
|
|
37
62
|
//# sourceMappingURL=patches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patches.d.ts","sourceRoot":"","sources":["../../src/codegen/patches.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"patches.d.ts","sourceRoot":"","sources":["../../src/codegen/patches.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,QAAA,MAAM,WAAW,YAAI,aAAa,EAAE,aAAa,EAAE,aAAa,CAAU,CAAC;AAE3E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,SAAS,UAAU,EAYpD,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,gDAAgD;IAChD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,iGAAiG;IACjG,SAAS,EAAE,UAAU,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAMxE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,SAAS,UAAU,EAAwB,GACtD;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAwCrD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cfn-lint patch fetcher and applier.
|
|
3
|
+
*
|
|
4
|
+
* Downloads cfn-lint patches from GitHub and applies them to raw schemas
|
|
5
|
+
* before parsing. This enriches the schemas with additional type information,
|
|
6
|
+
* enum values, and constraint fixes.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from "fs";
|
|
9
|
+
import { join } from "path";
|
|
10
|
+
import { homedir } from "os";
|
|
11
|
+
import { rfc6902Apply } from "@intentius/chant/codegen/json-patch";
|
|
12
|
+
import { fetchAndExtractTar } from "@intentius/chant/codegen/fetch";
|
|
13
|
+
import { cfnLintTarballUrl, PINNED_VERSIONS } from "./versions.js";
|
|
14
|
+
const CFN_LINT_TARBALL_URL = cfnLintTarballUrl();
|
|
15
|
+
// Keyed by version: the cache lives for 7 days, so an unkeyed directory would
|
|
16
|
+
// keep serving the old release's patches after the pin moves.
|
|
17
|
+
const PATCHES_DEST_DIR = join(homedir(), ".chant", `cfn-lint-patches-${PINNED_VERSIONS.cfnLint}`);
|
|
18
|
+
const PATCHES_TAR_PREFIX = "src/cfnlint/data/schemas/patches/extensions/all/";
|
|
19
|
+
const PATCH_FILES = ["manual.json", "smithy.json", "format.json"];
|
|
20
|
+
export const KNOWN_STALE_PATCHES = [
|
|
21
|
+
{
|
|
22
|
+
// Adds `format: ipv4-network` to `Cidr`, a constraint only; no generated
|
|
23
|
+
// type changes. Every cfn-lint release from v1.32.4 to v1.51.5 still
|
|
24
|
+
// targets the old name, and v1.52.0 removed the patch tree from cfn-lint
|
|
25
|
+
// (it moved to aws-cloudformation/resource-provider-enhanced-schemas,
|
|
26
|
+
// which has the corrected path but publishes only a rolling `latest`).
|
|
27
|
+
typeName: "AWS::MediaLive::InputSecurityGroup",
|
|
28
|
+
patchFile: "format.json",
|
|
29
|
+
cfnLint: "v1.32.4",
|
|
30
|
+
reason: "the 2026-10-19 spec renamed definition InputWhitelistRuleCidr to InputWhitelistRule (#4144)",
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Fetch cfn-lint patches from GitHub tarball and extract to cache.
|
|
35
|
+
* Returns the path to the extracted patches directory.
|
|
36
|
+
*/
|
|
37
|
+
export async function fetchCfnLintPatches(force = false) {
|
|
38
|
+
return fetchAndExtractTar({ url: CFN_LINT_TARBALL_URL, destDir: PATCHES_DEST_DIR }, PATCHES_TAR_PREFIX, force);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Apply cfn-lint RFC 6902 patches to raw schema bytes.
|
|
42
|
+
* For each schema, converts type name to directory name and applies
|
|
43
|
+
* manual.json, smithy.json, format.json in order.
|
|
44
|
+
*/
|
|
45
|
+
export function applyPatches(schemas, patchesDir, knownStale = KNOWN_STALE_PATCHES) {
|
|
46
|
+
const stats = { patchesApplied: 0, resourcesFixed: 0, warnings: [], skipped: [], retirable: [] };
|
|
47
|
+
const staleByKey = new Map(knownStale.map((s) => [`${s.typeName}/${s.patchFile}`, s]));
|
|
48
|
+
const result = new Map();
|
|
49
|
+
for (const [typeName, data] of schemas) {
|
|
50
|
+
const dirName = typeNameToPatchDir(typeName);
|
|
51
|
+
const patchPath = join(patchesDir, dirName);
|
|
52
|
+
let patched = data;
|
|
53
|
+
for (const pf of PATCH_FILES) {
|
|
54
|
+
const fullPath = join(patchPath, pf);
|
|
55
|
+
let patchData;
|
|
56
|
+
try {
|
|
57
|
+
patchData = readFileSync(fullPath);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
continue; // Patch file doesn't exist
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
patched = Buffer.from(rfc6902Apply(patched.toString("utf-8"), patchData.toString("utf-8")));
|
|
64
|
+
stats.patchesApplied++;
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
68
|
+
const stale = staleByKey.get(`${typeName}/${pf}`);
|
|
69
|
+
if (stale)
|
|
70
|
+
stats.skipped.push({ stale, error });
|
|
71
|
+
else
|
|
72
|
+
stats.warnings.push({ typeName, patchFile: pf, error });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (patched !== data) {
|
|
76
|
+
stats.resourcesFixed++;
|
|
77
|
+
}
|
|
78
|
+
result.set(typeName, patched);
|
|
79
|
+
}
|
|
80
|
+
const skippedStale = new Set(stats.skipped.map((s) => s.stale));
|
|
81
|
+
stats.retirable = knownStale.filter((s) => !skippedStale.has(s));
|
|
82
|
+
return { schemas: result, stats };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Convert CloudFormation type name to cfn-lint patch directory name.
|
|
86
|
+
* AWS::S3::Bucket → aws_s3_bucket
|
|
87
|
+
*/
|
|
88
|
+
export function typeNameToPatchDir(typeName) {
|
|
89
|
+
return typeName.replaceAll("::", "_").toLowerCase();
|
|
90
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backfilled properties (chant #3953).
|
|
3
|
+
*
|
|
4
|
+
* The Registry spec is pinned by content (src/spec/pin.ts), so a property AWS
|
|
5
|
+
* adds after the pin was accepted does not reach the generated types until the
|
|
6
|
+
* pin moves. Moving it is a reviewed, whole-spec decision: the 2026-08-05 pin
|
|
7
|
+
* against the October upstream is 185 resource types apart. When one property
|
|
8
|
+
* is needed before that, it goes here instead of being cast past the types.
|
|
9
|
+
*
|
|
10
|
+
* Each entry names a top-level property and the schema fragment to add for it,
|
|
11
|
+
* copied from the live Registry schema. It is merged into the raw schema before
|
|
12
|
+
* parsing, so the property reaches the `.d.ts` and the lexicon registry by the
|
|
13
|
+
* same path a spec property does. The overlay has no way to mark a property
|
|
14
|
+
* create-only, so it only suits properties that are updatable in place.
|
|
15
|
+
*
|
|
16
|
+
* Precedence follows the enum overlay (#1497): where the spec already declares
|
|
17
|
+
* the property, the spec wins and the entry is reported as redundant, so a pin
|
|
18
|
+
* bump surfaces the entries it retires.
|
|
19
|
+
*/
|
|
20
|
+
import overlayDocument from "./property-overlay.json" with { type: "json" };
|
|
21
|
+
/** The backfilled entries, in file order. */
|
|
22
|
+
export function propertyOverlayEntries() {
|
|
23
|
+
return overlayDocument.entries;
|
|
24
|
+
}
|
|
25
|
+
/** Entries grouped by CloudFormation type name. */
|
|
26
|
+
export function propertyOverlayByType(entries = propertyOverlayEntries()) {
|
|
27
|
+
const byType = new Map();
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
const list = byType.get(entry.type);
|
|
30
|
+
if (list)
|
|
31
|
+
list.push(entry);
|
|
32
|
+
else
|
|
33
|
+
byType.set(entry.type, [entry]);
|
|
34
|
+
}
|
|
35
|
+
return byType;
|
|
36
|
+
}
|
|
37
|
+
/** Add the entries for one CloudFormation type to its raw schema bytes. */
|
|
38
|
+
export function applyPropertyOverlay(data, entries) {
|
|
39
|
+
if (entries.length === 0)
|
|
40
|
+
return { data, applications: [] };
|
|
41
|
+
const text = typeof data === "string" ? data : data.toString("utf-8");
|
|
42
|
+
const doc = JSON.parse(text);
|
|
43
|
+
const properties = (doc.properties ?? (doc.properties = {}));
|
|
44
|
+
const applications = [];
|
|
45
|
+
let changed = false;
|
|
46
|
+
for (const entry of entries) {
|
|
47
|
+
if (entry.property in properties) {
|
|
48
|
+
applications.push({ entry, outcome: "redundant" });
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
properties[entry.property] = structuredClone(entry.schema);
|
|
52
|
+
changed = true;
|
|
53
|
+
applications.push({ entry, outcome: "applied" });
|
|
54
|
+
}
|
|
55
|
+
if (!changed)
|
|
56
|
+
return { data, applications };
|
|
57
|
+
const rewritten = JSON.stringify(doc);
|
|
58
|
+
return {
|
|
59
|
+
data: typeof data === "string" ? rewritten : Buffer.from(rewritten),
|
|
60
|
+
applications,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Fail on an entry whose type the run never saw. Only a run over the real
|
|
65
|
+
* schema zip is strict; a fixture run legitimately lacks most types.
|
|
66
|
+
*/
|
|
67
|
+
export function assertPropertyOverlayCoverage(entries, seenTypes, strict) {
|
|
68
|
+
if (!strict)
|
|
69
|
+
return;
|
|
70
|
+
const missing = [...new Set(entries.filter((e) => !seenTypes.has(e.type)).map((e) => e.type))];
|
|
71
|
+
if (missing.length === 0)
|
|
72
|
+
return;
|
|
73
|
+
throw new Error(`property overlay names type(s) the spec does not contain: ${missing.sort().join(", ")}. ` +
|
|
74
|
+
`Drop them from src/codegen/property-overlay.json or fix the type name.`);
|
|
75
|
+
}
|
|
76
|
+
/** One warning line per entry the spec has caught up with. */
|
|
77
|
+
export function redundantPropertyOverlayWarnings(applications) {
|
|
78
|
+
return applications
|
|
79
|
+
.filter((a) => a.outcome === "redundant")
|
|
80
|
+
.map((a) => ({
|
|
81
|
+
file: `${a.entry.type}/properties/${a.entry.property}`,
|
|
82
|
+
error: `property overlay entry is redundant: the spec already declares this property, ` +
|
|
83
|
+
`and the spec wins. Retire the entry from src/codegen/property-overlay.json.`,
|
|
84
|
+
}));
|
|
85
|
+
}
|