import * as aws from "@pulumi/aws"; import * as pulumi from "@pulumi/pulumi"; /** * Team type used by all Fargate-related functions for ownership tagging */ export type Team = "dapps" | "platform" | "data" | "marketing" | "infra"; /** * Prometheus metrics configuration */ export type MetricsConfig = { /** * Port where metrics are exposed */ port: number | string; /** * Path to the metrics endpoint (default: "/metrics") */ path?: string; /** * Job name for Prometheus (default: task/service name) */ jobName?: string; }; /** * Default CPU units for Fargate tasks (256 = 0.25 vCPU) */ export declare const DEFAULT_CPU = 256; /** * Default memory in MB for Fargate tasks */ export declare const DEFAULT_MEMORY = 512; /** * Default CloudWatch log retention in days */ export declare const DEFAULT_LOG_RETENTION_DAYS = 60; /** * Default desired count for ECS services */ export declare const DEFAULT_DESIRED_COUNT = 1; /** * Creates standard resource tags for Fargate resources * * @param serviceName The name of the service/task * @param team Team that owns this resource * @param additionalTags Optional additional tags to merge * @returns Record of tags */ export declare function createResourceTags(serviceName: string, team: Team, additionalTags?: Record): Record; /** * Creates a CloudWatch Log Group with consistent settings * * @param name The name for the log group (will be stack-scoped) * @param team Team that owns this resource * @param retentionInDays Log retention in days (default: 60) * @returns The created CloudWatch Log Group */ export declare function createLogGroup(name: string, team: Team, retentionInDays?: number): aws.cloudwatch.LogGroup; /** * Creates a security group for a Fargate task/service with standard tags * * @param name Resource name for the security group * @param vpcId The VPC ID where the security group will be created * @param serviceName The name of the service (for tagging) * @param team Team that owns this resource * @returns The created EC2 Security Group */ export declare function createTaskSecurityGroup(name: string, vpcId: pulumi.Input, serviceName: string, team: Team): aws.ec2.SecurityGroup; /** * Configures docker labels for Prometheus metrics discovery * * @param taskName The name of the task/service * @param metrics Metrics configuration * @returns Docker labels, port mappings, and the parsed metrics port */ export declare function configurePrometheusMetrics(taskName: string, metrics: MetricsConfig): { dockerLabels: Record; portMappings: aws.ecs.PortMapping[]; metricsPort: number; }; /** * Creates security group rules to allow Prometheus metrics scraping * * @param resourcePrefix Prefix for resource names * @param securityGroup The security group to add rules to * @param vpcCidrBlock The VPC CIDR block for ingress rules * @param metricsPort The port where metrics are exposed * @param taskName The name of the task/service */ export declare function setupPrometheusSecurityRules(resourcePrefix: string, securityGroup: aws.ec2.SecurityGroup, vpcCidrBlock: string, metricsPort: number, taskName: string): void; /** * Options for building a container definition */ export type ContainerDefinitionOptions = { /** * Container name */ name: string; /** * Docker image to run */ image: string | Promise | pulumi.OutputInstance; /** * CPU units for this container */ cpu: number; /** * Memory reservation in MB */ memory: number; /** * Environment variables */ environment?: { name: string; value: pulumi.Input; }[]; /** * Secrets from SSM/Secrets Manager */ secrets?: aws.ecs.Secret[]; /** * Override command */ command?: string[]; /** * Override entry point */ entryPoint?: string[]; /** * Port mappings */ portMappings?: aws.ecs.PortMapping[]; /** * Docker labels (e.g., for Prometheus) */ dockerLabels?: Record; /** * Mount points for volumes */ mountPoints?: aws.ecs.MountPoint[]; /** * Repository credentials for private registries */ repositoryCredentials?: aws.ecs.RepositoryCredentials; /** * Log configuration */ logConfiguration: aws.ecs.LogConfiguration; /** * Whether this container is essential (default: true) */ essential?: boolean; /** * Container health check */ healthCheck?: aws.ecs.HealthCheck; }; /** * Builds a container definition object for ECS task definitions * * @param options Container definition options * @returns Container definition object */ export declare function buildContainerDefinition(options: ContainerDefinitionOptions): aws.ecs.ContainerDefinition; /** * Options for creating a Fargate task definition */ export type FargateTaskDefinitionOptions = { /** * Name for the task definition */ name: string; /** * Execution role ARN (optional for some use cases) */ executionRoleArn?: pulumi.Input; /** * Task role ARN (optional for some use cases) */ taskRoleArn?: pulumi.Input; /** * JSON-stringified container definitions */ containerDefinitions: pulumi.Input; /** * Team that owns this resource */ team: Team; /** * CPU units for the task */ cpu: pulumi.Input; /** * Memory in MB for the task */ memory: pulumi.Input; /** * Ephemeral storage in GB (20-200) */ ephemeralStorageInGB?: number; /** * Runtime platform configuration (e.g., for ARM64) */ runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform; /** * Volumes to attach */ volumes?: pulumi.Input; /** * Resources to depend on */ dependsOn?: pulumi.Resource[]; }; /** * Creates a Fargate task definition with standard settings * * @param options Task definition options * @returns The created ECS Task Definition */ export declare function createFargateTaskDefinition(options: FargateTaskDefinitionOptions): aws.ecs.TaskDefinition;