@intentius/chant-lexicon-aws 0.124.31 → 0.124.33
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/health.d.ts +61 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +216 -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 +1012 -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/health.test.ts +136 -0
- package/src/health.ts +281 -0
- 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 +10 -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,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A managed resource's own properties (#1279).
|
|
3
|
+
*
|
|
4
|
+
* `describe-stack-resources` returns identity and status — logical id, physical
|
|
5
|
+
* id, type, timestamp — and nothing about the resource itself. So the managed
|
|
6
|
+
* observation filled `attributes` with the *stack's* outputs instead, copied
|
|
7
|
+
* onto every resource in the stack. Every node in a stack came out carrying the
|
|
8
|
+
* same `expVpcId`/`expWebIp` keys, and no node carried its own `VpcId`.
|
|
9
|
+
*
|
|
10
|
+
* That is invisible until something asks. `search --show VpcId` printed a blank
|
|
11
|
+
* column for six instances, which reads as "the estate has no VPCs" rather than
|
|
12
|
+
* "chant never read that". An agent asked which instances were outside the
|
|
13
|
+
* default VPC concluded all six were, because nothing in the graph said
|
|
14
|
+
* otherwise.
|
|
15
|
+
*
|
|
16
|
+
* A deep read (Cloud Control) answers this properly but is a per-resource call
|
|
17
|
+
* and is not available on every endpoint. This is the cheap middle: one describe
|
|
18
|
+
* per kind for the whole observation, joined back by physical id. Stack outputs
|
|
19
|
+
* no longer ride the resource at all — they are the stack's, and travel on the
|
|
20
|
+
* observation envelope's `stackExports`. Whatever a resource already carries is
|
|
21
|
+
* kept underneath its own properties, which win a name collision because they
|
|
22
|
+
* are the resource's.
|
|
23
|
+
*/
|
|
24
|
+
import { applyAwsEndpointArgv } from "./components/cloud-executor.js";
|
|
25
|
+
/**
|
|
26
|
+
* How to read each kind in bulk, and which field joins back to the physical id.
|
|
27
|
+
*
|
|
28
|
+
* Extending this is the way to widen coverage. Deliberately batch calls: one
|
|
29
|
+
* `describe-instances` for every instance in the stack, not one per instance.
|
|
30
|
+
*/
|
|
31
|
+
const DESCRIBE = {
|
|
32
|
+
"AWS::EC2::Instance": {
|
|
33
|
+
argv: ["ec2", "describe-instances"],
|
|
34
|
+
idFlag: "--instance-ids",
|
|
35
|
+
key: "Reservations",
|
|
36
|
+
nested: "Instances",
|
|
37
|
+
id: "InstanceId",
|
|
38
|
+
},
|
|
39
|
+
"AWS::EC2::VPC": { argv: ["ec2", "describe-vpcs"], idFlag: "--vpc-ids", key: "Vpcs", id: "VpcId" },
|
|
40
|
+
"AWS::EC2::Subnet": {
|
|
41
|
+
argv: ["ec2", "describe-subnets"],
|
|
42
|
+
idFlag: "--subnet-ids",
|
|
43
|
+
key: "Subnets",
|
|
44
|
+
id: "SubnetId",
|
|
45
|
+
},
|
|
46
|
+
"AWS::EC2::SecurityGroup": {
|
|
47
|
+
argv: ["ec2", "describe-security-groups"],
|
|
48
|
+
idFlag: "--group-ids",
|
|
49
|
+
key: "SecurityGroups",
|
|
50
|
+
id: "GroupId",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Stamp the region each resource was observed in (#1279).
|
|
55
|
+
*
|
|
56
|
+
* The observation is already scoped per stack and each stack declares its
|
|
57
|
+
* region, so the reader knows this and was throwing it away. Without it the
|
|
58
|
+
* only route to "which region is this in" was parsing
|
|
59
|
+
* `Placement.AvailabilityZone` and trimming the last character — a trick that
|
|
60
|
+
* happens to work for EC2 and for nothing else. Region is a dimension of the
|
|
61
|
+
* estate, not a substring of an availability zone.
|
|
62
|
+
*/
|
|
63
|
+
export function stampRegion(resources, region) {
|
|
64
|
+
// Fall back to the region the call would actually have used, so a
|
|
65
|
+
// single-region project gets the same attribute a multi-region one does.
|
|
66
|
+
const value = region ?? process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION;
|
|
67
|
+
if (!value)
|
|
68
|
+
return resources;
|
|
69
|
+
const stamped = {};
|
|
70
|
+
for (const [name, meta] of Object.entries(resources)) {
|
|
71
|
+
stamped[name] = { ...meta, attributes: { ...(meta.attributes ?? {}), region: value } };
|
|
72
|
+
}
|
|
73
|
+
return stamped;
|
|
74
|
+
}
|
|
75
|
+
/** True when this lexicon can read the kind's own properties. */
|
|
76
|
+
export function canDescribe(kind) {
|
|
77
|
+
return kind in DESCRIBE;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Merge each resource's own properties into an observation, in place of nothing.
|
|
81
|
+
*
|
|
82
|
+
* Best-effort per kind: an endpoint that cannot answer `describe-subnets` still
|
|
83
|
+
* yields instance properties. A miss costs detail — with one exception that used
|
|
84
|
+
* to be silent and is now reported.
|
|
85
|
+
*
|
|
86
|
+
* The exception (#1206): these attributes are compared by `lifecycle diff`, so a
|
|
87
|
+
* read that fails after the resource is already identified does not degrade to
|
|
88
|
+
* "less detail", it degrades to *drift* — the snapshot has `GroupId`, the live
|
|
89
|
+
* read has nothing, and the differ reports the property as removed. A partial
|
|
90
|
+
* failure still rides the best-effort path, but a total one is a hole the caller
|
|
91
|
+
* has to declare rather than a thinner set of facts.
|
|
92
|
+
*/
|
|
93
|
+
export async function describeOwnProperties(resources, region) {
|
|
94
|
+
// Group the physical ids to look up by kind, so each kind is one call.
|
|
95
|
+
const wanted = new Map();
|
|
96
|
+
for (const [name, meta] of Object.entries(resources)) {
|
|
97
|
+
if (!meta.physicalId || !canDescribe(meta.type))
|
|
98
|
+
continue;
|
|
99
|
+
const byId = wanted.get(meta.type) ?? new Map();
|
|
100
|
+
byId.set(meta.physicalId, [...(byId.get(meta.physicalId) ?? []), name]);
|
|
101
|
+
wanted.set(meta.type, byId);
|
|
102
|
+
}
|
|
103
|
+
if (wanted.size === 0)
|
|
104
|
+
return { resources, transportFailed: false, failures: new Map() };
|
|
105
|
+
const { getRuntime } = await import("@intentius/chant/runtime-adapter");
|
|
106
|
+
const rt = getRuntime();
|
|
107
|
+
const regionArgs = region ? ["--region", region] : [];
|
|
108
|
+
const merged = { ...resources };
|
|
109
|
+
const failures = new Map();
|
|
110
|
+
/** The last failure for a kind, phrased for a human — stderr when there is any, the exit status otherwise. */
|
|
111
|
+
let lastReason = "";
|
|
112
|
+
/** One describe for a set of ids. `null` when the call itself failed. */
|
|
113
|
+
const read = async (spec, ids) => {
|
|
114
|
+
const argv = ["aws", ...spec.argv, spec.idFlag, ...ids, ...regionArgs, "--output", "json"];
|
|
115
|
+
const result = await rt.spawn(applyAwsEndpointArgv(argv, process.env.AWS_ENDPOINT_URL));
|
|
116
|
+
if (result.exitCode !== 0) {
|
|
117
|
+
const stderr = result.stderr.trim().split("\n")[0];
|
|
118
|
+
lastReason = `${spec.argv.join(" ")} failed${stderr ? `: ${stderr}` : ` (${result.exitCode})`}`;
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return (JSON.parse(result.stdout)[spec.key] ?? []);
|
|
122
|
+
};
|
|
123
|
+
for (const [kind, byId] of wanted) {
|
|
124
|
+
const spec = DESCRIBE[kind];
|
|
125
|
+
try {
|
|
126
|
+
const ids = [...byId.keys()];
|
|
127
|
+
let top = await read(spec, ids);
|
|
128
|
+
// AWS fails the whole call on one bad id — a snapshot naming an instance
|
|
129
|
+
// that has since been terminated takes every other instance's properties
|
|
130
|
+
// down with it, and the result is indistinguishable from "the account has
|
|
131
|
+
// nothing to say". Retry one at a time so the damage stops at the bad id.
|
|
132
|
+
if (top === null && ids.length > 1) {
|
|
133
|
+
const perId = await Promise.all(ids.map((id) => read(spec, [id])));
|
|
134
|
+
// Every retry failing is the kind failing, not the kind being empty —
|
|
135
|
+
// the distinction the old `top = []` erased.
|
|
136
|
+
top = perId.every((r) => r === null) ? null : perId.flatMap((r) => r ?? []);
|
|
137
|
+
}
|
|
138
|
+
if (top === null) {
|
|
139
|
+
failures.set(kind, lastReason);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
// `describe-instances` buries instances one level down under reservations;
|
|
143
|
+
// the others return the resources directly.
|
|
144
|
+
const rows = spec.nested
|
|
145
|
+
? top.flatMap((r) => (r[spec.nested] ?? []))
|
|
146
|
+
: top;
|
|
147
|
+
for (const row of rows) {
|
|
148
|
+
const id = row[spec.id];
|
|
149
|
+
if (typeof id !== "string")
|
|
150
|
+
continue;
|
|
151
|
+
for (const name of byId.get(id) ?? []) {
|
|
152
|
+
merged[name] = {
|
|
153
|
+
...merged[name],
|
|
154
|
+
// Own properties last: a resource's `VpcId` outranks anything the
|
|
155
|
+
// entry already carried under the same name.
|
|
156
|
+
attributes: { ...(merged[name].attributes ?? {}), ...row },
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (err) {
|
|
162
|
+
failures.set(kind, `${spec.argv.join(" ")} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return { resources: merged, transportFailed: failures.size === wanted.size, failures };
|
|
166
|
+
}
|
package/dist/pseudo.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PseudoParameter, createPseudoParameters } from "@intentius/chant/pseudo-parameter";
|
|
2
|
+
export { PseudoParameter };
|
|
3
|
+
export const { StackName, Region, AccountId, StackId, URLSuffix, NoValue, NotificationARNs, Partition } = createPseudoParameters({
|
|
4
|
+
StackName: "AWS::StackName",
|
|
5
|
+
Region: "AWS::Region",
|
|
6
|
+
AccountId: "AWS::AccountId",
|
|
7
|
+
StackId: "AWS::StackId",
|
|
8
|
+
URLSuffix: "AWS::URLSuffix",
|
|
9
|
+
NoValue: "AWS::NoValue",
|
|
10
|
+
NotificationARNs: "AWS::NotificationARNs",
|
|
11
|
+
Partition: "AWS::Partition",
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* AWS namespace containing all pseudo-parameters
|
|
15
|
+
*/
|
|
16
|
+
export const AWS = {
|
|
17
|
+
StackName,
|
|
18
|
+
Region,
|
|
19
|
+
AccountId,
|
|
20
|
+
StackId,
|
|
21
|
+
URLSuffix,
|
|
22
|
+
NoValue,
|
|
23
|
+
NotificationARNs,
|
|
24
|
+
Partition,
|
|
25
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt-store.d.ts","sourceRoot":"","sources":["../src/receipt-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,
|
|
1
|
+
{"version":3,"file":"receipt-store.d.ts","sourceRoot":"","sources":["../src/receipt-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAO3B;0EAC0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC;6DACyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;6EACyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;0DACsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,wDAAwD;IACxD,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;iDACiD;AACjD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,CAyB5D;AAED;uCACuC;AACvC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,CAI9E;AAQD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAQ7B;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAiBf;AA4CD,wEAAwE;AACxE,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EAAE,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CA+ChC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,YAAY,CAyBlF"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The aws `ReceiptStore` (#1835, epic #1703) — core's injectable receipt seam
|
|
3
|
+
* (#1834, `@intentius/chant/op/receipt-store`) implemented over SSM Parameter
|
|
4
|
+
* Store, plain `String`, at the path identity ./effect-receipt-row.ts derives
|
|
5
|
+
* from the ownership marker fields.
|
|
6
|
+
*
|
|
7
|
+
* The transport is the lexicon's own read/apply transport (./api/read-client,
|
|
8
|
+
* #1206), pointed at the SSM JSON API: `fetch`, SigV4 when credentials
|
|
9
|
+
* resolve, and the one endpoint-override rule (#1694) — the `endpoint`
|
|
10
|
+
* option, else `AWS_ENDPOINT_URL_SSM`, else `AWS_ENDPOINT_URL` — so a local
|
|
11
|
+
* emulator lane reads and writes receipts without any store-specific wiring.
|
|
12
|
+
*
|
|
13
|
+
* Write discipline (epic decision 3): `write` exists for the `effect()` step
|
|
14
|
+
* alone — the step's read-compare-run-write is the only path that reaches it,
|
|
15
|
+
* on success, last. `PutParameter` is `Type: "String"` always; the first
|
|
16
|
+
* write creates the parameter with the ownership tags, and a later write
|
|
17
|
+
* overwrites the value (SSM refuses `Overwrite` and `Tags` in one call, so
|
|
18
|
+
* tags ride creation only — they never change after).
|
|
19
|
+
*
|
|
20
|
+
* Identity: the parameter name needs `<stack>` and `<env>`, which the
|
|
21
|
+
* activity args deliberately do not carry (the `EffectReceiptRef` is
|
|
22
|
+
* identity-of-the-effect, not identity-of-the-deployment). The store resolves
|
|
23
|
+
* them once, lazily, at first use: an explicit option, else `CHANT_ENV` (what
|
|
24
|
+
* `chant run --env` sets) and the project's `ownership` block — the same
|
|
25
|
+
* fields that stamp markers (epic decision 4). Nothing resolving is an error,
|
|
26
|
+
* never a guessed segment.
|
|
27
|
+
*/
|
|
28
|
+
import { loadChantConfigUpward, resolveOwnershipStack } from "@intentius/chant/config";
|
|
29
|
+
import { ownershipEntries } from "@intentius/chant/ownership";
|
|
30
|
+
import { AwsReadError, requestHeaders, serviceUrl, withChainCredentials, withEndpointOverride, } from "./api/read-client.js";
|
|
31
|
+
import { AWS_TAG_OWNERSHIP_KEYS } from "./ownership.js";
|
|
32
|
+
import { AWS_EFFECT_RECEIPT_ENTITY_TYPE, EFFECT_RECEIPTS_METADATA_KEY, receiptParameterName } from "./effect-receipt-row.js";
|
|
33
|
+
const SSM_SERVICE = "ssm";
|
|
34
|
+
const SSM_TARGET_PREFIX = "AmazonSSM";
|
|
35
|
+
/** One SSM JSON call. Exported for the observation leg (plugin.ts), which
|
|
36
|
+
* reads the same parameters the store writes. */
|
|
37
|
+
export async function ssmCall(action, payload, options) {
|
|
38
|
+
const settled = await withChainCredentials(withEndpointOverride(SSM_SERVICE, options));
|
|
39
|
+
const url = serviceUrl(SSM_SERVICE, settled.endpoint, settled.region);
|
|
40
|
+
const body = JSON.stringify(payload);
|
|
41
|
+
const base = {
|
|
42
|
+
"content-type": "application/x-amz-json-1.1",
|
|
43
|
+
"x-amz-target": `${SSM_TARGET_PREFIX}.${action}`,
|
|
44
|
+
};
|
|
45
|
+
const headers = requestHeaders(SSM_SERVICE, url, body, base, settled);
|
|
46
|
+
const http = settled.http ??
|
|
47
|
+
(async (u, init, signal) => {
|
|
48
|
+
const res = await fetch(u, { method: "POST", headers: init.headers, body: init.body, signal });
|
|
49
|
+
return { status: res.status, text: await res.text() };
|
|
50
|
+
});
|
|
51
|
+
const res = await http(url, { headers, body }, settled.signal);
|
|
52
|
+
let json = {};
|
|
53
|
+
try {
|
|
54
|
+
json = res.text ? JSON.parse(res.text) : {};
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
if (res.status < 400) {
|
|
58
|
+
throw new AwsReadError(`SSM ${action}: unparseable response (status ${res.status})`, res.status);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { status: res.status, json };
|
|
62
|
+
}
|
|
63
|
+
/** The API's own error code from a JSON-protocol error body — `__type`, with
|
|
64
|
+
* any `namespace#` prefix stripped. */
|
|
65
|
+
export function ssmErrorCode(json) {
|
|
66
|
+
const type = json.__type;
|
|
67
|
+
if (typeof type !== "string")
|
|
68
|
+
return undefined;
|
|
69
|
+
return type.includes("#") ? type.slice(type.indexOf("#") + 1) : type;
|
|
70
|
+
}
|
|
71
|
+
function ssmError(action, status, json) {
|
|
72
|
+
const code = ssmErrorCode(json);
|
|
73
|
+
const message = typeof json.message === "string" ? json.message : typeof json.Message === "string" ? json.Message : "";
|
|
74
|
+
return new AwsReadError(`SSM ${action} failed (status ${status})${code ? ` ${code}` : ""}${message ? `: ${message}` : ""}`, status, code);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `GetParameter` by name. Absent (`ParameterNotFound`) is `undefined` — a real
|
|
78
|
+
* answer, distinct from a failed read, which throws.
|
|
79
|
+
*/
|
|
80
|
+
export async function ssmGetParameter(name, options = {}) {
|
|
81
|
+
const { status, json } = await ssmCall("GetParameter", { Name: name }, options);
|
|
82
|
+
if (status >= 400) {
|
|
83
|
+
if (ssmErrorCode(json) === "ParameterNotFound")
|
|
84
|
+
return undefined;
|
|
85
|
+
throw ssmError("GetParameter", status, json);
|
|
86
|
+
}
|
|
87
|
+
const value = json.Parameter?.Value;
|
|
88
|
+
return typeof value === "string" ? value : undefined;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* `PutParameter`, plain `String`. Creation carries `tags`; an existing
|
|
92
|
+
* parameter is overwritten (`Overwrite: true`) without them — SSM refuses
|
|
93
|
+
* `Overwrite` and `Tags` in the same call, and ownership tags never change.
|
|
94
|
+
*/
|
|
95
|
+
export async function ssmPutParameter(name, value, tags, options = {}) {
|
|
96
|
+
const tagList = Object.entries(tags).map(([Key, Value]) => ({ Key, Value }));
|
|
97
|
+
const create = await ssmCall("PutParameter", { Name: name, Value: value, Type: "String", ...(tagList.length > 0 ? { Tags: tagList } : {}) }, options);
|
|
98
|
+
if (create.status < 400)
|
|
99
|
+
return;
|
|
100
|
+
if (ssmErrorCode(create.json) !== "ParameterAlreadyExists") {
|
|
101
|
+
throw ssmError("PutParameter", create.status, create.json);
|
|
102
|
+
}
|
|
103
|
+
const overwrite = await ssmCall("PutParameter", { Name: name, Value: value, Type: "String", Overwrite: true }, options);
|
|
104
|
+
if (overwrite.status >= 400)
|
|
105
|
+
throw ssmError("PutParameter", overwrite.status, overwrite.json);
|
|
106
|
+
}
|
|
107
|
+
async function resolveIdentity(options) {
|
|
108
|
+
const processEnv = options.env ?? process.env;
|
|
109
|
+
let stack = options.stack;
|
|
110
|
+
let env = options.environment ?? processEnv.CHANT_ENV;
|
|
111
|
+
if (!stack || !env) {
|
|
112
|
+
let config;
|
|
113
|
+
try {
|
|
114
|
+
config = (await loadChantConfigUpward(options.cwd ?? process.cwd())).config;
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
config = undefined;
|
|
118
|
+
}
|
|
119
|
+
if (config) {
|
|
120
|
+
stack = stack ?? resolveOwnershipStack(config);
|
|
121
|
+
// Only a literal env can answer here: a `{ param }` reference resolves
|
|
122
|
+
// per build, and an op run has no build parameters — `--env` does.
|
|
123
|
+
const configEnv = config.ownership?.env;
|
|
124
|
+
env = env ?? (typeof configEnv === "string" ? configEnv : undefined);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (!stack) {
|
|
128
|
+
throw new Error("aws receipt store: no stack identity — the receipt path is " +
|
|
129
|
+
"/chant-receipts/<stack>/<env>/<effect>, derived from the same ownership fields that stamp " +
|
|
130
|
+
"markers (chant #1703, decision 4). Set ownership: { stack } in chant.config.ts.");
|
|
131
|
+
}
|
|
132
|
+
if (!env) {
|
|
133
|
+
throw new Error("aws receipt store: no environment resolved — the receipt path's <env> segment is explicit " +
|
|
134
|
+
"(chant #1703, decision 4). Run with --env <name>, set CHANT_ENV, or set a literal " +
|
|
135
|
+
"ownership.env in chant.config.ts.");
|
|
136
|
+
}
|
|
137
|
+
return { stack, env };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The plan-side live read of the receipt rows (#1835's observation leg).
|
|
141
|
+
*
|
|
142
|
+
* A receipt is not a stack member — the applier never writes it (#1832) — so
|
|
143
|
+
* `describe-stack-resources` honestly reports it absent even while the
|
|
144
|
+
* parameter exists. The serializer renders each receipt's derived path into
|
|
145
|
+
* the template's `Metadata` (./serializer.ts), so this leg reads the paths
|
|
146
|
+
* back from the build output — one derivation, decision 4 — and asks SSM
|
|
147
|
+
* `GetParameter` for each. Present maps the stored value onto
|
|
148
|
+
* `attributes.value` (core's `RECEIPT_VALUE_ATTRIBUTE`); `ParameterNotFound`
|
|
149
|
+
* is a real absence and stays one; a failed read is an `unobserved` hole,
|
|
150
|
+
* never a wrong answer — a receipt nobody could read must not arrive
|
|
151
|
+
* downstream as "the effect never ran".
|
|
152
|
+
*/
|
|
153
|
+
export async function observeReceiptRows(entityNames, buildOutput, options = {}) {
|
|
154
|
+
const out = { resources: {}, unobserved: {} };
|
|
155
|
+
let rows;
|
|
156
|
+
try {
|
|
157
|
+
const template = JSON.parse(buildOutput);
|
|
158
|
+
const block = template.Metadata?.[EFFECT_RECEIPTS_METADATA_KEY];
|
|
159
|
+
if (typeof block === "object" && block !== null) {
|
|
160
|
+
rows = block;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
rows = undefined; // Not a JSON template — no receipt rows to read.
|
|
165
|
+
}
|
|
166
|
+
if (!rows)
|
|
167
|
+
return out;
|
|
168
|
+
for (const name of entityNames) {
|
|
169
|
+
const rendered = rows[name]?.Properties?.Name;
|
|
170
|
+
if (typeof rendered !== "string")
|
|
171
|
+
continue;
|
|
172
|
+
try {
|
|
173
|
+
const value = await ssmGetParameter(rendered, options);
|
|
174
|
+
if (value === undefined)
|
|
175
|
+
continue; // Confirmed absent — the effect has not stamped it yet.
|
|
176
|
+
out.resources[name] = {
|
|
177
|
+
type: AWS_EFFECT_RECEIPT_ENTITY_TYPE,
|
|
178
|
+
physicalId: rendered,
|
|
179
|
+
// Live outside the stack by design — the same word the identity
|
|
180
|
+
// fallback (#1647) uses for a resource CloudFormation does not hold.
|
|
181
|
+
status: "EXTERNAL",
|
|
182
|
+
// GetParameter returns no tags, so the marker channel is unreadable
|
|
183
|
+
// here; `unknown` is the total verdict, never a guess (#1089).
|
|
184
|
+
ownership: "unknown",
|
|
185
|
+
attributes: { value },
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
const detail = err instanceof AwsReadError && err.code
|
|
190
|
+
? `${err.code}: ${err.message}`
|
|
191
|
+
: String(err instanceof Error ? err.message : err);
|
|
192
|
+
const reason = /credential|token|expired|AccessDenied|not authorized|Unauthorized/i.test(detail)
|
|
193
|
+
? "no-credentials"
|
|
194
|
+
: "read-failed";
|
|
195
|
+
out.unobserved[name] = {
|
|
196
|
+
type: AWS_EFFECT_RECEIPT_ENTITY_TYPE,
|
|
197
|
+
reason,
|
|
198
|
+
detail: `GetParameter failed for receipt "${rendered}": ${detail}`,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* The `ReceiptStore` over SSM. Bind it once in the op activities barrel —
|
|
206
|
+
* `receiptActivities(awsReceiptStore())` — and the registry resolves
|
|
207
|
+
* `receiptRead`/`receiptWrite`/`receiptStaleness` by name, exactly like
|
|
208
|
+
* `ensureSecret` (#1830). Identity and endpoint resolve lazily at first use,
|
|
209
|
+
* so module load never reads the project or the environment.
|
|
210
|
+
*/
|
|
211
|
+
export function awsReceiptStore(options = {}) {
|
|
212
|
+
let identity;
|
|
213
|
+
const identityOf = () => (identity ?? (identity = resolveIdentity(options)));
|
|
214
|
+
const client = () => ({
|
|
215
|
+
...(options.endpoint !== undefined ? { endpoint: options.endpoint } : {}),
|
|
216
|
+
...(options.region !== undefined ? { region: options.region } : {}),
|
|
217
|
+
...(options.http !== undefined ? { http: options.http } : {}),
|
|
218
|
+
...(options.env !== undefined ? { env: options.env } : {}),
|
|
219
|
+
...(options.credentials !== undefined ? { credentials: options.credentials } : {}),
|
|
220
|
+
...(options.signEndpointOverride !== undefined ? { signEndpointOverride: options.signEndpointOverride } : {}),
|
|
221
|
+
});
|
|
222
|
+
return {
|
|
223
|
+
async read(receipt) {
|
|
224
|
+
const { stack, env } = await identityOf();
|
|
225
|
+
return ssmGetParameter(receiptParameterName(stack, env, receipt.effect), client());
|
|
226
|
+
},
|
|
227
|
+
async write(receipt, expectation) {
|
|
228
|
+
const { stack, env } = await identityOf();
|
|
229
|
+
const tags = ownershipEntries(AWS_TAG_OWNERSHIP_KEYS, { stack, env });
|
|
230
|
+
await ssmPutParameter(receiptParameterName(stack, env, receipt.effect), expectation, tags, client());
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS reference catalog (#778, epic #776 v1) — how observed AWS resources
|
|
3
|
+
* reference each other, so `chant graph --live` can reconstruct the topology.
|
|
4
|
+
*
|
|
5
|
+
* Keyed to the per-resource describe/export attribute shape (`VpcId`,
|
|
6
|
+
* `SecurityGroups[].GroupId`, `TargetGroupArn`, …), not the thin
|
|
7
|
+
* `describe-stack-resources` metadata. Enough to draw the canonical 3-tier VPC
|
|
8
|
+
* (internet → ALB → ECS service → RDS, with SG attachments). `containment`
|
|
9
|
+
* relations (subnet ∈ VPC) feed #779's boundary boxes; `reference` relations are
|
|
10
|
+
* edges.
|
|
11
|
+
*/
|
|
12
|
+
export const awsReferenceCatalog = {
|
|
13
|
+
identities: [
|
|
14
|
+
{ kind: "AWS::EC2::VPC", ids: ["VpcId"] },
|
|
15
|
+
{ kind: "AWS::EC2::Subnet", ids: ["SubnetId"] },
|
|
16
|
+
{ kind: "AWS::EC2::SecurityGroup", ids: ["GroupId"] },
|
|
17
|
+
{ kind: "AWS::EC2::NetworkInterface", ids: ["NetworkInterfaceId"] },
|
|
18
|
+
{ kind: "AWS::EC2::Instance", ids: ["InstanceId"] },
|
|
19
|
+
{ kind: "AWS::EC2::InternetGateway", ids: ["InternetGatewayId"] },
|
|
20
|
+
{ kind: "AWS::EC2::NatGateway", ids: ["NatGatewayId"] },
|
|
21
|
+
{ kind: "AWS::EC2::RouteTable", ids: ["RouteTableId"] },
|
|
22
|
+
{ kind: "AWS::EC2::LaunchTemplate", ids: ["LaunchTemplateId", "LaunchTemplateName"] },
|
|
23
|
+
{ kind: "AWS::ElasticLoadBalancingV2::LoadBalancer", ids: ["LoadBalancerArn", "DNSName"] },
|
|
24
|
+
{ kind: "AWS::ElasticLoadBalancingV2::TargetGroup", ids: ["TargetGroupArn"] },
|
|
25
|
+
{ kind: "AWS::ECS::Cluster", ids: ["ClusterArn", "ClusterName"] },
|
|
26
|
+
{ kind: "AWS::ECS::Service", ids: ["ServiceArn"] },
|
|
27
|
+
{ kind: "AWS::ECS::TaskDefinition", ids: ["TaskDefinitionArn"] },
|
|
28
|
+
{ kind: "AWS::RDS::DBInstance", ids: ["DBInstanceArn", "Endpoint.Address"] },
|
|
29
|
+
],
|
|
30
|
+
refs: [
|
|
31
|
+
// ── containment (→ boundary boxes, #779) ──
|
|
32
|
+
{ from: "AWS::EC2::Subnet", path: "VpcId", targetKind: "AWS::EC2::VPC", relation: "containment", label: "in VPC" },
|
|
33
|
+
{ from: "AWS::EC2::SecurityGroup", path: "VpcId", targetKind: "AWS::EC2::VPC", relation: "containment", label: "in VPC" },
|
|
34
|
+
{ from: "AWS::EC2::RouteTable", path: "VpcId", targetKind: "AWS::EC2::VPC", relation: "containment", label: "in VPC" },
|
|
35
|
+
{ from: "AWS::EC2::Instance", path: "SubnetId", targetKind: "AWS::EC2::Subnet", relation: "containment", label: "in subnet", viaAttr: "SubnetId" },
|
|
36
|
+
// An instance is in a VPC, and `describe-instances` says so directly. The
|
|
37
|
+
// other three kinds that sit in a VPC — subnet, security group, route table
|
|
38
|
+
// — all had this rule; the instance did not, so the estate's own topology
|
|
39
|
+
// was missing its most-asked-about member. Nothing derived it either: the
|
|
40
|
+
// instance reached its VPC only through its subnet, two hops, which a
|
|
41
|
+
// one-hop `<-` cannot cross.
|
|
42
|
+
{ from: "AWS::EC2::Instance", path: "VpcId", targetKind: "AWS::EC2::VPC", relation: "containment", label: "in VPC" },
|
|
43
|
+
{ from: "AWS::EC2::NatGateway", path: "SubnetId", targetKind: "AWS::EC2::Subnet", relation: "containment", label: "in subnet" },
|
|
44
|
+
{ from: "AWS::ElasticLoadBalancingV2::LoadBalancer", path: "AvailabilityZones[].SubnetId", targetKind: "AWS::EC2::Subnet", relation: "containment", label: "in subnet" },
|
|
45
|
+
{ from: "AWS::ElasticLoadBalancingV2::TargetGroup", path: "VpcId", targetKind: "AWS::EC2::VPC", relation: "containment", label: "in VPC" },
|
|
46
|
+
{ from: "AWS::ECS::Service", path: "NetworkConfiguration.AwsvpcConfiguration.Subnets[]", targetKind: "AWS::EC2::Subnet", relation: "containment", label: "in subnet" },
|
|
47
|
+
{ from: "AWS::RDS::DBInstance", path: "DBSubnetGroup.Subnets[].SubnetIdentifier", targetKind: "AWS::EC2::Subnet", relation: "containment", label: "in subnet" },
|
|
48
|
+
// ── references (→ edges) ──
|
|
49
|
+
{ from: "AWS::EC2::Instance", path: "SecurityGroups[].GroupId", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg", viaAttr: "SecurityGroupIds" },
|
|
50
|
+
{ from: "AWS::EC2::Instance", path: "SecurityGroupIds[]", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg", viaAttr: "SecurityGroupIds" },
|
|
51
|
+
// Security groups reached indirectly, through a launch template — the hop a
|
|
52
|
+
// flat describe-instances sweep misses, and the reason `effectiveIngress`
|
|
53
|
+
// exists as a fold rather than a passthrough.
|
|
54
|
+
{ from: "AWS::EC2::Instance", path: "LaunchTemplate.LaunchTemplateId", targetKind: "AWS::EC2::LaunchTemplate", relation: "reference", label: "from template", viaAttr: "LaunchTemplateId" },
|
|
55
|
+
{ from: "AWS::EC2::Instance", path: "LaunchTemplateId", targetKind: "AWS::EC2::LaunchTemplate", relation: "reference", label: "from template", viaAttr: "LaunchTemplateId" },
|
|
56
|
+
{ from: "AWS::EC2::LaunchTemplate", path: "LaunchTemplateData.SecurityGroupIds[]", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg", viaAttr: "SecurityGroupIds" },
|
|
57
|
+
{ from: "AWS::EC2::LaunchTemplate", path: "SecurityGroupIds[]", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg", viaAttr: "SecurityGroupIds" },
|
|
58
|
+
// The routing chain `internetFacing` walks. Route and association carry no
|
|
59
|
+
// physical id of their own, so they are only ever the `from` side.
|
|
60
|
+
{ from: "AWS::EC2::Route", path: "RouteTableId", targetKind: "AWS::EC2::RouteTable", relation: "reference", label: "in table", viaAttr: "RouteTableId" },
|
|
61
|
+
{ from: "AWS::EC2::SubnetRouteTableAssociation", path: "SubnetId", targetKind: "AWS::EC2::Subnet", relation: "reference", label: "associates", viaAttr: "SubnetId" },
|
|
62
|
+
{ from: "AWS::EC2::SubnetRouteTableAssociation", path: "RouteTableId", targetKind: "AWS::EC2::RouteTable", relation: "reference", label: "to table", viaAttr: "RouteTableId" },
|
|
63
|
+
{ from: "AWS::EC2::SecurityGroup", path: "IpPermissions[].UserIdGroupPairs[].GroupId", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "allows" },
|
|
64
|
+
// An ENI is where a security group is attached and where an instance's
|
|
65
|
+
// networking actually lives, so both edges are what make "unused" and
|
|
66
|
+
// "reachable" answerable from the graph rather than from a provider sweep.
|
|
67
|
+
{ from: "AWS::EC2::NetworkInterface", path: "Groups[].GroupId", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg", viaAttr: "Groups" },
|
|
68
|
+
{ from: "AWS::EC2::NetworkInterface", path: "Attachment.InstanceId", targetKind: "AWS::EC2::Instance", relation: "reference", label: "attached to", viaAttr: "Attachment" },
|
|
69
|
+
{ from: "AWS::EC2::NetworkInterface", path: "SubnetId", targetKind: "AWS::EC2::Subnet", relation: "containment", label: "in subnet" },
|
|
70
|
+
{ from: "AWS::EC2::Route", path: "GatewayId", targetKind: "AWS::EC2::InternetGateway", relation: "reference", label: "via", viaAttr: "GatewayId" },
|
|
71
|
+
{ from: "AWS::EC2::Route", path: "NatGatewayId", targetKind: "AWS::EC2::NatGateway", relation: "reference", label: "via" },
|
|
72
|
+
{ from: "AWS::ElasticLoadBalancingV2::LoadBalancer", path: "SecurityGroups[]", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg" },
|
|
73
|
+
{ from: "AWS::ElasticLoadBalancingV2::Listener", path: "LoadBalancerArn", targetKind: "AWS::ElasticLoadBalancingV2::LoadBalancer", relation: "reference", label: "on" },
|
|
74
|
+
{ from: "AWS::ElasticLoadBalancingV2::Listener", path: "DefaultActions[].TargetGroupArn", targetKind: "AWS::ElasticLoadBalancingV2::TargetGroup", relation: "reference", label: "forwards to" },
|
|
75
|
+
{ from: "AWS::ECS::Service", path: "ClusterArn", targetKind: "AWS::ECS::Cluster", relation: "reference", label: "in cluster" },
|
|
76
|
+
{ from: "AWS::ECS::Service", path: "TaskDefinition", targetKind: "AWS::ECS::TaskDefinition", relation: "reference", label: "runs" },
|
|
77
|
+
{ from: "AWS::ECS::Service", path: "LoadBalancers[].TargetGroupArn", targetKind: "AWS::ElasticLoadBalancingV2::TargetGroup", relation: "reference", label: "registered in" },
|
|
78
|
+
{ from: "AWS::ECS::Service", path: "NetworkConfiguration.AwsvpcConfiguration.SecurityGroups[]", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg" },
|
|
79
|
+
{ from: "AWS::RDS::DBInstance", path: "VpcSecurityGroups[].VpcSecurityGroupId", targetKind: "AWS::EC2::SecurityGroup", relation: "reference", label: "sg" },
|
|
80
|
+
// ── CloudFormation *template* property paths (#784) ──
|
|
81
|
+
// `enrichLiveAttrs` resolves the deployed template's `{Ref}`/`{Fn::GetAtt}`
|
|
82
|
+
// intrinsics to bare logical ids (= node ids), so these match by node id; the
|
|
83
|
+
// property names are the CFN template shape (SecurityGroupIds, Cluster, …),
|
|
84
|
+
// which differs from the describe/SDK shape above. No targetKind needed —
|
|
85
|
+
// logical ids are unique.
|
|
86
|
+
{ from: "AWS::EC2::Subnet", path: "VpcId", relation: "containment", label: "in VPC" },
|
|
87
|
+
{ from: "AWS::EC2::SecurityGroup", path: "VpcId", relation: "containment", label: "in VPC" },
|
|
88
|
+
{ from: "AWS::EC2::RouteTable", path: "VpcId", relation: "containment", label: "in VPC" },
|
|
89
|
+
{ from: "AWS::EC2::Instance", path: "SubnetId", relation: "containment", label: "in subnet" },
|
|
90
|
+
{ from: "AWS::EC2::Instance", path: "SecurityGroupIds[]", relation: "reference", label: "sg" },
|
|
91
|
+
{ from: "AWS::EC2::NatGateway", path: "SubnetId", relation: "containment", label: "in subnet" },
|
|
92
|
+
{ from: "AWS::EC2::Route", path: "RouteTableId", relation: "reference", label: "in" },
|
|
93
|
+
{ from: "AWS::EC2::Route", path: "GatewayId", relation: "reference", label: "via" },
|
|
94
|
+
{ from: "AWS::EC2::Route", path: "NatGatewayId", relation: "reference", label: "via" },
|
|
95
|
+
{ from: "AWS::ElasticLoadBalancingV2::LoadBalancer", path: "Subnets[]", relation: "containment", label: "in subnet" },
|
|
96
|
+
{ from: "AWS::ElasticLoadBalancingV2::LoadBalancer", path: "SecurityGroups[]", relation: "reference", label: "sg" },
|
|
97
|
+
{ from: "AWS::ElasticLoadBalancingV2::TargetGroup", path: "VpcId", relation: "containment", label: "in VPC" },
|
|
98
|
+
{ from: "AWS::ElasticLoadBalancingV2::Listener", path: "LoadBalancerArn", relation: "reference", label: "on" },
|
|
99
|
+
{ from: "AWS::ElasticLoadBalancingV2::Listener", path: "DefaultActions[].TargetGroupArn", relation: "reference", label: "forwards to" },
|
|
100
|
+
{ from: "AWS::ECS::Service", path: "Cluster", relation: "reference", label: "in cluster" },
|
|
101
|
+
{ from: "AWS::ECS::Service", path: "TaskDefinition", relation: "reference", label: "runs" },
|
|
102
|
+
{ from: "AWS::ECS::Service", path: "LoadBalancers[].TargetGroupArn", relation: "reference", label: "registered in" },
|
|
103
|
+
{ from: "AWS::RDS::DBInstance", path: "DBSubnetGroupName", relation: "reference", label: "subnets" },
|
|
104
|
+
{ from: "AWS::RDS::DBInstance", path: "VPCSecurityGroups[]", relation: "reference", label: "sg" },
|
|
105
|
+
],
|
|
106
|
+
};
|
package/dist/rules/ext001.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import { readFileSync } from "fs";
|
|
15
15
|
import { join } from "path";
|
|
16
|
+
import { moduleSourceDir } from "@intentius/chant/module-source";
|
|
16
17
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
17
18
|
import { parseCFTemplate, type CFResource } from "./cf-refs";
|
|
18
19
|
|
|
@@ -36,9 +37,8 @@ interface LexiconEntry {
|
|
|
36
37
|
function loadLexiconConstraints(): Map<string, ExtensionConstraint[]> {
|
|
37
38
|
const map = new Map<string, ExtensionConstraint[]>();
|
|
38
39
|
try {
|
|
39
|
-
//
|
|
40
|
-
const
|
|
41
|
-
const lexiconPath = join(pkgDir, "src", "generated", "lexicon-aws.json");
|
|
40
|
+
// From src/lint/post-synth/ (or its compiled twin under dist/) to src/generated/
|
|
41
|
+
const lexiconPath = join(moduleSourceDir(import.meta.url), "..", "..", "generated", "lexicon-aws.json");
|
|
42
42
|
const content = readFileSync(lexiconPath, "utf-8");
|
|
43
43
|
const data = JSON.parse(content) as Record<string, LexiconEntry>;
|
|
44
44
|
|
package/dist/rules/waw016.ts
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import { readFileSync } from "fs";
|
|
19
19
|
import { join } from "path";
|
|
20
|
+
import { moduleSourceDir } from "@intentius/chant/module-source";
|
|
20
21
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
21
22
|
import { parseCFTemplate } from "./cf-refs";
|
|
22
23
|
|
|
@@ -38,8 +39,7 @@ interface LexiconEntry {
|
|
|
38
39
|
function loadDeprecatedProperties(): Map<string, Map<string, DeprecationBasis>> {
|
|
39
40
|
const map = new Map<string, Map<string, DeprecationBasis>>();
|
|
40
41
|
try {
|
|
41
|
-
const
|
|
42
|
-
const lexiconPath = join(pkgDir, "src", "generated", "lexicon-aws.json");
|
|
42
|
+
const lexiconPath = join(moduleSourceDir(import.meta.url), "..", "..", "generated", "lexicon-aws.json");
|
|
43
43
|
const content = readFileSync(lexiconPath, "utf-8");
|
|
44
44
|
const data = JSON.parse(content) as Record<string, LexiconEntry>;
|
|
45
45
|
|