feat: Cloudformation + RDS

This commit is contained in:
Zakaria
2026-09-30 17:43:42 -04:00
parent 548a15d7ec
commit 7764ea0dc1
411 changed files with 10182 additions and 1063 deletions
+85 -15
View File
@@ -37,18 +37,27 @@ import type {
EventBridgeLambdaTriggerOverview,
EventBridgeRuleInput,
EventBridgeRuleOverview,
EventBridgePutEventInput,
EventBridgePutEventResult,
CloudFormationChangeSet,
CloudFormationChangeSetInput,
SqsLambdaEventSourceMappingInput,
SqsLambdaEventSourceMappingOverview,
SqsMessage,
SqsMoveTaskInput,
SqsMoveTaskResult,
SqsReceiveMessagesInput,
SqsSendMessageInput,
DatabaseSnapshot,
KubernetesFargateProfile,
KubernetesNodegroup,
LogsInsightsQueryInput,
LogsInsightsQueryResult,
LogsFilterInput,
KmsDecryptInput,
KmsDecryptResult,
KmsEncryptInput,
KmsEncryptResult,
NoSqlItem,
PublishNotificationInput,
PublishNotificationResult,
SnsSubscriptionInput,
@@ -71,6 +80,7 @@ import type {
CollectionPage,
DocumentStoreAdapter,
ItemStoreAdapter,
ItemQuery,
PageQuery,
} from '../cloud-spi/childCollections'
import {NotSupportedError} from '../cloud-spi/errors'
@@ -372,6 +382,42 @@ export class CloudProxyService {
await adapter.deleteEventBridgeRule(eventBusId, ruleName)
}
async putEventBridgeEvent(cloud: CloudProvider, eventBusId: string, input: EventBridgePutEventInput): Promise<EventBridgePutEventResult> {
const adapter = this.requireAdapter(cloud, 'events')
if (!adapter.putEventBridgeEvent) throw new NotSupportedError(`Event publishing is not supported for ${cloud}`)
return adapter.putEventBridgeEvent(eventBusId, input)
}
async listCloudFormationChangeSets(cloud: CloudProvider, stackName: string): Promise<CloudFormationChangeSet[]> {
const adapter = this.requireAdapter(cloud, 'iac')
if (!adapter.listCloudFormationChangeSets) throw new NotSupportedError(`CloudFormation change sets are not supported for ${cloud}`)
return adapter.listCloudFormationChangeSets(stackName)
}
async createCloudFormationChangeSet(cloud: CloudProvider, stackName: string, input: CloudFormationChangeSetInput): Promise<CloudFormationChangeSet> {
const adapter = this.requireAdapter(cloud, 'iac')
if (!adapter.createCloudFormationChangeSet) throw new NotSupportedError(`CloudFormation change sets are not supported for ${cloud}`)
return adapter.createCloudFormationChangeSet(stackName, input)
}
async executeCloudFormationChangeSet(cloud: CloudProvider, stackName: string, changeSetName: string): Promise<void> {
const adapter = this.requireAdapter(cloud, 'iac')
if (!adapter.executeCloudFormationChangeSet) throw new NotSupportedError(`CloudFormation change sets are not supported for ${cloud}`)
await adapter.executeCloudFormationChangeSet(stackName, changeSetName)
}
async deleteCloudFormationChangeSet(cloud: CloudProvider, stackName: string, changeSetName: string): Promise<void> {
const adapter = this.requireAdapter(cloud, 'iac')
if (!adapter.deleteCloudFormationChangeSet) throw new NotSupportedError(`CloudFormation change sets are not supported for ${cloud}`)
await adapter.deleteCloudFormationChangeSet(stackName, changeSetName)
}
async updateCloudFormationTerminationProtection(cloud: CloudProvider, stackName: string, enabled: boolean): Promise<void> {
const adapter = this.requireAdapter(cloud, 'iac')
if (!adapter.updateCloudFormationTerminationProtection) throw new NotSupportedError(`CloudFormation termination protection is not supported for ${cloud}`)
await adapter.updateCloudFormationTerminationProtection(stackName, enabled)
}
async createSqsLambdaEventSourceMapping(cloud: CloudProvider, input: SqsLambdaEventSourceMappingInput): Promise<SqsLambdaEventSourceMappingOverview> {
const adapter = this.requireAdapter(cloud, 'serverless')
if (!adapter.createSqsLambdaEventSourceMapping) throw new NotSupportedError(`SQS Lambda event source mappings are not supported for ${cloud}`)
@@ -390,6 +436,36 @@ export class CloudProxyService {
await adapter.deleteSqsLambdaEventSourceMapping(functionName, mappingId)
}
async sendSqsMessage(cloud: CloudProvider, queueId: string, input: SqsSendMessageInput): Promise<{messageId: string}> {
const adapter = this.requireAdapter(cloud, 'messaging')
if (!adapter.sendSqsMessage) throw new NotSupportedError(`SQS message sending is not supported for ${cloud}`)
return adapter.sendSqsMessage(queueId, input)
}
async receiveSqsMessages(cloud: CloudProvider, queueId: string, input: SqsReceiveMessagesInput): Promise<SqsMessage[]> {
const adapter = this.requireAdapter(cloud, 'messaging')
if (!adapter.receiveSqsMessages) throw new NotSupportedError(`SQS message receiving is not supported for ${cloud}`)
return adapter.receiveSqsMessages(queueId, input)
}
async deleteSqsMessage(cloud: CloudProvider, queueId: string, receiptHandle: string): Promise<void> {
const adapter = this.requireAdapter(cloud, 'messaging')
if (!adapter.deleteSqsMessage) throw new NotSupportedError(`SQS message deletion is not supported for ${cloud}`)
await adapter.deleteSqsMessage(queueId, receiptHandle)
}
async purgeSqsQueue(cloud: CloudProvider, queueId: string): Promise<void> {
const adapter = this.requireAdapter(cloud, 'messaging')
if (!adapter.purgeSqsQueue) throw new NotSupportedError(`SQS queue purging is not supported for ${cloud}`)
await adapter.purgeSqsQueue(queueId)
}
async startSqsMoveTask(cloud: CloudProvider, queueId: string, input: SqsMoveTaskInput): Promise<SqsMoveTaskResult> {
const adapter = this.requireAdapter(cloud, 'messaging')
if (!adapter.startSqsMoveTask) throw new NotSupportedError(`SQS message moving is not supported for ${cloud}`)
return adapter.startSqsMoveTask(queueId, input)
}
async updateResource(cloud: CloudProvider, service: CloudServiceType, id: string, input: UpdateResourceInput): Promise<CloudResource> {
const adapter = this.requireAdapter(cloud, service)
if (!adapter.update) throw new NotSupportedError(`Resource updates are not supported for ${cloud}/${service}`)
@@ -517,10 +593,10 @@ export class CloudProxyService {
await documents.deleteItem(resourceId, collectionId, itemId, partitionKey)
}
async queryCollectionItems(cloud: CloudProvider, service: CloudServiceType, resourceId: string, collectionId: string, query: string): Promise<CollectionPage<ChildItem>> {
async queryCollectionItems(cloud: CloudProvider, service: CloudServiceType, resourceId: string, collectionId: string, query: ItemQuery, page: PageQuery): Promise<CollectionPage<ChildItem>> {
const documents = this.requireDocuments(cloud, service)
if (!documents.queryItems) throw new NotSupportedError(`Querying items is not supported for ${cloud}/${service}`)
return documents.queryItems(resourceId, collectionId, query)
return documents.queryItems(resourceId, collectionId, query, page)
}
async listFlatItems(cloud: CloudProvider, service: CloudServiceType, resourceId: string, page: PageQuery): Promise<CollectionPage<ChildItem>> {
@@ -539,10 +615,10 @@ export class CloudProxyService {
await items.deleteItem(resourceId, itemId, partitionKey)
}
async queryFlatItems(cloud: CloudProvider, service: CloudServiceType, resourceId: string, query: string): Promise<CollectionPage<ChildItem>> {
async queryFlatItems(cloud: CloudProvider, service: CloudServiceType, resourceId: string, query: ItemQuery, page: PageQuery): Promise<CollectionPage<ChildItem>> {
const items = this.requireItems(cloud, service)
if (!items.queryItems) throw new NotSupportedError(`Querying items is not supported for ${cloud}/${service}`)
return items.queryItems(resourceId, query)
return items.queryItems(resourceId, query, page)
}
private requireDocuments(cloud: CloudProvider, service: CloudServiceType): DocumentStoreAdapter {
@@ -641,16 +717,10 @@ export class CloudProxyService {
return adapter.queryLogs(logGroupName, input)
}
async listNoSqlItems(cloud: CloudProvider, resourceId: string): Promise<NoSqlItem[]> {
const adapter = this.requireAdapter(cloud, 'nosql')
if (!adapter.listNoSqlItems) throw new NotSupportedError(`Item listing is not supported for ${cloud}/nosql`)
return adapter.listNoSqlItems(resourceId)
}
async putNoSqlItem(cloud: CloudProvider, resourceId: string, document: Record<string, unknown>): Promise<NoSqlItem> {
const adapter = this.requireAdapter(cloud, 'nosql')
if (!adapter.putNoSqlItem) throw new NotSupportedError(`Item creation is not supported for ${cloud}/nosql`)
return adapter.putNoSqlItem(resourceId, document)
async filterLogEvents(cloud: CloudProvider, logGroupName: string, input: LogsFilterInput, page: PageQuery = {}): Promise<CollectionPage<ChildItem>> {
const adapter = this.requireAdapter(cloud, 'logs')
if (!adapter.filterLogEvents) throw new NotSupportedError(`Log event filtering is not supported for ${cloud}/logs`)
return adapter.filterLogEvents(logGroupName, input, page)
}
async listKubernetesNodegroups(cloud: CloudProvider, clusterId: string): Promise<KubernetesNodegroup[]> {