// https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html export const AwsApiGatewayManagedMetricName = { ["4XX_ERROR"]: "4XXError", ["5XX_ERROR"]: "5XXError", CACHE_HIT_COUNT: "CacheHitCount", CACHE_MISS_COUNT: "CacheMissCount", COUNT: "Count", INTEGRATION_LATENCY: "IntegrationLatency", LATENCY: "Latency", }; export const AwsApiGatewayManagedMetricDimensionName = { API_NAME: "ApiName", METHOD: "Method", RESOURCE: "Resource", STAGE: "Stage", }; //https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonapigateway.html export const AwsApiGatewayIamPolicyAction = { INVALIDATE_CACHE: "execute-api:InvalidateCache", INVOKE: "execute-api:Invoke", MANAGE_CONNECTIONS: "execute-api:ManageConnections", }; export interface CreateAwsApiGatewayExecuteApiGeneralArnParams { partition: string; region: string; account: string; apiId: string; stage: string; method: string; apiSpecificResourcePath: string; } export const createAwsApiGatewayExecuteApiGeneralArn = ({ partition, account, region, apiId, stage, method, apiSpecificResourcePath, }: CreateAwsApiGatewayExecuteApiGeneralArnParams): string => { return `arn:${partition}:execute-api:${region}:${account}:${apiId}/${stage}/${method}/${apiSpecificResourcePath}`; };