feat: EC2 UI polished + storage persisting
This commit is contained in:
@@ -204,6 +204,16 @@ export interface ServerlessInvokeResult {
|
||||
executionDuration?: number;
|
||||
}
|
||||
|
||||
export interface PublishNotificationInput {
|
||||
message: string;
|
||||
subject?: string;
|
||||
messageAttributes?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface PublishNotificationResult {
|
||||
messageId: string | null;
|
||||
}
|
||||
|
||||
export interface CreateApiGatewayLambdaRouteInput {
|
||||
path: string;
|
||||
method: string;
|
||||
@@ -268,6 +278,19 @@ export interface S3LambdaTriggerOverview {
|
||||
suffix: string | null;
|
||||
}
|
||||
|
||||
export interface CreateSnsSubscriptionInput {
|
||||
protocol: string;
|
||||
endpoint: string;
|
||||
}
|
||||
|
||||
export interface SnsSubscriptionOverview {
|
||||
arn: string | null;
|
||||
protocol: string;
|
||||
endpoint: string;
|
||||
status: "Confirmed" | "PendingConfirmation";
|
||||
filterPolicy: string | null;
|
||||
}
|
||||
|
||||
export interface CreateEventBridgeLambdaTriggerInput {
|
||||
ruleName: string;
|
||||
scheduleExpression: string;
|
||||
@@ -283,6 +306,27 @@ export interface EventBridgeLambdaTriggerOverview {
|
||||
state: string | null;
|
||||
}
|
||||
|
||||
export interface EventBridgeRuleTarget {
|
||||
id: string;
|
||||
arn: string;
|
||||
}
|
||||
|
||||
export interface CreateEventBridgeRuleInput {
|
||||
name: string;
|
||||
scheduleExpression?: string;
|
||||
eventPattern?: string;
|
||||
state?: "ENABLED" | "DISABLED";
|
||||
description?: string;
|
||||
targets: EventBridgeRuleTarget[];
|
||||
}
|
||||
|
||||
export interface EventBridgeRuleOverview extends CreateEventBridgeRuleInput {
|
||||
busName: string;
|
||||
busId: string;
|
||||
arn: string | null;
|
||||
state: "ENABLED" | "DISABLED";
|
||||
}
|
||||
|
||||
export interface CreateSqsLambdaEventSourceMappingInput {
|
||||
queueArn: string;
|
||||
batchSize?: number;
|
||||
@@ -393,6 +437,46 @@ export async function deleteS3LambdaTrigger(
|
||||
);
|
||||
}
|
||||
|
||||
export async function createSnsSubscription(
|
||||
cloud: CloudProvider,
|
||||
topicArn: string,
|
||||
input: CreateSnsSubscriptionInput,
|
||||
signal?: AbortSignal,
|
||||
): Promise<SnsSubscriptionOverview> {
|
||||
const res = await apiClient.call<SnsSubscriptionOverview, CreateSnsSubscriptionInput>(
|
||||
apiEndpointKeys.clouds.resources.createSnsSubscription,
|
||||
requestOptions(cloud, "notifications", {signal, body: input}),
|
||||
{cloud, id: topicArn},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listSnsSubscriptions(
|
||||
cloud: CloudProvider,
|
||||
topicArn: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<SnsSubscriptionOverview[]> {
|
||||
const res = await apiClient.call<SnsSubscriptionOverview[]>(
|
||||
apiEndpointKeys.clouds.resources.listSnsSubscriptions,
|
||||
requestOptions(cloud, "notifications", {signal}),
|
||||
{cloud, id: topicArn},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function deleteSnsSubscription(
|
||||
cloud: CloudProvider,
|
||||
topicArn: string,
|
||||
subscriptionArn: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<void> {
|
||||
await apiClient.call<void>(
|
||||
apiEndpointKeys.clouds.resources.deleteSnsSubscription,
|
||||
requestOptions(cloud, "notifications", {signal}),
|
||||
{cloud, id: topicArn, subscriptionArn},
|
||||
);
|
||||
}
|
||||
|
||||
export async function createEventBridgeLambdaTrigger(
|
||||
cloud: CloudProvider,
|
||||
functionName: string,
|
||||
@@ -433,6 +517,46 @@ export async function deleteEventBridgeLambdaTrigger(
|
||||
);
|
||||
}
|
||||
|
||||
export async function createEventBridgeRule(
|
||||
cloud: CloudProvider,
|
||||
eventBusId: string,
|
||||
input: CreateEventBridgeRuleInput,
|
||||
signal?: AbortSignal,
|
||||
): Promise<EventBridgeRuleOverview> {
|
||||
const res = await apiClient.call<EventBridgeRuleOverview, CreateEventBridgeRuleInput>(
|
||||
apiEndpointKeys.clouds.resources.createEventBridgeRule,
|
||||
requestOptions(cloud, "events", {signal, body: input}),
|
||||
{cloud, id: eventBusId},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listEventBridgeRules(
|
||||
cloud: CloudProvider,
|
||||
eventBusId: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<EventBridgeRuleOverview[]> {
|
||||
const res = await apiClient.call<EventBridgeRuleOverview[]>(
|
||||
apiEndpointKeys.clouds.resources.listEventBridgeRules,
|
||||
requestOptions(cloud, "events", {signal}),
|
||||
{cloud, id: eventBusId},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function deleteEventBridgeRule(
|
||||
cloud: CloudProvider,
|
||||
eventBusId: string,
|
||||
ruleName: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<void> {
|
||||
await apiClient.call<void>(
|
||||
apiEndpointKeys.clouds.resources.deleteEventBridgeRule,
|
||||
requestOptions(cloud, "events", {signal}),
|
||||
{cloud, id: eventBusId, ruleName},
|
||||
);
|
||||
}
|
||||
|
||||
export async function createSqsLambdaEventSourceMapping(
|
||||
cloud: CloudProvider,
|
||||
functionName: string,
|
||||
@@ -525,6 +649,20 @@ export async function invokeCloudResource(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function publishNotification(
|
||||
cloud: CloudProvider,
|
||||
topicArn: string,
|
||||
input: PublishNotificationInput,
|
||||
signal?: AbortSignal,
|
||||
): Promise<PublishNotificationResult> {
|
||||
const res = await apiClient.call<PublishNotificationResult, PublishNotificationInput>(
|
||||
apiEndpointKeys.clouds.resources.publish,
|
||||
requestOptions(cloud, "notifications", { signal, body: input }),
|
||||
{ cloud, id: topicArn },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function encryptKmsResource(
|
||||
cloud: CloudProvider,
|
||||
id: string,
|
||||
|
||||
Reference in New Issue
Block a user