@intentius/chant-lexicon-gcp 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/index.js +45 -0
- package/dist/api/read-client.js +105 -0
- package/dist/codegen/docs-cli.js +6 -0
- package/dist/codegen/docs.js +115 -0
- package/dist/codegen/generate-cli.js +17 -0
- package/dist/codegen/generate.js +218 -0
- package/dist/codegen/naming.js +164 -0
- package/dist/codegen/package.js +43 -0
- package/dist/composites/catalog.d.ts.map +1 -1
- package/dist/composites/catalog.js +1251 -0
- package/dist/composites/cloud-function.js +65 -0
- package/dist/composites/cloud-run-service.d.ts +7 -3
- package/dist/composites/cloud-run-service.d.ts.map +1 -1
- package/dist/composites/cloud-run-service.js +75 -0
- package/dist/composites/cloud-sql-instance.js +85 -0
- package/dist/composites/gcs-bucket.js +64 -0
- package/dist/composites/gke-cluster.js +113 -0
- package/dist/composites/gke-crdb-region.js +137 -0
- package/dist/composites/gpu-node-pool.js +74 -0
- package/dist/composites/index.js +15 -0
- package/dist/composites/landing-zone.js +89 -0
- package/dist/composites/managed-certificate.js +46 -0
- package/dist/composites/memorystore-redis.js +52 -0
- package/dist/composites/multi-region-vpc.js +108 -0
- package/dist/composites/private-service.js +50 -0
- package/dist/composites/pubsub-pipeline.js +63 -0
- package/dist/composites/secure-project.js +85 -0
- package/dist/composites/vpc-network.js +113 -0
- package/dist/coverage.js +28 -0
- package/dist/deep-observe-hooks.js +152 -0
- package/dist/deep-observe.js +273 -0
- package/dist/default-labels.js +67 -0
- package/dist/describe-resources.js +264 -0
- package/dist/detect.js +16 -0
- package/dist/export-resources.js +59 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +1804 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +98 -0
- package/dist/health.d.ts +42 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +87 -0
- package/dist/import/generator.js +68 -0
- package/dist/import/live-export.js +73 -0
- package/dist/import/parser.js +61 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -0
- package/dist/integrity.json +5 -5
- package/dist/lint/audit-catalog.js +38 -0
- package/dist/lint/audit-lineage.js +63 -0
- package/dist/lint/post-synth/gcp-helpers.js +91 -0
- package/dist/lint/post-synth/index.js +54 -0
- package/dist/lint/post-synth/schema-registry.d.ts.map +1 -1
- package/dist/lint/post-synth/schema-registry.js +69 -0
- package/dist/lint/post-synth/wgc101.js +47 -0
- package/dist/lint/post-synth/wgc102.js +29 -0
- package/dist/lint/post-synth/wgc103.js +37 -0
- package/dist/lint/post-synth/wgc104.js +34 -0
- package/dist/lint/post-synth/wgc105.js +39 -0
- package/dist/lint/post-synth/wgc106.js +30 -0
- package/dist/lint/post-synth/wgc107.js +33 -0
- package/dist/lint/post-synth/wgc108.js +34 -0
- package/dist/lint/post-synth/wgc109.js +33 -0
- package/dist/lint/post-synth/wgc110.js +32 -0
- package/dist/lint/post-synth/wgc111.js +47 -0
- package/dist/lint/post-synth/wgc112.js +46 -0
- package/dist/lint/post-synth/wgc113.js +35 -0
- package/dist/lint/post-synth/wgc201.js +30 -0
- package/dist/lint/post-synth/wgc202.js +33 -0
- package/dist/lint/post-synth/wgc203.js +35 -0
- package/dist/lint/post-synth/wgc204.js +33 -0
- package/dist/lint/post-synth/wgc301.js +28 -0
- package/dist/lint/post-synth/wgc302.js +28 -0
- package/dist/lint/post-synth/wgc303.js +29 -0
- package/dist/lint/post-synth/wgc401.js +50 -0
- package/dist/lint/post-synth/wgc402.js +46 -0
- package/dist/lint/post-synth/wgc403.js +74 -0
- package/dist/lint/post-synth/wgc501.js +63 -0
- package/dist/lint/post-synth/wgc502.js +37 -0
- package/dist/lint/post-synth/wgc503.js +49 -0
- package/dist/lint/rules/hardcoded-project.js +51 -0
- package/dist/lint/rules/hardcoded-region.js +51 -0
- package/dist/lint/rules/index.js +3 -0
- package/dist/lint/rules/public-iam.js +37 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +15 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +46 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +1848 -481
- package/dist/okf/types/API.md +2 -0
- package/dist/okf/types/APIConfig.md +3 -0
- package/dist/okf/types/APIQuotaAdjusterSettings.md +2 -0
- package/dist/okf/types/APIQuotaPreference.md +2 -0
- package/dist/okf/types/AccessBoundaryPolicy.md +2 -0
- package/dist/okf/types/AccessLevel.md +2 -0
- package/dist/okf/types/AccessLevelCondition.md +1 -0
- package/dist/okf/types/AccessPolicy.md +4 -0
- package/dist/okf/types/AddonsConfig.md +1 -0
- package/dist/okf/types/AgentPool.md +2 -0
- package/dist/okf/types/AiplatformModel.md +2 -0
- package/dist/okf/types/AistreamsCluster.md +2 -0
- package/dist/okf/types/AlertPolicy.md +2 -0
- package/dist/okf/types/AlloydbBackup.md +9 -0
- package/dist/okf/types/AlloydbCluster.md +5 -0
- package/dist/okf/types/AlloydbInstance.md +10 -0
- package/dist/okf/types/AnalyticsAccount.md +2 -0
- package/dist/okf/types/AndroidApp.md +4 -0
- package/dist/okf/types/AnywhereCache.md +2 -0
- package/dist/okf/types/ApigatewayGateway.md +3 -0
- package/dist/okf/types/ApigeeEnvironment.md +5 -0
- package/dist/okf/types/ApigeeInstance.md +2 -0
- package/dist/okf/types/ApihubDeployment.md +2 -0
- package/dist/okf/types/ApikeysKey.md +2 -0
- package/dist/okf/types/AppConnection.md +1 -0
- package/dist/okf/types/AppConnector.md +2 -0
- package/dist/okf/types/AppGateway.md +3 -0
- package/dist/okf/types/AppProfile.md +3 -0
- package/dist/okf/types/Application.md +2 -0
- package/dist/okf/types/ArtifactRegistryRepository.md +4 -0
- package/dist/okf/types/Assignment.md +2 -0
- package/dist/okf/types/Attestor.md +2 -0
- package/dist/okf/types/AuthorizationPolicy.md +4 -0
- package/dist/okf/types/AuthorizedView.md +2 -0
- package/dist/okf/types/AutokeyConfig.md +2 -0
- package/dist/okf/types/Automation.md +2 -0
- package/dist/okf/types/Autoscaler.md +3 -0
- package/dist/okf/types/AutoscalingPolicy.md +2 -0
- package/dist/okf/types/BQJob.md +3 -0
- package/dist/okf/types/BackendBucket.md +3 -0
- package/dist/okf/types/BackendBucketSignedURLKey.md +1 -0
- package/dist/okf/types/BackendService.md +5 -0
- package/dist/okf/types/BackendServiceSignedURLKey.md +1 -0
- package/dist/okf/types/BackupPlanAssociation.md +2 -0
- package/dist/okf/types/BackupPolicy.md +2 -0
- package/dist/okf/types/BackupdrBackupPlan.md +2 -0
- package/dist/okf/types/BackupdrBackupVault.md +2 -0
- package/dist/okf/types/Batch.md +2 -0
- package/dist/okf/types/BatchJob.md +2 -0
- package/dist/okf/types/BatchTask.md +3 -0
- package/dist/okf/types/BigLakeCatalog.md +2 -0
- package/dist/okf/types/BigLakeDatabase.md +2 -0
- package/dist/okf/types/BigLakeTable.md +2 -0
- package/dist/okf/types/BigQueryDataPolicy.md +2 -0
- package/dist/okf/types/BigQueryDataset.md +6 -0
- package/dist/okf/types/BigQueryExport.md +2 -0
- package/dist/okf/types/BigQueryTable.md +11 -0
- package/dist/okf/types/BigqueryconnectionConnection.md +2 -0
- package/dist/okf/types/BigquerydatatransferConfig.md +2 -0
- package/dist/okf/types/BigqueryreservationReservation.md +2 -0
- package/dist/okf/types/BigtableInstance.md +1 -0
- package/dist/okf/types/BigtableTable.md +2 -0
- package/dist/okf/types/BillingAccount.md +2 -0
- package/dist/okf/types/BinaryauthorizationPolicy.md +3 -0
- package/dist/okf/types/Brand.md +2 -0
- package/dist/okf/types/BtBackup.md +2 -0
- package/dist/okf/types/BtCluster.md +2 -0
- package/dist/okf/types/Bucket.md +2 -0
- package/dist/okf/types/BucketAccessControl.md +3 -0
- package/dist/okf/types/Budget.md +2 -0
- package/dist/okf/types/CAPool.md +1 -0
- package/dist/okf/types/CapacityCommitment.md +5 -0
- package/dist/okf/types/CertificateAuthority.md +7 -0
- package/dist/okf/types/CertificateIssuanceConfig.md +2 -0
- package/dist/okf/types/CertificateMap.md +3 -0
- package/dist/okf/types/CertificateMapEntry.md +4 -0
- package/dist/okf/types/CertificateTemplate.md +3 -0
- package/dist/okf/types/CertificatemanagerCertificate.md +1 -0
- package/dist/okf/types/ClientConnectorService.md +2 -0
- package/dist/okf/types/ClientTLSPolicy.md +3 -0
- package/dist/okf/types/CloudBatchResourceAllowance.md +2 -0
- package/dist/okf/types/CloudFunction.md +4 -0
- package/dist/okf/types/CloudRunJob.md +13 -0
- package/dist/okf/types/CloudRunService.md +13 -0
- package/dist/okf/types/CloudbuildTrigger.md +4 -0
- package/dist/okf/types/ClouddmsPrivateConnection.md +2 -0
- package/dist/okf/types/CloudidentityGroup.md +5 -0
- package/dist/okf/types/CloudidentityMembership.md +6 -0
- package/dist/okf/types/CloudidsEndpoint.md +1 -0
- package/dist/okf/types/CloudschedulerJob.md +5 -0
- package/dist/okf/types/ComposerEnvironment.md +2 -0
- package/dist/okf/types/ComputeAddress.md +4 -0
- package/dist/okf/types/ComputeDisk.md +9 -0
- package/dist/okf/types/ComputeFirewallPolicy.md +7 -0
- package/dist/okf/types/ComputeHealthCheck.md +4 -0
- package/dist/okf/types/ComputeInstance.md +8 -0
- package/dist/okf/types/ComputeNetworkPeering.md +3 -0
- package/dist/okf/types/ComputeNodeGroup.md +3 -0
- package/dist/okf/types/ComputeReservation.md +6 -0
- package/dist/okf/types/ComputeRoute.md +3 -0
- package/dist/okf/types/ComputeSnapshot.md +7 -0
- package/dist/okf/types/ConfigcontrollerInstance.md +3 -0
- package/dist/okf/types/ConnectionProfile.md +2 -0
- package/dist/okf/types/ConnectivityTest.md +2 -0
- package/dist/okf/types/Connector.md +3 -0
- package/dist/okf/types/ConsentStore.md +1 -0
- package/dist/okf/types/ConsumerGroup.md +2 -0
- package/dist/okf/types/ConsumerQuotaOverride.md +2 -0
- package/dist/okf/types/Contact.md +2 -0
- package/dist/okf/types/ContainerattachedCluster.md +8 -0
- package/dist/okf/types/ConversionWorkspace.md +2 -0
- package/dist/okf/types/CryptoKeyVersion.md +5 -0
- package/dist/okf/types/CustomClass.md +2 -0
- package/dist/okf/types/CustomConstraint.md +2 -0
- package/dist/okf/types/CustomRole.md +3 -0
- package/dist/okf/types/CustomTargetType.md +2 -0
- package/dist/okf/types/DICOMStore.md +2 -0
- package/dist/okf/types/DNSAuthorization.md +2 -0
- package/dist/okf/types/DNSManagedZone.md +3 -0
- package/dist/okf/types/DNSRecordSet.md +1 -0
- package/dist/okf/types/Dashboard.md +2 -0
- package/dist/okf/types/DataExchange.md +2 -0
- package/dist/okf/types/DataLabelingJob.md +2 -0
- package/dist/okf/types/DataPolicy.md +2 -0
- package/dist/okf/types/DataStore.md +2 -0
- package/dist/okf/types/DataStoreTargetSite.md +2 -0
- package/dist/okf/types/Database.md +2 -0
- package/dist/okf/types/DatacatalogEntryGroup.md +2 -0
- package/dist/okf/types/DataflowJob.md +4 -0
- package/dist/okf/types/DataformRepository.md +2 -0
- package/dist/okf/types/DatafusionInstance.md +10 -0
- package/dist/okf/types/DataplexEntryGroup.md +2 -0
- package/dist/okf/types/DataplexTask.md +2 -0
- package/dist/okf/types/DataprocCluster.md +2 -0
- package/dist/okf/types/DataprocJob.md +2 -0
- package/dist/okf/types/DataprocNodeGroup.md +2 -0
- package/dist/okf/types/DataprocSession.md +2 -0
- package/dist/okf/types/DatasetAccess.md +2 -0
- package/dist/okf/types/DatastoreIndex.md +2 -0
- package/dist/okf/types/DatastreamPrivateConnection.md +2 -0
- package/dist/okf/types/DatastreamRoute.md +2 -0
- package/dist/okf/types/DefaultObjectAccessControl.md +5 -0
- package/dist/okf/types/DefaultSupportedIDPConfig.md +2 -0
- package/dist/okf/types/DeidentifyTemplate.md +4 -0
- package/dist/okf/types/DeliveryPipeline.md +2 -0
- package/dist/okf/types/DenyPolicy.md +2 -0
- package/dist/okf/types/DeployPolicy.md +2 -0
- package/dist/okf/types/DeploymentResourcePool.md +2 -0
- package/dist/okf/types/DeploymentmanagerDeployment.md +4 -0
- package/dist/okf/types/Device.md +8 -0
- package/dist/okf/types/DeviceRegistry.md +1 -0
- package/dist/okf/types/DevicestreamingSession.md +2 -0
- package/dist/okf/types/DialogflowAgent.md +2 -0
- package/dist/okf/types/DialogflowEntityType.md +2 -0
- package/dist/okf/types/DialogflowIntent.md +3 -0
- package/dist/okf/types/DialogflowcxAgent.md +3 -0
- package/dist/okf/types/DialogflowcxEntityType.md +2 -0
- package/dist/okf/types/DialogflowcxIntent.md +2 -0
- package/dist/okf/types/DiscoveredService.md +2 -0
- package/dist/okf/types/DiscoveredWorkload.md +2 -0
- package/dist/okf/types/DiskResourcePolicyAttachment.md +1 -0
- package/dist/okf/types/DnsPolicy.md +1 -0
- package/dist/okf/types/Document.md +2 -0
- package/dist/okf/types/DomainMapping.md +2 -0
- package/dist/okf/types/EdgeCacheKeyset.md +1 -0
- package/dist/okf/types/EdgeCacheOrigin.md +1 -0
- package/dist/okf/types/EdgeCacheService.md +1 -0
- package/dist/okf/types/EdgecontainerCluster.md +9 -0
- package/dist/okf/types/EdgecontainerNodePool.md +4 -0
- package/dist/okf/types/EdgenetworkNetwork.md +4 -0
- package/dist/okf/types/EndpointAttachment.md +2 -0
- package/dist/okf/types/EndpointPolicy.md +3 -0
- package/dist/okf/types/Engine.md +2 -0
- package/dist/okf/types/Enrollment.md +2 -0
- package/dist/okf/types/Entitlement.md +2 -0
- package/dist/okf/types/Entry.md +2 -0
- package/dist/okf/types/EntryType.md +2 -0
- package/dist/okf/types/Envgroup.md +2 -0
- package/dist/okf/types/EnvgroupAttachment.md +2 -0
- package/dist/okf/types/EventarcChannel.md +2 -0
- package/dist/okf/types/EventarcTrigger.md +5 -0
- package/dist/okf/types/ExampleStore.md +2 -0
- package/dist/okf/types/ExternalAccessRule.md +2 -0
- package/dist/okf/types/ExternalAddress.md +2 -0
- package/dist/okf/types/ExternalVPNGateway.md +3 -0
- package/dist/okf/types/FHIRStore.md +2 -0
- package/dist/okf/types/Feature.md +4 -0
- package/dist/okf/types/FeatureMembership.md +1 -0
- package/dist/okf/types/Featurestore.md +2 -0
- package/dist/okf/types/FeaturestoreEntityType.md +5 -0
- package/dist/okf/types/FeaturestoreEntityTypeFeature.md +5 -0
- package/dist/okf/types/Federation.md +2 -0
- package/dist/okf/types/Feed.md +2 -0
- package/dist/okf/types/Field.md +2 -0
- package/dist/okf/types/FilestoreBackup.md +7 -0
- package/dist/okf/types/FilestoreInstance.md +5 -0
- package/dist/okf/types/FilestoreSnapshot.md +4 -0
- package/dist/okf/types/FirebaseProject.md +3 -0
- package/dist/okf/types/FirebasedatabaseInstance.md +4 -0
- package/dist/okf/types/FirebasehostingChannel.md +2 -0
- package/dist/okf/types/FirestoreBackupSchedule.md +2 -0
- package/dist/okf/types/FirestoreIndex.md +2 -0
- package/dist/okf/types/Firewall.md +3 -0
- package/dist/okf/types/FirewallPolicyAssociation.md +2 -0
- package/dist/okf/types/FirewallPolicyRule.md +4 -0
- package/dist/okf/types/FirewallRule.md +1 -0
- package/dist/okf/types/FlexTemplateJob.md +4 -0
- package/dist/okf/types/FlexibleAppVersion.md +2 -0
- package/dist/okf/types/Flow.md +2 -0
- package/dist/okf/types/FolderFeed.md +3 -0
- package/dist/okf/types/ForwardingRule.md +10 -0
- package/dist/okf/types/Fulfillment.md +2 -0
- package/dist/okf/types/Function.md +5 -0
- package/dist/okf/types/FutureReservation.md +2 -0
- package/dist/okf/types/GCPServiceAccount.md +5 -0
- package/dist/okf/types/GCPUserAccessBinding.md +2 -0
- package/dist/okf/types/GCPolicy.md +1 -0
- package/dist/okf/types/GKECluster.md +8 -0
- package/dist/okf/types/GRPCRoute.md +4 -0
- package/dist/okf/types/GcsFolder.md +2 -0
- package/dist/okf/types/GkebackupBackup.md +2 -0
- package/dist/okf/types/GkebackupBackupPlan.md +2 -0
- package/dist/okf/types/GkehubMembership.md +6 -0
- package/dist/okf/types/GkehubNamespace.md +2 -0
- package/dist/okf/types/GlobalNetworkEndpoint.md +1 -0
- package/dist/okf/types/GlobalNetworkEndpointGroup.md +2 -0
- package/dist/okf/types/GoogleChannelConfig.md +2 -0
- package/dist/okf/types/GuestPolicy.md +4 -0
- package/dist/okf/types/HL7V2Store.md +2 -0
- package/dist/okf/types/HMACKey.md +5 -0
- package/dist/okf/types/HTTPHealthCheck.md +3 -0
- package/dist/okf/types/HTTPRoute.md +4 -0
- package/dist/okf/types/HTTPSHealthCheck.md +3 -0
- package/dist/okf/types/HealthcareDataset.md +2 -0
- package/dist/okf/types/Hub.md +5 -0
- package/dist/okf/types/IAMAuditConfig.md +1 -0
- package/dist/okf/types/IAMPolicy.md +1 -0
- package/dist/okf/types/IAMPolicyMember.md +1 -0
- package/dist/okf/types/IdentityAwareProxyClient.md +2 -0
- package/dist/okf/types/IdentityplatformConfig.md +2 -0
- package/dist/okf/types/Image.md +5 -0
- package/dist/okf/types/ImportJob.md +2 -0
- package/dist/okf/types/InboundSAMLConfig.md +1 -0
- package/dist/okf/types/IndexEndpoint.md +6 -0
- package/dist/okf/types/InspectTemplate.md +4 -0
- package/dist/okf/types/InstanceAttachment.md +2 -0
- package/dist/okf/types/InstanceConfig.md +2 -0
- package/dist/okf/types/InstanceEndpoint.md +1 -0
- package/dist/okf/types/InstanceGroup.md +3 -0
- package/dist/okf/types/InstanceGroupManager.md +8 -0
- package/dist/okf/types/InstanceGroupNamedPort.md +1 -0
- package/dist/okf/types/InstanceTemplate.md +5 -0
- package/dist/okf/types/InterceptDeployment.md +2 -0
- package/dist/okf/types/InterceptEndpointGroup.md +2 -0
- package/dist/okf/types/Interconnect.md +2 -0
- package/dist/okf/types/InterconnectAttachment.md +9 -0
- package/dist/okf/types/InternalRange.md +2 -0
- package/dist/okf/types/JobTrigger.md +5 -0
- package/dist/okf/types/KMSCryptoKey.md +2 -0
- package/dist/okf/types/KMSKeyRing.md +2 -0
- package/dist/okf/types/KeyHandle.md +2 -0
- package/dist/okf/types/KeyRingImportJob.md +4 -0
- package/dist/okf/types/LBRouteExtension.md +2 -0
- package/dist/okf/types/Lake.md +2 -0
- package/dist/okf/types/Lien.md +3 -0
- package/dist/okf/types/Link.md +2 -0
- package/dist/okf/types/Listing.md +2 -0
- package/dist/okf/types/LocationTagBinding.md +3 -0
- package/dist/okf/types/LogBucket.md +4 -0
- package/dist/okf/types/LogExclusion.md +3 -0
- package/dist/okf/types/LogMetric.md +3 -0
- package/dist/okf/types/LogSink.md +2 -0
- package/dist/okf/types/LogView.md +3 -0
- package/dist/okf/types/LogicalView.md +3 -0
- package/dist/okf/types/Machine.md +2 -0
- package/dist/okf/types/MachineImage.md +2 -0
- package/dist/okf/types/ManagedFolder.md +2 -0
- package/dist/okf/types/ManagedSSLCertificate.md +1 -0
- package/dist/okf/types/ManagedkafkaCluster.md +2 -0
- package/dist/okf/types/ManagedkafkaTopic.md +2 -0
- package/dist/okf/types/ManagementServer.md +2 -0
- package/dist/okf/types/MaterializedView.md +3 -0
- package/dist/okf/types/MembershipBinding.md +2 -0
- package/dist/okf/types/MemcacheInstance.md +4 -0
- package/dist/okf/types/MemorystoreInstance.md +2 -0
- package/dist/okf/types/Mesh.md +4 -0
- package/dist/okf/types/MetadataStore.md +2 -0
- package/dist/okf/types/MetastoreBackup.md +2 -0
- package/dist/okf/types/MetastoreService.md +2 -0
- package/dist/okf/types/MetricDescriptor.md +2 -0
- package/dist/okf/types/MigrationJob.md +2 -0
- package/dist/okf/types/MlengineModel.md +1 -0
- package/dist/okf/types/MonGroup.md +1 -0
- package/dist/okf/types/MonService.md +1 -0
- package/dist/okf/types/MonitoredProject.md +2 -0
- package/dist/okf/types/MuteConfig.md +2 -0
- package/dist/okf/types/NATAddress.md +3 -0
- package/dist/okf/types/NetappBackupVault.md +2 -0
- package/dist/okf/types/NetworkAttachment.md +2 -0
- package/dist/okf/types/NetworkEdgeSecurityService.md +2 -0
- package/dist/okf/types/NetworkEndpoint.md +1 -0
- package/dist/okf/types/NetworkEndpointGroup.md +3 -0
- package/dist/okf/types/NetworkFirewallPolicy.md +7 -0
- package/dist/okf/types/NetworkFirewallPolicyAssociation.md +2 -0
- package/dist/okf/types/NetworkFirewallPolicyRule.md +3 -0
- package/dist/okf/types/NetworkPeeringRoutesConfig.md +1 -0
- package/dist/okf/types/NetworkPolicy.md +2 -0
- package/dist/okf/types/NetworkservicesGateway.md +4 -0
- package/dist/okf/types/Node.md +2 -0
- package/dist/okf/types/NodePool.md +2 -0
- package/dist/okf/types/NodeTemplate.md +4 -0
- package/dist/okf/types/Note.md +3 -0
- package/dist/okf/types/NotebookInstance.md +2 -0
- package/dist/okf/types/NotebooksEnvironment.md +2 -0
- package/dist/okf/types/Notification.md +3 -0
- package/dist/okf/types/NotificationChannel.md +3 -0
- package/dist/okf/types/NotificationConfig.md +3 -0
- package/dist/okf/types/OAuthIDPConfig.md +1 -0
- package/dist/okf/types/OSPolicyAssignment.md +9 -0
- package/dist/okf/types/Occurrence.md +5 -0
- package/dist/okf/types/Organization.md +10 -0
- package/dist/okf/types/OrganizationFeed.md +2 -0
- package/dist/okf/types/OrganizationSecurityPolicy.md +3 -0
- package/dist/okf/types/OrganizationSecurityPolicyAssociation.md +2 -0
- package/dist/okf/types/OrganizationSecurityPolicyRule.md +1 -0
- package/dist/okf/types/OrgpolicyPolicy.md +2 -0
- package/dist/okf/types/PacketMirroring.md +4 -0
- package/dist/okf/types/Page.md +2 -0
- package/dist/okf/types/Parameter.md +2 -0
- package/dist/okf/types/ParameterVersion.md +2 -0
- package/dist/okf/types/PartialPolicy.md +1 -0
- package/dist/okf/types/PatchDeployment.md +5 -0
- package/dist/okf/types/PeeredDNSDomain.md +2 -0
- package/dist/okf/types/PerInstanceConfig.md +1 -0
- package/dist/okf/types/PhraseSet.md +2 -0
- package/dist/okf/types/PlatformPolicy.md +2 -0
- package/dist/okf/types/PolicyTag.md +3 -0
- package/dist/okf/types/PrivateCloud.md +2 -0
- package/dist/okf/types/PrivatecaCertificate.md +5 -0
- package/dist/okf/types/Processor.md +2 -0
- package/dist/okf/types/ProcessorDefaultVersion.md +1 -0
- package/dist/okf/types/ProcessorVersion.md +2 -0
- package/dist/okf/types/ProjectDefaultConfig.md +2 -0
- package/dist/okf/types/ProjectFeed.md +2 -0
- package/dist/okf/types/ProjectMetadata.md +1 -0
- package/dist/okf/types/PubSubSnapshot.md +2 -0
- package/dist/okf/types/PubSubSubscription.md +1 -0
- package/dist/okf/types/PubSubTopic.md +1 -0
- package/dist/okf/types/PubsubliteReservation.md +1 -0
- package/dist/okf/types/PubsubliteTopic.md +1 -0
- package/dist/okf/types/RecaptchaenterpriseFirewallPolicy.md +2 -0
- package/dist/okf/types/RecaptchaenterpriseKey.md +2 -0
- package/dist/okf/types/Recognizer.md +2 -0
- package/dist/okf/types/RedisCluster.md +2 -0
- package/dist/okf/types/RedisInstance.md +8 -0
- package/dist/okf/types/RegionAutoscaler.md +3 -0
- package/dist/okf/types/RegionDiskResourcePolicyAttachment.md +1 -0
- package/dist/okf/types/RegionNetworkEndpointGroup.md +2 -0
- package/dist/okf/types/RegionPerInstanceConfig.md +1 -0
- package/dist/okf/types/RegionSSLPolicy.md +4 -0
- package/dist/okf/types/RegionalEndpoint.md +2 -0
- package/dist/okf/types/ResourceBundle.md +2 -0
- package/dist/okf/types/ResourcePolicy.md +3 -0
- package/dist/okf/types/ResourcemanagerFolder.md +5 -0
- package/dist/okf/types/ResourcemanagerPolicy.md +3 -0
- package/dist/okf/types/ResourcemanagerProject.md +2 -0
- package/dist/okf/types/ResponsePolicy.md +1 -0
- package/dist/okf/types/ResponsePolicyRule.md +1 -0
- package/dist/okf/types/Restore.md +2 -0
- package/dist/okf/types/RestorePlan.md +2 -0
- package/dist/okf/types/Router.md +3 -0
- package/dist/okf/types/RouterInterface.md +1 -0
- package/dist/okf/types/RouterNAT.md +1 -0
- package/dist/okf/types/RouterPeer.md +2 -0
- package/dist/okf/types/Routine.md +3 -0
- package/dist/okf/types/Runtime.md +2 -0
- package/dist/okf/types/RuntimeTemplate.md +2 -0
- package/dist/okf/types/SQLDatabase.md +2 -0
- package/dist/okf/types/SQLInstance.md +10 -0
- package/dist/okf/types/SQLUser.md +1 -0
- package/dist/okf/types/SSHPublicKey.md +2 -0
- package/dist/okf/types/SSLCert.md +8 -0
- package/dist/okf/types/SSLCertificate.md +5 -0
- package/dist/okf/types/SSLPolicy.md +4 -0
- package/dist/okf/types/SavedQuery.md +2 -0
- package/dist/okf/types/Schema.md +1 -0
- package/dist/okf/types/Scope.md +5 -0
- package/dist/okf/types/ScopeRBACRoleBinding.md +2 -0
- package/dist/okf/types/SecretCiphertext.md +2 -0
- package/dist/okf/types/SecretManagerSecret.md +3 -0
- package/dist/okf/types/SecretManagerSecretVersion.md +6 -0
- package/dist/okf/types/SecuresourcemanagerInstance.md +2 -0
- package/dist/okf/types/SecuresourcemanagerRepository.md +2 -0
- package/dist/okf/types/SecurityPolicy.md +3 -0
- package/dist/okf/types/ServerTLSPolicy.md +3 -0
- package/dist/okf/types/ServiceAccountKey.md +6 -0
- package/dist/okf/types/ServiceAttachment.md +5 -0
- package/dist/okf/types/ServiceBinding.md +2 -0
- package/dist/okf/types/ServiceConnectionPolicy.md +2 -0
- package/dist/okf/types/ServiceIdentity.md +2 -0
- package/dist/okf/types/ServiceLevelObjective.md +4 -0
- package/dist/okf/types/ServicePerimeter.md +4 -0
- package/dist/okf/types/ServicePerimeterResource.md +1 -0
- package/dist/okf/types/ServiceProjectAttachment.md +2 -0
- package/dist/okf/types/ServiceSplitTraffic.md +1 -0
- package/dist/okf/types/ServicedirectoryEndpoint.md +2 -0
- package/dist/okf/types/ServicedirectoryNamespace.md +2 -0
- package/dist/okf/types/ServicedirectoryService.md +2 -0
- package/dist/okf/types/ServicenetworkingConnection.md +2 -0
- package/dist/okf/types/ServiceusageService.md +1 -0
- package/dist/okf/types/Settings.md +2 -0
- package/dist/okf/types/SharedVPCHostProject.md +1 -0
- package/dist/okf/types/SharedVPCServiceProject.md +1 -0
- package/dist/okf/types/Site.md +3 -0
- package/dist/okf/types/Source.md +2 -0
- package/dist/okf/types/SourcerepoRepository.md +3 -0
- package/dist/okf/types/SpannerBackupSchedule.md +2 -0
- package/dist/okf/types/SpannerDatabase.md +2 -0
- package/dist/okf/types/SpannerInstance.md +3 -0
- package/dist/okf/types/Spoke.md +5 -0
- package/dist/okf/types/StandardAppVersion.md +2 -0
- package/dist/okf/types/StorageBucket.md +3 -0
- package/dist/okf/types/StoragetransferJob.md +5 -0
- package/dist/okf/types/StoredInfoType.md +1 -0
- package/dist/okf/types/Stream.md +3 -0
- package/dist/okf/types/Subnet.md +5 -0
- package/dist/okf/types/Subnetwork.md +8 -0
- package/dist/okf/types/Subscription.md +1 -0
- package/dist/okf/types/SyncAuthorization.md +2 -0
- package/dist/okf/types/TCPRoute.md +4 -0
- package/dist/okf/types/TLSRoute.md +4 -0
- package/dist/okf/types/Tag.md +2 -0
- package/dist/okf/types/TagBinding.md +3 -0
- package/dist/okf/types/TagKey.md +6 -0
- package/dist/okf/types/TagTemplate.md +2 -0
- package/dist/okf/types/TagValue.md +6 -0
- package/dist/okf/types/Target.md +2 -0
- package/dist/okf/types/TargetGRPCProxy.md +5 -0
- package/dist/okf/types/TargetHTTPProxy.md +4 -0
- package/dist/okf/types/TargetHTTPSProxy.md +5 -0
- package/dist/okf/types/TargetInstance.md +3 -0
- package/dist/okf/types/TargetPool.md +2 -0
- package/dist/okf/types/TargetSSLProxy.md +4 -0
- package/dist/okf/types/TargetTCPProxy.md +5 -0
- package/dist/okf/types/TargetVPNGateway.md +4 -0
- package/dist/okf/types/TasksQueue.md +2 -0
- package/dist/okf/types/Taxonomy.md +3 -0
- package/dist/okf/types/Tenant.md +1 -0
- package/dist/okf/types/TenantDefaultSupportedIDPConfig.md +2 -0
- package/dist/okf/types/TenantInboundSAMLConfig.md +1 -0
- package/dist/okf/types/TenantOAuthIDPConfig.md +1 -0
- package/dist/okf/types/Tensorboard.md +6 -0
- package/dist/okf/types/URLMap.md +5 -0
- package/dist/okf/types/UptimeCheckConfig.md +1 -0
- package/dist/okf/types/User.md +2 -0
- package/dist/okf/types/VPCNetwork.md +3 -0
- package/dist/okf/types/VPNGateway.md +2 -0
- package/dist/okf/types/VPNTunnel.md +7 -0
- package/dist/okf/types/VertexaiDataset.md +1 -0
- package/dist/okf/types/VertexaiEndpoint.md +1 -0
- package/dist/okf/types/VertexaiIndex.md +1 -0
- package/dist/okf/types/VirtualMachine.md +2 -0
- package/dist/okf/types/VmwareengineNetwork.md +2 -0
- package/dist/okf/types/VmwareengineNetworkPeering.md +2 -0
- package/dist/okf/types/VpnConnection.md +3 -0
- package/dist/okf/types/WasmPlugin.md +2 -0
- package/dist/okf/types/WebApp.md +3 -0
- package/dist/okf/types/Webhook.md +3 -0
- package/dist/okf/types/WorkerPool.md +2 -0
- package/dist/okf/types/Workflow.md +2 -0
- package/dist/okf/types/WorkflowTemplate.md +4 -0
- package/dist/okf/types/WorkflowsExecution.md +2 -0
- package/dist/okf/types/WorkforcePool.md +3 -0
- package/dist/okf/types/WorkforcePoolProvider.md +2 -0
- package/dist/okf/types/Workload.md +2 -0
- package/dist/okf/types/WorkloadIdentityPool.md +2 -0
- package/dist/okf/types/WorkloadIdentityPoolProvider.md +2 -0
- package/dist/okf/types/Workstation.md +2 -0
- package/dist/okf/types/WorkstationCluster.md +2 -0
- package/dist/okf/types/WorkstationConfig.md +2 -0
- package/dist/okf/types/Zone.md +2 -0
- package/dist/op/activities/floci-gcp.js +49 -0
- package/dist/op/activities/gcp-apply.js +618 -0
- package/dist/op/activities/index.js +10 -0
- package/dist/op/builders.js +50 -0
- package/dist/ownership.js +38 -0
- package/dist/package-cli.js +20 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +377 -0
- package/dist/pseudo.js +15 -0
- package/dist/rules/schema-registry.ts +2 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +247 -0
- package/dist/spec/fetch.js +107 -0
- package/dist/spec/parse.d.ts +1 -1
- package/dist/spec/parse.js +339 -0
- package/dist/types/index.d.ts +1367 -0
- package/dist/validate-cli.js +11 -0
- package/dist/validate.js +24 -0
- package/dist/variables.js +15 -0
- package/package.json +8 -8
- package/src/attributes.test.ts +16 -0
- package/src/codegen/generate.ts +8 -3
- package/src/codegen/package.ts +2 -2
- package/src/composites/catalog.ts +7 -1
- package/src/composites/cloud-run-service.ts +12 -5
- package/src/composites/composites.test.ts +17 -0
- package/src/generated/index.d.ts +1367 -0
- package/src/generated/index.ts +487 -487
- package/src/generated/lexicon-gcp.json +1848 -481
- package/src/health.test.ts +59 -0
- package/src/health.ts +123 -0
- package/src/index.ts +3 -0
- package/src/lint/post-synth/schema-registry.ts +2 -1
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/plugin.ts +8 -0
- package/src/serializer-outputs.test.ts +26 -0
- package/src/serializer.ts +21 -3
- package/src/spec/parse.test.ts +42 -2
- package/src/spec/parse.ts +17 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP IAM role constants for common patterns.
|
|
3
|
+
*/
|
|
4
|
+
export const StorageRoles = {
|
|
5
|
+
Admin: "roles/storage.admin",
|
|
6
|
+
ObjectAdmin: "roles/storage.objectAdmin",
|
|
7
|
+
ObjectViewer: "roles/storage.objectViewer",
|
|
8
|
+
ObjectCreator: "roles/storage.objectCreator",
|
|
9
|
+
};
|
|
10
|
+
export const ComputeRoles = {
|
|
11
|
+
Admin: "roles/compute.admin",
|
|
12
|
+
Viewer: "roles/compute.viewer",
|
|
13
|
+
NetworkAdmin: "roles/compute.networkAdmin",
|
|
14
|
+
InstanceAdmin: "roles/compute.instanceAdmin.v1",
|
|
15
|
+
};
|
|
16
|
+
export const ContainerRoles = {
|
|
17
|
+
Admin: "roles/container.admin",
|
|
18
|
+
Developer: "roles/container.developer",
|
|
19
|
+
Viewer: "roles/container.viewer",
|
|
20
|
+
ClusterAdmin: "roles/container.clusterAdmin",
|
|
21
|
+
};
|
|
22
|
+
export const IAMRoles = {
|
|
23
|
+
Admin: "roles/iam.serviceAccountAdmin",
|
|
24
|
+
User: "roles/iam.serviceAccountUser",
|
|
25
|
+
TokenCreator: "roles/iam.serviceAccountTokenCreator",
|
|
26
|
+
WorkloadIdentityUser: "roles/iam.workloadIdentityUser",
|
|
27
|
+
};
|
|
28
|
+
export const SQLRoles = {
|
|
29
|
+
Admin: "roles/cloudsql.admin",
|
|
30
|
+
Client: "roles/cloudsql.client",
|
|
31
|
+
Editor: "roles/cloudsql.editor",
|
|
32
|
+
Viewer: "roles/cloudsql.viewer",
|
|
33
|
+
};
|
|
34
|
+
export const RunRoles = {
|
|
35
|
+
Admin: "roles/run.admin",
|
|
36
|
+
Developer: "roles/run.developer",
|
|
37
|
+
Invoker: "roles/run.invoker",
|
|
38
|
+
Viewer: "roles/run.viewer",
|
|
39
|
+
};
|
|
40
|
+
export const PubSubRoles = {
|
|
41
|
+
Admin: "roles/pubsub.admin",
|
|
42
|
+
Publisher: "roles/pubsub.publisher",
|
|
43
|
+
Subscriber: "roles/pubsub.subscriber",
|
|
44
|
+
Viewer: "roles/pubsub.viewer",
|
|
45
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP read transport (#1209) — the applier's own REST client, pointed at the
|
|
3
|
+
* read side.
|
|
4
|
+
*
|
|
5
|
+
* GCP applies cluster-free over direct REST (#706) and, until this, observed
|
|
6
|
+
* through a Config Connector cluster: `kubectl get <cnrm-gvk> -o json` per
|
|
7
|
+
* entity, on both the thin and the deep path. That split is what #1085's
|
|
8
|
+
* principle forbids — a lexicon should be observed on the transport it is
|
|
9
|
+
* applied with, or the two can disagree about what a resource even is — and it
|
|
10
|
+
* is what made GCP the heaviest of the three O slots.
|
|
11
|
+
*
|
|
12
|
+
* ## The URL comes from the applier, not from here
|
|
13
|
+
*
|
|
14
|
+
* Every GET is built by the same `ResourceMapper.plan()` the applier uses, and
|
|
15
|
+
* this module reads `plan().getUrl` rather than composing its own URL. That is
|
|
16
|
+
* deliberate: a reader that builds its own paths is a second, silently
|
|
17
|
+
* divergent opinion about where a resource lives, and the first symptom is a
|
|
18
|
+
* read that reports absent for something the applier just wrote. Reusing the
|
|
19
|
+
* mapper makes the two structurally incapable of disagreeing.
|
|
20
|
+
*
|
|
21
|
+
* ## What that bounds
|
|
22
|
+
*
|
|
23
|
+
* Coverage is exactly the applier's dispatch table (`MAPPERS`) — StorageBucket,
|
|
24
|
+
* PubSubTopic, PubSubSubscription, SecretManagerSecret, IAMServiceAccount,
|
|
25
|
+
* RunService. The kubectl path could fetch any CNRM kind the cluster knew
|
|
26
|
+
* about, so this is narrower on paper. It is not narrower in practice for
|
|
27
|
+
* anything chant can act on: a kind with no mapper cannot be applied either, so
|
|
28
|
+
* observing it produced a live tree nothing could ever reconcile against.
|
|
29
|
+
*
|
|
30
|
+
* A kind outside the table reports NOT-OBSERVED with `unsupported-kind` rather
|
|
31
|
+
* than being dropped, so the estate says "chant did not look at this" instead of
|
|
32
|
+
* quietly implying it is not there. Widening the table is #1209's stated
|
|
33
|
+
* non-goal and belongs with the applier.
|
|
34
|
+
*/
|
|
35
|
+
import { MAPPERS } from "../op/activities/gcp-apply.js";
|
|
36
|
+
const defaultHttp = async (method, url) => {
|
|
37
|
+
const res = await fetch(url, { method });
|
|
38
|
+
return { status: res.status, text: await res.text() };
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A read that failed for a reason the caller must classify — carries the HTTP
|
|
42
|
+
* status so a 404 (absent) is told apart from a 401/403 (no credentials) and a
|
|
43
|
+
* 5xx/network error (could not look). Mirrors `AzureReadError`.
|
|
44
|
+
*/
|
|
45
|
+
export class GcpReadError extends Error {
|
|
46
|
+
constructor(message, status) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.status = status;
|
|
49
|
+
this.name = "GcpReadError";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** A 404 — the resource is genuinely absent, which is an answer, not a failure. */
|
|
53
|
+
export function isNotFound(err) {
|
|
54
|
+
return err instanceof GcpReadError && err.status === 404;
|
|
55
|
+
}
|
|
56
|
+
/** The mapper for a CNRM kind, or undefined when chant cannot act on it. */
|
|
57
|
+
export function mapperForKind(kind) {
|
|
58
|
+
return MAPPERS[kind];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* GET one resource on the applier's transport.
|
|
62
|
+
*
|
|
63
|
+
* `declared` is the entity's own declared spec, which is what `plan()` needs to
|
|
64
|
+
* build a URL — the same input the applier hands it. Returns the parsed body,
|
|
65
|
+
* or throws {@link GcpReadError} carrying the status.
|
|
66
|
+
*/
|
|
67
|
+
export async function getResource(client, kind, name, declared) {
|
|
68
|
+
const mapper = mapperForKind(kind);
|
|
69
|
+
if (!mapper)
|
|
70
|
+
throw new GcpReadError(`no REST mapper for kind ${kind}`);
|
|
71
|
+
const base = (client.endpoint ?? mapper.defaultHost).replace(/\/$/, "");
|
|
72
|
+
const resource = {
|
|
73
|
+
kind,
|
|
74
|
+
metadata: { name },
|
|
75
|
+
spec: declared?.spec ?? declared ?? {},
|
|
76
|
+
};
|
|
77
|
+
let getUrl;
|
|
78
|
+
try {
|
|
79
|
+
getUrl = mapper.plan(resource, { base, project: client.project }).getUrl;
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
// A mapper that cannot plan from the declared spec cannot produce a URL, so
|
|
83
|
+
// there is nothing to read — a hole, never an absence.
|
|
84
|
+
throw new GcpReadError(`could not build a read URL for ${kind}/${name}: ${err instanceof Error ? err.message : String(err)}`);
|
|
85
|
+
}
|
|
86
|
+
const http = client.http ?? defaultHttp;
|
|
87
|
+
let res;
|
|
88
|
+
try {
|
|
89
|
+
res = await http("GET", getUrl);
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
throw new GcpReadError(err instanceof Error ? err.message : String(err));
|
|
93
|
+
}
|
|
94
|
+
if (res.status === 404)
|
|
95
|
+
throw new GcpReadError(`${kind}/${name} not found`, 404);
|
|
96
|
+
if (res.status < 200 || res.status >= 300) {
|
|
97
|
+
throw new GcpReadError(`GET ${kind}/${name} failed with ${res.status}: ${res.text.slice(0, 200)}`, res.status);
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return JSON.parse(res.text);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
throw new GcpReadError(`GET ${kind}/${name} returned a non-JSON body`, res.status);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP Config Connector documentation generator.
|
|
3
|
+
*
|
|
4
|
+
* writeDocsSite puts the pages in the main docs site under
|
|
5
|
+
* docs/src/content/docs/lexicons/gcp/ (chant #3993).
|
|
6
|
+
*/
|
|
7
|
+
import { dirname, join } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { docsPipeline, writeDocsSite } from "@intentius/chant/codegen/docs";
|
|
10
|
+
/**
|
|
11
|
+
* Extract service name from GCP resource type: "GCP::Compute::Instance" → "Compute"
|
|
12
|
+
*/
|
|
13
|
+
function serviceFromType(resourceType) {
|
|
14
|
+
const parts = resourceType.split("::");
|
|
15
|
+
return parts.length >= 2 ? parts[1] : "Other";
|
|
16
|
+
}
|
|
17
|
+
const overview = `The **GCP Config Connector** lexicon provides full support for defining Google Cloud infrastructure using chant's declarative TypeScript syntax. Resources are serialized to Config Connector YAML manifests.
|
|
18
|
+
|
|
19
|
+
This lexicon is generated from the official [Config Connector CRDs](https://github.com/GoogleCloudPlatform/k8s-config-connector) and includes coverage for 300+ resource types across 80+ GCP services.
|
|
20
|
+
|
|
21
|
+
New? Start with the [Getting Started](/chant/lexicons/gcp/getting-started/) guide.
|
|
22
|
+
|
|
23
|
+
Install it with:
|
|
24
|
+
|
|
25
|
+
\`\`\`bash
|
|
26
|
+
npm install --save-dev @intentius/chant-lexicon-gcp
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
\`\`\`typescript
|
|
32
|
+
import { StorageBucket, IAMPolicyMember, GCP } from "@intentius/chant-lexicon-gcp";
|
|
33
|
+
import { defaultAnnotations } from "@intentius/chant-lexicon-gcp";
|
|
34
|
+
|
|
35
|
+
export const annotations = defaultAnnotations({
|
|
36
|
+
"cnrm.cloud.google.com/project-id": GCP.ProjectId,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const bucket = new StorageBucket({
|
|
40
|
+
location: "US",
|
|
41
|
+
storageClass: "STANDARD",
|
|
42
|
+
uniformBucketLevelAccess: true,
|
|
43
|
+
versioning: { enabled: true },
|
|
44
|
+
});
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
The lexicon provides **300+ resource types** across Compute, Storage, IAM, Networking, Container, SQL, PubSub, and more, plus composites (GkeCluster, CloudRunService, CloudSqlInstance, GcsBucket, VpcNetwork, PubSubPipeline, CloudFunctionWithTrigger, PrivateService, ManagedCertificate, SecureProject) for common patterns.
|
|
48
|
+
`;
|
|
49
|
+
const outputFormat = `The GCP lexicon serializes resources into **Config Connector YAML manifests** (Kubernetes CRDs).
|
|
50
|
+
|
|
51
|
+
## Building
|
|
52
|
+
|
|
53
|
+
Run \`chant build\` to produce Config Connector YAML from your declarations:
|
|
54
|
+
|
|
55
|
+
\`\`\`bash
|
|
56
|
+
chant build
|
|
57
|
+
# Writes dist/manifests.yaml
|
|
58
|
+
\`\`\`
|
|
59
|
+
|
|
60
|
+
The generated manifests include:
|
|
61
|
+
|
|
62
|
+
- \`apiVersion\` and \`kind\` (Config Connector CRD)
|
|
63
|
+
- \`metadata\` with name, labels, and annotations
|
|
64
|
+
- \`spec\` with the resource configuration
|
|
65
|
+
|
|
66
|
+
## Key conversions
|
|
67
|
+
|
|
68
|
+
| Chant (TypeScript) | YAML output | Rule |
|
|
69
|
+
|--------------------|-------------|------|
|
|
70
|
+
| \`export const myBucket = new StorageBucket({...})\` | \`metadata.name: my-bucket\` | Export name → kebab-case |
|
|
71
|
+
| \`defaultLabels({...})\` | Merged into all resources | Project-wide label injection |
|
|
72
|
+
| \`defaultAnnotations({...})\` | Merged into all resources | Project-wide annotation injection |
|
|
73
|
+
|
|
74
|
+
## Applying
|
|
75
|
+
|
|
76
|
+
Apply to a Kubernetes cluster with Config Connector installed:
|
|
77
|
+
|
|
78
|
+
\`\`\`bash
|
|
79
|
+
# Dry run
|
|
80
|
+
kubectl apply -f dist/manifests.yaml --dry-run=server
|
|
81
|
+
|
|
82
|
+
# Apply
|
|
83
|
+
kubectl apply -f dist/manifests.yaml
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
## Compatibility
|
|
87
|
+
|
|
88
|
+
The output is compatible with:
|
|
89
|
+
- kubectl apply/diff
|
|
90
|
+
- Config Connector controller on GKE
|
|
91
|
+
- ArgoCD / Flux GitOps controllers
|
|
92
|
+
- Kustomize (as a base)`;
|
|
93
|
+
/**
|
|
94
|
+
* Generate documentation for the GCP Config Connector lexicon.
|
|
95
|
+
*/
|
|
96
|
+
export async function generateDocs(opts) {
|
|
97
|
+
const pkgDir = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
|
98
|
+
const config = {
|
|
99
|
+
name: "gcp",
|
|
100
|
+
displayName: "GCP Config Connector",
|
|
101
|
+
description: "Typed constructors for GCP Config Connector resource manifests",
|
|
102
|
+
distDir: join(pkgDir, "dist"),
|
|
103
|
+
outDir: join(pkgDir, "docs"),
|
|
104
|
+
overview,
|
|
105
|
+
outputFormat,
|
|
106
|
+
serviceFromType,
|
|
107
|
+
srcDir: join(pkgDir, "src"),
|
|
108
|
+
basePath: "/chant/lexicons/gcp/",
|
|
109
|
+
};
|
|
110
|
+
const result = docsPipeline(config);
|
|
111
|
+
writeDocsSite(config, result);
|
|
112
|
+
if (opts?.verbose) {
|
|
113
|
+
console.error(`Generated docs: ${result.stats.resources} resources, ${result.stats.properties} properties, ${result.stats.services} services, ${result.stats.rules} rules`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* CLI entry point for GCP lexicon generation.
|
|
4
|
+
*/
|
|
5
|
+
import { dirname } from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
import { generate, writeGeneratedFiles } from "./generate.js";
|
|
8
|
+
// src/codegen/generate-cli.ts → dirname x3 → package root
|
|
9
|
+
const pkgDir = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
|
10
|
+
const verbose = process.argv.includes("--verbose") || !process.argv.includes("--quiet");
|
|
11
|
+
const force = process.argv.includes("--force");
|
|
12
|
+
const result = await generate({ verbose, force });
|
|
13
|
+
writeGeneratedFiles(result, pkgDir);
|
|
14
|
+
console.error(`Generated ${result.resources} resources, ${result.properties} property types, ${result.enums} enums`);
|
|
15
|
+
if (result.warnings.length > 0) {
|
|
16
|
+
console.error(`${result.warnings.length} warnings`);
|
|
17
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP Config Connector generation pipeline — uses core generatePipeline
|
|
3
|
+
* with GCP-specific fetch, parse, naming, and generation callbacks.
|
|
4
|
+
*/
|
|
5
|
+
import { generatePipeline, writeGeneratedArtifacts, } from "@intentius/chant/codegen/generate";
|
|
6
|
+
import { fetchCRDBundle } from "../spec/fetch.js";
|
|
7
|
+
import { parseGcpCRD } from "../spec/parse.js";
|
|
8
|
+
import { NamingStrategy, propertyTypeName } from "./naming.js";
|
|
9
|
+
import { generateRuntimeIndex as coreGenerateRuntimeIndex, } from "@intentius/chant/codegen/generate-runtime-index";
|
|
10
|
+
const gcpPipelineConfig = {
|
|
11
|
+
fetchSchemas: async (opts) => {
|
|
12
|
+
return fetchCRDBundle(opts.force);
|
|
13
|
+
},
|
|
14
|
+
parseSchema: (_typeName, data) => {
|
|
15
|
+
const results = parseGcpCRD(data);
|
|
16
|
+
// Each CRD file may contain one or more resources
|
|
17
|
+
// We return the first one; additional ones get collected in augmentResults
|
|
18
|
+
if (results.length === 0)
|
|
19
|
+
return null;
|
|
20
|
+
return results[0];
|
|
21
|
+
},
|
|
22
|
+
createNaming: (results) => new NamingStrategy(results),
|
|
23
|
+
augmentResults: (results, _opts, log) => {
|
|
24
|
+
const warnings = [];
|
|
25
|
+
log(`Total: ${results.length} GCP Config Connector resource schemas`);
|
|
26
|
+
return { results, warnings };
|
|
27
|
+
},
|
|
28
|
+
generateRegistry: (results, naming) => {
|
|
29
|
+
return generateLexiconJSON(results, naming);
|
|
30
|
+
},
|
|
31
|
+
generateTypes: (results, naming) => {
|
|
32
|
+
return generateTypeScriptDeclarations(results, naming);
|
|
33
|
+
},
|
|
34
|
+
generateRuntimeIndex: (results, naming) => {
|
|
35
|
+
return generateRuntimeIndex(results, naming);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Run the full GCP generation pipeline.
|
|
40
|
+
*/
|
|
41
|
+
export async function generate(opts = {}) {
|
|
42
|
+
return generatePipeline(gcpPipelineConfig, opts);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Write generated artifacts to disk.
|
|
46
|
+
*/
|
|
47
|
+
export function writeGeneratedFiles(result, baseDir) {
|
|
48
|
+
writeGeneratedArtifacts({
|
|
49
|
+
baseDir,
|
|
50
|
+
files: {
|
|
51
|
+
"lexicon-gcp.json": result.lexiconJSON,
|
|
52
|
+
"index.d.ts": result.typesDTS,
|
|
53
|
+
"index.ts": result.indexTS,
|
|
54
|
+
"runtime.ts": [
|
|
55
|
+
"/**",
|
|
56
|
+
" * Runtime factory constructors — re-exported from core.",
|
|
57
|
+
" */",
|
|
58
|
+
'export { createResource, createProperty } from "@intentius/chant/runtime";',
|
|
59
|
+
"",
|
|
60
|
+
].join("\n"),
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Extract the property-type suffix from a GCP `::` name and flatten to valid TS identifier.
|
|
66
|
+
* "GCP::Alloydb::Backup::EncryptionConfig", "GCP::Alloydb::Backup" → "EncryptionConfig"
|
|
67
|
+
* "GCP::Acm::AccessLevel::Custom::Expr", "GCP::Acm::AccessLevel" → "Custom_Expr"
|
|
68
|
+
*/
|
|
69
|
+
function gcpDefName(ptName, resourceType) {
|
|
70
|
+
const prefix = `${resourceType}::`;
|
|
71
|
+
const raw = ptName.startsWith(prefix) ? ptName.slice(prefix.length) : ptName.split("::").pop();
|
|
72
|
+
return raw.replace(/::/g, "_");
|
|
73
|
+
}
|
|
74
|
+
// ── Lexicon JSON generation ─────────────────────────────────────────
|
|
75
|
+
function generateLexiconJSON(results, naming) {
|
|
76
|
+
const entries = {};
|
|
77
|
+
for (const r of results) {
|
|
78
|
+
const cfnType = r.resource.typeName;
|
|
79
|
+
const tsName = naming.resolve(cfnType);
|
|
80
|
+
if (!tsName)
|
|
81
|
+
continue;
|
|
82
|
+
const apiVersion = `${r.gvk.group}/${r.gvk.version}`;
|
|
83
|
+
entries[tsName] = {
|
|
84
|
+
resourceType: cfnType,
|
|
85
|
+
kind: "resource",
|
|
86
|
+
apiVersion,
|
|
87
|
+
gvkKind: r.gvk.kind,
|
|
88
|
+
group: r.gvk.group,
|
|
89
|
+
properties: r.resource.properties.length,
|
|
90
|
+
schema: {
|
|
91
|
+
fields: Object.fromEntries(r.resource.properties.map((p) => [p.name, {
|
|
92
|
+
type: p.tsType,
|
|
93
|
+
required: p.required,
|
|
94
|
+
...(p.enum && { enum: p.enum }),
|
|
95
|
+
...(p.isResourceRef && { ref: true }),
|
|
96
|
+
}])),
|
|
97
|
+
required: r.resource.properties.filter((p) => p.required).map((p) => p.name),
|
|
98
|
+
},
|
|
99
|
+
attrs: Object.fromEntries(r.resource.attributes.map((a) => [attrKey(a.name), a.tsType])),
|
|
100
|
+
};
|
|
101
|
+
// Add property types
|
|
102
|
+
for (const pt of r.propertyTypes) {
|
|
103
|
+
const defName = gcpDefName(pt.name, cfnType);
|
|
104
|
+
const ptName = propertyTypeName(tsName, defName);
|
|
105
|
+
entries[ptName] = {
|
|
106
|
+
resourceType: `${cfnType}.${pt.specType}`,
|
|
107
|
+
kind: "property",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return JSON.stringify(entries, null, 2);
|
|
112
|
+
}
|
|
113
|
+
// ── TypeScript declarations generation ──────────────────────────────
|
|
114
|
+
function generateTypeScriptDeclarations(results, naming) {
|
|
115
|
+
const lines = [
|
|
116
|
+
"/**",
|
|
117
|
+
" * GCP Config Connector resource type declarations.",
|
|
118
|
+
" *",
|
|
119
|
+
" * Auto-generated — do not edit.",
|
|
120
|
+
" */",
|
|
121
|
+
"",
|
|
122
|
+
];
|
|
123
|
+
const emittedTypes = new Set();
|
|
124
|
+
for (const r of results) {
|
|
125
|
+
const cfnType = r.resource.typeName;
|
|
126
|
+
const tsName = naming.resolve(cfnType);
|
|
127
|
+
if (!tsName)
|
|
128
|
+
continue;
|
|
129
|
+
// Resource class interface
|
|
130
|
+
const desc = (r.resource.description ?? cfnType).replace(/\*\//g, "*\\/");
|
|
131
|
+
lines.push(`/** ${desc} */`);
|
|
132
|
+
lines.push(`export declare class ${tsName} {`);
|
|
133
|
+
lines.push(` constructor(props: ${tsName}Props);`);
|
|
134
|
+
// Attributes
|
|
135
|
+
for (const attr of r.resource.attributes) {
|
|
136
|
+
lines.push(` readonly ${attrKey(attr.name)}: ${attr.tsType};`);
|
|
137
|
+
}
|
|
138
|
+
lines.push(`}`);
|
|
139
|
+
lines.push("");
|
|
140
|
+
// Props interface
|
|
141
|
+
lines.push(`export interface ${tsName}Props {`);
|
|
142
|
+
for (const prop of r.resource.properties) {
|
|
143
|
+
const optional = prop.required ? "" : "?";
|
|
144
|
+
const safeName = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(prop.name) ? prop.name : JSON.stringify(prop.name);
|
|
145
|
+
const propDesc = prop.description ? ` /** ${prop.description.replace(/\*\//g, "*\\/")} */\n` : "";
|
|
146
|
+
lines.push(`${propDesc} ${safeName}${optional}: ${prop.tsType};`);
|
|
147
|
+
}
|
|
148
|
+
lines.push(`}`);
|
|
149
|
+
lines.push("");
|
|
150
|
+
// Aliases
|
|
151
|
+
for (const alias of naming.aliases(cfnType)) {
|
|
152
|
+
lines.push(`/** Alias for ${tsName} */`);
|
|
153
|
+
lines.push(`export declare const ${alias}: typeof ${tsName};`);
|
|
154
|
+
lines.push("");
|
|
155
|
+
}
|
|
156
|
+
// Property types (skip duplicates from singularization collisions)
|
|
157
|
+
for (const pt of r.propertyTypes) {
|
|
158
|
+
const defName = gcpDefName(pt.name, cfnType);
|
|
159
|
+
const ptName = propertyTypeName(tsName, defName);
|
|
160
|
+
if (emittedTypes.has(ptName))
|
|
161
|
+
continue;
|
|
162
|
+
emittedTypes.add(ptName);
|
|
163
|
+
lines.push(`export declare class ${ptName} {`);
|
|
164
|
+
lines.push(` constructor(props: ${ptName}Props);`);
|
|
165
|
+
lines.push(`}`);
|
|
166
|
+
lines.push("");
|
|
167
|
+
lines.push(`export interface ${ptName}Props {`);
|
|
168
|
+
for (const prop of pt.properties) {
|
|
169
|
+
const optional = prop.required ? "" : "?";
|
|
170
|
+
const safeName = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(prop.name) ? prop.name : JSON.stringify(prop.name);
|
|
171
|
+
lines.push(` ${safeName}${optional}: ${prop.tsType};`);
|
|
172
|
+
}
|
|
173
|
+
lines.push(`}`);
|
|
174
|
+
lines.push("");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return lines.join("\n");
|
|
178
|
+
}
|
|
179
|
+
// ── Runtime index generation ────────────────────────────────────────
|
|
180
|
+
/** The property an attribute is read through: `status.uri` is `status_uri`, as AWS's `Endpoint.Address` is `Endpoint_Address`. */
|
|
181
|
+
function attrKey(name) {
|
|
182
|
+
return name.replace(/\./g, "_");
|
|
183
|
+
}
|
|
184
|
+
function generateRuntimeIndex(results, naming) {
|
|
185
|
+
const resourceEntries = [];
|
|
186
|
+
const propertyEntries = [];
|
|
187
|
+
const emittedProperties = new Set();
|
|
188
|
+
for (const r of results) {
|
|
189
|
+
const cfnType = r.resource.typeName;
|
|
190
|
+
const tsName = naming.resolve(cfnType);
|
|
191
|
+
if (!tsName)
|
|
192
|
+
continue;
|
|
193
|
+
const attrs = {};
|
|
194
|
+
for (const a of r.resource.attributes) {
|
|
195
|
+
attrs[attrKey(a.name)] = a.name;
|
|
196
|
+
}
|
|
197
|
+
resourceEntries.push({ tsName, resourceType: cfnType, attrs });
|
|
198
|
+
for (const alias of naming.aliases(cfnType)) {
|
|
199
|
+
resourceEntries.push({ tsName: alias, resourceType: cfnType, attrs });
|
|
200
|
+
}
|
|
201
|
+
for (const pt of r.propertyTypes) {
|
|
202
|
+
const defName = gcpDefName(pt.name, cfnType);
|
|
203
|
+
const ptName = propertyTypeName(tsName, defName);
|
|
204
|
+
if (emittedProperties.has(ptName))
|
|
205
|
+
continue;
|
|
206
|
+
emittedProperties.add(ptName);
|
|
207
|
+
const ptCfnType = `${cfnType}.${pt.specType}`;
|
|
208
|
+
propertyEntries.push({ tsName: ptName, resourceType: ptCfnType });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return coreGenerateRuntimeIndex(resourceEntries, propertyEntries, {
|
|
212
|
+
lexiconName: "gcp",
|
|
213
|
+
pseudoReExports: {
|
|
214
|
+
names: ["GCP", "ProjectId", "Region", "Zone"],
|
|
215
|
+
from: "../pseudo",
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP-specific naming configuration for the core NamingStrategy.
|
|
3
|
+
*
|
|
4
|
+
* Maps Config Connector resource types to concise TypeScript class names.
|
|
5
|
+
*/
|
|
6
|
+
import { NamingStrategy as CoreNamingStrategy, } from "@intentius/chant/codegen/naming";
|
|
7
|
+
export { propertyTypeName, extractDefName } from "@intentius/chant/codegen/naming";
|
|
8
|
+
import { gcpShortName } from "../spec/parse.js";
|
|
9
|
+
/**
|
|
10
|
+
* Fixed TypeScript class names for key GCP resources.
|
|
11
|
+
*/
|
|
12
|
+
const priorityNames = {
|
|
13
|
+
"GCP::Compute::Instance": "ComputeInstance",
|
|
14
|
+
"GCP::Compute::Network": "VPCNetwork",
|
|
15
|
+
"GCP::Compute::Subnetwork": "Subnetwork",
|
|
16
|
+
"GCP::Compute::Firewall": "Firewall",
|
|
17
|
+
"GCP::Compute::Address": "ComputeAddress",
|
|
18
|
+
"GCP::Compute::Disk": "ComputeDisk",
|
|
19
|
+
"GCP::Compute::ForwardingRule": "ForwardingRule",
|
|
20
|
+
"GCP::Compute::HealthCheck": "ComputeHealthCheck",
|
|
21
|
+
"GCP::Compute::Router": "Router",
|
|
22
|
+
"GCP::Compute::RouterNAT": "RouterNAT",
|
|
23
|
+
"GCP::Compute::BackendService": "BackendService",
|
|
24
|
+
"GCP::Compute::TargetHTTPProxy": "TargetHTTPProxy",
|
|
25
|
+
"GCP::Compute::URLMap": "URLMap",
|
|
26
|
+
"GCP::Compute::SSLCertificate": "SSLCertificate",
|
|
27
|
+
"GCP::Storage::Bucket": "StorageBucket",
|
|
28
|
+
"GCP::Sql::Instance": "SQLInstance",
|
|
29
|
+
"GCP::Sql::Database": "SQLDatabase",
|
|
30
|
+
"GCP::Sql::User": "SQLUser",
|
|
31
|
+
"GCP::Container::Cluster": "GKECluster",
|
|
32
|
+
"GCP::Container::NodePool": "NodePool",
|
|
33
|
+
"GCP::Iam::ServiceAccount": "GCPServiceAccount",
|
|
34
|
+
"GCP::Iam::PolicyMember": "IAMPolicyMember",
|
|
35
|
+
"GCP::Iam::Policy": "IAMPolicy",
|
|
36
|
+
"GCP::Iam::AuditConfig": "IAMAuditConfig",
|
|
37
|
+
"GCP::Run::Service": "CloudRunService",
|
|
38
|
+
"GCP::Run::Job": "CloudRunJob",
|
|
39
|
+
"GCP::Pubsub::Topic": "PubSubTopic",
|
|
40
|
+
"GCP::Pubsub::Subscription": "PubSubSubscription",
|
|
41
|
+
"GCP::Bigquery::Dataset": "BigQueryDataset",
|
|
42
|
+
"GCP::Bigquery::Table": "BigQueryTable",
|
|
43
|
+
"GCP::Dns::ManagedZone": "DNSManagedZone",
|
|
44
|
+
"GCP::Dns::RecordSet": "DNSRecordSet",
|
|
45
|
+
"GCP::Logging::Metric": "LoggingMetric",
|
|
46
|
+
"GCP::Monitoring::AlertPolicy": "AlertPolicy",
|
|
47
|
+
"GCP::Secretmanager::Secret": "SecretManagerSecret",
|
|
48
|
+
"GCP::Secretmanager::SecretVersion": "SecretManagerSecretVersion",
|
|
49
|
+
"GCP::Artifactregistry::Repository": "ArtifactRegistryRepository",
|
|
50
|
+
"GCP::Cloudfunctions::Function": "CloudFunction",
|
|
51
|
+
"GCP::Kms::KeyRing": "KMSKeyRing",
|
|
52
|
+
"GCP::Kms::CryptoKey": "KMSCryptoKey",
|
|
53
|
+
"GCP::Redis::Instance": "RedisInstance",
|
|
54
|
+
"GCP::Memcache::Instance": "MemcacheInstance",
|
|
55
|
+
"GCP::Spanner::Instance": "SpannerInstance",
|
|
56
|
+
"GCP::Spanner::Database": "SpannerDatabase",
|
|
57
|
+
"GCP::Dataflow::Job": "DataflowJob",
|
|
58
|
+
"GCP::Bigtable::Instance": "BigtableInstance",
|
|
59
|
+
"GCP::Bigtable::Table": "BigtableTable",
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Additional TypeScript names beyond the primary priority name.
|
|
63
|
+
*/
|
|
64
|
+
const priorityAliases = {
|
|
65
|
+
"GCP::Compute::Network": ["VPC"],
|
|
66
|
+
"GCP::Container::Cluster": ["GKE"],
|
|
67
|
+
"GCP::Storage::Bucket": ["GCSBucket"],
|
|
68
|
+
"GCP::Sql::Instance": ["CloudSQL"],
|
|
69
|
+
"GCP::Iam::ServiceAccount": ["GSA"],
|
|
70
|
+
"GCP::Run::Service": ["CloudRun"],
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Service name abbreviations for collision-resolved names.
|
|
74
|
+
*/
|
|
75
|
+
const serviceAbbreviations = {
|
|
76
|
+
Compute: "Compute",
|
|
77
|
+
Storage: "Gcs",
|
|
78
|
+
Container: "Gke",
|
|
79
|
+
Sql: "Sql",
|
|
80
|
+
Iam: "Iam",
|
|
81
|
+
Bigquery: "BQ",
|
|
82
|
+
Pubsub: "PubSub",
|
|
83
|
+
Dns: "Dns",
|
|
84
|
+
Logging: "Log",
|
|
85
|
+
Monitoring: "Mon",
|
|
86
|
+
Secretmanager: "Sm",
|
|
87
|
+
Artifactregistry: "Ar",
|
|
88
|
+
Cloudfunctions: "Gcf",
|
|
89
|
+
Kms: "Kms",
|
|
90
|
+
Redis: "Redis",
|
|
91
|
+
Run: "Run",
|
|
92
|
+
Spanner: "Spanner",
|
|
93
|
+
Dataflow: "Df",
|
|
94
|
+
Bigtable: "Bt",
|
|
95
|
+
Memcache: "Mc",
|
|
96
|
+
};
|
|
97
|
+
const gcpNamingConfig = {
|
|
98
|
+
priorityNames,
|
|
99
|
+
priorityAliases,
|
|
100
|
+
priorityPropertyAliases: {
|
|
101
|
+
"GCP::Compute::Instance": {
|
|
102
|
+
NetworkInterface: "InstanceNetworkInterface",
|
|
103
|
+
AccessConfig: "InstanceAccessConfig",
|
|
104
|
+
AttachedDisk: "InstanceAttachedDisk",
|
|
105
|
+
Metadata: "InstanceMetadata",
|
|
106
|
+
Scheduling: "InstanceScheduling",
|
|
107
|
+
ServiceAccount: "InstanceServiceAccount",
|
|
108
|
+
ShieldedInstanceConfig: "InstanceShieldedConfig",
|
|
109
|
+
},
|
|
110
|
+
"GCP::Container::Cluster": {
|
|
111
|
+
NetworkConfig: "ClusterNetworkConfig",
|
|
112
|
+
NodeConfig: "ClusterNodeConfig",
|
|
113
|
+
IpAllocationPolicy: "ClusterIpAllocationPolicy",
|
|
114
|
+
MasterAuth: "ClusterMasterAuth",
|
|
115
|
+
PrivateClusterConfig: "ClusterPrivateConfig",
|
|
116
|
+
AddonsConfig: "ClusterAddonsConfig",
|
|
117
|
+
},
|
|
118
|
+
"GCP::Container::NodePool": {
|
|
119
|
+
NodeConfig: "NodePoolNodeConfig",
|
|
120
|
+
AutoScaling: "NodePoolAutoScaling",
|
|
121
|
+
Management: "NodePoolManagement",
|
|
122
|
+
UpgradeSettings: "NodePoolUpgradeSettings",
|
|
123
|
+
},
|
|
124
|
+
"GCP::Sql::Instance": {
|
|
125
|
+
IpConfiguration: "SqlIpConfiguration",
|
|
126
|
+
BackupConfiguration: "SqlBackupConfiguration",
|
|
127
|
+
DatabaseFlags: "SqlDatabaseFlags",
|
|
128
|
+
Settings: "SqlSettings",
|
|
129
|
+
},
|
|
130
|
+
"GCP::Storage::Bucket": {
|
|
131
|
+
Encryption: "BucketEncryption",
|
|
132
|
+
Versioning: "BucketVersioning",
|
|
133
|
+
Lifecycle: "BucketLifecycle",
|
|
134
|
+
LifecycleRule: "BucketLifecycleRule",
|
|
135
|
+
Logging: "BucketLogging",
|
|
136
|
+
RetentionPolicy: "BucketRetentionPolicy",
|
|
137
|
+
},
|
|
138
|
+
"GCP::Compute::Network": {
|
|
139
|
+
RoutingConfig: "NetworkRoutingConfig",
|
|
140
|
+
},
|
|
141
|
+
"GCP::Compute::Subnetwork": {
|
|
142
|
+
LogConfig: "SubnetworkLogConfig",
|
|
143
|
+
SecondaryIpRange: "SubnetworkSecondaryIpRange",
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
serviceAbbreviations,
|
|
147
|
+
shortName: gcpShortName,
|
|
148
|
+
serviceName: (typeName) => {
|
|
149
|
+
const parts = typeName.split("::");
|
|
150
|
+
return parts.length >= 2 ? parts[1] : "Other";
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* GCP-specific NamingStrategy — wraps the core algorithm with GCP data tables.
|
|
155
|
+
*/
|
|
156
|
+
export class NamingStrategy extends CoreNamingStrategy {
|
|
157
|
+
constructor(results) {
|
|
158
|
+
const inputs = results.map((r) => ({
|
|
159
|
+
typeName: r.resource.typeName,
|
|
160
|
+
propertyTypes: r.propertyTypes,
|
|
161
|
+
}));
|
|
162
|
+
super(inputs, gcpNamingConfig);
|
|
163
|
+
}
|
|
164
|
+
}
|