feat: Cloudformation + RDS
This commit is contained in:
@@ -28,7 +28,9 @@ import type {
|
||||
KubernetesNodegroup,
|
||||
LogsInsightsQueryInput,
|
||||
LogsInsightsQueryResult,
|
||||
NoSqlItem,
|
||||
LogsFilterInput,
|
||||
SqsMessage,
|
||||
SqsSendMessageInput,
|
||||
SqlCredentials,
|
||||
SqlDatabase,
|
||||
SqlEngine,
|
||||
@@ -257,6 +259,8 @@ export interface WorkflowExecutionHistoryPage {
|
||||
|
||||
export interface CreateApiGatewayLambdaRouteInput {
|
||||
path: string;
|
||||
parentResourceId?: string;
|
||||
pathPart?: string;
|
||||
method: string;
|
||||
stage: string;
|
||||
functionName: string;
|
||||
@@ -311,7 +315,16 @@ export interface ApiGatewayRouteOverview {
|
||||
integrationType: string | null;
|
||||
}
|
||||
|
||||
export interface ApiGatewayResourceOverview {
|
||||
resourceId: string;
|
||||
parentId: string | null;
|
||||
path: string;
|
||||
pathPart: string | null;
|
||||
methods: ApiGatewayRouteOverview[];
|
||||
}
|
||||
|
||||
export interface ApiGatewayRoutesResult {
|
||||
resources: ApiGatewayResourceOverview[];
|
||||
routes: ApiGatewayRouteOverview[];
|
||||
stages: string[];
|
||||
}
|
||||
@@ -401,6 +414,20 @@ export interface EventBridgeRuleOverview extends CreateEventBridgeRuleInput {
|
||||
state: "ENABLED" | "DISABLED";
|
||||
}
|
||||
|
||||
export interface PutEventBridgeEventInput {
|
||||
source: string;
|
||||
detailType: string;
|
||||
detail: string;
|
||||
resources?: string[];
|
||||
}
|
||||
|
||||
export interface PutEventBridgeEventResult {
|
||||
eventId: string | null;
|
||||
errorCode: string | null;
|
||||
errorMessage: string | null;
|
||||
}
|
||||
export interface CloudFormationChangeSet { name: string; id: string; status: string | null; executionStatus: string | null; changes: Array<{action: string | null; logicalResourceId: string | null; resourceType: string | null}> }
|
||||
|
||||
export interface CreateSqsLambdaEventSourceMappingInput {
|
||||
queueArn: string;
|
||||
batchSize?: number;
|
||||
@@ -697,6 +724,26 @@ export async function deleteEventBridgeRule(
|
||||
);
|
||||
}
|
||||
|
||||
export async function putEventBridgeEvent(
|
||||
cloud: CloudProvider,
|
||||
eventBusId: string,
|
||||
input: PutEventBridgeEventInput,
|
||||
signal?: AbortSignal,
|
||||
): Promise<PutEventBridgeEventResult> {
|
||||
const res = await apiClient.call<PutEventBridgeEventResult, PutEventBridgeEventInput>(
|
||||
apiEndpointKeys.clouds.resources.putEventBridgeEvent,
|
||||
requestOptions(cloud, "events", {signal, body: input}),
|
||||
{cloud, id: eventBusId},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listCloudFormationChangeSets(cloud: CloudProvider, stackName: string, signal?: AbortSignal): Promise<CloudFormationChangeSet[]> { const res = await apiClient.call<CloudFormationChangeSet[]>(apiEndpointKeys.clouds.resources.listCloudFormationChangeSets, requestOptions(cloud, 'iac', {signal}), {cloud, id: stackName}); return res.data }
|
||||
export async function createCloudFormationChangeSet(cloud: CloudProvider, stackName: string, input: {name: string; templateBody: string; parameters?: Record<string, string>; capabilities?: string[]}): Promise<CloudFormationChangeSet> { const res = await apiClient.call<CloudFormationChangeSet, typeof input>(apiEndpointKeys.clouds.resources.createCloudFormationChangeSet, requestOptions(cloud, 'iac', {body: input}), {cloud, id: stackName}); return res.data }
|
||||
export async function executeCloudFormationChangeSet(cloud: CloudProvider, stackName: string, name: string): Promise<void> { await apiClient.call<void>(apiEndpointKeys.clouds.resources.executeCloudFormationChangeSet, requestOptions(cloud, 'iac', {}), {cloud, id: stackName, name}) }
|
||||
export async function deleteCloudFormationChangeSet(cloud: CloudProvider, stackName: string, name: string): Promise<void> { await apiClient.call<void>(apiEndpointKeys.clouds.resources.deleteCloudFormationChangeSet, requestOptions(cloud, 'iac', {}), {cloud, id: stackName, name}) }
|
||||
export async function updateCloudFormationTerminationProtection(cloud: CloudProvider, stackName: string, enabled: boolean): Promise<void> { await apiClient.call<void, {enabled: boolean}>(apiEndpointKeys.clouds.resources.updateCloudFormationTerminationProtection, requestOptions(cloud, 'iac', {body: {enabled}}), {cloud, id: stackName}) }
|
||||
|
||||
export async function createSqsLambdaEventSourceMapping(
|
||||
cloud: CloudProvider,
|
||||
functionName: string,
|
||||
@@ -1107,6 +1154,23 @@ export async function listFlatItems(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function queryFlatItems(
|
||||
cloud: CloudProvider,
|
||||
service: CloudServiceType,
|
||||
resourceId: string,
|
||||
query: Record<string, unknown>,
|
||||
cursor?: string,
|
||||
limit = 100,
|
||||
signal?: AbortSignal,
|
||||
): Promise<CollectionPage<ChildItem>> {
|
||||
const res = await apiClient.call<CollectionPage<ChildItem>, {query: Record<string, unknown>}>(
|
||||
apiEndpointKeys.clouds.flatItems.query,
|
||||
requestOptions(cloud, service, {signal, params: {cursor, limit}, body: {query}}),
|
||||
{cloud, service, id: resourceId},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function deleteFlatItem(
|
||||
cloud: CloudProvider,
|
||||
service: CloudServiceType,
|
||||
@@ -1215,6 +1279,44 @@ export async function queryLogs(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function filterLogEvents(
|
||||
cloud: CloudProvider,
|
||||
logGroupName: string,
|
||||
input: LogsFilterInput,
|
||||
cursor?: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<CollectionPage<ChildItem>> {
|
||||
const res = await apiClient.call<CollectionPage<ChildItem>, LogsFilterInput>(
|
||||
apiEndpointKeys.clouds.logs.filter,
|
||||
requestOptions(cloud, "logs", { signal, body: input, params: cursor ? { cursor } : undefined }),
|
||||
{ cloud, id: logGroupName },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function sendSqsMessage(cloud: CloudProvider, queueId: string, input: SqsSendMessageInput): Promise<{messageId: string}> {
|
||||
const res = await apiClient.call<{messageId: string}, SqsSendMessageInput>(apiEndpointKeys.clouds.messaging.messages.send, requestOptions(cloud, 'messaging', {body: input}), {cloud, id: queueId})
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function receiveSqsMessages(cloud: CloudProvider, queueId: string, maxNumberOfMessages: number): Promise<SqsMessage[]> {
|
||||
const res = await apiClient.call<SqsMessage[], {maxNumberOfMessages: number}>(apiEndpointKeys.clouds.messaging.messages.receive, requestOptions(cloud, 'messaging', {body: {maxNumberOfMessages}}), {cloud, id: queueId})
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function deleteSqsMessage(cloud: CloudProvider, queueId: string, receiptHandle: string): Promise<void> {
|
||||
await apiClient.call(apiEndpointKeys.clouds.messaging.messages.delete, requestOptions(cloud, 'messaging', {body: {receiptHandle}}), {cloud, id: queueId})
|
||||
}
|
||||
|
||||
export async function purgeSqsQueue(cloud: CloudProvider, queueId: string): Promise<void> {
|
||||
await apiClient.call(apiEndpointKeys.clouds.messaging.messages.purge, requestOptions(cloud, 'messaging'), {cloud, id: queueId})
|
||||
}
|
||||
|
||||
export async function startSqsMoveTask(cloud: CloudProvider, queueId: string, destinationArn?: string): Promise<{taskHandle: string}> {
|
||||
const res = await apiClient.call<{taskHandle: string}, {destinationArn?: string}>(apiEndpointKeys.clouds.messaging.moveTasks, requestOptions(cloud, 'messaging', {body: {destinationArn}}), {cloud, id: queueId})
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function listDatabaseSnapshots(
|
||||
cloud: CloudProvider,
|
||||
instanceIdentifier?: string,
|
||||
@@ -1260,33 +1362,6 @@ export async function listDatabaseOrderableClasses(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listNoSqlItems(
|
||||
cloud: CloudProvider,
|
||||
resourceId: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<NoSqlItem[]> {
|
||||
const res = await apiClient.call<NoSqlItem[]>(
|
||||
apiEndpointKeys.clouds.nosql.items.list,
|
||||
requestOptions(cloud, "nosql", { signal }),
|
||||
{ cloud, id: resourceId },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function putNoSqlItem(
|
||||
cloud: CloudProvider,
|
||||
resourceId: string,
|
||||
document: Record<string, unknown>,
|
||||
signal?: AbortSignal,
|
||||
): Promise<NoSqlItem> {
|
||||
const res = await apiClient.call<NoSqlItem, Record<string, unknown>>(
|
||||
apiEndpointKeys.clouds.nosql.items.put,
|
||||
requestOptions(cloud, "nosql", { signal, body: document }),
|
||||
{ cloud, id: resourceId },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listKubernetesNodegroups(
|
||||
cloud: CloudProvider,
|
||||
clusterId: string,
|
||||
@@ -1560,8 +1635,8 @@ export async function getAppConfigDeployment(
|
||||
}
|
||||
|
||||
function requestOptions<TBody = unknown>(
|
||||
cloud: CloudProvider,
|
||||
service: string,
|
||||
_cloud: CloudProvider,
|
||||
_service: string,
|
||||
options: {
|
||||
signal?: AbortSignal;
|
||||
params?: Record<string, string | number | boolean | undefined>;
|
||||
@@ -1574,7 +1649,6 @@ function requestOptions<TBody = unknown>(
|
||||
) {
|
||||
return {
|
||||
...options,
|
||||
telemetry: { provider: cloud, service },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user