import type { Application, CacheInitializerService, ISecurityGroup, IServerGroupCommand, IServerGroupCommandBackingData, IServerGroupCommandBackingDataFiltered, IServerGroupCommandDirty, IServerGroupCommandResult, IServerGroupCommandViewState, LoadBalancerReader, SecurityGroupReader, ServerGroupCommandRegistry } from '@spinnaker/core'; import type { IAmazonLoadBalancerSourceData, IKeyPair, IScalingProcess } from '../../domain'; import type { IAmazonInstanceType } from '../../instance/awsInstanceType.service'; export type IBlockDeviceMappingSource = 'source' | 'ami' | 'default'; export interface IAmazonServerGroupCommandDirty extends IServerGroupCommandDirty { targetGroups?: string[]; launchTemplateOverridesForInstanceType?: IAmazonInstanceTypeOverride[]; } export interface IAmazonServerGroupCommandResult extends IServerGroupCommandResult { dirty: IAmazonServerGroupCommandDirty; } export interface IAmazonServerGroupCommandBackingDataFiltered extends IServerGroupCommandBackingDataFiltered { keyPairs: string[]; targetGroups: string[]; instanceTypesInfo: IAmazonInstanceType[]; } export interface IAmazonServerGroupCommandBackingData extends IServerGroupCommandBackingData { appLoadBalancers: IAmazonLoadBalancerSourceData[]; filtered: IAmazonServerGroupCommandBackingDataFiltered; keyPairs: IKeyPair[]; targetGroups: string[]; scalingProcesses: IScalingProcess[]; instanceTypesInfo: IAmazonInstanceType[]; } export interface IAmazonServerGroupCommandViewState extends IServerGroupCommandViewState { isNew: boolean; dirty: IAmazonServerGroupCommandDirty; spelTargetGroups: string[]; spelLoadBalancers: string[]; useSimpleInstanceTypeSelector: boolean; } export interface IAmazonInstanceTypeOverride { instanceType: string; weightedCapacity?: string; priority?: number; } /** * We model server group commands in two subtly different ways. * It's unclear what the intention is, but we should converge on a single model eventually. * * This model is stored in a Aws Deploy Stage under `clusters[]`. * It is also sent across the wire during a deploy task from infrastructure view * (i.e., "clone server group", "create server group") */ export interface IAmazonServerGroupDeployConfiguration extends IAmazonServerGroupCommand_Internal { account: string; availabilityZones: { [region: string]: string[]; }; } interface IAmazonServerGroupCommand_Internal extends IAmazonServerGroupCommand { availabilityZones: any; } export interface IAmazonServerGroupCommand extends IServerGroupCommand { associateIPv6Address?: boolean; associatePublicIpAddress: boolean; backingData: IAmazonServerGroupCommandBackingData; base64UserData: string; copySourceCustomBlockDeviceMappings: boolean; ebsOptimized: boolean; healthCheckGracePeriod: number; instanceMonitoring: boolean; keyPair: string; legacyUdf?: boolean; requireIMDSv2?: boolean; spotPrice: string; targetHealthyDeployPercentage: number; useAmiBlockDeviceMappings: boolean; targetGroups: string[]; setLaunchTemplate?: boolean; unlimitedCpuCredits?: boolean; capacityRebalance?: boolean; ramdiskId?: string; viewState: IAmazonServerGroupCommandViewState; source: { account: string; region: string; asgName: string; }; onDemandAllocationStrategy?: string; onDemandBaseCapacity?: number; onDemandPercentageAboveBaseCapacity?: number; spotAllocationStrategy?: string; spotInstancePools?: number; launchTemplateOverridesForInstanceType?: IAmazonInstanceTypeOverride[]; amiArchitecture: string; getBlockDeviceMappingsSource: (command: IServerGroupCommand) => IBlockDeviceMappingSource; selectBlockDeviceMappingsSource: (command: IServerGroupCommand, selection: string) => void; usePreferredZonesChanged: (command: IServerGroupCommand) => IAmazonServerGroupCommandResult; regionIsDeprecated: (command: IServerGroupCommand) => boolean; launchTemplateOverridesChanged: (command: IServerGroupCommand) => void; } export declare class AwsServerGroupConfigurationService { private securityGroupReader; private awsInstanceTypeService; private cacheInitializer; private loadBalancerReader; private serverGroupCommandRegistry; private enabledMetrics; private healthCheckTypes; private terminationPolicies; static $inject: string[]; constructor(securityGroupReader: SecurityGroupReader, awsInstanceTypeService: any, cacheInitializer: CacheInitializerService, loadBalancerReader: LoadBalancerReader, serverGroupCommandRegistry: ServerGroupCommandRegistry); configureUpdateCommand(command: IAmazonServerGroupCommand): void; configureCommand(application: Application, cmd: IAmazonServerGroupCommand): PromiseLike; applyOverrides(phase: string, command: IAmazonServerGroupCommand): void; configureKeyPairs(command: IAmazonServerGroupCommand): IServerGroupCommandResult; configureInstanceTypes(command: IAmazonServerGroupCommand): IServerGroupCommandResult; configureImages(command: IAmazonServerGroupCommand): IServerGroupCommandResult; configureAvailabilityZones(command: IAmazonServerGroupCommand): void; configureSubnetPurposes(command: IAmazonServerGroupCommand): IServerGroupCommandResult; getRegionalSecurityGroups(command: IAmazonServerGroupCommand): ISecurityGroup[]; configureSecurityGroupOptions(command: IAmazonServerGroupCommand): IServerGroupCommandResult; refreshSecurityGroups(command: IAmazonServerGroupCommand, skipCommandReconfiguration?: boolean): PromiseLike; private getLoadBalancerMap; getLoadBalancerNames(command: IAmazonServerGroupCommand): string[]; getVpcLoadBalancerNames(command: IAmazonServerGroupCommand): string[]; getTargetGroupNames(command: IAmazonServerGroupCommand): string[]; private getValidMatches; configureLoadBalancerOptions(command: IAmazonServerGroupCommand): IServerGroupCommandResult; refreshLoadBalancers(command: IAmazonServerGroupCommand, skipCommandReconfiguration?: boolean): PromiseLike; configureVpcId(command: IAmazonServerGroupCommand): IAmazonServerGroupCommandResult; attachEventHandlers(cmd: IAmazonServerGroupCommand): void; } export declare const AWS_SERVER_GROUP_CONFIGURATION_SERVICE = "spinnaker.amazon.serverGroup.configure.service"; export {};