@intentius/chant-lexicon-aws 0.124.31 → 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,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for extracting CloudFormation resource references
|
|
3
|
+
* from template properties.
|
|
4
|
+
*
|
|
5
|
+
* Used by WAW010 (redundant DependsOn) and COR020 (circular deps).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parse a serialized CloudFormation template from build output.
|
|
9
|
+
* Accepts either a raw string or a SerializerResult (extracts primary).
|
|
10
|
+
*/
|
|
11
|
+
export function parseCFTemplate(output) {
|
|
12
|
+
const raw = typeof output === "string" ? output : output.primary;
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse(raw);
|
|
15
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
16
|
+
return parsed;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// Not valid JSON
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Recursively walk a CloudFormation property value and extract all logical IDs
|
|
26
|
+
* referenced via Ref and Fn::GetAtt.
|
|
27
|
+
*
|
|
28
|
+
* Skips pseudo-parameters (those starting with "AWS::").
|
|
29
|
+
*/
|
|
30
|
+
export function findResourceRefs(value) {
|
|
31
|
+
const refs = new Set();
|
|
32
|
+
walkValue(value, refs);
|
|
33
|
+
return refs;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build the reverse of `findResourceRefs` for a whole template: logical id →
|
|
37
|
+
* the set of logical ids whose Properties reference it via Ref/Fn::GetAtt.
|
|
38
|
+
* Lets a check walk the graph consumer-ward (who uses this role?) instead of
|
|
39
|
+
* dependency-ward. Used by WAW059.
|
|
40
|
+
*/
|
|
41
|
+
export function buildReverseRefIndex(template) {
|
|
42
|
+
const index = new Map();
|
|
43
|
+
for (const [logicalId, resource] of Object.entries(template.Resources ?? {})) {
|
|
44
|
+
for (const target of findResourceRefs(resource.Properties)) {
|
|
45
|
+
if (target === logicalId)
|
|
46
|
+
continue;
|
|
47
|
+
let consumers = index.get(target);
|
|
48
|
+
if (!consumers) {
|
|
49
|
+
consumers = new Set();
|
|
50
|
+
index.set(target, consumers);
|
|
51
|
+
}
|
|
52
|
+
consumers.add(logicalId);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return index;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if a value is a CloudFormation intrinsic function (Ref, Fn::*, etc.)
|
|
59
|
+
* that cannot be statically evaluated.
|
|
60
|
+
*/
|
|
61
|
+
export function isIntrinsic(value) {
|
|
62
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
63
|
+
return false;
|
|
64
|
+
const obj = value;
|
|
65
|
+
return "Ref" in obj || Object.keys(obj).some((k) => k.startsWith("Fn::"));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Walk IAM policy statements from a resource's properties.
|
|
69
|
+
* Handles IAM::Policy, IAM::Role, and IAM::ManagedPolicy layouts.
|
|
70
|
+
*/
|
|
71
|
+
export function walkPolicyStatements(resource) {
|
|
72
|
+
const statements = [];
|
|
73
|
+
const props = resource.Properties ?? {};
|
|
74
|
+
// PolicyDocument.Statement (IAM::Policy, IAM::ManagedPolicy)
|
|
75
|
+
collectStatements(props.PolicyDocument, statements);
|
|
76
|
+
// AssumeRolePolicyDocument.Statement (IAM::Role)
|
|
77
|
+
collectStatements(props.AssumeRolePolicyDocument, statements);
|
|
78
|
+
// Policies[].PolicyDocument.Statement (IAM::Role inline policies)
|
|
79
|
+
if (Array.isArray(props.Policies)) {
|
|
80
|
+
for (const policy of props.Policies) {
|
|
81
|
+
if (typeof policy === "object" && policy !== null) {
|
|
82
|
+
collectStatements(policy.PolicyDocument, statements);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return statements;
|
|
87
|
+
}
|
|
88
|
+
function collectStatements(policyDoc, out) {
|
|
89
|
+
if (typeof policyDoc !== "object" || policyDoc === null)
|
|
90
|
+
return;
|
|
91
|
+
const doc = policyDoc;
|
|
92
|
+
if (Array.isArray(doc.Statement)) {
|
|
93
|
+
for (const stmt of doc.Statement) {
|
|
94
|
+
if (typeof stmt === "object" && stmt !== null) {
|
|
95
|
+
out.push(stmt);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Normalize security group ingress rules from inline SecurityGroupIngress
|
|
102
|
+
* property and standalone SecurityGroupIngress resources.
|
|
103
|
+
*/
|
|
104
|
+
export function getSecurityGroupIngress(resource) {
|
|
105
|
+
const rules = [];
|
|
106
|
+
const props = resource.Properties ?? {};
|
|
107
|
+
if (Array.isArray(props.SecurityGroupIngress)) {
|
|
108
|
+
for (const rule of props.SecurityGroupIngress) {
|
|
109
|
+
if (typeof rule === "object" && rule !== null) {
|
|
110
|
+
rules.push(rule);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return rules;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Extract an ECS TaskDefinition's container definitions (shared by the
|
|
118
|
+
* WAW046/047/048 ECS checks).
|
|
119
|
+
*/
|
|
120
|
+
export function getContainerDefinitions(resource) {
|
|
121
|
+
const props = resource.Properties ?? {};
|
|
122
|
+
const defs = props.ContainerDefinitions;
|
|
123
|
+
if (!Array.isArray(defs))
|
|
124
|
+
return [];
|
|
125
|
+
return defs.filter((d) => typeof d === "object" && d !== null);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether a build's `env` (from `--env` or the project's `ownership.env`, see
|
|
129
|
+
* PostSynthContext#env and #201) should be treated as the strict "full"/
|
|
130
|
+
* production tier for tier-gated checks, vs a relaxed "light" tier acceptable
|
|
131
|
+
* for local/Floci-style stacks. Reuses the existing `ctx.env` seam — no new
|
|
132
|
+
* tier field. An undefined or unrecognized env is treated as non-strict so a
|
|
133
|
+
* project that never sets `--env`/`ownership.env` isn't unexpectedly hard-failed.
|
|
134
|
+
*/
|
|
135
|
+
export function isFullTierEnv(env) {
|
|
136
|
+
return env === "prod" || env === "production" || env === "full";
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Parse an IPv4 CIDR literal ("10.0.0.0/16") into its numeric base address
|
|
140
|
+
* and prefix length. Returns null for anything that isn't a plain IPv4 CIDR
|
|
141
|
+
* (IPv6, malformed octets, out-of-range prefix) — callers treat that as
|
|
142
|
+
* "can't prove statically" rather than an error.
|
|
143
|
+
*/
|
|
144
|
+
export function parseIpv4Cidr(cidr) {
|
|
145
|
+
const m = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/.exec(cidr.trim());
|
|
146
|
+
if (!m)
|
|
147
|
+
return null;
|
|
148
|
+
const octets = m.slice(1, 5).map(Number);
|
|
149
|
+
if (octets.some((o) => o < 0 || o > 255))
|
|
150
|
+
return null;
|
|
151
|
+
const prefix = Number(m[5]);
|
|
152
|
+
if (prefix < 0 || prefix > 32)
|
|
153
|
+
return null;
|
|
154
|
+
const base = ((octets[0] << 24) | (octets[1] << 16) | (octets[2] << 8) | octets[3]) >>> 0;
|
|
155
|
+
return { base, prefix };
|
|
156
|
+
}
|
|
157
|
+
/** [networkAddress, broadcastAddress] for a parsed IPv4 CIDR block. */
|
|
158
|
+
function ipv4Range(cidr) {
|
|
159
|
+
const maskBits = cidr.prefix === 0 ? 0 : (0xffffffff << (32 - cidr.prefix)) >>> 0;
|
|
160
|
+
const network = (cidr.base & maskBits) >>> 0;
|
|
161
|
+
const broadcast = (network | (~maskBits >>> 0)) >>> 0;
|
|
162
|
+
return [network, broadcast];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Whether `inner` (an IPv4 CIDR literal) falls entirely within `outer`.
|
|
166
|
+
* Returns null — not false — when either literal isn't a plain, parseable
|
|
167
|
+
* IPv4 CIDR (e.g. IPv6, or a CloudFormation intrinsic already stringified
|
|
168
|
+
* elsewhere); a null means "statically unprovable", not "violation".
|
|
169
|
+
*/
|
|
170
|
+
export function ipv4CidrContains(outer, inner) {
|
|
171
|
+
const outerCidr = parseIpv4Cidr(outer);
|
|
172
|
+
const innerCidr = parseIpv4Cidr(inner);
|
|
173
|
+
if (!outerCidr || !innerCidr)
|
|
174
|
+
return null;
|
|
175
|
+
const [oStart, oEnd] = ipv4Range(outerCidr);
|
|
176
|
+
const [iStart, iEnd] = ipv4Range(innerCidr);
|
|
177
|
+
return iStart >= oStart && iEnd <= oEnd;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* A port as a number. CloudFormation accepts `"80"` as well as `80`, so a
|
|
181
|
+
* string of digits counts; anything else reads as -1, which means all ports.
|
|
182
|
+
*/
|
|
183
|
+
function portNumber(port) {
|
|
184
|
+
if (typeof port === "number")
|
|
185
|
+
return port;
|
|
186
|
+
if (typeof port === "string" && /^-?\d+$/.test(port.trim()))
|
|
187
|
+
return Number(port);
|
|
188
|
+
return -1;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Check if a port range [fromPort, toPort] contains any of the sensitive ports.
|
|
192
|
+
*/
|
|
193
|
+
export function portRangeContainsSensitive(fromPort, toPort, sensitivePorts) {
|
|
194
|
+
// Missing ports means all ports
|
|
195
|
+
if (fromPort === undefined && toPort === undefined)
|
|
196
|
+
return true;
|
|
197
|
+
const from = portNumber(fromPort);
|
|
198
|
+
const to = portNumber(toPort);
|
|
199
|
+
// If either is an intrinsic, we can't statically verify
|
|
200
|
+
if (isIntrinsic(fromPort) || isIntrinsic(toPort))
|
|
201
|
+
return false;
|
|
202
|
+
if (from === -1 && to === -1)
|
|
203
|
+
return true;
|
|
204
|
+
for (const port of sensitivePorts) {
|
|
205
|
+
if (from <= port && port <= to)
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
function walkValue(value, refs) {
|
|
211
|
+
if (value === null || value === undefined)
|
|
212
|
+
return;
|
|
213
|
+
if (typeof value !== "object")
|
|
214
|
+
return;
|
|
215
|
+
if (Array.isArray(value)) {
|
|
216
|
+
for (const item of value) {
|
|
217
|
+
walkValue(item, refs);
|
|
218
|
+
}
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const obj = value;
|
|
222
|
+
// Check for Ref
|
|
223
|
+
if ("Ref" in obj && typeof obj.Ref === "string") {
|
|
224
|
+
if (!obj.Ref.startsWith("AWS::")) {
|
|
225
|
+
refs.add(obj.Ref);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Check for Fn::GetAtt
|
|
229
|
+
if ("Fn::GetAtt" in obj) {
|
|
230
|
+
const getAtt = obj["Fn::GetAtt"];
|
|
231
|
+
if (Array.isArray(getAtt) && getAtt.length >= 1 && typeof getAtt[0] === "string") {
|
|
232
|
+
refs.add(getAtt[0]);
|
|
233
|
+
}
|
|
234
|
+
else if (typeof getAtt === "string") {
|
|
235
|
+
// Dot-delimited form: "LogicalId.Attribute"
|
|
236
|
+
const logicalId = getAtt.split(".")[0];
|
|
237
|
+
if (logicalId)
|
|
238
|
+
refs.add(logicalId);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Recurse into all object values (including intrinsic function arguments)
|
|
242
|
+
for (const val of Object.values(obj)) {
|
|
243
|
+
if (typeof val === "object" && val !== null) {
|
|
244
|
+
walkValue(val, refs);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* COR020: Circular Resource Dependencies
|
|
3
|
+
*
|
|
4
|
+
* Builds a directed dependency graph from Ref, Fn::GetAtt, and DependsOn
|
|
5
|
+
* entries in the synthesized CloudFormation template. Detects cycles using
|
|
6
|
+
* DFS with three-color marking (white/gray/black).
|
|
7
|
+
*/
|
|
8
|
+
import { detectCycles } from "@intentius/chant/discovery/cycles";
|
|
9
|
+
import { parseCFTemplate, findResourceRefs } from "./cf-refs.js";
|
|
10
|
+
export const cor020 = {
|
|
11
|
+
id: "COR020",
|
|
12
|
+
description: "Circular resource dependency — detects cycles in the resource dependency graph",
|
|
13
|
+
check(ctx) {
|
|
14
|
+
const diagnostics = [];
|
|
15
|
+
for (const [_lexicon, output] of ctx.outputs) {
|
|
16
|
+
const template = parseCFTemplate(output);
|
|
17
|
+
if (!template?.Resources)
|
|
18
|
+
continue;
|
|
19
|
+
const resourceIds = new Set(Object.keys(template.Resources));
|
|
20
|
+
// Build adjacency list: resource → set of resources it depends on
|
|
21
|
+
const graph = new Map();
|
|
22
|
+
for (const [logicalId, resource] of Object.entries(template.Resources)) {
|
|
23
|
+
const deps = new Set();
|
|
24
|
+
// Refs from Properties
|
|
25
|
+
const propertyRefs = findResourceRefs(resource.Properties);
|
|
26
|
+
for (const ref of propertyRefs) {
|
|
27
|
+
if (resourceIds.has(ref) && ref !== logicalId) {
|
|
28
|
+
deps.add(ref);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Explicit DependsOn
|
|
32
|
+
if (resource.DependsOn) {
|
|
33
|
+
const dependsOn = Array.isArray(resource.DependsOn)
|
|
34
|
+
? resource.DependsOn
|
|
35
|
+
: [resource.DependsOn];
|
|
36
|
+
for (const target of dependsOn) {
|
|
37
|
+
if (resourceIds.has(target) && target !== logicalId) {
|
|
38
|
+
deps.add(target);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
graph.set(logicalId, deps);
|
|
43
|
+
}
|
|
44
|
+
// Detect cycles
|
|
45
|
+
const cycles = detectCycles(graph);
|
|
46
|
+
for (const cycle of cycles) {
|
|
47
|
+
// Add trailing node for display: "A -> B -> C -> A"
|
|
48
|
+
const chain = [...cycle, cycle[0]].join(" -> ");
|
|
49
|
+
diagnostics.push({
|
|
50
|
+
checkId: "COR020",
|
|
51
|
+
severity: "error",
|
|
52
|
+
message: `Circular resource dependency: ${chain}`,
|
|
53
|
+
entity: cycle[0],
|
|
54
|
+
lexicon: "aws",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return diagnostics;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ext001.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/ext001.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"ext001.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/ext001.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG9G,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,oBAAoB,GAAG,aAAa,GAAG,cAAc,CAAC;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA+KD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,gBAAgB,EACrB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,GAChD,mBAAmB,EAAE,CAkBvB;AAED,eAAO,MAAM,MAAM,EAAE,cAOpB,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXT001: Extension Constraint Violation
|
|
3
|
+
*
|
|
4
|
+
* Validates CloudFormation resource properties against cross-property
|
|
5
|
+
* constraints from cfn-lint extension schemas.
|
|
6
|
+
*
|
|
7
|
+
* Constraint types:
|
|
8
|
+
* - if_then: if condition properties match, then requirement must hold
|
|
9
|
+
* - dependent_excluded: if property A exists, property B must not
|
|
10
|
+
* - required_or: at least one of the listed properties must exist
|
|
11
|
+
* - required_xor: exactly one of the listed properties must exist
|
|
12
|
+
*/
|
|
13
|
+
import { readFileSync } from "fs";
|
|
14
|
+
import { join } from "path";
|
|
15
|
+
import { moduleSourceDir } from "@intentius/chant/module-source";
|
|
16
|
+
import { parseCFTemplate } from "./cf-refs.js";
|
|
17
|
+
/**
|
|
18
|
+
* Load lexicon JSON to get constraints per resource type.
|
|
19
|
+
*/
|
|
20
|
+
function loadLexiconConstraints() {
|
|
21
|
+
const map = new Map();
|
|
22
|
+
try {
|
|
23
|
+
// From src/lint/post-synth/ (or its compiled twin under dist/) to src/generated/
|
|
24
|
+
const lexiconPath = join(moduleSourceDir(import.meta.url), "..", "..", "generated", "lexicon-aws.json");
|
|
25
|
+
const content = readFileSync(lexiconPath, "utf-8");
|
|
26
|
+
const data = JSON.parse(content);
|
|
27
|
+
for (const [_name, entry] of Object.entries(data)) {
|
|
28
|
+
if (entry.kind === "resource" && entry.resourceType && entry.constraints && entry.constraints.length > 0) {
|
|
29
|
+
map.set(entry.resourceType, entry.constraints);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Lexicon not available — skip constraint checking
|
|
35
|
+
}
|
|
36
|
+
return map;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a JSON schema "if" condition matches resource properties.
|
|
40
|
+
*/
|
|
41
|
+
function matchesCondition(condition, properties) {
|
|
42
|
+
if (!condition || typeof condition !== "object")
|
|
43
|
+
return false;
|
|
44
|
+
const cond = condition;
|
|
45
|
+
// { properties: { PropName: { const: value } } }
|
|
46
|
+
if (cond.properties && typeof cond.properties === "object") {
|
|
47
|
+
const condProps = cond.properties;
|
|
48
|
+
for (const [propName, schema] of Object.entries(condProps)) {
|
|
49
|
+
if (!schema || typeof schema !== "object")
|
|
50
|
+
continue;
|
|
51
|
+
const s = schema;
|
|
52
|
+
if ("const" in s) {
|
|
53
|
+
if (properties[propName] !== s.const)
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if ("enum" in s && Array.isArray(s.enum)) {
|
|
57
|
+
if (!s.enum.includes(properties[propName]))
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if ("pattern" in s && typeof s.pattern === "string") {
|
|
61
|
+
const val = properties[propName];
|
|
62
|
+
if (typeof val !== "string" || !new RegExp(s.pattern).test(val))
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// { required: ["PropName"] } — check the properties exist
|
|
68
|
+
if (Array.isArray(cond.required)) {
|
|
69
|
+
for (const req of cond.required) {
|
|
70
|
+
if (!(req in properties))
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check if a JSON schema "then" requirement holds for resource properties.
|
|
78
|
+
*/
|
|
79
|
+
function checkRequirement(requirement, properties) {
|
|
80
|
+
if (!requirement || typeof requirement !== "object")
|
|
81
|
+
return null;
|
|
82
|
+
const req = requirement;
|
|
83
|
+
// { required: ["PropName"] }
|
|
84
|
+
if (Array.isArray(req.required)) {
|
|
85
|
+
const missing = req.required.filter((r) => !(r in properties));
|
|
86
|
+
if (missing.length > 0) {
|
|
87
|
+
return `missing required properties: ${missing.join(", ")}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
function validateResource(logicalId, resource, constraints) {
|
|
93
|
+
const diagnostics = [];
|
|
94
|
+
const props = resource.Properties ?? {};
|
|
95
|
+
for (const constraint of constraints) {
|
|
96
|
+
switch (constraint.type) {
|
|
97
|
+
case "if_then": {
|
|
98
|
+
if (matchesCondition(constraint.condition, props)) {
|
|
99
|
+
const error = checkRequirement(constraint.requirement, props);
|
|
100
|
+
if (error) {
|
|
101
|
+
diagnostics.push({
|
|
102
|
+
checkId: "EXT001",
|
|
103
|
+
severity: "error",
|
|
104
|
+
message: `Resource "${logicalId}" (${resource.Type}): constraint "${constraint.name}" violated — ${error}`,
|
|
105
|
+
entity: logicalId,
|
|
106
|
+
lexicon: "aws",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
case "dependent_excluded": {
|
|
113
|
+
// { PropA: ["PropB", "PropC"] } — if PropA exists, PropB and PropC must not
|
|
114
|
+
const req = constraint.requirement;
|
|
115
|
+
if (req) {
|
|
116
|
+
for (const [propName, excluded] of Object.entries(req)) {
|
|
117
|
+
if (propName in props) {
|
|
118
|
+
const present = excluded.filter((e) => e in props);
|
|
119
|
+
if (present.length > 0) {
|
|
120
|
+
diagnostics.push({
|
|
121
|
+
checkId: "EXT001",
|
|
122
|
+
severity: "error",
|
|
123
|
+
message: `Resource "${logicalId}" (${resource.Type}): "${propName}" excludes [${present.join(", ")}] but both are present`,
|
|
124
|
+
entity: logicalId,
|
|
125
|
+
lexicon: "aws",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case "required_or": {
|
|
134
|
+
// ["PropA", "PropB"] — at least one must exist
|
|
135
|
+
const required = constraint.requirement;
|
|
136
|
+
if (required && Array.isArray(required)) {
|
|
137
|
+
const present = required.filter((r) => r in props);
|
|
138
|
+
if (present.length === 0) {
|
|
139
|
+
diagnostics.push({
|
|
140
|
+
checkId: "EXT001",
|
|
141
|
+
severity: "error",
|
|
142
|
+
message: `Resource "${logicalId}" (${resource.Type}): at least one of [${required.join(", ")}] must be specified`,
|
|
143
|
+
entity: logicalId,
|
|
144
|
+
lexicon: "aws",
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
case "required_xor": {
|
|
151
|
+
// ["PropA", "PropB"] — exactly one must exist
|
|
152
|
+
const required = constraint.requirement;
|
|
153
|
+
if (required && Array.isArray(required)) {
|
|
154
|
+
const present = required.filter((r) => r in props);
|
|
155
|
+
if (present.length !== 1) {
|
|
156
|
+
diagnostics.push({
|
|
157
|
+
checkId: "EXT001",
|
|
158
|
+
severity: "error",
|
|
159
|
+
message: `Resource "${logicalId}" (${resource.Type}): exactly one of [${required.join(", ")}] must be specified (found ${present.length})`,
|
|
160
|
+
entity: logicalId,
|
|
161
|
+
lexicon: "aws",
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return diagnostics;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Core detection logic — exported for direct testing with synthetic data.
|
|
173
|
+
*/
|
|
174
|
+
export function checkExtensionConstraints(ctx, constraintMap) {
|
|
175
|
+
if (constraintMap.size === 0)
|
|
176
|
+
return [];
|
|
177
|
+
const diagnostics = [];
|
|
178
|
+
for (const [_lexicon, output] of ctx.outputs) {
|
|
179
|
+
const template = parseCFTemplate(output);
|
|
180
|
+
if (!template?.Resources)
|
|
181
|
+
continue;
|
|
182
|
+
for (const [logicalId, resource] of Object.entries(template.Resources)) {
|
|
183
|
+
const constraints = constraintMap.get(resource.Type);
|
|
184
|
+
if (!constraints)
|
|
185
|
+
continue;
|
|
186
|
+
diagnostics.push(...validateResource(logicalId, resource, constraints));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return diagnostics;
|
|
190
|
+
}
|
|
191
|
+
export const ext001 = {
|
|
192
|
+
id: "EXT001",
|
|
193
|
+
description: "Extension constraint violation — cross-property validation from cfn-lint extension schemas",
|
|
194
|
+
check(ctx) {
|
|
195
|
+
return checkExtensionConstraints(ctx, loadLexiconConstraints());
|
|
196
|
+
},
|
|
197
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { cor020 } from "./cor020.js";
|
|
2
|
+
import { ext001 } from "./ext001.js";
|
|
3
|
+
import { waw010 } from "./waw010.js";
|
|
4
|
+
import { waw011 } from "./waw011.js";
|
|
5
|
+
import { waw013 } from "./waw013.js";
|
|
6
|
+
import { waw014 } from "./waw014.js";
|
|
7
|
+
import { waw015 } from "./waw015.js";
|
|
8
|
+
import { waw016 } from "./waw016.js";
|
|
9
|
+
import { waw017 } from "./waw017.js";
|
|
10
|
+
import { waw018 } from "./waw018.js";
|
|
11
|
+
import { waw019 } from "./waw019.js";
|
|
12
|
+
import { waw020 } from "./waw020.js";
|
|
13
|
+
import { waw021 } from "./waw021.js";
|
|
14
|
+
import { waw022 } from "./waw022.js";
|
|
15
|
+
import { waw023 } from "./waw023.js";
|
|
16
|
+
import { waw024 } from "./waw024.js";
|
|
17
|
+
import { waw025 } from "./waw025.js";
|
|
18
|
+
import { waw026 } from "./waw026.js";
|
|
19
|
+
import { waw027 } from "./waw027.js";
|
|
20
|
+
import { waw028 } from "./waw028.js";
|
|
21
|
+
import { waw029 } from "./waw029.js";
|
|
22
|
+
import { waw030 } from "./waw030.js";
|
|
23
|
+
import { waw031 } from "./waw031.js";
|
|
24
|
+
import { waw032 } from "./waw032.js";
|
|
25
|
+
import { waw033 } from "./waw033.js";
|
|
26
|
+
import { waw034 } from "./waw034.js";
|
|
27
|
+
import { waw035 } from "./waw035.js";
|
|
28
|
+
import { waw036 } from "./waw036.js";
|
|
29
|
+
import { waw037 } from "./waw037.js";
|
|
30
|
+
import { waw038 } from "./waw038.js";
|
|
31
|
+
import { waw039 } from "./waw039.js";
|
|
32
|
+
import { waw040 } from "./waw040.js";
|
|
33
|
+
import { waw041 } from "./waw041.js";
|
|
34
|
+
import { waw042 } from "./waw042.js";
|
|
35
|
+
import { waw043 } from "./waw043.js";
|
|
36
|
+
import { waw044 } from "./waw044.js";
|
|
37
|
+
import { waw045 } from "./waw045.js";
|
|
38
|
+
import { waw046 } from "./waw046.js";
|
|
39
|
+
import { waw047 } from "./waw047.js";
|
|
40
|
+
import { waw048 } from "./waw048.js";
|
|
41
|
+
import { waw049 } from "./waw049.js";
|
|
42
|
+
import { waw050 } from "./waw050.js";
|
|
43
|
+
import { waw051 } from "./waw051.js";
|
|
44
|
+
import { waw052 } from "./waw052.js";
|
|
45
|
+
import { waw053 } from "./waw053.js";
|
|
46
|
+
import { waw054 } from "./waw054.js";
|
|
47
|
+
import { waw055 } from "./waw055.js";
|
|
48
|
+
import { waw056 } from "./waw056.js";
|
|
49
|
+
import { waw057 } from "./waw057.js";
|
|
50
|
+
import { waw058 } from "./waw058.js";
|
|
51
|
+
import { waw059 } from "./waw059.js";
|
|
52
|
+
import { waw060 } from "./waw060.js";
|
|
53
|
+
import { waw061 } from "./waw061.js";
|
|
54
|
+
import { waw062 } from "./waw062.js";
|
|
55
|
+
import { waw063 } from "./waw063.js";
|
|
56
|
+
import { waw064 } from "./waw064.js";
|
|
57
|
+
import { waw065 } from "./waw065.js";
|
|
58
|
+
import { waw066 } from "./waw066.js";
|
|
59
|
+
import { waw067 } from "./waw067.js";
|
|
60
|
+
import { waw068 } from "./waw068.js";
|
|
61
|
+
import { waw069 } from "./waw069.js";
|
|
62
|
+
export const postSynthChecks = [
|
|
63
|
+
cor020,
|
|
64
|
+
ext001,
|
|
65
|
+
waw010,
|
|
66
|
+
waw011,
|
|
67
|
+
waw013,
|
|
68
|
+
waw014,
|
|
69
|
+
waw015,
|
|
70
|
+
waw016,
|
|
71
|
+
waw017,
|
|
72
|
+
waw018,
|
|
73
|
+
waw019,
|
|
74
|
+
waw020,
|
|
75
|
+
waw021,
|
|
76
|
+
waw022,
|
|
77
|
+
waw023,
|
|
78
|
+
waw024,
|
|
79
|
+
waw025,
|
|
80
|
+
waw026,
|
|
81
|
+
waw027,
|
|
82
|
+
waw028,
|
|
83
|
+
waw029,
|
|
84
|
+
waw030,
|
|
85
|
+
waw031,
|
|
86
|
+
waw032,
|
|
87
|
+
waw033,
|
|
88
|
+
waw034,
|
|
89
|
+
waw035,
|
|
90
|
+
waw036,
|
|
91
|
+
waw037,
|
|
92
|
+
waw038,
|
|
93
|
+
waw039,
|
|
94
|
+
waw040,
|
|
95
|
+
waw041,
|
|
96
|
+
waw042,
|
|
97
|
+
waw043,
|
|
98
|
+
waw044,
|
|
99
|
+
waw045,
|
|
100
|
+
waw046,
|
|
101
|
+
waw047,
|
|
102
|
+
waw048,
|
|
103
|
+
waw049,
|
|
104
|
+
waw050,
|
|
105
|
+
waw051,
|
|
106
|
+
waw052,
|
|
107
|
+
waw053,
|
|
108
|
+
waw054,
|
|
109
|
+
waw055,
|
|
110
|
+
waw056,
|
|
111
|
+
waw057,
|
|
112
|
+
waw058,
|
|
113
|
+
waw059,
|
|
114
|
+
waw060,
|
|
115
|
+
waw061,
|
|
116
|
+
waw062,
|
|
117
|
+
waw063,
|
|
118
|
+
waw064,
|
|
119
|
+
waw065,
|
|
120
|
+
waw066,
|
|
121
|
+
waw067,
|
|
122
|
+
waw068,
|
|
123
|
+
waw069,
|
|
124
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAW010: Redundant DependsOn
|
|
3
|
+
*
|
|
4
|
+
* Detects DependsOn entries that are already implied by Ref or Fn::GetAtt
|
|
5
|
+
* references in the resource's Properties. CloudFormation automatically
|
|
6
|
+
* creates dependencies for these references, making explicit DependsOn redundant.
|
|
7
|
+
*/
|
|
8
|
+
import { parseCFTemplate, findResourceRefs } from "./cf-refs.js";
|
|
9
|
+
export const waw010 = {
|
|
10
|
+
id: "WAW010",
|
|
11
|
+
description: "Redundant DependsOn — target is already referenced via Ref or Fn::GetAtt in Properties",
|
|
12
|
+
check(ctx) {
|
|
13
|
+
const diagnostics = [];
|
|
14
|
+
for (const [_lexicon, output] of ctx.outputs) {
|
|
15
|
+
const template = parseCFTemplate(output);
|
|
16
|
+
if (!template?.Resources)
|
|
17
|
+
continue;
|
|
18
|
+
for (const [logicalId, resource] of Object.entries(template.Resources)) {
|
|
19
|
+
if (!resource.DependsOn)
|
|
20
|
+
continue;
|
|
21
|
+
const dependsOn = Array.isArray(resource.DependsOn)
|
|
22
|
+
? resource.DependsOn
|
|
23
|
+
: [resource.DependsOn];
|
|
24
|
+
// Find all refs in Properties
|
|
25
|
+
const propertyRefs = findResourceRefs(resource.Properties);
|
|
26
|
+
for (const target of dependsOn) {
|
|
27
|
+
if (propertyRefs.has(target)) {
|
|
28
|
+
diagnostics.push({
|
|
29
|
+
checkId: "WAW010",
|
|
30
|
+
severity: "warning",
|
|
31
|
+
message: `Resource "${logicalId}" has redundant DependsOn "${target}" — already referenced in Properties`,
|
|
32
|
+
entity: logicalId,
|
|
33
|
+
lexicon: "aws",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return diagnostics;
|
|
40
|
+
},
|
|
41
|
+
};
|