@altostra/core
Version:
Core library for shared types and logic
27 lines (26 loc) • 1.51 kB
TypeScript
import type { NonEmptyString } from "../../common/CustomTypes/NonEmptyString";
import type { PositiveOrZero } from "../../common/CustomTypes/Numerics";
import type { ResourceBase } from "./Common";
import type { FunctionEnvironment, PolicyReference } from "./ComputeFunction";
export declare type FargateServerlessContainerType = 'resource.compute.serverless-container';
export interface FargateServerlessContainer extends ResourceBase {
type: FargateServerlessContainerType;
vCPU: PositiveOrZero;
memory: PositiveOrZero;
image: NonEmptyString;
policies?: PolicyReference | PolicyReference[];
environment?: FunctionEnvironment;
}
export declare const availableGiBMemoryPerVCPU: Readonly<Record<number, readonly number[]>>;
export declare const availableVCPUPerGiBMemory: Readonly<Record<number, readonly number[]>>;
/**
* Checks if the specified memory is valid together with the specified amount of memory
* @param memoryInGiB The amount of memory in GiB
* @param vCPUs The vCPU values
* @returns `true` if the specification is valid; \
* Otherwise, `false`.
*/
export declare function areMemoryAndCPUsValid(memoryInGiB: number, vCPUs: number): boolean;
export declare const isFargateServerlessContainer: import("@altostra/type-validations").TypeValidation<FargateServerlessContainer>;
export declare function isServerlessContainerCPU(cpu: unknown): cpu is PositiveOrZero;
export declare function isServerlessContainerMemory(memoryInGiB: unknown): memoryInGiB is PositiveOrZero;