/** * AWS Infra MCP - Type Definitions */ export declare const CONFIG_FILE = "config.json"; export declare const STATE_FILE = "state.json"; export declare const CONFIG_DIR = ".aws-infra-mcp"; export declare const ANALYSIS_CACHE_FILE = "analysis-cache.json"; export declare const CDK_OUTPUT_DIR = "cdk-infra"; export type AWSRegion = 'us-east-1' | 'us-east-2' | 'us-west-1' | 'us-west-2' | 'eu-west-1' | 'eu-west-2' | 'eu-central-1' | 'ap-northeast-1' | 'ap-northeast-2' | 'ap-northeast-3' | 'ap-southeast-1' | 'ap-southeast-2' | 'sa-east-1'; export interface EC2InstanceConfig { id: string; name: string; instanceType: string; ami?: string; keyPair?: string; subnetId?: string; securityGroupIds?: string[]; userData?: string; ebsVolumes?: EBSVolumeConfig[]; tags?: Record; } export interface AutoScalingConfig { id: string; name: string; minSize: number; maxSize: number; desiredCapacity: number; instanceType: string; ami?: string; subnetIds?: string[]; healthCheckType?: 'EC2' | 'ELB'; healthCheckGracePeriod?: number; targetGroupArns?: string[]; } export interface LambdaFunctionConfig { id: string; name: string; runtime: LambdaRuntime; handler: string; codeUri?: string; memorySize?: number; timeout?: number; environment?: Record; vpcConfig?: { subnetIds: string[]; securityGroupIds: string[]; }; layers?: string[]; reservedConcurrency?: number; eventSources?: LambdaEventSource[]; } export type LambdaRuntime = 'nodejs18.x' | 'nodejs20.x' | 'python3.9' | 'python3.10' | 'python3.11' | 'python3.12' | 'java17' | 'java21' | 'dotnet6' | 'dotnet8' | 'go1.x' | 'provided.al2' | 'provided.al2023'; export interface LambdaEventSource { type: 'api-gateway' | 'sqs' | 's3' | 'dynamodb' | 'sns' | 'schedule'; config: Record; } export interface ECSClusterConfig { id: string; name: string; capacityProviders?: ('FARGATE' | 'FARGATE_SPOT' | string)[]; defaultCapacityProviderStrategy?: { capacityProvider: string; weight: number; base?: number; }[]; containerInsights?: boolean; } export interface ECSServiceConfig { id: string; name: string; clusterId: string; taskDefinitionId: string; desiredCount: number; launchType?: 'EC2' | 'FARGATE'; networkConfiguration?: { subnetIds: string[]; securityGroupIds: string[]; assignPublicIp?: boolean; }; loadBalancer?: { targetGroupArn: string; containerName: string; containerPort: number; }; } export interface ECSTaskDefinitionConfig { id: string; family: string; cpu: string; memory: string; networkMode?: 'awsvpc' | 'bridge' | 'host' | 'none'; requiresCompatibilities?: ('EC2' | 'FARGATE')[]; executionRoleArn?: string; taskRoleArn?: string; containers: ContainerDefinition[]; } export interface ContainerDefinition { name: string; image: string; cpu?: number; memory?: number; memoryReservation?: number; essential?: boolean; portMappings?: { containerPort: number; hostPort?: number; protocol?: 'tcp' | 'udp'; }[]; environment?: { name: string; value: string; }[]; secrets?: { name: string; valueFrom: string; }[]; logConfiguration?: { logDriver: string; options?: Record; }; } export interface EKSClusterConfig { id: string; name: string; version?: string; roleArn?: string; subnetIds?: string[]; securityGroupIds?: string[]; endpointPrivateAccess?: boolean; endpointPublicAccess?: boolean; nodeGroups?: EKSNodeGroupConfig[]; fargateProfiles?: EKSFargateProfileConfig[]; } export interface EKSNodeGroupConfig { id: string; name: string; instanceTypes?: string[]; scalingConfig?: { minSize: number; maxSize: number; desiredSize: number; }; diskSize?: number; subnetIds?: string[]; amiType?: 'AL2_x86_64' | 'AL2_x86_64_GPU' | 'AL2_ARM_64' | 'BOTTLEROCKET_x86_64' | 'BOTTLEROCKET_ARM_64'; } export interface EKSFargateProfileConfig { id: string; name: string; subnetIds?: string[]; selectors: { namespace: string; labels?: Record; }[]; } export interface ComputeConfig { ec2Instances?: EC2InstanceConfig[]; autoScalingGroups?: AutoScalingConfig[]; lambdaFunctions?: LambdaFunctionConfig[]; ecsClusters?: ECSClusterConfig[]; ecsServices?: ECSServiceConfig[]; ecsTaskDefinitions?: ECSTaskDefinitionConfig[]; eksClusters?: EKSClusterConfig[]; } export type RDSEngine = 'mysql' | 'postgres' | 'mariadb' | 'oracle-ee' | 'sqlserver-ee' | 'aurora-mysql' | 'aurora-postgresql'; export interface RDSInstanceConfig { id: string; name: string; engine: RDSEngine; engineVersion?: string; instanceClass: string; allocatedStorage: number; maxAllocatedStorage?: number; storageType?: 'gp2' | 'gp3' | 'io1' | 'io2'; iops?: number; multiAZ?: boolean; publiclyAccessible?: boolean; subnetGroupName?: string; securityGroupIds?: string[]; databaseName?: string; masterUsername?: string; deletionProtection?: boolean; backupRetentionPeriod?: number; performanceInsightsEnabled?: boolean; } export interface AuroraClusterConfig { id: string; name: string; engine: 'aurora-mysql' | 'aurora-postgresql'; engineVersion?: string; instanceClass: string; instances: number; serverlessV2ScalingConfiguration?: { minCapacity: number; maxCapacity: number; }; subnetGroupName?: string; securityGroupIds?: string[]; databaseName?: string; masterUsername?: string; deletionProtection?: boolean; backupRetentionPeriod?: number; } export interface DynamoDBTableConfig { id: string; name: string; partitionKey: { name: string; type: 'S' | 'N' | 'B'; }; sortKey?: { name: string; type: 'S' | 'N' | 'B'; }; billingMode?: 'PAY_PER_REQUEST' | 'PROVISIONED'; readCapacity?: number; writeCapacity?: number; globalSecondaryIndexes?: DynamoDBIndexConfig[]; localSecondaryIndexes?: DynamoDBIndexConfig[]; streamEnabled?: boolean; streamViewType?: 'KEYS_ONLY' | 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES'; ttlAttribute?: string; pointInTimeRecovery?: boolean; } export interface DynamoDBIndexConfig { name: string; partitionKey: { name: string; type: 'S' | 'N' | 'B'; }; sortKey?: { name: string; type: 'S' | 'N' | 'B'; }; projectionType?: 'ALL' | 'KEYS_ONLY' | 'INCLUDE'; projectionAttributes?: string[]; readCapacity?: number; writeCapacity?: number; } export interface DatabaseConfig { rdsInstances?: RDSInstanceConfig[]; auroraClusters?: AuroraClusterConfig[]; dynamoDBTables?: DynamoDBTableConfig[]; } export interface S3BucketConfig { id: string; name: string; versioning?: boolean; encryption?: { type: 'AES256' | 'aws:kms'; kmsKeyId?: string; }; publicAccessBlock?: { blockPublicAcls?: boolean; blockPublicPolicy?: boolean; ignorePublicAcls?: boolean; restrictPublicBuckets?: boolean; }; lifecycleRules?: S3LifecycleRule[]; corsRules?: S3CorsRule[]; websiteConfiguration?: { indexDocument: string; errorDocument?: string; }; replicationConfiguration?: { destinationBucket: string; destinationRegion: string; }; } export interface S3LifecycleRule { id: string; enabled: boolean; prefix?: string; transitions?: { days: number; storageClass: string; }[]; expiration?: { days: number; } | { date: string; }; noncurrentVersionTransitions?: { days: number; storageClass: string; }[]; noncurrentVersionExpiration?: { days: number; }; } export interface S3CorsRule { allowedMethods: ('GET' | 'PUT' | 'POST' | 'DELETE' | 'HEAD')[]; allowedOrigins: string[]; allowedHeaders?: string[]; exposedHeaders?: string[]; maxAge?: number; } export interface EBSVolumeConfig { id: string; name: string; availabilityZone: string; size: number; volumeType?: 'gp2' | 'gp3' | 'io1' | 'io2' | 'st1' | 'sc1' | 'standard'; iops?: number; throughput?: number; encrypted?: boolean; kmsKeyId?: string; snapshotId?: string; } export interface ECRRepositoryConfig { id: string; name: string; imageScanningEnabled?: boolean; imageTagMutability?: 'MUTABLE' | 'IMMUTABLE'; encryptionType?: 'AES256' | 'KMS'; kmsKey?: string; lifecyclePolicy?: { rules: ECRLifecycleRule[]; }; } export interface ECRLifecycleRule { rulePriority: number; description?: string; selection: { tagStatus: 'tagged' | 'untagged' | 'any'; tagPrefixList?: string[]; countType: 'imageCountMoreThan' | 'sinceImagePushed'; countUnit?: 'days'; countNumber: number; }; action: { type: 'expire'; }; } export interface StorageConfig { s3Buckets?: S3BucketConfig[]; ebsVolumes?: EBSVolumeConfig[]; ecrRepositories?: ECRRepositoryConfig[]; } export interface VPCConfig { id: string; name: string; cidrBlock: string; enableDnsSupport?: boolean; enableDnsHostnames?: boolean; subnets?: SubnetConfig[]; internetGateway?: boolean; natGateways?: NATGatewayConfig[]; routeTables?: RouteTableConfig[]; securityGroups?: SecurityGroupConfig[]; } export interface SubnetConfig { id: string; name: string; cidrBlock: string; availabilityZone: string; type: 'public' | 'private' | 'isolated'; mapPublicIpOnLaunch?: boolean; } export interface NATGatewayConfig { id: string; name: string; subnetId: string; allocationId?: string; } export interface RouteTableConfig { id: string; name: string; routes: RouteConfig[]; associations: string[]; } export interface RouteConfig { destinationCidrBlock: string; gatewayId?: string; natGatewayId?: string; networkInterfaceId?: string; vpcPeeringConnectionId?: string; } export interface SecurityGroupConfig { id: string; name: string; description: string; ingressRules?: SecurityGroupRule[]; egressRules?: SecurityGroupRule[]; } export interface SecurityGroupRule { protocol: 'tcp' | 'udp' | 'icmp' | '-1'; fromPort: number; toPort: number; cidrBlocks?: string[]; securityGroupId?: string; description?: string; } export interface APIGatewayConfig { id: string; name: string; type: 'REST' | 'HTTP' | 'WEBSOCKET'; description?: string; cors?: { allowOrigins: string[]; allowMethods: string[]; allowHeaders?: string[]; exposeHeaders?: string[]; maxAge?: number; allowCredentials?: boolean; }; routes?: APIGatewayRouteConfig[]; stages?: APIGatewayStageConfig[]; authorizers?: APIGatewayAuthorizerConfig[]; } export interface APIGatewayRouteConfig { path: string; method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'ANY'; integration: { type: 'AWS_PROXY' | 'HTTP_PROXY' | 'MOCK'; uri?: string; lambdaFunctionId?: string; }; authorizerId?: string; } export interface APIGatewayStageConfig { name: string; autoDeploy?: boolean; description?: string; throttling?: { burstLimit: number; rateLimit: number; }; logging?: { level: 'OFF' | 'ERROR' | 'INFO'; dataTraceEnabled?: boolean; }; } export interface APIGatewayAuthorizerConfig { id: string; name: string; type: 'JWT' | 'REQUEST' | 'COGNITO_USER_POOLS'; identitySource?: string[]; jwtConfiguration?: { audience: string[]; issuer: string; }; lambdaFunctionId?: string; } export interface NetworkConfig { vpcs?: VPCConfig[]; apiGateways?: APIGatewayConfig[]; } export interface AWSInfraConfig { projectName: string; awsProfile?: string; region: AWSRegion; account?: string; environment?: string; compute: ComputeConfig; database: DatabaseConfig; storage: StorageConfig; network: NetworkConfig; tags?: Record; createdAt: string; lastModified: string; } export interface AWSInfraState { initialized: boolean; analyzedAt?: string; generatedStacks: GeneratedStack[]; generationHistory: GenerationEvent[]; analysisCache?: AWSResourceAnalysis; lastModified: string; } export interface GeneratedStack { name: string; path: string; type: 'network' | 'compute' | 'database' | 'storage' | 'main'; generatedAt: string; contentHash: string; } export interface GenerationEvent { id: string; timestamp: string; tool: string; action: string; files: string[]; success: boolean; error: string | null; } export interface AWSResourceAnalysis { region: AWSRegion; account: string; analyzedAt: string; resources: { ec2: AnalyzedEC2Instance[]; rds: AnalyzedRDSInstance[]; lambda: AnalyzedLambdaFunction[]; s3: AnalyzedS3Bucket[]; dynamodb: AnalyzedDynamoDBTable[]; ecs: AnalyzedECSCluster[]; eks: AnalyzedEKSCluster[]; ecr: AnalyzedECRRepository[]; vpc: AnalyzedVPC[]; apiGateway: AnalyzedAPIGateway[]; }; importableResources: ImportableResource[]; } export interface AnalyzedEC2Instance { instanceId: string; name?: string; instanceType: string; state: string; vpcId?: string; subnetId?: string; publicIpAddress?: string; privateIpAddress?: string; tags: Record; } export interface AnalyzedRDSInstance { dbInstanceIdentifier: string; engine: string; engineVersion: string; dbInstanceClass: string; allocatedStorage: number; status: string; multiAZ: boolean; publiclyAccessible: boolean; } export interface AnalyzedLambdaFunction { functionName: string; functionArn: string; runtime: string; handler: string; memorySize: number; timeout: number; lastModified: string; } export interface AnalyzedS3Bucket { name: string; creationDate: string; region: string; versioning: boolean; encryption: boolean; } export interface AnalyzedDynamoDBTable { tableName: string; tableArn: string; status: string; itemCount: number; tableSizeBytes: number; billingMode: string; } export interface AnalyzedECSCluster { clusterName: string; clusterArn: string; status: string; runningTasksCount: number; pendingTasksCount: number; activeServicesCount: number; } export interface AnalyzedEKSCluster { name: string; arn: string; version: string; status: string; endpoint: string; } export interface AnalyzedECRRepository { repositoryName: string; repositoryArn: string; repositoryUri: string; imageCount: number; } export interface AnalyzedVPC { vpcId: string; cidrBlock: string; state: string; isDefault: boolean; tags: Record; } export interface AnalyzedAPIGateway { apiId: string; name: string; protocolType: string; apiEndpoint: string; } export interface ImportableResource { type: string; id: string; name: string; arn?: string; importCommand: string; } export interface CostEstimate { totalMonthly: number; currency: 'USD'; breakdown: CostBreakdownItem[]; generatedAt: string; disclaimer: string; } export interface CostBreakdownItem { service: string; resource: string; monthlyCost: number; details: string; } export interface SecurityValidationResult { passed: boolean; score: number; findings: SecurityFinding[]; recommendations: string[]; validatedAt: string; } export interface SecurityFinding { severity: 'critical' | 'high' | 'medium' | 'low' | 'info'; resource: string; issue: string; recommendation: string; } export interface ToolContext { configRoot: string; config: AWSInfraConfig | null; state: AWSInfraState | null; } export interface ToolResponse { success: boolean; message: string; data?: Record; generatedFiles?: string[]; warnings?: string[]; nextSteps?: string[]; } export interface CDKTemplateContext { projectName: string; region: AWSRegion; account?: string; environment?: string; stacks: { network?: boolean; compute?: boolean; database?: boolean; storage?: boolean; }; config: AWSInfraConfig; [key: string]: unknown; } //# sourceMappingURL=types.d.ts.map