@spinnaker/amazon 2026.2.2 → 2026.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aws.module.d.ts +2 -1
- package/dist/aws.services.d.ts +8 -0
- package/dist/certificates/AmazonCertificateReader.d.ts +1 -1
- package/dist/domain/IAmazonServerGroup.d.ts +10 -0
- package/dist/function/CreateLambdaFunction.d.ts +10 -5
- package/dist/function/configure/Network.d.ts +3 -0
- package/dist/function/details/FunctionActions.d.ts +3 -0
- package/dist/function/function.transformer.d.ts +1 -0
- package/dist/image/image.reader.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/amazon.instance.write.service.d.ts +5 -5
- package/dist/instance/awsInstanceType.service.d.ts +13 -2
- package/dist/instance/details/AmazonInstanceDetails.d.ts +67 -0
- package/dist/instance/index.d.ts +1 -0
- package/dist/keyPairs/KeyPairsReader.d.ts +1 -1
- package/dist/loadBalancer/AmazonLoadBalancersTag.d.ts +7 -4
- package/dist/loadBalancer/OidcConfigReader.d.ts +1 -1
- package/dist/loadBalancer/TargetGroupDetails.d.ts +37 -3
- package/dist/loadBalancer/amazonLoadBalancerDataUtils.d.ts +1 -1
- package/dist/loadBalancer/configure/AmazonLoadBalancerChoiceModal.d.ts +6 -2
- package/dist/loadBalancer/configure/LoadBalancerTypes.d.ts +4 -4
- package/dist/loadBalancer/configure/application/CreateApplicationLoadBalancer.d.ts +10 -5
- package/dist/loadBalancer/configure/classic/CreateClassicLoadBalancer.d.ts +12 -7
- package/dist/loadBalancer/configure/common/SecurityGroups.d.ts +4 -0
- package/dist/loadBalancer/configure/network/CreateNetworkLoadBalancer.d.ts +10 -5
- package/dist/loadBalancer/details/LoadBalancerActions.d.ts +9 -2
- package/dist/loadBalancer/details/amazonLoadBalancerDetails.d.ts +22 -0
- package/dist/loadBalancer/index.d.ts +1 -0
- package/dist/loadBalancer/loadBalancer.transformer.d.ts +1 -1
- package/dist/pipeline/stages/AmazonStageConfig.d.ts +11 -0
- package/dist/pipeline/stages/bake/AwsBakeStageConfig.d.ts +66 -0
- package/dist/pipeline/stages/cloneServerGroup/AwsCloneServerGroupStageConfig.d.ts +20 -0
- package/dist/pipeline/stages/deleteLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.d.ts +5 -4
- package/dist/pipeline/stages/deployCloudFormation/DeployCloudFormationStackStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service.d.ts +1 -3
- package/dist/pipeline/stages/deployLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/destroyAsg/awsDestroyAsgStage.d.ts +26 -2
- package/dist/pipeline/stages/disableAsg/AwsDisableAsgStageConfig.d.ts +27 -0
- package/dist/pipeline/stages/disableCluster/AwsDisableClusterStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/enableAsg/AwsEnableAsgStageConfig.d.ts +20 -0
- package/dist/pipeline/stages/findAmi/awsFindAmiStage.d.ts +17 -2
- package/dist/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/findImageFromTags/awsFindImageFromTagsStage.d.ts +12 -2
- package/dist/pipeline/stages/invokeLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/modifyScalingProcess/ModifyScalingProcessStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.d.ts +20 -2
- package/dist/pipeline/stages/modifyWarmPool/ModifyWarmPoolStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.d.ts +20 -0
- package/dist/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.d.ts +17 -0
- package/dist/pipeline/stages/resizeAsg/awsResizeAsgStage.d.ts +40 -2
- package/dist/pipeline/stages/rollbackCluster/AwsRollbackClusterStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/routeLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/scaleDownCluster/AwsScaleDownClusterStageConfig.d.ts +22 -0
- package/dist/pipeline/stages/shrinkCluster/AwsShrinkClusterStageConfig.d.ts +21 -0
- package/dist/pipeline/stages/tagImage/awsTagImageStage.d.ts +5 -2
- package/dist/pipeline/stages/updateCodeLambda/index.d.ts +1 -1
- package/dist/search/searchResultFormatter.d.ts +4 -2
- package/dist/securityGroup/configure/AmazonSecurityGroupModal.d.ts +43 -0
- package/dist/securityGroup/details/AmazonSecurityGroupDetails.d.ts +62 -0
- package/dist/securityGroup/details/index.d.ts +1 -0
- package/dist/securityGroup/index.d.ts +1 -0
- package/dist/securityGroup/securityGroup.reader.d.ts +0 -1
- package/dist/securityGroup/securityGroup.transformer.d.ts +11 -2
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +23 -7
- package/dist/serverGroup/configure/serverGroupConfiguration.service.d.ts +17 -13
- package/dist/serverGroup/configure/wizard/AmazonCloneServerGroupModal.d.ts +16 -6
- package/dist/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.d.ts +6 -3
- package/dist/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.d.ts +3 -0
- package/dist/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.d.ts +4 -0
- package/dist/serverGroup/details/AmazonServerGroupActions.d.ts +10 -2
- package/dist/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.d.ts +17 -0
- package/dist/serverGroup/details/advancedSettings/index.d.ts +1 -0
- package/dist/serverGroup/details/resize/AmazonResizeServerGroupModal.d.ts +5 -3
- package/dist/serverGroup/details/rollback/AmazonRollbackServerGroupModal.d.ts +67 -0
- package/dist/serverGroup/details/rollback/index.d.ts +2 -0
- package/dist/serverGroup/details/rollback/rollbackServerGroupSelection.d.ts +9 -0
- package/dist/serverGroup/details/scalingPolicy/ScalingPolicyWriter.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.d.ts +0 -1
- package/dist/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.d.ts +24 -0
- package/dist/serverGroup/details/scalingProcesses/index.d.ts +2 -0
- package/dist/serverGroup/details/scheduledActions/EditScheduledActionsModal.d.ts +31 -0
- package/dist/serverGroup/details/scheduledActions/index.d.ts +1 -0
- package/dist/serverGroup/details/sections/AdvancedSettingsDetailsSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/AmazonCapacityDetailsSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ScalingProcessesDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/ScheduledActionsDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/SecurityGroupsDetailsSection.d.ts +4 -1
- package/dist/serverGroup/details/sections/WarmPoolDetailsSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/index.d.ts +1 -0
- package/dist/serverGroup/details/securityGroups/EditSecurityGroupsModal.d.ts +32 -0
- package/dist/serverGroup/details/securityGroups/index.d.ts +1 -0
- package/dist/serverGroup/details/warmPool/ModifyWarmPoolModal.d.ts +26 -0
- package/dist/serverGroup/details/warmPool/WarmPoolService.d.ts +6 -0
- package/dist/serverGroup/details/warmPool/index.d.ts +2 -0
- package/dist/serverGroup/serverGroup.transformer.d.ts +1 -2
- package/dist/vpc/VpcReader.d.ts +2 -2
- package/dist/vpc/index.d.ts +1 -0
- package/package.json +3 -12
- package/src/aws.module.spec.ts +296 -0
- package/src/aws.module.ts +107 -112
- package/src/aws.services.ts +21 -0
- package/src/certificates/AmazonCertificateReader.ts +1 -1
- package/src/domain/IAmazonServerGroup.ts +9 -0
- package/src/function/CreateLambdaFunction.tsx +29 -16
- package/src/function/configure/Network.tsx +8 -4
- package/src/function/details/AmazonFunctionDetails.tsx +4 -5
- package/src/function/details/FunctionActions.tsx +5 -1
- package/src/function/function.transformer.ts +4 -0
- package/src/image/image.reader.ts +3 -5
- package/src/index.ts +2 -2
- package/src/instance/amazon.instance.write.service.ts +15 -4
- package/src/instance/awsInstanceType.service.spec.js +172 -136
- package/src/instance/awsInstanceType.service.ts +142 -154
- package/src/instance/details/AmazonInstanceDetails.spec.tsx +79 -0
- package/src/instance/details/AmazonInstanceDetails.tsx +644 -0
- package/src/instance/details/InstanceInformation.tsx +11 -14
- package/src/instance/details/InstanceSecurityGroups.tsx +20 -23
- package/src/instance/details/InstanceTags.tsx +5 -3
- package/src/instance/index.ts +1 -0
- package/src/keyPairs/KeyPairsReader.ts +1 -1
- package/src/loadBalancer/AmazonLoadBalancersTag.spec.tsx +39 -0
- package/src/loadBalancer/AmazonLoadBalancersTag.tsx +21 -14
- package/src/loadBalancer/OidcConfigReader.ts +1 -1
- package/src/loadBalancer/TargetGroupDetails.spec.tsx +113 -0
- package/src/loadBalancer/TargetGroupDetails.tsx +287 -7
- package/src/loadBalancer/amazonLoadBalancerDataUtils.ts +21 -21
- package/src/loadBalancer/configure/AmazonLoadBalancerChoiceModal.tsx +17 -4
- package/src/loadBalancer/configure/LoadBalancerTypes.ts +7 -4
- package/src/loadBalancer/configure/application/ALBListeners.tsx +1 -2
- package/src/loadBalancer/configure/application/CreateApplicationLoadBalancer.tsx +28 -18
- package/src/loadBalancer/configure/classic/CreateClassicLoadBalancer.tsx +29 -19
- package/src/loadBalancer/configure/common/LoadBalancerLocation.tsx +1 -1
- package/src/loadBalancer/configure/common/SecurityGroups.spec.tsx +27 -0
- package/src/loadBalancer/configure/common/SecurityGroups.tsx +11 -5
- package/src/loadBalancer/configure/network/CreateNetworkLoadBalancer.tsx +28 -18
- package/src/loadBalancer/details/LoadBalancerActions.tsx +19 -5
- package/src/loadBalancer/details/amazonLoadBalancerDetails.spec.tsx +141 -0
- package/src/loadBalancer/details/amazonLoadBalancerDetails.tsx +599 -0
- package/src/loadBalancer/index.ts +1 -0
- package/src/loadBalancer/loadBalancer.transformer.ts +3 -4
- package/src/pipeline/stages/AmazonStageConfig.spec.tsx +103 -0
- package/src/pipeline/stages/AmazonStageConfig.tsx +259 -0
- package/src/pipeline/stages/bake/AwsBakeStageConfig.tsx +708 -0
- package/src/pipeline/stages/cloneServerGroup/AwsCloneServerGroupStageConfig.tsx +275 -0
- package/src/pipeline/stages/deleteLambda/index.ts +2 -6
- package/src/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.tsx +14 -33
- package/src/pipeline/stages/deployCloudFormation/DeployCloudFormationStackStageConfig.tsx +264 -0
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.spec.tsx +403 -0
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.ts +21 -29
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service.ts +1 -11
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionApproval.tsx +4 -3
- package/src/pipeline/stages/deployLambda/components/NetworkForm.tsx +3 -6
- package/src/pipeline/stages/deployLambda/index.ts +2 -6
- package/src/pipeline/stages/destroyAsg/awsDestroyAsgStage.js +28 -65
- package/src/pipeline/stages/disableAsg/AwsDisableAsgStageConfig.tsx +103 -0
- package/src/pipeline/stages/disableCluster/AwsDisableClusterStageConfig.tsx +119 -0
- package/src/pipeline/stages/enableAsg/AwsEnableAsgStageConfig.tsx +98 -0
- package/src/pipeline/stages/findAmi/awsFindAmiStage.js +22 -79
- package/src/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.spec.tsx +122 -0
- package/src/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.tsx +71 -0
- package/src/pipeline/stages/findImageFromTags/awsFindImageFromTagsStage.js +17 -32
- package/src/pipeline/stages/invokeLambda/index.ts +2 -6
- package/src/pipeline/stages/modifyScalingProcess/ModifyScalingProcessStageConfig.tsx +146 -0
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.js +27 -98
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.spec.tsx +167 -0
- package/src/pipeline/stages/modifyWarmPool/ModifyWarmPoolStageConfig.tsx +157 -0
- package/src/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.js +26 -0
- package/src/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.spec.tsx +89 -0
- package/src/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.spec.tsx +617 -0
- package/src/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.tsx +340 -0
- package/src/pipeline/stages/resizeAsg/awsResizeAsgStage.js +34 -125
- package/src/pipeline/stages/rollbackCluster/AwsRollbackClusterStageConfig.tsx +129 -0
- package/src/pipeline/stages/routeLambda/index.ts +2 -6
- package/src/pipeline/stages/scaleDownCluster/AwsScaleDownClusterStageConfig.tsx +121 -0
- package/src/pipeline/stages/shrinkCluster/AwsShrinkClusterStageConfig.tsx +136 -0
- package/src/pipeline/stages/tagImage/awsTagImageStage.spec.tsx +167 -0
- package/src/pipeline/stages/tagImage/awsTagImageStage.tsx +94 -0
- package/src/pipeline/stages/updateCodeLambda/index.ts +2 -6
- package/src/routerConsumers.spec.tsx +207 -0
- package/src/search/searchResultFormatter.ts +9 -16
- package/src/securityGroup/configure/AmazonSecurityGroupModal.spec.tsx +170 -0
- package/src/securityGroup/configure/AmazonSecurityGroupModal.tsx +440 -0
- package/src/securityGroup/details/AmazonSecurityGroupDetails.spec.tsx +62 -0
- package/src/securityGroup/details/AmazonSecurityGroupDetails.tsx +444 -0
- package/src/securityGroup/details/IPRangeRules.tsx +1 -1
- package/src/securityGroup/details/index.ts +1 -0
- package/src/securityGroup/index.ts +1 -0
- package/src/securityGroup/securityGroup.reader.ts +0 -5
- package/src/securityGroup/securityGroup.transformer.ts +35 -0
- package/src/serverGroup/configure/AmazonImageSelectInput.spec.tsx +104 -80
- package/src/serverGroup/configure/AmazonImageSelectInput.tsx +37 -18
- package/src/serverGroup/configure/serverGroupCommandBuilder.aws.service.spec.js +28 -66
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +476 -465
- package/src/serverGroup/configure/serverGroupCommandBuilder.spec.js +76 -124
- package/src/serverGroup/configure/serverGroupConfiguration.service.ts +106 -103
- package/src/serverGroup/configure/wizard/AmazonCloneServerGroupModal.tsx +65 -25
- package/src/serverGroup/configure/wizard/instanceType/CpuCreditsToggle.tsx +3 -3
- package/src/serverGroup/configure/wizard/instanceType/advancedMode/AdvancedModeSelector.tsx +2 -2
- package/src/serverGroup/configure/wizard/instanceType/simpleMode/SimpleModeSelector.spec.tsx +105 -0
- package/src/serverGroup/configure/wizard/instanceType/simpleMode/SimpleModeSelector.tsx +20 -6
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.spec.tsx +39 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.tsx +10 -9
- package/src/serverGroup/configure/wizard/pages/ServerGroupInstanceType.tsx +2 -2
- package/src/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.tsx +5 -2
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.spec.tsx +53 -0
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.tsx +35 -33
- package/src/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.spec.tsx +20 -0
- package/src/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.tsx +9 -4
- package/src/serverGroup/details/AmazonServerGroupActions.spec.tsx +186 -0
- package/src/serverGroup/details/AmazonServerGroupActions.tsx +37 -87
- package/src/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.spec.tsx +110 -0
- package/src/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.tsx +117 -0
- package/src/serverGroup/details/advancedSettings/index.ts +1 -0
- package/src/serverGroup/details/amazonServerGroupDetailsGetter.ts +4 -4
- package/src/serverGroup/details/resize/AmazonResizeServerGroupModal.tsx +16 -6
- package/src/serverGroup/details/rollback/AmazonRollbackServerGroupModal.spec.tsx +285 -0
- package/src/serverGroup/details/rollback/AmazonRollbackServerGroupModal.tsx +449 -0
- package/src/serverGroup/details/rollback/index.ts +2 -0
- package/src/serverGroup/details/rollback/rollbackServerGroupSelection.spec.ts +101 -0
- package/src/serverGroup/details/rollback/rollbackServerGroupSelection.ts +81 -0
- package/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx +4 -4
- package/src/serverGroup/details/scalingPolicy/ScalingPolicyWriter.ts +2 -5
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.tsx +0 -2
- package/src/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.spec.tsx +74 -0
- package/src/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.tsx +140 -0
- package/src/serverGroup/details/scalingProcesses/index.ts +2 -0
- package/src/serverGroup/details/scheduledActions/EditScheduledActionsModal.spec.tsx +115 -0
- package/src/serverGroup/details/scheduledActions/EditScheduledActionsModal.tsx +205 -0
- package/src/serverGroup/details/scheduledActions/index.ts +1 -0
- package/src/serverGroup/details/sections/AdvancedSettingsDetailsSection.tsx +7 -14
- package/src/serverGroup/details/sections/AmazonCapacityDetailsSection.tsx +14 -2
- package/src/serverGroup/details/sections/AmazonServerGroupMaintenanceActions.spec.tsx +148 -0
- package/src/serverGroup/details/sections/InstancesDistributionDetailsSection.spec.tsx +1 -5
- package/src/serverGroup/details/sections/LaunchTemplateDetailsSection.spec.tsx +1 -5
- package/src/serverGroup/details/sections/ScalingProcessesDetailsSection.tsx +8 -20
- package/src/serverGroup/details/sections/ScheduledActionsDetailsSection.tsx +7 -12
- package/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx +14 -19
- package/src/serverGroup/details/sections/WarmPoolDetailsSection.tsx +44 -0
- package/src/serverGroup/details/sections/index.ts +1 -0
- package/src/serverGroup/details/securityGroups/EditSecurityGroupsModal.spec.tsx +161 -0
- package/src/serverGroup/details/securityGroups/EditSecurityGroupsModal.tsx +177 -0
- package/src/serverGroup/details/securityGroups/index.ts +1 -0
- package/src/serverGroup/details/warmPool/ModifyWarmPoolModal.spec.tsx +69 -0
- package/src/serverGroup/details/warmPool/ModifyWarmPoolModal.tsx +191 -0
- package/src/serverGroup/details/warmPool/WarmPoolService.spec.ts +30 -0
- package/src/serverGroup/details/warmPool/WarmPoolService.ts +15 -0
- package/src/serverGroup/details/warmPool/index.ts +2 -0
- package/src/serverGroup/serverGroup.transformer.ts +1 -6
- package/src/vpc/VpcReader.ts +2 -2
- package/src/vpc/index.ts +1 -0
- package/dist/common/common.module.d.ts +0 -1
- package/dist/common/footer.component.d.ts +0 -1
- package/dist/function/function.module.d.ts +0 -1
- package/dist/instance/details/amazonInstanceInformation.component.d.ts +0 -1
- package/dist/instance/details/instance.details.controller.d.ts +0 -2
- package/dist/instance/details/instanceDns.component.d.ts +0 -1
- package/dist/instance/details/instanceSecurityGroups.component.d.ts +0 -1
- package/dist/instance/details/instanceStatus.component.d.ts +0 -1
- package/dist/instance/details/instanceTags.component.d.ts +0 -1
- package/dist/loadBalancer/details/loadBalancerActions.component.d.ts +0 -1
- package/dist/loadBalancer/details/loadBalancerDetails.controller.d.ts +0 -41
- package/dist/loadBalancer/details/targetGroupDetails.controller.d.ts +0 -30
- package/dist/loadBalancer/loadBalancer.module.d.ts +0 -1
- package/dist/loadBalancer/targetGroup.states.d.ts +0 -1
- package/dist/pipeline/stages/bake/awsBakeStage.d.ts +0 -2
- package/dist/pipeline/stages/bake/bakeExecutionDetails.controller.d.ts +0 -2
- package/dist/pipeline/stages/cloneServerGroup/awsCloneServerGroupStage.d.ts +0 -2
- package/dist/pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component.d.ts +0 -1
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.controller.d.ts +0 -25
- package/dist/pipeline/stages/disableAsg/awsDisableAsgStage.d.ts +0 -2
- package/dist/pipeline/stages/disableCluster/awsDisableClusterStage.d.ts +0 -2
- package/dist/pipeline/stages/enableAsg/awsEnableAsgStage.d.ts +0 -2
- package/dist/pipeline/stages/rollbackCluster/awsRollbackClusterStage.d.ts +0 -2
- package/dist/pipeline/stages/scaleDownCluster/awsScaleDownClusterStage.d.ts +0 -2
- package/dist/pipeline/stages/shrinkCluster/awsShrinkClusterStage.d.ts +0 -2
- package/dist/reactShims/aws.react.injector.d.ts +0 -18
- package/dist/reactShims/aws.react.module.d.ts +0 -1
- package/dist/reactShims/index.d.ts +0 -1
- package/dist/securityGroup/clone/cloneSecurityGroup.controller.d.ts +0 -2
- package/dist/securityGroup/configure/CreateSecurityGroupCtrl.d.ts +0 -2
- package/dist/securityGroup/configure/EditSecurityGroupCtrl.d.ts +0 -2
- package/dist/securityGroup/configure/configSecurityGroup.mixin.controller.d.ts +0 -2
- package/dist/securityGroup/configure/ingressRuleGroupSelector.component.d.ts +0 -1
- package/dist/securityGroup/configure/securityGroupDetailsCustom.component.d.ts +0 -1
- package/dist/securityGroup/configure/securityGroupDetailsCustom.d.ts +0 -10
- package/dist/securityGroup/details/securityGroupDetail.controller.d.ts +0 -2
- package/dist/securityGroup/details/securityGroupIpRangeRules.component.d.ts +0 -1
- package/dist/securityGroup/securityGroup.module.d.ts +0 -1
- package/dist/serverGroup/details/advancedSettings/editAsgAdvancedSettings.modal.controller.d.ts +0 -2
- package/dist/serverGroup/details/rollback/rollbackServerGroup.controller.d.ts +0 -2
- package/dist/serverGroup/details/scalingPolicy/createScalingPolicyButton.component.d.ts +0 -1
- package/dist/serverGroup/details/scalingPolicy/scalingPolicy.module.d.ts +0 -1
- package/dist/serverGroup/details/scalingPolicy/scalingPolicySummary.component.d.ts +0 -1
- package/dist/serverGroup/details/scalingProcesses/modifyScalingProcesses.controller.d.ts +0 -2
- package/dist/serverGroup/details/scheduledAction/editScheduledActions.modal.controller.d.ts +0 -2
- package/dist/serverGroup/details/securityGroup/editSecurityGroups.modal.controller.d.ts +0 -2
- package/dist/serverGroup/details/serverGroupDetails.module.d.ts +0 -1
- package/dist/subnet/subnet.renderer.d.ts +0 -5
- package/dist/vpc/vpc.module.d.ts +0 -1
- package/src/applicationProviderFields/awsFields.html +0 -13
- package/src/common/common.module.ts +0 -6
- package/src/common/footer.component.ts +0 -29
- package/src/function/function.module.ts +0 -5
- package/src/image/image.reader.spec.ts +0 -75
- package/src/instance/details/amazonInstanceInformation.component.ts +0 -13
- package/src/instance/details/instance.details.controller.js +0 -586
- package/src/instance/details/instance.details.controller.spec.js +0 -133
- package/src/instance/details/instanceDetails.html +0 -65
- package/src/instance/details/instanceDns.component.ts +0 -21
- package/src/instance/details/instanceSecurityGroups.component.ts +0 -13
- package/src/instance/details/instanceStatus.component.ts +0 -19
- package/src/instance/details/instanceTags.component.ts +0 -13
- package/src/loadBalancer/details/loadBalancerActions.component.ts +0 -16
- package/src/loadBalancer/details/loadBalancerDetails.controller.spec.ts +0 -76
- package/src/loadBalancer/details/loadBalancerDetails.controller.ts +0 -240
- package/src/loadBalancer/details/loadBalancerDetails.html +0 -266
- package/src/loadBalancer/details/targetGroupDetails.controller.ts +0 -95
- package/src/loadBalancer/details/targetGroupDetails.html +0 -138
- package/src/loadBalancer/loadBalancer.module.ts +0 -15
- package/src/loadBalancer/targetGroup.states.ts +0 -55
- package/src/pipeline/stages/bake/awsBakeStage.js +0 -219
- package/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +0 -43
- package/src/pipeline/stages/bake/bakeExecutionDetails.html +0 -65
- package/src/pipeline/stages/bake/bakeStage.html +0 -205
- package/src/pipeline/stages/cloneServerGroup/awsCloneServerGroupStage.js +0 -143
- package/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html +0 -143
- package/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html +0 -1
- package/src/pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component.ts +0 -46
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.controller.ts +0 -84
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.html +0 -84
- package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +0 -9
- package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +0 -1
- package/src/pipeline/stages/disableAsg/awsDisableAsgStage.js +0 -69
- package/src/pipeline/stages/disableAsg/disableAsgStage.html +0 -11
- package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/disableCluster/awsDisableClusterStage.js +0 -84
- package/src/pipeline/stages/disableCluster/disableClusterStage.html +0 -26
- package/src/pipeline/stages/enableAsg/awsEnableAsgStage.js +0 -73
- package/src/pipeline/stages/enableAsg/enableAsgStage.html +0 -11
- package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/findAmi/findAmiStage.html +0 -24
- package/src/pipeline/stages/findImageFromTags/findImageFromTagsExecutionDetails.html +0 -44
- package/src/pipeline/stages/findImageFromTags/findImageFromTagsStage.html +0 -11
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessExecutionDetails.html +0 -36
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.html +0 -24
- package/src/pipeline/stages/resizeAsg/resizeAsgStage.html +0 -90
- package/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html +0 -4
- package/src/pipeline/stages/rollbackCluster/awsRollbackClusterStage.js +0 -66
- package/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html +0 -43
- package/src/pipeline/stages/scaleDownCluster/awsScaleDownClusterStage.js +0 -78
- package/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html +0 -35
- package/src/pipeline/stages/shrinkCluster/awsShrinkClusterStage.js +0 -73
- package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html +0 -34
- package/src/pipeline/stages/tagImage/awsTagImageStage.js +0 -34
- package/src/pipeline/stages/tagImage/tagImageExecutionDetails.html +0 -38
- package/src/pipeline/stages/tagImage/tagImageStage.html +0 -10
- package/src/reactShims/aws.react.injector.ts +0 -25
- package/src/reactShims/aws.react.module.ts +0 -12
- package/src/reactShims/index.ts +0 -1
- package/src/securityGroup/clone/cloneSecurityGroup.controller.js +0 -106
- package/src/securityGroup/clone/cloneSecurityGroup.html +0 -19
- package/src/securityGroup/configure/CreateSecurityGroup.controller.spec.js +0 -307
- package/src/securityGroup/configure/CreateSecurityGroupCtrl.js +0 -47
- package/src/securityGroup/configure/EditSecurityGroupCtrl.js +0 -115
- package/src/securityGroup/configure/configSecurityGroup.mixin.controller.js +0 -366
- package/src/securityGroup/configure/createSecurityGroup.html +0 -19
- package/src/securityGroup/configure/createSecurityGroupIngress.html +0 -100
- package/src/securityGroup/configure/createSecurityGroupProperties.html +0 -123
- package/src/securityGroup/configure/editSecurityGroup.html +0 -20
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.html +0 -77
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.less +0 -6
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.ts +0 -190
- package/src/securityGroup/configure/securityGroupDetailsCustom.component.ts +0 -16
- package/src/securityGroup/configure/securityGroupDetailsCustom.tsx +0 -16
- package/src/securityGroup/details/securityGroupDetail.controller.js +0 -249
- package/src/securityGroup/details/securityGroupDetail.html +0 -114
- package/src/securityGroup/details/securityGroupIpRangeRules.component.ts +0 -12
- package/src/securityGroup/securityGroup.module.ts +0 -26
- package/src/securityGroup/securityGroup.transformer.js +0 -48
- package/src/serverGroup/configure/serverGroupConfiguration.service.spec.ts +0 -478
- package/src/serverGroup/details/advancedSettings/editAsgAdvancedSettings.modal.controller.js +0 -47
- package/src/serverGroup/details/advancedSettings/editAsgAdvancedSettings.modal.html +0 -79
- package/src/serverGroup/details/rollback/rollbackServerGroup.controller.js +0 -146
- package/src/serverGroup/details/rollback/rollbackServerGroup.html +0 -139
- package/src/serverGroup/details/scalingPolicy/createScalingPolicyButton.component.ts +0 -15
- package/src/serverGroup/details/scalingPolicy/scalingPolicy.module.ts +0 -6
- package/src/serverGroup/details/scalingPolicy/scalingPolicySummary.component.ts +0 -14
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/dimensionsEditor.less +0 -18
- package/src/serverGroup/details/scalingProcesses/modifyScalingProcesses.controller.js +0 -95
- package/src/serverGroup/details/scalingProcesses/modifyScalingProcesses.controller.spec.js +0 -106
- package/src/serverGroup/details/scalingProcesses/modifyScalingProcesses.html +0 -30
- package/src/serverGroup/details/scheduledAction/editScheduledActions.modal.controller.js +0 -70
- package/src/serverGroup/details/scheduledAction/editScheduledActions.modal.html +0 -89
- package/src/serverGroup/details/securityGroup/editSecurityGroups.modal.controller.js +0 -95
- package/src/serverGroup/details/securityGroup/editSecurityGroups.modal.html +0 -40
- package/src/serverGroup/details/serverGroupDetails.module.ts +0 -18
- package/src/serverGroup/serverGroup.transformer.spec.ts +0 -185
- package/src/subnet/SubnetSelectInput.spec.tsx +0 -91
- package/src/subnet/subnet.renderer.ts +0 -12
- package/src/vpc/vpc.module.ts +0 -9
|
@@ -1,528 +1,539 @@
|
|
|
1
|
-
import type { IQService } from 'angular';
|
|
2
|
-
import * as angular from 'angular';
|
|
3
1
|
import _ from 'lodash';
|
|
4
2
|
|
|
5
|
-
import type { Application, InstanceTypeService } from '@spinnaker/core';
|
|
6
|
-
import {
|
|
7
|
-
AccountService,
|
|
8
|
-
DeploymentStrategyRegistry,
|
|
9
|
-
INSTANCE_TYPE_SERVICE,
|
|
10
|
-
NameUtils,
|
|
11
|
-
SubnetReader,
|
|
12
|
-
} from '@spinnaker/core';
|
|
3
|
+
import type { Application, DeckRuntimeServices, InstanceTypeService } from '@spinnaker/core';
|
|
4
|
+
import { AccountService, DeploymentStrategyRegistry, NameUtils, SubnetReader } from '@spinnaker/core';
|
|
13
5
|
|
|
14
6
|
import { AWSProviderSettings } from '../../aws.settings';
|
|
15
7
|
import type { IAmazonLaunchTemplateOverrides, ILaunchTemplateData } from '../../domain';
|
|
16
8
|
import type { IAmazonServerGroup, IAmazonServerGroupView, INetworkInterface } from '../../domain';
|
|
9
|
+
import type { AwsServerGroupConfigurationService } from './serverGroupConfiguration.service';
|
|
17
10
|
import type {
|
|
18
|
-
AwsServerGroupConfigurationService,
|
|
19
11
|
IAmazonInstanceTypeOverride,
|
|
20
12
|
IAmazonServerGroupCommand,
|
|
21
13
|
IAmazonServerGroupCommandViewState,
|
|
22
14
|
IAmazonServerGroupDeployConfiguration,
|
|
23
15
|
} from './serverGroupConfiguration.service';
|
|
24
|
-
import { AWS_SERVER_GROUP_CONFIGURATION_SERVICE } from './serverGroupConfiguration.service';
|
|
25
|
-
|
|
26
|
-
export const AMAZON_SERVERGROUP_CONFIGURE_SERVERGROUPCOMMANDBUILDER_SERVICE =
|
|
27
|
-
'spinnaker.amazon.serverGroupCommandBuilder.service';
|
|
28
|
-
export const name = AMAZON_SERVERGROUP_CONFIGURE_SERVERGROUPCOMMANDBUILDER_SERVICE; // for backwards compatibility
|
|
29
16
|
|
|
30
17
|
export interface AwsServerGroupCommandBuilder {
|
|
31
18
|
buildNewServerGroupCommand(
|
|
32
19
|
application: Application,
|
|
33
20
|
defaults?: { account?: string; region?: string; subnet?: string; mode?: string },
|
|
34
|
-
):
|
|
21
|
+
): Promise<Partial<IAmazonServerGroupCommand>>;
|
|
35
22
|
|
|
36
23
|
buildServerGroupCommandFromExisting(
|
|
37
24
|
application: Application,
|
|
38
25
|
serverGroup: IAmazonServerGroupView,
|
|
39
26
|
mode?: string,
|
|
40
|
-
):
|
|
27
|
+
): Promise<Partial<IAmazonServerGroupCommand>>;
|
|
41
28
|
|
|
42
|
-
buildNewServerGroupCommandForPipeline():
|
|
29
|
+
buildNewServerGroupCommandForPipeline(): Promise<Partial<IAmazonServerGroupCommand>>;
|
|
43
30
|
|
|
44
31
|
buildServerGroupCommandFromPipeline(
|
|
45
32
|
application: Application,
|
|
46
33
|
originalCluster: IAmazonServerGroupDeployConfiguration,
|
|
47
|
-
):
|
|
34
|
+
): Promise<Partial<IAmazonServerGroupCommand>>;
|
|
48
35
|
|
|
49
36
|
buildUpdateServerGroupCommand(serverGroup: IAmazonServerGroup): Partial<IAmazonServerGroupCommand>;
|
|
50
37
|
}
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
mode: defaults.mode || 'create',
|
|
136
|
-
disableStrategySelection: true,
|
|
137
|
-
dirty: {},
|
|
138
|
-
submitButtonLabel: getSubmitButtonLabel(defaults.mode || 'create'),
|
|
139
|
-
} as IAmazonServerGroupCommandViewState,
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
if (application.attributes?.platformHealthOnlyShowOverride && application.attributes?.platformHealthOnly) {
|
|
143
|
-
command.interestingHealthProviderNames = ['Amazon'];
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (defaultCredentials === 'test' && AWSProviderSettings.serverGroups?.enableIPv6) {
|
|
147
|
-
command.associateIPv6Address = true;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (AWSProviderSettings.serverGroups?.enableIMDSv2) {
|
|
151
|
-
/**
|
|
152
|
-
* Older SDKs do not support IMDSv2. A timestamp can be optionally configured at which any apps created after can safely default to using IMDSv2.
|
|
153
|
-
*/
|
|
154
|
-
const appAgeRequirement = AWSProviderSettings.serverGroups.defaultIMDSv2AppAgeLimit;
|
|
155
|
-
const creationDate = application.attributes?.createTs;
|
|
156
|
-
|
|
157
|
-
command.requireIMDSv2 = appAgeRequirement && creationDate && Number(creationDate) > appAgeRequirement;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return command;
|
|
161
|
-
});
|
|
39
|
+
export function createAwsServerGroupCommandBuilder(
|
|
40
|
+
instanceTypeService: InstanceTypeService,
|
|
41
|
+
awsServerGroupConfigurationService: AwsServerGroupConfigurationService,
|
|
42
|
+
): AwsServerGroupCommandBuilder {
|
|
43
|
+
function buildNewServerGroupCommand(
|
|
44
|
+
application: Application,
|
|
45
|
+
defaults: { account?: string; region?: string; subnet?: string; mode?: string },
|
|
46
|
+
) {
|
|
47
|
+
defaults = defaults || {};
|
|
48
|
+
|
|
49
|
+
const credentialsLoader = AccountService.getCredentialsKeyedByAccount('aws');
|
|
50
|
+
|
|
51
|
+
const defaultCredentials =
|
|
52
|
+
defaults.account || application.defaultCredentials.aws || AWSProviderSettings.defaults.account;
|
|
53
|
+
const defaultRegion = defaults.region || application.defaultRegions.aws || AWSProviderSettings.defaults.region;
|
|
54
|
+
const defaultSubnet = defaults.subnet || AWSProviderSettings.defaults.subnetType || '';
|
|
55
|
+
|
|
56
|
+
const preferredZonesLoader = AccountService.getAvailabilityZonesForAccountAndRegion(
|
|
57
|
+
'aws',
|
|
58
|
+
defaultCredentials,
|
|
59
|
+
defaultRegion,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return Promise.all([preferredZonesLoader, credentialsLoader]).then(function ([
|
|
63
|
+
preferredZones,
|
|
64
|
+
credentialsKeyedByAccount,
|
|
65
|
+
]) {
|
|
66
|
+
const credentials = credentialsKeyedByAccount[defaultCredentials];
|
|
67
|
+
const keyPair = credentials ? credentials.defaultKeyPair : null;
|
|
68
|
+
const applicationAwsSettings = application.attributes?.providerSettings?.aws ?? {};
|
|
69
|
+
|
|
70
|
+
let defaultIamRole = AWSProviderSettings.defaults.iamRole || 'BaseIAMRole';
|
|
71
|
+
defaultIamRole = defaultIamRole.replace('{{application}}', application.name);
|
|
72
|
+
|
|
73
|
+
const useAmiBlockDeviceMappings = applicationAwsSettings.useAmiBlockDeviceMappings || false;
|
|
74
|
+
|
|
75
|
+
const command: Partial<IAmazonServerGroupCommand> = {
|
|
76
|
+
application: application.name,
|
|
77
|
+
credentials: defaultCredentials,
|
|
78
|
+
region: defaultRegion,
|
|
79
|
+
strategy: '',
|
|
80
|
+
capacity: {
|
|
81
|
+
min: 1,
|
|
82
|
+
max: 1,
|
|
83
|
+
desired: 1,
|
|
84
|
+
},
|
|
85
|
+
targetHealthyDeployPercentage: 100,
|
|
86
|
+
cooldown: 10,
|
|
87
|
+
enabledMetrics: [],
|
|
88
|
+
healthCheckType: 'EC2',
|
|
89
|
+
healthCheckGracePeriod: 600,
|
|
90
|
+
instanceMonitoring: false,
|
|
91
|
+
ebsOptimized: false,
|
|
92
|
+
selectedProvider: 'aws',
|
|
93
|
+
iamRole: defaultIamRole,
|
|
94
|
+
terminationPolicies: ['Default'],
|
|
95
|
+
vpcId: null,
|
|
96
|
+
subnetType: defaultSubnet,
|
|
97
|
+
availabilityZones: preferredZones,
|
|
98
|
+
keyPair: keyPair,
|
|
99
|
+
suspendedProcesses: [],
|
|
100
|
+
securityGroups: [],
|
|
101
|
+
stack: '',
|
|
102
|
+
freeFormDetails: '',
|
|
103
|
+
spotPrice: '',
|
|
104
|
+
tags: {},
|
|
105
|
+
useAmiBlockDeviceMappings: useAmiBlockDeviceMappings,
|
|
106
|
+
copySourceCustomBlockDeviceMappings: false, // default to using block device mappings from current instance type
|
|
107
|
+
viewState: {
|
|
108
|
+
instanceProfile: 'custom',
|
|
109
|
+
useSimpleInstanceTypeSelector: true,
|
|
110
|
+
useAllImageSelection: false,
|
|
111
|
+
useSimpleCapacity: true,
|
|
112
|
+
usePreferredZones: true,
|
|
113
|
+
mode: defaults.mode || 'create',
|
|
114
|
+
disableStrategySelection: true,
|
|
115
|
+
dirty: {},
|
|
116
|
+
submitButtonLabel: getSubmitButtonLabel(defaults.mode || 'create'),
|
|
117
|
+
} as IAmazonServerGroupCommandViewState,
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
if (application.attributes?.platformHealthOnlyShowOverride && application.attributes?.platformHealthOnly) {
|
|
121
|
+
command.interestingHealthProviderNames = ['Amazon'];
|
|
162
122
|
}
|
|
163
123
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
) {
|
|
168
|
-
const pipelineCluster = _.cloneDeep(originalCluster);
|
|
169
|
-
const region = Object.keys(pipelineCluster.availabilityZones)[0];
|
|
170
|
-
|
|
171
|
-
const instanceTypes = pipelineCluster.launchTemplateOverridesForInstanceType
|
|
172
|
-
? pipelineCluster.launchTemplateOverridesForInstanceType.map((o) => o.instanceType)
|
|
173
|
-
: [pipelineCluster.instanceType];
|
|
174
|
-
const instanceTypeCategoryLoader = instanceTypeService.getCategoryForMultipleInstanceTypes(
|
|
175
|
-
'aws',
|
|
176
|
-
instanceTypes,
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
const commandOptions = { account: pipelineCluster.account, region: region };
|
|
180
|
-
const asyncLoader = $q.all([
|
|
181
|
-
buildNewServerGroupCommand(application, commandOptions),
|
|
182
|
-
instanceTypeCategoryLoader,
|
|
183
|
-
]);
|
|
184
|
-
|
|
185
|
-
return asyncLoader.then(function ([command, instanceProfile]) {
|
|
186
|
-
const zones = pipelineCluster.availabilityZones[region];
|
|
187
|
-
const usePreferredZones = zones.join(',') === command.availabilityZones.join(',');
|
|
188
|
-
|
|
189
|
-
const viewState = {
|
|
190
|
-
instanceProfile,
|
|
191
|
-
disableImageSelection: true,
|
|
192
|
-
useSimpleCapacity:
|
|
193
|
-
pipelineCluster.capacity.min === pipelineCluster.capacity.max &&
|
|
194
|
-
pipelineCluster.useSourceCapacity !== true,
|
|
195
|
-
usePreferredZones: usePreferredZones,
|
|
196
|
-
mode: 'editPipeline',
|
|
197
|
-
submitButtonLabel: 'Done',
|
|
198
|
-
templatingEnabled: true,
|
|
199
|
-
existingPipelineCluster: true,
|
|
200
|
-
dirty: {},
|
|
201
|
-
useSimpleInstanceTypeSelector: isSimpleModeEnabled(pipelineCluster),
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const viewOverrides = {
|
|
205
|
-
region: region,
|
|
206
|
-
credentials: pipelineCluster.account,
|
|
207
|
-
availabilityZones: pipelineCluster.availabilityZones[region],
|
|
208
|
-
iamRole: pipelineCluster.iamRole,
|
|
209
|
-
viewState: viewState,
|
|
210
|
-
};
|
|
124
|
+
if (defaultCredentials === 'test' && AWSProviderSettings.serverGroups?.enableIPv6) {
|
|
125
|
+
command.associateIPv6Address = true;
|
|
126
|
+
}
|
|
211
127
|
|
|
212
|
-
|
|
128
|
+
if (AWSProviderSettings.serverGroups?.enableIMDSv2) {
|
|
129
|
+
/**
|
|
130
|
+
* Older SDKs do not support IMDSv2. A timestamp can be optionally configured at which any apps created after can safely default to using IMDSv2.
|
|
131
|
+
*/
|
|
132
|
+
const appAgeRequirement = AWSProviderSettings.serverGroups.defaultIMDSv2AppAgeLimit;
|
|
133
|
+
const creationDate = application.attributes?.createTs;
|
|
213
134
|
|
|
214
|
-
|
|
215
|
-
});
|
|
135
|
+
command.requireIMDSv2 = appAgeRequirement && creationDate && Number(creationDate) > appAgeRequirement;
|
|
216
136
|
}
|
|
217
137
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
viewState: {
|
|
222
|
-
requiresTemplateSelection: true,
|
|
223
|
-
} as IAmazonServerGroupCommandViewState,
|
|
224
|
-
});
|
|
225
|
-
}
|
|
138
|
+
return command;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
226
141
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
142
|
+
function buildServerGroupCommandFromPipeline(
|
|
143
|
+
application: Application,
|
|
144
|
+
originalCluster: IAmazonServerGroupDeployConfiguration,
|
|
145
|
+
) {
|
|
146
|
+
const pipelineCluster = _.cloneDeep(originalCluster);
|
|
147
|
+
const region = Object.keys(pipelineCluster.availabilityZones)[0];
|
|
148
|
+
|
|
149
|
+
const instanceTypes = pipelineCluster.launchTemplateOverridesForInstanceType
|
|
150
|
+
? pipelineCluster.launchTemplateOverridesForInstanceType.map((o) => o.instanceType)
|
|
151
|
+
: [pipelineCluster.instanceType];
|
|
152
|
+
const instanceTypeCategoryLoader = instanceTypeService.getCategoryForMultipleInstanceTypes('aws', instanceTypes);
|
|
153
|
+
|
|
154
|
+
const commandOptions = { account: pipelineCluster.account, region: region };
|
|
155
|
+
const asyncLoader = Promise.all([
|
|
156
|
+
buildNewServerGroupCommand(application, commandOptions),
|
|
157
|
+
instanceTypeCategoryLoader,
|
|
158
|
+
]);
|
|
159
|
+
|
|
160
|
+
return asyncLoader.then(function ([command, instanceProfile]) {
|
|
161
|
+
const zones = pipelineCluster.availabilityZones[region];
|
|
162
|
+
const usePreferredZones = zones.join(',') === command.availabilityZones.join(',');
|
|
163
|
+
|
|
164
|
+
const viewState = {
|
|
165
|
+
instanceProfile,
|
|
166
|
+
disableImageSelection: true,
|
|
167
|
+
useSimpleCapacity:
|
|
168
|
+
pipelineCluster.capacity.min === pipelineCluster.capacity.max && pipelineCluster.useSourceCapacity !== true,
|
|
169
|
+
usePreferredZones: usePreferredZones,
|
|
170
|
+
mode: 'editPipeline',
|
|
171
|
+
submitButtonLabel: 'Done',
|
|
172
|
+
templatingEnabled: true,
|
|
173
|
+
existingPipelineCluster: true,
|
|
174
|
+
dirty: {},
|
|
175
|
+
useSimpleInstanceTypeSelector: isSimpleModeEnabled(pipelineCluster),
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const viewOverrides = {
|
|
179
|
+
region: region,
|
|
180
|
+
credentials: pipelineCluster.account,
|
|
181
|
+
availabilityZones: pipelineCluster.availabilityZones[region],
|
|
182
|
+
iamRole: pipelineCluster.iamRole,
|
|
183
|
+
viewState: viewState,
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
pipelineCluster.strategy = pipelineCluster.strategy || '';
|
|
187
|
+
|
|
188
|
+
return Object.assign({}, command, pipelineCluster, viewOverrides);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Only used to prepare view requiring template selecting
|
|
193
|
+
function buildNewServerGroupCommandForPipeline() {
|
|
194
|
+
return Promise.resolve({
|
|
195
|
+
viewState: {
|
|
196
|
+
requiresTemplateSelection: true,
|
|
197
|
+
} as IAmazonServerGroupCommandViewState,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function getSubmitButtonLabel(mode: string) {
|
|
202
|
+
switch (mode) {
|
|
203
|
+
case 'createPipeline':
|
|
204
|
+
return 'Add';
|
|
205
|
+
case 'editPipeline':
|
|
206
|
+
return 'Done';
|
|
207
|
+
case 'clone':
|
|
208
|
+
return 'Clone';
|
|
209
|
+
default:
|
|
210
|
+
return 'Create';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function buildUpdateServerGroupCommand(serverGroup: IAmazonServerGroup) {
|
|
215
|
+
const command = ({
|
|
216
|
+
type: 'modifyAsg',
|
|
217
|
+
asgs: [{ asgName: serverGroup.name, region: serverGroup.region }],
|
|
218
|
+
cooldown: serverGroup.asg.defaultCooldown,
|
|
219
|
+
enabledMetrics: (serverGroup.asg?.enabledMetrics ?? []).map((m) => m.metric),
|
|
220
|
+
healthCheckGracePeriod: serverGroup.asg.healthCheckGracePeriod,
|
|
221
|
+
healthCheckType: serverGroup.asg.healthCheckType,
|
|
222
|
+
terminationPolicies: _.cloneDeep(serverGroup.asg.terminationPolicies),
|
|
223
|
+
credentials: serverGroup.account,
|
|
224
|
+
capacityRebalance: serverGroup.asg.capacityRebalance,
|
|
225
|
+
} as Partial<IAmazonServerGroupCommand>) as IAmazonServerGroupCommand;
|
|
226
|
+
awsServerGroupConfigurationService.configureUpdateCommand(command);
|
|
227
|
+
return command;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function buildServerGroupCommandFromExisting(
|
|
231
|
+
application: Application,
|
|
232
|
+
serverGroup: IAmazonServerGroupView,
|
|
233
|
+
mode = 'clone',
|
|
234
|
+
) {
|
|
235
|
+
const preferredZonesLoader = AccountService.getPreferredZonesByAccount('aws');
|
|
236
|
+
const subnetsLoader = SubnetReader.listSubnets();
|
|
237
|
+
|
|
238
|
+
const serverGroupName = NameUtils.parseServerGroupName(serverGroup.asg.autoScalingGroupName);
|
|
239
|
+
|
|
240
|
+
let instanceTypes;
|
|
241
|
+
if (serverGroup.mixedInstancesPolicy) {
|
|
242
|
+
const ltOverrides = serverGroup.mixedInstancesPolicy?.launchTemplateOverridesForInstanceType;
|
|
243
|
+
// note: single launch template case is currently the only supported case for mixed instances policy
|
|
244
|
+
instanceTypes = ltOverrides
|
|
245
|
+
? ltOverrides.map((o) => o.instanceType)
|
|
246
|
+
: [serverGroup.mixedInstancesPolicy?.launchTemplates[0]?.launchTemplateData?.instanceType];
|
|
247
|
+
} else if (serverGroup.launchTemplate) {
|
|
248
|
+
instanceTypes = [_.get(serverGroup, 'launchTemplate.launchTemplateData.instanceType')];
|
|
249
|
+
} else if (serverGroup.launchConfig) {
|
|
250
|
+
instanceTypes = [_.get(serverGroup, 'launchConfig.instanceType')];
|
|
251
|
+
}
|
|
252
|
+
const instanceTypeCategoryLoader = instanceTypeService.getCategoryForMultipleInstanceTypes('aws', instanceTypes);
|
|
253
|
+
|
|
254
|
+
return Promise.all([preferredZonesLoader, subnetsLoader, instanceTypeCategoryLoader]).then(
|
|
255
|
+
([preferredZones, subnets, instanceProfile]) => {
|
|
256
|
+
const zones = serverGroup.asg.availabilityZones.sort();
|
|
257
|
+
let usePreferredZones = false;
|
|
258
|
+
const preferredZonesForAccount = preferredZones[serverGroup.account];
|
|
259
|
+
if (preferredZonesForAccount) {
|
|
260
|
+
const preferredZones = preferredZonesForAccount[serverGroup.region].sort();
|
|
261
|
+
usePreferredZones = zones.join(',') === preferredZones.join(',');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// These processes should never be copied over, as the affect launching instances and enabling traffic
|
|
265
|
+
const enabledProcesses = ['Launch', 'Terminate', 'AddToLoadBalancer'];
|
|
266
|
+
|
|
267
|
+
const applicationAwsSettings = application.attributes?.providerSettings?.aws ?? {};
|
|
268
|
+
const useAmiBlockDeviceMappings = applicationAwsSettings.useAmiBlockDeviceMappings || false;
|
|
269
|
+
|
|
270
|
+
const existingTags: { [key: string]: string } = {};
|
|
271
|
+
// These tags are applied by Clouddriver (if configured to do so), regardless of what the user might enter
|
|
272
|
+
// Might be worth feature flagging this if it turns out other folks are hard-coding these values
|
|
273
|
+
const reservedTags = ['spinnaker:application', 'spinnaker:stack', 'spinnaker:details'];
|
|
274
|
+
if (serverGroup.asg.tags) {
|
|
275
|
+
serverGroup.asg.tags
|
|
276
|
+
.filter((t) => !reservedTags.includes(t.key))
|
|
277
|
+
.forEach((tag) => {
|
|
278
|
+
existingTags[tag.key] = tag.value;
|
|
279
|
+
});
|
|
237
280
|
}
|
|
238
|
-
}
|
|
239
281
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
282
|
+
const command: Partial<IAmazonServerGroupCommand> = {
|
|
283
|
+
application: application.name,
|
|
284
|
+
strategy: '',
|
|
285
|
+
stack: serverGroupName.stack,
|
|
286
|
+
freeFormDetails: serverGroupName.freeFormDetails,
|
|
287
|
+
credentials: serverGroup.account,
|
|
244
288
|
cooldown: serverGroup.asg.defaultCooldown,
|
|
245
|
-
enabledMetrics: (serverGroup.
|
|
289
|
+
enabledMetrics: _.get(serverGroup, 'asg.enabledMetrics', []).map((m) => m.metric),
|
|
246
290
|
healthCheckGracePeriod: serverGroup.asg.healthCheckGracePeriod,
|
|
247
291
|
healthCheckType: serverGroup.asg.healthCheckType,
|
|
248
|
-
terminationPolicies:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
292
|
+
terminationPolicies: serverGroup.asg.terminationPolicies,
|
|
293
|
+
loadBalancers: serverGroup.asg.loadBalancerNames,
|
|
294
|
+
region: serverGroup.region,
|
|
295
|
+
useSourceCapacity: false,
|
|
296
|
+
capacity: {
|
|
297
|
+
min: serverGroup.asg.minSize,
|
|
298
|
+
max: serverGroup.asg.maxSize,
|
|
299
|
+
desired: serverGroup.asg.desiredCapacity,
|
|
300
|
+
},
|
|
301
|
+
targetHealthyDeployPercentage: 100,
|
|
302
|
+
availabilityZones: zones,
|
|
303
|
+
selectedProvider: 'aws',
|
|
304
|
+
source: {
|
|
305
|
+
account: serverGroup.account,
|
|
306
|
+
region: serverGroup.region,
|
|
307
|
+
asgName: serverGroup.asg.autoScalingGroupName,
|
|
308
|
+
},
|
|
309
|
+
suspendedProcesses: (serverGroup.asg.suspendedProcesses || [])
|
|
310
|
+
.map((process) => process.processName)
|
|
311
|
+
.filter((name) => !enabledProcesses.includes(name)),
|
|
312
|
+
tags: Object.assign({}, serverGroup.tags, existingTags),
|
|
313
|
+
targetGroups: serverGroup.targetGroups,
|
|
314
|
+
useAmiBlockDeviceMappings: useAmiBlockDeviceMappings,
|
|
315
|
+
copySourceCustomBlockDeviceMappings: mode === 'clone', // default to using block device mappings if not cloning
|
|
316
|
+
viewState: {
|
|
317
|
+
instanceProfile,
|
|
318
|
+
useAllImageSelection: false,
|
|
319
|
+
useSimpleCapacity: serverGroup.asg.minSize === serverGroup.asg.maxSize,
|
|
320
|
+
usePreferredZones: usePreferredZones,
|
|
321
|
+
mode: mode,
|
|
322
|
+
submitButtonLabel: getSubmitButtonLabel(mode),
|
|
323
|
+
isNew: false,
|
|
324
|
+
dirty: {},
|
|
325
|
+
} as IAmazonServerGroupCommandViewState,
|
|
326
|
+
};
|
|
255
327
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
serverGroup: IAmazonServerGroupView,
|
|
259
|
-
mode = 'clone',
|
|
260
|
-
) {
|
|
261
|
-
const preferredZonesLoader = AccountService.getPreferredZonesByAccount('aws');
|
|
262
|
-
const subnetsLoader = SubnetReader.listSubnets();
|
|
263
|
-
|
|
264
|
-
const serverGroupName = NameUtils.parseServerGroupName(serverGroup.asg.autoScalingGroupName);
|
|
265
|
-
|
|
266
|
-
let instanceTypes;
|
|
267
|
-
if (serverGroup.mixedInstancesPolicy) {
|
|
268
|
-
const ltOverrides = serverGroup.mixedInstancesPolicy?.launchTemplateOverridesForInstanceType;
|
|
269
|
-
// note: single launch template case is currently the only supported case for mixed instances policy
|
|
270
|
-
instanceTypes = ltOverrides
|
|
271
|
-
? ltOverrides.map((o) => o.instanceType)
|
|
272
|
-
: [serverGroup.mixedInstancesPolicy?.launchTemplates[0]?.launchTemplateData?.instanceType];
|
|
273
|
-
} else if (serverGroup.launchTemplate) {
|
|
274
|
-
instanceTypes = [_.get(serverGroup, 'launchTemplate.launchTemplateData.instanceType')];
|
|
275
|
-
} else if (serverGroup.launchConfig) {
|
|
276
|
-
instanceTypes = [_.get(serverGroup, 'launchConfig.instanceType')];
|
|
328
|
+
if (application.attributes?.platformHealthOnlyShowOverride && application.attributes?.platformHealthOnly) {
|
|
329
|
+
command.interestingHealthProviderNames = ['Amazon'];
|
|
277
330
|
}
|
|
278
|
-
const instanceTypeCategoryLoader = instanceTypeService.getCategoryForMultipleInstanceTypes(
|
|
279
|
-
'aws',
|
|
280
|
-
instanceTypes,
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
return $q
|
|
284
|
-
.all([preferredZonesLoader, subnetsLoader, instanceTypeCategoryLoader])
|
|
285
|
-
.then(([preferredZones, subnets, instanceProfile]) => {
|
|
286
|
-
const zones = serverGroup.asg.availabilityZones.sort();
|
|
287
|
-
let usePreferredZones = false;
|
|
288
|
-
const preferredZonesForAccount = preferredZones[serverGroup.account];
|
|
289
|
-
if (preferredZonesForAccount) {
|
|
290
|
-
const preferredZones = preferredZonesForAccount[serverGroup.region].sort();
|
|
291
|
-
usePreferredZones = zones.join(',') === preferredZones.join(',');
|
|
292
|
-
}
|
|
293
331
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
// Might be worth feature flagging this if it turns out other folks are hard-coding these values
|
|
303
|
-
const reservedTags = ['spinnaker:application', 'spinnaker:stack', 'spinnaker:details'];
|
|
304
|
-
if (serverGroup.asg.tags) {
|
|
305
|
-
serverGroup.asg.tags
|
|
306
|
-
.filter((t) => !reservedTags.includes(t.key))
|
|
307
|
-
.forEach((tag) => {
|
|
308
|
-
existingTags[tag.key] = tag.value;
|
|
309
|
-
});
|
|
310
|
-
}
|
|
332
|
+
if (mode === 'editPipeline') {
|
|
333
|
+
command.useSourceCapacity = true;
|
|
334
|
+
command.viewState.useSimpleCapacity = false;
|
|
335
|
+
command.strategy = 'redblack';
|
|
336
|
+
const redblack = DeploymentStrategyRegistry.getStrategy('redblack');
|
|
337
|
+
redblack.initializationMethod && redblack.initializationMethod(command);
|
|
338
|
+
command.suspendedProcesses = [];
|
|
339
|
+
}
|
|
311
340
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
terminationPolicies: serverGroup.asg.terminationPolicies,
|
|
323
|
-
loadBalancers: serverGroup.asg.loadBalancerNames,
|
|
324
|
-
region: serverGroup.region,
|
|
325
|
-
useSourceCapacity: false,
|
|
326
|
-
capacity: {
|
|
327
|
-
min: serverGroup.asg.minSize,
|
|
328
|
-
max: serverGroup.asg.maxSize,
|
|
329
|
-
desired: serverGroup.asg.desiredCapacity,
|
|
330
|
-
},
|
|
331
|
-
targetHealthyDeployPercentage: 100,
|
|
332
|
-
availabilityZones: zones,
|
|
333
|
-
selectedProvider: 'aws',
|
|
334
|
-
source: {
|
|
335
|
-
account: serverGroup.account,
|
|
336
|
-
region: serverGroup.region,
|
|
337
|
-
asgName: serverGroup.asg.autoScalingGroupName,
|
|
338
|
-
},
|
|
339
|
-
suspendedProcesses: (serverGroup.asg.suspendedProcesses || [])
|
|
340
|
-
.map((process) => process.processName)
|
|
341
|
-
.filter((name) => !enabledProcesses.includes(name)),
|
|
342
|
-
tags: Object.assign({}, serverGroup.tags, existingTags),
|
|
343
|
-
targetGroups: serverGroup.targetGroups,
|
|
344
|
-
useAmiBlockDeviceMappings: useAmiBlockDeviceMappings,
|
|
345
|
-
copySourceCustomBlockDeviceMappings: mode === 'clone', // default to using block device mappings if not cloning
|
|
346
|
-
viewState: {
|
|
347
|
-
instanceProfile,
|
|
348
|
-
useAllImageSelection: false,
|
|
349
|
-
useSimpleCapacity: serverGroup.asg.minSize === serverGroup.asg.maxSize,
|
|
350
|
-
usePreferredZones: usePreferredZones,
|
|
351
|
-
mode: mode,
|
|
352
|
-
submitButtonLabel: getSubmitButtonLabel(mode),
|
|
353
|
-
isNew: false,
|
|
354
|
-
dirty: {},
|
|
355
|
-
} as IAmazonServerGroupCommandViewState,
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
if (application.attributes?.platformHealthOnlyShowOverride && application.attributes?.platformHealthOnly) {
|
|
359
|
-
command.interestingHealthProviderNames = ['Amazon'];
|
|
360
|
-
}
|
|
341
|
+
const vpcZoneIdentifier = serverGroup.asg.vpczoneIdentifier;
|
|
342
|
+
if (vpcZoneIdentifier !== '') {
|
|
343
|
+
const subnetId = vpcZoneIdentifier.split(',')[0];
|
|
344
|
+
const subnet = subnets.find((x) => x.id === subnetId);
|
|
345
|
+
command.subnetType = subnet.purpose;
|
|
346
|
+
command.vpcId = subnet.vpcId;
|
|
347
|
+
} else {
|
|
348
|
+
command.subnetType = '';
|
|
349
|
+
command.vpcId = null;
|
|
350
|
+
}
|
|
361
351
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
352
|
+
if (serverGroup.launchConfig) {
|
|
353
|
+
Object.assign(command, {
|
|
354
|
+
instanceType: serverGroup.launchConfig.instanceType,
|
|
355
|
+
iamRole: serverGroup.launchConfig.iamInstanceProfile,
|
|
356
|
+
keyPair: serverGroup.launchConfig.keyName,
|
|
357
|
+
associatePublicIpAddress: serverGroup.launchConfig.associatePublicIpAddress,
|
|
358
|
+
ramdiskId: serverGroup.launchConfig.ramdiskId,
|
|
359
|
+
instanceMonitoring:
|
|
360
|
+
serverGroup.launchConfig.instanceMonitoring && serverGroup.launchConfig.instanceMonitoring.enabled,
|
|
361
|
+
ebsOptimized: serverGroup.launchConfig.ebsOptimized,
|
|
362
|
+
spotPrice: serverGroup.launchConfig.spotPrice,
|
|
363
|
+
});
|
|
364
|
+
if (serverGroup.launchConfig.userData) {
|
|
365
|
+
command.base64UserData = serverGroup.launchConfig.userData;
|
|
366
|
+
}
|
|
367
|
+
command.viewState.imageId = serverGroup.launchConfig.imageId;
|
|
368
|
+
command.viewState.useSimpleInstanceTypeSelector = true;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (serverGroup.launchTemplate || serverGroup.mixedInstancesPolicy) {
|
|
372
|
+
let launchTemplateData: ILaunchTemplateData, spotMaxPrice: string;
|
|
373
|
+
if (serverGroup.launchTemplate) {
|
|
374
|
+
launchTemplateData = serverGroup.launchTemplate.launchTemplateData;
|
|
375
|
+
spotMaxPrice = launchTemplateData.instanceMarketOptions?.spotOptions?.maxPrice;
|
|
376
|
+
command.instanceType = launchTemplateData.instanceType;
|
|
377
|
+
command.viewState.useSimpleInstanceTypeSelector = true;
|
|
378
|
+
if (launchTemplateData.userData) {
|
|
379
|
+
command.base64UserData = launchTemplateData.userData;
|
|
369
380
|
}
|
|
381
|
+
}
|
|
370
382
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
383
|
+
if (serverGroup.mixedInstancesPolicy) {
|
|
384
|
+
const mip = serverGroup.mixedInstancesPolicy;
|
|
385
|
+
// note: single launch template case is currently the only supported case for mixed instances policy
|
|
386
|
+
launchTemplateData = mip?.launchTemplates?.[0]?.launchTemplateData;
|
|
387
|
+
spotMaxPrice = mip?.instancesDistribution?.spotMaxPrice;
|
|
388
|
+
command.securityGroups = launchTemplateData.networkInterfaces
|
|
389
|
+
? (launchTemplateData.networkInterfaces.find((ni) => ni.deviceIndex === 0) ?? {}).groups
|
|
390
|
+
: launchTemplateData.securityGroups;
|
|
391
|
+
command.onDemandAllocationStrategy = mip.instancesDistribution.onDemandAllocationStrategy;
|
|
392
|
+
command.onDemandBaseCapacity = mip.instancesDistribution.onDemandBaseCapacity;
|
|
393
|
+
command.onDemandPercentageAboveBaseCapacity = mip.instancesDistribution.onDemandPercentageAboveBaseCapacity;
|
|
394
|
+
command.spotAllocationStrategy = mip.instancesDistribution.spotAllocationStrategy;
|
|
395
|
+
command.spotInstancePools = mip.instancesDistribution.spotInstancePools;
|
|
396
|
+
|
|
397
|
+
// 'launchTemplateOverridesForInstanceType' is used for multiple instance types case, 'instanceType' is used for all other cases.
|
|
398
|
+
if (mip.launchTemplateOverridesForInstanceType) {
|
|
399
|
+
command.launchTemplateOverridesForInstanceType = getInstanceTypesWithPriority(
|
|
400
|
+
mip.launchTemplateOverridesForInstanceType,
|
|
401
|
+
);
|
|
377
402
|
} else {
|
|
378
|
-
command.
|
|
379
|
-
command.vpcId = null;
|
|
403
|
+
command.instanceType = launchTemplateData.instanceType;
|
|
380
404
|
}
|
|
381
405
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
instanceType: serverGroup.launchConfig.instanceType,
|
|
385
|
-
iamRole: serverGroup.launchConfig.iamInstanceProfile,
|
|
386
|
-
keyPair: serverGroup.launchConfig.keyName,
|
|
387
|
-
associatePublicIpAddress: serverGroup.launchConfig.associatePublicIpAddress,
|
|
388
|
-
ramdiskId: serverGroup.launchConfig.ramdiskId,
|
|
389
|
-
instanceMonitoring:
|
|
390
|
-
serverGroup.launchConfig.instanceMonitoring && serverGroup.launchConfig.instanceMonitoring.enabled,
|
|
391
|
-
ebsOptimized: serverGroup.launchConfig.ebsOptimized,
|
|
392
|
-
spotPrice: serverGroup.launchConfig.spotPrice,
|
|
393
|
-
});
|
|
394
|
-
if (serverGroup.launchConfig.userData) {
|
|
395
|
-
command.base64UserData = serverGroup.launchConfig.userData;
|
|
396
|
-
}
|
|
397
|
-
command.viewState.imageId = serverGroup.launchConfig.imageId;
|
|
398
|
-
command.viewState.useSimpleInstanceTypeSelector = true;
|
|
399
|
-
}
|
|
406
|
+
command.viewState.useSimpleInstanceTypeSelector = isSimpleModeEnabled(command);
|
|
407
|
+
}
|
|
400
408
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
command.onDemandAllocationStrategy = mip.instancesDistribution.onDemandAllocationStrategy;
|
|
422
|
-
command.onDemandBaseCapacity = mip.instancesDistribution.onDemandBaseCapacity;
|
|
423
|
-
command.onDemandPercentageAboveBaseCapacity =
|
|
424
|
-
mip.instancesDistribution.onDemandPercentageAboveBaseCapacity;
|
|
425
|
-
command.spotAllocationStrategy = mip.instancesDistribution.spotAllocationStrategy;
|
|
426
|
-
command.spotInstancePools = mip.instancesDistribution.spotInstancePools;
|
|
427
|
-
|
|
428
|
-
// 'launchTemplateOverridesForInstanceType' is used for multiple instance types case, 'instanceType' is used for all other cases.
|
|
429
|
-
if (mip.launchTemplateOverridesForInstanceType) {
|
|
430
|
-
command.launchTemplateOverridesForInstanceType = getInstanceTypesWithPriority(
|
|
431
|
-
mip.launchTemplateOverridesForInstanceType,
|
|
432
|
-
);
|
|
433
|
-
} else {
|
|
434
|
-
command.instanceType = launchTemplateData.instanceType;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
command.viewState.useSimpleInstanceTypeSelector = isSimpleModeEnabled(command);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
const networkInterfaces = _.get(launchTemplateData, 'networkInterfaces[0]');
|
|
441
|
-
const ipv6AddressCount = (networkInterfaces as INetworkInterface)?.ipv6AddressCount ?? 0;
|
|
442
|
-
|
|
443
|
-
const asgSettings = AWSProviderSettings.serverGroups;
|
|
444
|
-
const isTestEnv = serverGroup.accountDetails && serverGroup.accountDetails.environment === 'test';
|
|
445
|
-
const shouldAutoEnableIPv6 =
|
|
446
|
-
asgSettings && asgSettings.enableIPv6 && asgSettings.setIPv6InTest && isTestEnv;
|
|
447
|
-
|
|
448
|
-
angular.extend(command, {
|
|
449
|
-
iamRole: launchTemplateData.iamInstanceProfile.name,
|
|
450
|
-
keyPair: launchTemplateData.keyName,
|
|
451
|
-
associateIPv6Address: shouldAutoEnableIPv6 || Boolean(ipv6AddressCount),
|
|
452
|
-
ramdiskId: launchTemplateData.ramdiskId,
|
|
453
|
-
instanceMonitoring: launchTemplateData.monitoring && launchTemplateData.monitoring.enabled,
|
|
454
|
-
ebsOptimized: launchTemplateData.ebsOptimized,
|
|
455
|
-
spotPrice: spotMaxPrice || undefined,
|
|
456
|
-
requireIMDSv2: Boolean(launchTemplateData.metadataOptions?.httpTokens === 'required'),
|
|
457
|
-
unlimitedCpuCredits: launchTemplateData.creditSpecification
|
|
458
|
-
? launchTemplateData.creditSpecification.cpuCredits === 'unlimited'
|
|
459
|
-
: undefined,
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
command.viewState.imageId = launchTemplateData.imageId;
|
|
463
|
-
}
|
|
409
|
+
const networkInterfaces = _.get(launchTemplateData, 'networkInterfaces[0]');
|
|
410
|
+
const ipv6AddressCount = (networkInterfaces as INetworkInterface)?.ipv6AddressCount ?? 0;
|
|
411
|
+
|
|
412
|
+
const asgSettings = AWSProviderSettings.serverGroups;
|
|
413
|
+
const isTestEnv = serverGroup.accountDetails && serverGroup.accountDetails.environment === 'test';
|
|
414
|
+
const shouldAutoEnableIPv6 = asgSettings && asgSettings.enableIPv6 && asgSettings.setIPv6InTest && isTestEnv;
|
|
415
|
+
|
|
416
|
+
Object.assign(command, {
|
|
417
|
+
iamRole: launchTemplateData.iamInstanceProfile.name,
|
|
418
|
+
keyPair: launchTemplateData.keyName,
|
|
419
|
+
associateIPv6Address: shouldAutoEnableIPv6 || Boolean(ipv6AddressCount),
|
|
420
|
+
ramdiskId: launchTemplateData.ramdiskId,
|
|
421
|
+
instanceMonitoring: launchTemplateData.monitoring && launchTemplateData.monitoring.enabled,
|
|
422
|
+
ebsOptimized: launchTemplateData.ebsOptimized,
|
|
423
|
+
spotPrice: spotMaxPrice || undefined,
|
|
424
|
+
requireIMDSv2: Boolean(launchTemplateData.metadataOptions?.httpTokens === 'required'),
|
|
425
|
+
unlimitedCpuCredits: launchTemplateData.creditSpecification
|
|
426
|
+
? launchTemplateData.creditSpecification.cpuCredits === 'unlimited'
|
|
427
|
+
: undefined,
|
|
428
|
+
});
|
|
464
429
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
430
|
+
command.viewState.imageId = launchTemplateData.imageId;
|
|
431
|
+
}
|
|
468
432
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
433
|
+
if (mode === 'clone' && serverGroup.image && serverGroup.image.name) {
|
|
434
|
+
command.amiName = serverGroup.image.name;
|
|
435
|
+
}
|
|
472
436
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
437
|
+
if (serverGroup.launchConfig && serverGroup.launchConfig.securityGroups.length) {
|
|
438
|
+
command.securityGroups = serverGroup.launchConfig.securityGroups;
|
|
439
|
+
}
|
|
476
440
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
({} as INetworkInterface);
|
|
481
|
-
command.securityGroups = networkInterface.groups;
|
|
482
|
-
}
|
|
441
|
+
if (serverGroup.launchTemplate && serverGroup.launchTemplate.launchTemplateData.securityGroups.length) {
|
|
442
|
+
command.securityGroups = serverGroup.launchTemplate.launchTemplateData.securityGroups;
|
|
443
|
+
}
|
|
483
444
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
445
|
+
if (serverGroup.launchTemplate && serverGroup.launchTemplate.launchTemplateData.networkInterfaces) {
|
|
446
|
+
const networkInterface =
|
|
447
|
+
serverGroup.launchTemplate.launchTemplateData.networkInterfaces.find((ni) => ni.deviceIndex === 0) ??
|
|
448
|
+
({} as INetworkInterface);
|
|
449
|
+
command.securityGroups = networkInterface.groups;
|
|
450
|
+
}
|
|
487
451
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
452
|
+
return command;
|
|
453
|
+
},
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Since Deck allows changing priority of instance types via drag handle, fill priority field explicitly if empty
|
|
458
|
+
function getInstanceTypesWithPriority(
|
|
459
|
+
instanceTypeOverrides: IAmazonLaunchTemplateOverrides[],
|
|
460
|
+
): IAmazonInstanceTypeOverride[] {
|
|
461
|
+
let explicitPriority = 1;
|
|
462
|
+
return _.sortBy(instanceTypeOverrides, ['priority']).map((override) => {
|
|
463
|
+
const { instanceType, weightedCapacity } = override;
|
|
464
|
+
let priority;
|
|
465
|
+
if (override.priority) {
|
|
466
|
+
priority = override.priority;
|
|
467
|
+
explicitPriority = override.priority + 1;
|
|
468
|
+
} else {
|
|
469
|
+
priority = explicitPriority++;
|
|
504
470
|
}
|
|
471
|
+
return { instanceType, weightedCapacity, priority };
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function isSimpleModeEnabled(command: IAmazonServerGroupDeployConfiguration | Partial<IAmazonServerGroupCommand>) {
|
|
476
|
+
const isAdvancedModeEnabledInCommand =
|
|
477
|
+
command.onDemandAllocationStrategy ||
|
|
478
|
+
command.onDemandBaseCapacity ||
|
|
479
|
+
command.onDemandPercentageAboveBaseCapacity ||
|
|
480
|
+
command.spotAllocationStrategy ||
|
|
481
|
+
command.spotInstancePools ||
|
|
482
|
+
(command.launchTemplateOverridesForInstanceType && command.launchTemplateOverridesForInstanceType.length > 0);
|
|
483
|
+
|
|
484
|
+
return !isAdvancedModeEnabledInCommand;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return {
|
|
488
|
+
buildNewServerGroupCommand,
|
|
489
|
+
buildServerGroupCommandFromExisting,
|
|
490
|
+
buildNewServerGroupCommandForPipeline,
|
|
491
|
+
buildServerGroupCommandFromPipeline,
|
|
492
|
+
buildUpdateServerGroupCommand,
|
|
493
|
+
} as AwsServerGroupCommandBuilder;
|
|
494
|
+
}
|
|
505
495
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
496
|
+
export class AwsServerGroupCommandBuilderDelegate implements AwsServerGroupCommandBuilder {
|
|
497
|
+
public static readonly requiresDeckRuntimeServices = true;
|
|
498
|
+
|
|
499
|
+
private delegate: AwsServerGroupCommandBuilder;
|
|
500
|
+
|
|
501
|
+
constructor(_promiseService: unknown, runtimeServices: DeckRuntimeServices) {
|
|
502
|
+
const configurationService = runtimeServices.providerServiceDelegate.getDelegate<
|
|
503
|
+
AwsServerGroupConfigurationService
|
|
504
|
+
>('aws', 'serverGroup.configurationService');
|
|
505
|
+
this.delegate = createAwsServerGroupCommandBuilder(runtimeServices.instanceTypeService, configurationService);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
public buildNewServerGroupCommand(
|
|
509
|
+
application: Application,
|
|
510
|
+
defaults?: { account?: string; region?: string; subnet?: string; mode?: string },
|
|
511
|
+
): Promise<Partial<IAmazonServerGroupCommand>> {
|
|
512
|
+
return this.delegate.buildNewServerGroupCommand(application, defaults);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
public buildServerGroupCommandFromExisting(
|
|
516
|
+
application: Application,
|
|
517
|
+
serverGroup: IAmazonServerGroupView,
|
|
518
|
+
mode?: string,
|
|
519
|
+
): Promise<Partial<IAmazonServerGroupCommand>> {
|
|
520
|
+
return this.delegate.buildServerGroupCommandFromExisting(application, serverGroup, mode);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
public buildNewServerGroupCommandForPipeline(): Promise<Partial<IAmazonServerGroupCommand>> {
|
|
524
|
+
return this.delegate.buildNewServerGroupCommandForPipeline();
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
public buildServerGroupCommandFromPipeline(
|
|
528
|
+
application: Application,
|
|
529
|
+
originalCluster: IAmazonServerGroupDeployConfiguration,
|
|
530
|
+
): Promise<Partial<IAmazonServerGroupCommand>> {
|
|
531
|
+
return this.delegate.buildServerGroupCommandFromPipeline(application, originalCluster);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
public buildUpdateServerGroupCommand(serverGroup: IAmazonServerGroup): Partial<IAmazonServerGroupCommand> {
|
|
535
|
+
return this.delegate.buildUpdateServerGroupCommand(serverGroup);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
519
538
|
|
|
520
|
-
|
|
521
|
-
buildNewServerGroupCommand,
|
|
522
|
-
buildServerGroupCommandFromExisting,
|
|
523
|
-
buildNewServerGroupCommandForPipeline,
|
|
524
|
-
buildServerGroupCommandFromPipeline,
|
|
525
|
-
buildUpdateServerGroupCommand,
|
|
526
|
-
} as AwsServerGroupCommandBuilder;
|
|
527
|
-
},
|
|
528
|
-
]);
|
|
539
|
+
export const AwsServerGroupCommandBuilder = AwsServerGroupCommandBuilderDelegate;
|