@spinnaker/amazon 0.13.9 → 0.14.1

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.
Files changed (110) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/aws.validators.d.ts +1 -0
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/pipeline/stages/deleteLambda/DeleteLambdaFunctionStageForm.d.ts +3 -0
  6. package/dist/pipeline/stages/deleteLambda/LambdaDeleteStage.d.ts +8 -0
  7. package/dist/pipeline/stages/deleteLambda/constants/deleteVersion.constants.d.ts +6 -0
  8. package/dist/pipeline/stages/deleteLambda/constants/deleteVersion.picker.d.ts +16 -0
  9. package/dist/pipeline/stages/deleteLambda/constants/index.d.ts +2 -0
  10. package/dist/pipeline/stages/deleteLambda/index.d.ts +1 -0
  11. package/dist/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.d.ts +3 -0
  12. package/dist/pipeline/stages/deployLambda/components/BasicSettingsForm.d.ts +3 -0
  13. package/dist/pipeline/stages/deployLambda/components/EnvironmentForm.d.ts +2 -0
  14. package/dist/pipeline/stages/deployLambda/components/ExecutionRoleForm.d.ts +2 -0
  15. package/dist/pipeline/stages/deployLambda/components/LambdaAtEdgeForm.d.ts +3 -0
  16. package/dist/pipeline/stages/deployLambda/components/NetworkForm.d.ts +3 -0
  17. package/dist/pipeline/stages/deployLambda/components/TriggerEventsForm.d.ts +3 -0
  18. package/dist/pipeline/stages/deployLambda/components/function.constants.d.ts +5 -0
  19. package/dist/pipeline/stages/deployLambda/components/index.d.ts +5 -0
  20. package/dist/pipeline/stages/deployLambda/config/LambdaDeploymentStage.d.ts +3 -0
  21. package/dist/pipeline/stages/deployLambda/config/LambdaDeploymentStageConfig.d.ts +4 -0
  22. package/dist/pipeline/stages/deployLambda/config/LambdaDeploymentStageExecutionDetails.d.ts +6 -0
  23. package/dist/pipeline/stages/deployLambda/config/UpsertDefaults.d.ts +1 -0
  24. package/dist/pipeline/stages/deployLambda/config/function.defaults.d.ts +2 -0
  25. package/dist/pipeline/stages/deployLambda/index.d.ts +1 -0
  26. package/dist/pipeline/stages/invokeLambda/InvokeLambdaFunctionStageForm.d.ts +3 -0
  27. package/dist/pipeline/stages/invokeLambda/LambdaInvokeStage.d.ts +8 -0
  28. package/dist/pipeline/stages/invokeLambda/components/InvokeLambdaOperation.d.ts +3 -0
  29. package/dist/pipeline/stages/invokeLambda/components/index.d.ts +1 -0
  30. package/dist/pipeline/stages/invokeLambda/index.d.ts +1 -0
  31. package/dist/pipeline/stages/routeLambda/LambdaRouteStage.d.ts +8 -0
  32. package/dist/pipeline/stages/routeLambda/RouteLambdaFunctionStageForm.d.ts +3 -0
  33. package/dist/pipeline/stages/routeLambda/TriggerEventsForm.d.ts +3 -0
  34. package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/BlueGreenDeploymentForm.d.ts +3 -0
  35. package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/HealthCheckStrategy.d.ts +3 -0
  36. package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/InvocationHealthCheck.d.ts +3 -0
  37. package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/health.constants.d.ts +5 -0
  38. package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/index.d.ts +1 -0
  39. package/dist/pipeline/stages/routeLambda/components/DeploymentStrategyForm.d.ts +3 -0
  40. package/dist/pipeline/stages/routeLambda/components/RenderStrategy.d.ts +3 -0
  41. package/dist/pipeline/stages/routeLambda/components/SimpleDeploymentForm.d.ts +3 -0
  42. package/dist/pipeline/stages/routeLambda/components/VersionPicker.d.ts +14 -0
  43. package/dist/pipeline/stages/routeLambda/components/WeightedDeploymentForm.d.ts +3 -0
  44. package/dist/pipeline/stages/routeLambda/components/index.d.ts +1 -0
  45. package/dist/pipeline/stages/routeLambda/constants/index.d.ts +3 -0
  46. package/dist/pipeline/stages/routeLambda/constants/strategy.constants.d.ts +6 -0
  47. package/dist/pipeline/stages/routeLambda/constants/strategy.picker.d.ts +16 -0
  48. package/dist/pipeline/stages/routeLambda/constants/versions.constants.d.ts +6 -0
  49. package/dist/pipeline/stages/routeLambda/index.d.ts +1 -0
  50. package/dist/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStage.d.ts +3 -0
  51. package/dist/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStageConfig.d.ts +5 -0
  52. package/dist/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStageExecutionDetails.d.ts +6 -0
  53. package/dist/pipeline/stages/updateCodeLambda/components/UpdateCodeStageForm.d.ts +3 -0
  54. package/dist/pipeline/stages/updateCodeLambda/components/index.d.ts +1 -0
  55. package/dist/pipeline/stages/updateCodeLambda/index.d.ts +1 -0
  56. package/package.json +3 -3
  57. package/src/aws.module.ts +6 -6
  58. package/src/aws.validators.ts +7 -3
  59. package/src/pipeline/stages/deleteLambda/DeleteLambdaFunctionStageForm.tsx +143 -0
  60. package/src/pipeline/stages/deleteLambda/LambdaDeleteStage.tsx +86 -0
  61. package/src/pipeline/stages/deleteLambda/constants/deleteVersion.constants.ts +37 -0
  62. package/src/pipeline/stages/deleteLambda/constants/deleteVersion.picker.tsx +47 -0
  63. package/src/pipeline/stages/deleteLambda/constants/index.ts +5 -0
  64. package/src/pipeline/stages/deleteLambda/index.ts +11 -0
  65. package/src/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.tsx +139 -0
  66. package/src/pipeline/stages/deployLambda/components/BasicSettingsForm.tsx +176 -0
  67. package/src/pipeline/stages/deployLambda/components/EnvironmentForm.tsx +24 -0
  68. package/src/pipeline/stages/deployLambda/components/ExecutionRoleForm.tsx +15 -0
  69. package/src/pipeline/stages/deployLambda/components/LambdaAtEdgeForm.tsx +28 -0
  70. package/src/pipeline/stages/deployLambda/components/NetworkForm.tsx +123 -0
  71. package/src/pipeline/stages/deployLambda/components/TriggerEventsForm.tsx +49 -0
  72. package/src/pipeline/stages/deployLambda/components/function.constants.ts +32 -0
  73. package/src/pipeline/stages/deployLambda/components/index.ts +8 -0
  74. package/src/pipeline/stages/deployLambda/config/LambdaDeploymentStage.tsx +20 -0
  75. package/src/pipeline/stages/deployLambda/config/LambdaDeploymentStageConfig.tsx +64 -0
  76. package/src/pipeline/stages/deployLambda/config/LambdaDeploymentStageExecutionDetails.tsx +31 -0
  77. package/src/pipeline/stages/deployLambda/config/UpsertDefaults.tsx +21 -0
  78. package/src/pipeline/stages/deployLambda/config/function.defaults.ts +39 -0
  79. package/src/pipeline/stages/deployLambda/index.ts +11 -0
  80. package/src/pipeline/stages/invokeLambda/InvokeLambdaFunctionStageForm.tsx +106 -0
  81. package/src/pipeline/stages/invokeLambda/LambdaInvokeStage.tsx +125 -0
  82. package/src/pipeline/stages/invokeLambda/components/InvokeLambdaOperation.tsx +77 -0
  83. package/src/pipeline/stages/invokeLambda/components/index.ts +4 -0
  84. package/src/pipeline/stages/invokeLambda/index.ts +11 -0
  85. package/src/pipeline/stages/routeLambda/LambdaRouteStage.tsx +98 -0
  86. package/src/pipeline/stages/routeLambda/RouteLambdaFunctionStageForm.tsx +151 -0
  87. package/src/pipeline/stages/routeLambda/TriggerEventsForm.tsx +51 -0
  88. package/src/pipeline/stages/routeLambda/components/BlueGreenDeployment/BlueGreenDeploymentForm.tsx +27 -0
  89. package/src/pipeline/stages/routeLambda/components/BlueGreenDeployment/HealthCheckStrategy.tsx +21 -0
  90. package/src/pipeline/stages/routeLambda/components/BlueGreenDeployment/InvocationHealthCheck.tsx +93 -0
  91. package/src/pipeline/stages/routeLambda/components/BlueGreenDeployment/health.constants.ts +14 -0
  92. package/src/pipeline/stages/routeLambda/components/BlueGreenDeployment/index.ts +4 -0
  93. package/src/pipeline/stages/routeLambda/components/DeploymentStrategyForm.tsx +18 -0
  94. package/src/pipeline/stages/routeLambda/components/RenderStrategy.tsx +23 -0
  95. package/src/pipeline/stages/routeLambda/components/SimpleDeploymentForm.tsx +67 -0
  96. package/src/pipeline/stages/routeLambda/components/VersionPicker.tsx +43 -0
  97. package/src/pipeline/stages/routeLambda/components/WeightedDeploymentForm.tsx +107 -0
  98. package/src/pipeline/stages/routeLambda/components/index.ts +4 -0
  99. package/src/pipeline/stages/routeLambda/constants/index.ts +6 -0
  100. package/src/pipeline/stages/routeLambda/constants/strategy.constants.tsx +26 -0
  101. package/src/pipeline/stages/routeLambda/constants/strategy.picker.tsx +47 -0
  102. package/src/pipeline/stages/routeLambda/constants/versions.constants.ts +31 -0
  103. package/src/pipeline/stages/routeLambda/index.ts +11 -0
  104. package/src/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStage.tsx +20 -0
  105. package/src/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStageConfig.tsx +41 -0
  106. package/src/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStageExecutionDetails.tsx +31 -0
  107. package/src/pipeline/stages/updateCodeLambda/components/UpdateCodeStageForm.tsx +122 -0
  108. package/src/pipeline/stages/updateCodeLambda/components/index.ts +4 -0
  109. package/src/pipeline/stages/updateCodeLambda/index.ts +11 -0
  110. package/src/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.tsx +2 -2
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function DeleteLambdaFunctionStageForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { IExecutionDetailsSectionProps, IStageTypeConfig } from '@spinnaker/core';
3
+ export declare function DeleteLambdaExecutionDetails(props: IExecutionDetailsSectionProps): JSX.Element;
4
+ export declare const initialize: () => void;
5
+ export declare namespace DeleteLambdaExecutionDetails {
6
+ const title = "Delete Lambda Stage";
7
+ }
8
+ export declare const lambdaDeleteStage: IStageTypeConfig;
@@ -0,0 +1,6 @@
1
+ export interface IDeleteVersionConstant {
2
+ description: string;
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export declare const DeleteVersionList: IDeleteVersionConstant[];
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export interface IVersionPickerProps {
4
+ config: IFormikStageConfigInjectedProps;
5
+ value: string;
6
+ showingDetails: boolean;
7
+ }
8
+ export interface IVersionPickerState {
9
+ value: string;
10
+ label: string;
11
+ description: string;
12
+ }
13
+ export declare class DeleteVersionPicker extends React.Component<IVersionPickerProps, IVersionPickerState> {
14
+ constructor(props: IVersionPickerProps);
15
+ render(): JSX.Element;
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from './deleteVersion.constants';
2
+ export * from './deleteVersion.picker';
@@ -0,0 +1 @@
1
+ export * from './LambdaDeleteStage';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function AwsLambdaFunctionStageForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function BasicSettingsForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function ExecutionRoleForm(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function ExecutionRoleForm(): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function LambdaAtEdgeForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function NetworkForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function TriggerEventsForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const availableRuntimes: string[];
2
+ export declare const lambdaHelpFields: {
3
+ stack: string;
4
+ detail: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ export * from './BasicSettingsForm';
2
+ export * from './NetworkForm';
3
+ export * from './ExecutionRoleForm';
4
+ export * from './TriggerEventsForm';
5
+ export * from './LambdaAtEdgeForm';
@@ -0,0 +1,3 @@
1
+ import type { IStageTypeConfig } from '@spinnaker/core';
2
+ export declare const initialize: () => void;
3
+ export declare const lambdaDeploymentStage: IStageTypeConfig;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { IStage, IStageConfigProps } from '@spinnaker/core';
3
+ export declare function LambdaDeploymentConfig(props: IStageConfigProps): JSX.Element;
4
+ export declare function validate(stageConfig: IStage): any;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { IExecutionDetailsSectionProps } from '@spinnaker/core';
3
+ export declare function LambdaDeploymentExecutionDetails(props: IExecutionDetailsSectionProps): JSX.Element;
4
+ export declare namespace LambdaDeploymentExecutionDetails {
5
+ const title = "Lambda Deployment Stage";
6
+ }
@@ -0,0 +1 @@
1
+ export declare function upsertDefaults(initialValues: any, defaultValues: any): any;
@@ -0,0 +1,2 @@
1
+ import type { IAmazonFunctionUpsertCommand } from '../../../../domain';
2
+ export declare function constructNewAwsFunctionTemplate(): IAmazonFunctionUpsertCommand;
@@ -0,0 +1 @@
1
+ export * from './config/LambdaDeploymentStage';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function InvokeLambdaFunctionStageForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { IExecutionDetailsSectionProps, IStageTypeConfig } from '@spinnaker/core';
3
+ export declare function InvokeLambdaExecutionDetails(props: IExecutionDetailsSectionProps): JSX.Element;
4
+ export declare const initialize: () => void;
5
+ export declare namespace InvokeLambdaExecutionDetails {
6
+ const title = "Invoke Lambda Stage";
7
+ }
8
+ export declare const lambdaInvokeStage: IStageTypeConfig;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function InvokeLambdaOperation(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './InvokeLambdaOperation';
@@ -0,0 +1 @@
1
+ export * from './LambdaInvokeStage';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { IExecutionDetailsSectionProps, IStageTypeConfig } from '@spinnaker/core';
3
+ export declare function RouteLambdaExecutionDetails(props: IExecutionDetailsSectionProps): JSX.Element;
4
+ export declare const initialize: () => void;
5
+ export declare namespace RouteLambdaExecutionDetails {
6
+ const title = "Route Lambda Traffic Stage";
7
+ }
8
+ export declare const lambdaRouteStage: IStageTypeConfig;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function RouteLambdaFunctionStageForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function TriggerEventsForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function BlueGreenDeploymentForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function retrieveHealthCheck(value: string, props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function InvokeLambdaHealthCheck(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface IHealthConstant {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ export declare const HealthCheckList: IHealthConstant[];
@@ -0,0 +1 @@
1
+ export * from './BlueGreenDeploymentForm';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function DeploymentStrategyForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function retrieveComponent(value: string, props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function SimpleDeploymentForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export interface IVersionPickerProps {
3
+ value: string;
4
+ showingDetails: boolean;
5
+ }
6
+ export interface IVersionPickerState {
7
+ value: string;
8
+ label: string;
9
+ description: string;
10
+ }
11
+ export declare class VersionPicker extends React.Component<IVersionPickerProps, IVersionPickerState> {
12
+ constructor(props: IVersionPickerProps);
13
+ render(): JSX.Element;
14
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function WeightedDeploymentForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './DeploymentStrategyForm';
@@ -0,0 +1,3 @@
1
+ export * from './strategy.constants';
2
+ export * from './strategy.picker';
3
+ export * from './versions.constants';
@@ -0,0 +1,6 @@
1
+ export interface IStrategyConstant {
2
+ description: string;
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export declare const DeploymentStrategyList: IStrategyConstant[];
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export interface IVersionPickerProps {
4
+ config: IFormikStageConfigInjectedProps;
5
+ value: string;
6
+ showingDetails: boolean;
7
+ }
8
+ export interface IVersionPickerState {
9
+ value: string;
10
+ label: string;
11
+ description: string;
12
+ }
13
+ export declare class DeploymentStrategyPicker extends React.Component<IVersionPickerProps, IVersionPickerState> {
14
+ constructor(props: IVersionPickerProps);
15
+ render(): JSX.Element;
16
+ }
@@ -0,0 +1,6 @@
1
+ export interface IVersionConstant {
2
+ description: string;
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export declare const VersionList: IVersionConstant[];
@@ -0,0 +1 @@
1
+ export * from './LambdaRouteStage';
@@ -0,0 +1,3 @@
1
+ import type { IStageTypeConfig } from '@spinnaker/core';
2
+ export declare const initialize: () => void;
3
+ export declare const lambdaUpdateCodeStage: IStageTypeConfig;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { IStage, IStageConfigProps } from '@spinnaker/core';
3
+ import './LambdaUpdateCodeStage.less';
4
+ export declare function LambdaUpdateCodeConfig(props: IStageConfigProps): JSX.Element;
5
+ export declare function validate(stageConfig: IStage): any;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { IExecutionDetailsSectionProps } from '@spinnaker/core';
3
+ export declare function LambdaUpdateCodeExecutionDetails(props: IExecutionDetailsSectionProps): JSX.Element;
4
+ export declare namespace LambdaUpdateCodeExecutionDetails {
5
+ const title = "Lambda Update Code Stage";
6
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { IFormikStageConfigInjectedProps } from '@spinnaker/core';
3
+ export declare function UpdateCodeLambdaFunctionStageForm(props: IFormikStageConfigInjectedProps): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './UpdateCodeStageForm';
@@ -0,0 +1 @@
1
+ export * from './LambdaUpdateCodeStage';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spinnaker/amazon",
3
3
  "license": "Apache-2.0",
4
- "version": "0.13.9",
4
+ "version": "0.14.1",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "lib": "npm run build"
14
14
  },
15
15
  "dependencies": {
16
- "@spinnaker/core": "^0.24.1",
16
+ "@spinnaker/core": "^0.26.0",
17
17
  "@uirouter/angularjs": "1.0.26",
18
18
  "@uirouter/core": "6.0.8",
19
19
  "@uirouter/react": "1.0.7",
@@ -55,5 +55,5 @@
55
55
  "shx": "0.3.3",
56
56
  "typescript": "4.3.5"
57
57
  },
58
- "gitHead": "eb226ee64d23c8c34be5ace816809a2262917e3f"
58
+ "gitHead": "581f9d4358d0c90a385df0119a7ae0a41b81c1cb"
59
59
  }
package/src/aws.module.ts CHANGED
@@ -6,9 +6,9 @@ import { AWSProviderSettings } from './aws.settings';
6
6
  import { COMMON_MODULE } from './common/common.module';
7
7
  import './deploymentStrategy/rollingPush.strategy';
8
8
  import { AmazonFunctionDetails } from './function';
9
- import { CreateLambdaFunction } from './function/CreateLambdaFunction';
9
+ import { CreateLambdaFunction } from './function';
10
+ import { AwsFunctionTransformer } from './function';
10
11
  import { AWS_FUNCTION_MODULE } from './function/function.module';
11
- import { AwsFunctionTransformer } from './function/function.transformer';
12
12
  import './help/amazon.help';
13
13
  import { AwsImageReader } from './image';
14
14
  import { AMAZON_INSTANCE_AWSINSTANCETYPE_SERVICE } from './instance/awsInstanceType.service';
@@ -18,11 +18,11 @@ import { INSTANCE_DNS_COMPONENT } from './instance/details/instanceDns.component
18
18
  import { INSTANCE_SECURITY_GROUPS_COMPONENT } from './instance/details/instanceSecurityGroups.component';
19
19
  import { INSTANCE_STATUS_COMPONENT } from './instance/details/instanceStatus.component';
20
20
  import { INSTANCE_TAGS_COMPONENT } from './instance/details/instanceTags.component';
21
- import { AmazonLoadBalancerClusterContainer } from './loadBalancer/AmazonLoadBalancerClusterContainer';
22
- import { AmazonLoadBalancersTag } from './loadBalancer/AmazonLoadBalancersTag';
23
- import { AmazonLoadBalancerChoiceModal } from './loadBalancer/configure/AmazonLoadBalancerChoiceModal';
21
+ import { AmazonLoadBalancerClusterContainer } from './loadBalancer';
22
+ import { AmazonLoadBalancersTag } from './loadBalancer';
23
+ import { AmazonLoadBalancerChoiceModal } from './loadBalancer';
24
+ import { AwsLoadBalancerTransformer } from './loadBalancer';
24
25
  import { AWS_LOAD_BALANCER_MODULE } from './loadBalancer/loadBalancer.module';
25
- import { AwsLoadBalancerTransformer } from './loadBalancer/loadBalancer.transformer';
26
26
  import amazonLogo from './logo/amazon.logo.svg';
27
27
  import { AMAZON_PIPELINE_STAGES_BAKE_AWSBAKESTAGE } from './pipeline/stages/bake/awsBakeStage';
28
28
  import { AMAZON_PIPELINE_STAGES_CLONESERVERGROUP_AWSCLONESERVERGROUPSTAGE } from './pipeline/stages/cloneServerGroup/awsCloneServerGroupStage';
@@ -1,7 +1,7 @@
1
1
  import { isEmpty } from 'lodash';
2
2
 
3
3
  export const iamRoleValidator = (value: string, label: string) => {
4
- const isIAMRole = value.match(/^arn:aws:iam::\d{12}:role\/?\/[a-zA-Z_0-9+=,.@\-_/]+/);
4
+ const isIAMRole = value.match(/^arn:aws:iam::\d{12}:role\/?\/[a-zA-Z_0-9+=,.@\-/]+/);
5
5
  return isIAMRole
6
6
  ? undefined
7
7
  : `Invalid role. ${label} must match regular expression: arn:aws:iam::d{12}:role/?[a-zA-Z_0-9+=,.@-_/]+`;
@@ -9,10 +9,9 @@ export const iamRoleValidator = (value: string, label: string) => {
9
9
 
10
10
  export const s3BucketNameValidator = (value: string, label: string) => {
11
11
  const s3BucketName = value.match(/^[0-9A-Za-z.-]*[^.]$/);
12
- const err = s3BucketName
12
+ return s3BucketName
13
13
  ? undefined
14
14
  : `Invalid S3 Bucket name. ${label} must match regular expression: [0-9A-Za-z.-]*[^.]$`;
15
- return err;
16
15
  };
17
16
 
18
17
  export const awsArnValidator = (value: string, label: string) => {
@@ -25,3 +24,8 @@ export const awsArnValidator = (value: string, label: string) => {
25
24
  export const awsTagsValidator = (value: string | { [key: string]: string }, label: string) => {
26
25
  return isEmpty(value) ? `At least one ${label} is required` : undefined;
27
26
  };
27
+
28
+ export const simpleStringValidator = (value: string, label: string) => {
29
+ const simpleString = value.match(/^[0-9A-Za-z]*$/);
30
+ return simpleString ? undefined : `Invalid String Value. ${label} must match regular expression: [0-9A-Za-z]`;
31
+ };
@@ -0,0 +1,143 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import React from 'react';
5
+
6
+ import type {
7
+ IAccount,
8
+ IAccountDetails,
9
+ IFormikStageConfigInjectedProps,
10
+ IFormInputProps,
11
+ IFunction,
12
+ IRegion,
13
+ } from '@spinnaker/core';
14
+ import { AccountService, FormikFormField, HelpField, NumberInput, ReactSelectInput, useData } from '@spinnaker/core';
15
+
16
+ import { DeleteVersionList, DeleteVersionPicker } from './constants';
17
+ import type { IAmazonFunctionSourceData } from '../../../domain';
18
+
19
+ export function DeleteLambdaFunctionStageForm(props: IFormikStageConfigInjectedProps) {
20
+ const { values } = props.formik;
21
+ const { functions } = props.application;
22
+
23
+ const { result: fetchAccountsResult, status: fetchAccountsStatus } = useData(
24
+ () => AccountService.listAccounts('aws'),
25
+ [],
26
+ [],
27
+ );
28
+
29
+ const onAccountChange = (fieldName: string, fieldValue: any): void => {
30
+ props.formik.setFieldValue('region', null);
31
+ props.formik.setFieldValue('functionName', null);
32
+
33
+ props.formik.setFieldValue(fieldName, fieldValue);
34
+ };
35
+
36
+ const onRegionChange = (fieldName: string, fieldValue: any): void => {
37
+ props.formik.setFieldValue('functionName', null);
38
+
39
+ props.formik.setFieldValue(fieldName, fieldValue);
40
+ };
41
+
42
+ const availableFunctions =
43
+ values.account && values.region
44
+ ? functions.data
45
+ .filter((f: IFunction) => f.account === values.account)
46
+ .filter((f: IFunction) => f.region === values.region)
47
+ .map((f: IFunction) => f.functionName)
48
+ : [];
49
+
50
+ return (
51
+ <div className="form-horizontal">
52
+ <FormikFormField
53
+ label="Account"
54
+ name="account"
55
+ onChange={onAccountChange}
56
+ required={true}
57
+ input={(inputProps: IFormInputProps) => (
58
+ <ReactSelectInput
59
+ {...inputProps}
60
+ clearable={false}
61
+ isLoading={fetchAccountsStatus === 'PENDING'}
62
+ stringOptions={fetchAccountsResult.map((acc: IAccount) => acc.name)}
63
+ />
64
+ )}
65
+ />
66
+ <FormikFormField
67
+ label="Region"
68
+ name="region"
69
+ onChange={onRegionChange}
70
+ input={(inputProps: IFormInputProps) => (
71
+ <ReactSelectInput
72
+ clearable={false}
73
+ disabled={!values.account}
74
+ placeholder={values.account ? 'Select...' : 'Select an Account...'}
75
+ {...inputProps}
76
+ isLoading={fetchAccountsStatus === 'PENDING'}
77
+ stringOptions={fetchAccountsResult
78
+ .filter((acc: IAccountDetails) => acc.name === values.account)
79
+ .flatMap((acc: IAccountDetails) => acc.regions)
80
+ .map((reg: IRegion) => reg.name)}
81
+ />
82
+ )}
83
+ />
84
+ <FormikFormField
85
+ label="Function Name"
86
+ name="functionName"
87
+ input={(inputProps: IFormInputProps) => (
88
+ <ReactSelectInput
89
+ clearable={false}
90
+ disabled={!(values.account && values.region)}
91
+ placeholder={values.account && values.region ? 'Select...' : 'Select an Account and Region...'}
92
+ {...inputProps}
93
+ stringOptions={availableFunctions}
94
+ />
95
+ )}
96
+ />
97
+ <FormikFormField
98
+ label="Target Version"
99
+ name="version"
100
+ input={(inputProps: IFormInputProps) => (
101
+ <ReactSelectInput
102
+ {...inputProps}
103
+ clearable={false}
104
+ options={DeleteVersionList}
105
+ optionRenderer={(option) => (
106
+ <DeleteVersionPicker config={props} value={option.value as any} showingDetails={true} />
107
+ )}
108
+ />
109
+ )}
110
+ />
111
+ {values.version === '$PROVIDED' ? (
112
+ <FormikFormField
113
+ label="Version Number"
114
+ name="versionNumber"
115
+ input={(inputProps: IFormInputProps) => (
116
+ <ReactSelectInput
117
+ {...inputProps}
118
+ clearable={false}
119
+ stringOptions={functions.data
120
+ .filter((f: IAmazonFunctionSourceData) => f.account === values.account)
121
+ .filter((f: IAmazonFunctionSourceData) => f.region === values.region)
122
+ .filter((f: IAmazonFunctionSourceData) => f.functionName === values.functionName)
123
+ .flatMap((f: IAmazonFunctionSourceData) =>
124
+ Object.values(f.revisions).sort(function (a: number, b: number) {
125
+ return b - a;
126
+ }),
127
+ )
128
+ .filter((r: any) => r !== '$LATEST')}
129
+ />
130
+ )}
131
+ />
132
+ ) : null}
133
+ {values.version === '$MOVING' ? (
134
+ <FormikFormField
135
+ name="retentionNumber"
136
+ help={<HelpField content="The number of Lambda versions to retain" />}
137
+ label="Prior Versions to Retain"
138
+ input={(props) => <NumberInput {...props} min={1} max={100} />}
139
+ />
140
+ ) : null}
141
+ </div>
142
+ );
143
+ }
@@ -0,0 +1,86 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import React from 'react';
5
+
6
+ import type {
7
+ IExecutionDetailsSectionProps,
8
+ IFormikStageConfigInjectedProps,
9
+ IStage,
10
+ IStageConfigProps,
11
+ IStageTypeConfig,
12
+ } from '@spinnaker/core';
13
+ import {
14
+ ExecutionDetailsSection,
15
+ ExecutionDetailsTasks,
16
+ FormikStageConfig,
17
+ FormValidator,
18
+ HelpContentsRegistry,
19
+ StageFailureMessage,
20
+ } from '@spinnaker/core';
21
+
22
+ import { DeleteLambdaFunctionStageForm } from './DeleteLambdaFunctionStageForm';
23
+
24
+ export function DeleteLambdaExecutionDetails(props: IExecutionDetailsSectionProps) {
25
+ const { stage, name, current } = props;
26
+ return (
27
+ <ExecutionDetailsSection name={name} current={current}>
28
+ <StageFailureMessage stage={stage} message={stage.outputs.failureMessage} />
29
+ <div>
30
+ <p>
31
+ {' '}
32
+ <b> Status: </b> {stage.outputs.deleteTask === 'done' ? 'COMPLETE' : stage.outputs.deleteTask}{' '}
33
+ </p>
34
+ <p>
35
+ {' '}
36
+ <b> Deleted Version: </b>{' '}
37
+ {stage.outputs['deleteTask:deleteVersion'] ? stage.outputs['deleteTask:deleteVersion'] : 'N/A'}{' '}
38
+ </p>
39
+ </div>
40
+ </ExecutionDetailsSection>
41
+ );
42
+ }
43
+
44
+ function DeleteLambdaConfig(props: IStageConfigProps) {
45
+ return (
46
+ <div className="DeleteLambdaStageConfig">
47
+ <FormikStageConfig
48
+ {...props}
49
+ validate={validate}
50
+ onChange={props.updateStage}
51
+ render={(props: IFormikStageConfigInjectedProps) => <DeleteLambdaFunctionStageForm {...props} />}
52
+ />
53
+ </div>
54
+ );
55
+ }
56
+
57
+ export const initialize = () => {
58
+ HelpContentsRegistry.register('aws.lambdaDeploymentStage.lambda', 'Lambda Name');
59
+ };
60
+
61
+ function validate(stageConfig: IStage) {
62
+ const validator = new FormValidator(stageConfig);
63
+ validator.field('account', 'Account Name').required();
64
+
65
+ validator.field('region', 'Region').required();
66
+
67
+ validator.field('functionName', 'Lambda Function Name').required();
68
+
69
+ validator.field('version', 'Lambda Function Version').required();
70
+
71
+ return validator.validateForm();
72
+ }
73
+
74
+ // eslint-disable-next-line
75
+ export namespace DeleteLambdaExecutionDetails {
76
+ export const title = 'Delete Lambda Stage';
77
+ }
78
+
79
+ export const lambdaDeleteStage: IStageTypeConfig = {
80
+ key: 'Aws.LambdaDeleteStage',
81
+ label: `AWS Lambda Delete`,
82
+ description: 'Delete an AWS Lambda Function',
83
+ component: DeleteLambdaConfig, // stage config
84
+ executionDetailsSections: [DeleteLambdaExecutionDetails, ExecutionDetailsTasks],
85
+ validateFn: validate,
86
+ };