@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
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Modal } from 'react-bootstrap';
|
|
3
|
+
|
|
4
|
+
import type { Application, IModalComponentProps, IRouterInjectedProps, ISecurityGroup } from '@spinnaker/core';
|
|
5
|
+
import {
|
|
6
|
+
FirewallLabels,
|
|
7
|
+
ModalClose,
|
|
8
|
+
noop,
|
|
9
|
+
ReactModal,
|
|
10
|
+
SecurityGroupWriter,
|
|
11
|
+
SubmitButton,
|
|
12
|
+
TaskMonitor,
|
|
13
|
+
TaskMonitorWrapper,
|
|
14
|
+
withRouter,
|
|
15
|
+
} from '@spinnaker/core';
|
|
16
|
+
|
|
17
|
+
export type AmazonSecurityGroupModalMode = 'create' | 'edit' | 'clone';
|
|
18
|
+
|
|
19
|
+
interface IAmazonSecurityGroupModalProps extends IModalComponentProps {
|
|
20
|
+
app?: Application;
|
|
21
|
+
application?: Application;
|
|
22
|
+
credentials?: string;
|
|
23
|
+
isNew?: boolean;
|
|
24
|
+
mode?: AmazonSecurityGroupModalMode;
|
|
25
|
+
region?: string;
|
|
26
|
+
securityGroup?: any;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface IIngressRule {
|
|
30
|
+
account?: string;
|
|
31
|
+
accountId?: string;
|
|
32
|
+
accountName?: string;
|
|
33
|
+
cidr?: string;
|
|
34
|
+
endPort: number;
|
|
35
|
+
existing?: boolean;
|
|
36
|
+
id?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
startPort: number;
|
|
39
|
+
type: string;
|
|
40
|
+
vpcId?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface IAmazonSecurityGroupModalState {
|
|
44
|
+
securityGroup: any;
|
|
45
|
+
taskMonitor: TaskMonitor;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function accountFor(securityGroup: any): string {
|
|
49
|
+
return (
|
|
50
|
+
securityGroup.credentials || securityGroup.accountName || securityGroup.accountId || securityGroup.account || ''
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ipIngressFromInboundRules(securityGroup: any): IIngressRule[] {
|
|
55
|
+
return (securityGroup.inboundRules || [])
|
|
56
|
+
.filter((rule: any) => rule.range)
|
|
57
|
+
.reduce((rules: IIngressRule[], rule: any) => {
|
|
58
|
+
(rule.portRanges || []).forEach((portRange: any) => {
|
|
59
|
+
rules.push({
|
|
60
|
+
cidr: rule.range.ip + rule.range.cidr,
|
|
61
|
+
type: rule.protocol,
|
|
62
|
+
startPort: portRange.startPort,
|
|
63
|
+
endPort: portRange.endPort,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
return rules;
|
|
67
|
+
}, []);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function securityGroupIngressFromInboundRules(securityGroup: any, mode: AmazonSecurityGroupModalMode): IIngressRule[] {
|
|
71
|
+
return (securityGroup.inboundRules || [])
|
|
72
|
+
.filter((rule: any) => rule.securityGroup)
|
|
73
|
+
.reduce((rules: IIngressRule[], rule: any) => {
|
|
74
|
+
(rule.portRanges || []).forEach((portRange: any) => {
|
|
75
|
+
const referencedGroup = rule.securityGroup;
|
|
76
|
+
const existing = mode === 'edit';
|
|
77
|
+
rules.push({
|
|
78
|
+
...(existing
|
|
79
|
+
? {
|
|
80
|
+
account: referencedGroup.account,
|
|
81
|
+
accountId: referencedGroup.accountId,
|
|
82
|
+
accountName: referencedGroup.accountName || referencedGroup.accountId,
|
|
83
|
+
existing: true,
|
|
84
|
+
id: referencedGroup.id,
|
|
85
|
+
vpcId: referencedGroup.vpcId !== securityGroup.vpcId ? referencedGroup.vpcId : null,
|
|
86
|
+
}
|
|
87
|
+
: {}),
|
|
88
|
+
name: referencedGroup.inferredName ? null : referencedGroup.name,
|
|
89
|
+
type: rule.protocol,
|
|
90
|
+
startPort: portRange.startPort,
|
|
91
|
+
endPort: portRange.endPort,
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
return rules;
|
|
95
|
+
}, []);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function initializeAmazonSecurityGroupForModal(props: IAmazonSecurityGroupModalProps, appName: string): any {
|
|
99
|
+
const source = props.securityGroup || {};
|
|
100
|
+
const account = accountFor(source) || props.credentials || '';
|
|
101
|
+
const region = source.region || props.region || source.regions?.[0] || '';
|
|
102
|
+
const mode = props.mode || 'create';
|
|
103
|
+
const name = source.name || appName;
|
|
104
|
+
const securityGroup = {
|
|
105
|
+
...source,
|
|
106
|
+
account,
|
|
107
|
+
accountId: source.accountId || account,
|
|
108
|
+
accountName: source.accountName || account,
|
|
109
|
+
credentials: account,
|
|
110
|
+
description: source.description || '',
|
|
111
|
+
ipIngress: source.ipIngress || ipIngressFromInboundRules(source),
|
|
112
|
+
name,
|
|
113
|
+
region,
|
|
114
|
+
regions: [region].filter(Boolean),
|
|
115
|
+
securityGroupIngress: source.securityGroupIngress || securityGroupIngressFromInboundRules(source, mode),
|
|
116
|
+
vpcId: source.vpcId || '',
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
if (mode === 'clone') {
|
|
120
|
+
delete securityGroup.id;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return securityGroup;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function isValidRule(rule: IIngressRule): boolean {
|
|
127
|
+
return !!rule.type && rule.startPort !== undefined && rule.endPort !== undefined;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function isAmazonSecurityGroupValid(securityGroup: any): boolean {
|
|
131
|
+
return (
|
|
132
|
+
!!securityGroup.name &&
|
|
133
|
+
!!accountFor(securityGroup) &&
|
|
134
|
+
!!securityGroup.region &&
|
|
135
|
+
(securityGroup.ipIngress || []).every((rule: IIngressRule) => !!rule.cidr && isValidRule(rule)) &&
|
|
136
|
+
(securityGroup.securityGroupIngress || []).every(
|
|
137
|
+
(rule: IIngressRule) => !!(rule.name || rule.id) && isValidRule(rule),
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export class AmazonSecurityGroupModalComponent extends React.Component<
|
|
143
|
+
IAmazonSecurityGroupModalProps & IRouterInjectedProps,
|
|
144
|
+
IAmazonSecurityGroupModalState
|
|
145
|
+
> {
|
|
146
|
+
public static defaultProps: Partial<IAmazonSecurityGroupModalProps> = {
|
|
147
|
+
closeModal: noop,
|
|
148
|
+
dismissModal: noop,
|
|
149
|
+
mode: 'create',
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
public static show(props: IAmazonSecurityGroupModalProps): Promise<any> {
|
|
153
|
+
return ReactModal.show(AmazonSecurityGroupModal, props, { dialogClassName: 'modal-lg' });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
constructor(props: IAmazonSecurityGroupModalProps & IRouterInjectedProps) {
|
|
157
|
+
super(props);
|
|
158
|
+
const app = this.getApplication(props);
|
|
159
|
+
this.state = {
|
|
160
|
+
securityGroup: initializeAmazonSecurityGroupForModal(props, app.name),
|
|
161
|
+
taskMonitor: new TaskMonitor({
|
|
162
|
+
application: app,
|
|
163
|
+
title: `${this.getMode(props) === 'edit' ? 'Updating' : 'Creating'} your ${FirewallLabels.get('firewall')}`,
|
|
164
|
+
onDismiss: () => props.dismissModal(),
|
|
165
|
+
onTaskComplete: this.onTaskComplete,
|
|
166
|
+
}),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private getApplication(props = this.props): Application {
|
|
171
|
+
return (props.app || props.application) as Application;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
private getMode(props = this.props): AmazonSecurityGroupModalMode {
|
|
175
|
+
return props.mode || 'create';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
private updateSecurityGroup = (updates: any): void => {
|
|
179
|
+
this.setState(({ securityGroup }) => ({ securityGroup: { ...securityGroup, ...updates } }));
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
private updateRule = (
|
|
183
|
+
collection: 'ipIngress' | 'securityGroupIngress',
|
|
184
|
+
index: number,
|
|
185
|
+
updates: Partial<IIngressRule>,
|
|
186
|
+
) => {
|
|
187
|
+
const rules = this.state.securityGroup[collection].slice();
|
|
188
|
+
rules[index] = { ...rules[index], ...updates };
|
|
189
|
+
this.updateSecurityGroup({ [collection]: rules });
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
private addIpRule = (): void => {
|
|
193
|
+
this.updateSecurityGroup({
|
|
194
|
+
ipIngress: [
|
|
195
|
+
...this.state.securityGroup.ipIngress,
|
|
196
|
+
{ cidr: '0.0.0.0/0', type: 'tcp', startPort: 7001, endPort: 7001 },
|
|
197
|
+
],
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
private addSecurityGroupRule = (): void => {
|
|
202
|
+
this.updateSecurityGroup({
|
|
203
|
+
securityGroupIngress: [
|
|
204
|
+
...this.state.securityGroup.securityGroupIngress,
|
|
205
|
+
{ name: '', type: 'tcp', startPort: 7001, endPort: 7001 },
|
|
206
|
+
],
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
private removeRule = (collection: 'ipIngress' | 'securityGroupIngress', index: number): void => {
|
|
211
|
+
this.updateSecurityGroup({
|
|
212
|
+
[collection]: this.state.securityGroup[collection].filter((_rule: any, ruleIndex: number) => ruleIndex !== index),
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
private onTaskComplete = (): void => {
|
|
217
|
+
const app = this.getApplication();
|
|
218
|
+
app.securityGroups?.refresh?.();
|
|
219
|
+
this.props.closeModal();
|
|
220
|
+
|
|
221
|
+
if (this.getMode() === 'edit') {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const { securityGroup } = this.state;
|
|
226
|
+
this.props.stateService.go(
|
|
227
|
+
this.props.stateService.includes('**.firewallDetails') ? '^.firewallDetails' : '.firewallDetails',
|
|
228
|
+
{
|
|
229
|
+
accountId: accountFor(securityGroup),
|
|
230
|
+
name: securityGroup.name,
|
|
231
|
+
provider: 'aws',
|
|
232
|
+
region: securityGroup.region,
|
|
233
|
+
vpcId: securityGroup.vpcId,
|
|
234
|
+
},
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
private submit = (): void => {
|
|
239
|
+
const app = this.getApplication();
|
|
240
|
+
const { securityGroup } = this.state;
|
|
241
|
+
const credentials = accountFor(securityGroup);
|
|
242
|
+
const command = {
|
|
243
|
+
...securityGroup,
|
|
244
|
+
account: credentials,
|
|
245
|
+
accountId: credentials,
|
|
246
|
+
accountName: credentials,
|
|
247
|
+
cloudProvider: 'aws',
|
|
248
|
+
credentials,
|
|
249
|
+
regions: [securityGroup.region],
|
|
250
|
+
} as ISecurityGroup;
|
|
251
|
+
const descriptor = this.getMode() === 'edit' ? 'Update' : this.getMode() === 'clone' ? 'Clone' : 'Create';
|
|
252
|
+
|
|
253
|
+
this.state.taskMonitor.submit(() => SecurityGroupWriter.upsertSecurityGroup(command, app, descriptor));
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
private renderTextField(label: string, value: string, onChange: (value: string) => void): JSX.Element {
|
|
257
|
+
return (
|
|
258
|
+
<div className="form-group row">
|
|
259
|
+
<label className="col-md-3 sm-label-right">{label}</label>
|
|
260
|
+
<div className="col-md-7">
|
|
261
|
+
<input
|
|
262
|
+
className="form-control input-sm"
|
|
263
|
+
value={value || ''}
|
|
264
|
+
onChange={(event) => onChange(event.target.value)}
|
|
265
|
+
/>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
private renderIpRules(): JSX.Element {
|
|
272
|
+
const rules = this.state.securityGroup.ipIngress || [];
|
|
273
|
+
return (
|
|
274
|
+
<div>
|
|
275
|
+
<h5>IP Ingress</h5>
|
|
276
|
+
{rules.map((rule: IIngressRule, index: number) => (
|
|
277
|
+
<div className="row" key={`ip-${index}`}>
|
|
278
|
+
<div className="col-md-3">
|
|
279
|
+
<input
|
|
280
|
+
className="form-control input-sm"
|
|
281
|
+
value={rule.cidr || ''}
|
|
282
|
+
onChange={(event) => this.updateRule('ipIngress', index, { cidr: event.target.value })}
|
|
283
|
+
/>
|
|
284
|
+
</div>
|
|
285
|
+
<div className="col-md-2">
|
|
286
|
+
<input
|
|
287
|
+
className="form-control input-sm"
|
|
288
|
+
value={rule.type || ''}
|
|
289
|
+
onChange={(event) => this.updateRule('ipIngress', index, { type: event.target.value })}
|
|
290
|
+
/>
|
|
291
|
+
</div>
|
|
292
|
+
<div className="col-md-2">
|
|
293
|
+
<input
|
|
294
|
+
className="form-control input-sm"
|
|
295
|
+
type="number"
|
|
296
|
+
value={rule.startPort}
|
|
297
|
+
onChange={(event) => this.updateRule('ipIngress', index, { startPort: Number(event.target.value) })}
|
|
298
|
+
/>
|
|
299
|
+
</div>
|
|
300
|
+
<div className="col-md-2">
|
|
301
|
+
<input
|
|
302
|
+
className="form-control input-sm"
|
|
303
|
+
type="number"
|
|
304
|
+
value={rule.endPort}
|
|
305
|
+
onChange={(event) => this.updateRule('ipIngress', index, { endPort: Number(event.target.value) })}
|
|
306
|
+
/>
|
|
307
|
+
</div>
|
|
308
|
+
<div className="col-md-1">
|
|
309
|
+
<Button bsSize="xsmall" onClick={() => this.removeRule('ipIngress', index)}>
|
|
310
|
+
Remove
|
|
311
|
+
</Button>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
))}
|
|
315
|
+
<Button bsSize="small" onClick={this.addIpRule}>
|
|
316
|
+
Add IP Rule
|
|
317
|
+
</Button>
|
|
318
|
+
</div>
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
private renderSecurityGroupRules(): JSX.Element {
|
|
323
|
+
const rules = this.state.securityGroup.securityGroupIngress || [];
|
|
324
|
+
return (
|
|
325
|
+
<div>
|
|
326
|
+
<h5>{FirewallLabels.get('Firewall')} Ingress</h5>
|
|
327
|
+
{rules.map((rule: IIngressRule, index: number) => (
|
|
328
|
+
<div className="row" key={`sg-${index}`}>
|
|
329
|
+
<div className="col-md-3">
|
|
330
|
+
{rule.existing ? (
|
|
331
|
+
<span className="form-control-static">{rule.name || rule.id}</span>
|
|
332
|
+
) : (
|
|
333
|
+
<input
|
|
334
|
+
className="form-control input-sm"
|
|
335
|
+
value={rule.name || ''}
|
|
336
|
+
onChange={(event) => this.updateRule('securityGroupIngress', index, { name: event.target.value })}
|
|
337
|
+
/>
|
|
338
|
+
)}
|
|
339
|
+
</div>
|
|
340
|
+
<div className="col-md-2">
|
|
341
|
+
<input
|
|
342
|
+
className="form-control input-sm"
|
|
343
|
+
value={rule.type || ''}
|
|
344
|
+
onChange={(event) => this.updateRule('securityGroupIngress', index, { type: event.target.value })}
|
|
345
|
+
/>
|
|
346
|
+
</div>
|
|
347
|
+
<div className="col-md-2">
|
|
348
|
+
<input
|
|
349
|
+
className="form-control input-sm"
|
|
350
|
+
type="number"
|
|
351
|
+
value={rule.startPort}
|
|
352
|
+
onChange={(event) =>
|
|
353
|
+
this.updateRule('securityGroupIngress', index, { startPort: Number(event.target.value) })
|
|
354
|
+
}
|
|
355
|
+
/>
|
|
356
|
+
</div>
|
|
357
|
+
<div className="col-md-2">
|
|
358
|
+
<input
|
|
359
|
+
className="form-control input-sm"
|
|
360
|
+
type="number"
|
|
361
|
+
value={rule.endPort}
|
|
362
|
+
onChange={(event) =>
|
|
363
|
+
this.updateRule('securityGroupIngress', index, { endPort: Number(event.target.value) })
|
|
364
|
+
}
|
|
365
|
+
/>
|
|
366
|
+
</div>
|
|
367
|
+
<div className="col-md-1">
|
|
368
|
+
<Button bsSize="xsmall" onClick={() => this.removeRule('securityGroupIngress', index)}>
|
|
369
|
+
Remove
|
|
370
|
+
</Button>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
))}
|
|
374
|
+
<Button bsSize="small" onClick={this.addSecurityGroupRule}>
|
|
375
|
+
Add {FirewallLabels.get('Firewall')} Rule
|
|
376
|
+
</Button>
|
|
377
|
+
</div>
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
public render(): JSX.Element {
|
|
382
|
+
const { securityGroup, taskMonitor } = this.state;
|
|
383
|
+
const mode = this.getMode();
|
|
384
|
+
const valid = isAmazonSecurityGroupValid(securityGroup);
|
|
385
|
+
return (
|
|
386
|
+
<>
|
|
387
|
+
<TaskMonitorWrapper monitor={taskMonitor} />
|
|
388
|
+
<ModalClose dismiss={this.props.dismissModal} />
|
|
389
|
+
<Modal.Header>
|
|
390
|
+
<Modal.Title>
|
|
391
|
+
{mode === 'edit' ? 'Edit' : mode === 'clone' ? 'Clone' : 'Create'} {FirewallLabels.get('Firewall')}
|
|
392
|
+
</Modal.Title>
|
|
393
|
+
</Modal.Header>
|
|
394
|
+
<Modal.Body>
|
|
395
|
+
{this.renderTextField('Account', accountFor(securityGroup), (credentials) =>
|
|
396
|
+
this.updateSecurityGroup({
|
|
397
|
+
account: credentials,
|
|
398
|
+
accountId: credentials,
|
|
399
|
+
accountName: credentials,
|
|
400
|
+
credentials,
|
|
401
|
+
}),
|
|
402
|
+
)}
|
|
403
|
+
{this.renderTextField('Region', securityGroup.region, (region) =>
|
|
404
|
+
this.updateSecurityGroup({ region, regions: [region] }),
|
|
405
|
+
)}
|
|
406
|
+
{this.renderTextField('VPC ID', securityGroup.vpcId, (vpcId) => this.updateSecurityGroup({ vpcId }))}
|
|
407
|
+
{this.renderTextField('Name', securityGroup.name, (name) => this.updateSecurityGroup({ name }))}
|
|
408
|
+
{this.renderTextField('Description', securityGroup.description, (description) =>
|
|
409
|
+
this.updateSecurityGroup({ description }),
|
|
410
|
+
)}
|
|
411
|
+
<div className="well">
|
|
412
|
+
<div className="row small text-bold">
|
|
413
|
+
<div className="col-md-3">CIDR / {FirewallLabels.get('Firewall')}</div>
|
|
414
|
+
<div className="col-md-2">Protocol</div>
|
|
415
|
+
<div className="col-md-2">Start Port</div>
|
|
416
|
+
<div className="col-md-2">End Port</div>
|
|
417
|
+
</div>
|
|
418
|
+
{this.renderIpRules()}
|
|
419
|
+
{this.renderSecurityGroupRules()}
|
|
420
|
+
</div>
|
|
421
|
+
</Modal.Body>
|
|
422
|
+
<Modal.Footer>
|
|
423
|
+
<Button onClick={this.props.dismissModal}>Cancel</Button>
|
|
424
|
+
<SubmitButton
|
|
425
|
+
isDisabled={!valid}
|
|
426
|
+
isFormSubmit={false}
|
|
427
|
+
submitting={taskMonitor.submitting}
|
|
428
|
+
onClick={this.submit}
|
|
429
|
+
label={mode === 'edit' ? 'Update' : mode === 'clone' ? 'Clone' : 'Create'}
|
|
430
|
+
/>
|
|
431
|
+
</Modal.Footer>
|
|
432
|
+
</>
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export const AmazonSecurityGroupModal = Object.assign(
|
|
438
|
+
withRouter<IAmazonSecurityGroupModalProps & IRouterInjectedProps>(AmazonSecurityGroupModalComponent),
|
|
439
|
+
{ show: AmazonSecurityGroupModalComponent.show },
|
|
440
|
+
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AmazonSecurityGroupDetailsComponent as AmazonSecurityGroupDetails } from './AmazonSecurityGroupDetails';
|
|
2
|
+
import { VpcReader } from '../../vpc/VpcReader';
|
|
3
|
+
|
|
4
|
+
const tick = () => new Promise((resolve) => setTimeout(resolve));
|
|
5
|
+
|
|
6
|
+
describe('AmazonSecurityGroupDetails', () => {
|
|
7
|
+
it('replaces missing details through the injected state service', () => {
|
|
8
|
+
const stateService = { go: jasmine.createSpy('go') };
|
|
9
|
+
const component = new AmazonSecurityGroupDetails({
|
|
10
|
+
app: { isStandalone: false },
|
|
11
|
+
resolvedSecurityGroup: { accountId: 'test-account', name: 'missing', region: 'us-west-2' },
|
|
12
|
+
router: {},
|
|
13
|
+
stateParams: {},
|
|
14
|
+
stateService,
|
|
15
|
+
} as any);
|
|
16
|
+
|
|
17
|
+
(component as any).autoClose();
|
|
18
|
+
|
|
19
|
+
expect(stateService.go).toHaveBeenCalledWith('^', { allowModalToStayOpen: true }, { location: 'replace' });
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('does not update state when the VPC lookup resolves after unmount', async () => {
|
|
23
|
+
const details = {
|
|
24
|
+
accountId: 'test-account',
|
|
25
|
+
id: 'sg-123',
|
|
26
|
+
name: 'test-security-group',
|
|
27
|
+
region: 'us-west-2',
|
|
28
|
+
vpcId: 'vpc-1',
|
|
29
|
+
};
|
|
30
|
+
const securityGroupReader = {
|
|
31
|
+
getApplicationSecurityGroup: jasmine.createSpy('getApplicationSecurityGroup').and.returnValue(details),
|
|
32
|
+
getSecurityGroupDetails: jasmine.createSpy('getSecurityGroupDetails').and.returnValue(Promise.resolve(details)),
|
|
33
|
+
};
|
|
34
|
+
let resolveVpcName: (vpcName: string) => void;
|
|
35
|
+
const vpcName = new Promise<string>((resolve) => {
|
|
36
|
+
resolveVpcName = resolve;
|
|
37
|
+
});
|
|
38
|
+
spyOn(VpcReader, 'getVpcName').and.returnValue(vpcName);
|
|
39
|
+
const component = new AmazonSecurityGroupDetails({
|
|
40
|
+
app: { isStandalone: false } as any,
|
|
41
|
+
resolvedSecurityGroup: {
|
|
42
|
+
accountId: 'test-account',
|
|
43
|
+
name: 'test-security-group',
|
|
44
|
+
region: 'us-west-2',
|
|
45
|
+
vpcId: 'vpc-1',
|
|
46
|
+
},
|
|
47
|
+
securityGroupReader: securityGroupReader as any,
|
|
48
|
+
});
|
|
49
|
+
spyOn(component, 'setState');
|
|
50
|
+
|
|
51
|
+
(component as any).loadSecurityGroup();
|
|
52
|
+
await tick();
|
|
53
|
+
expect(VpcReader.getVpcName).toHaveBeenCalledWith('vpc-1');
|
|
54
|
+
(component.setState as jasmine.Spy).calls.reset();
|
|
55
|
+
|
|
56
|
+
component.componentWillUnmount();
|
|
57
|
+
resolveVpcName('Main VPC');
|
|
58
|
+
await tick();
|
|
59
|
+
|
|
60
|
+
expect(component.setState).not.toHaveBeenCalled();
|
|
61
|
+
});
|
|
62
|
+
});
|