Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(provider/aws): Lambda function target support for AWS ALB #7630

Merged
merged 38 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c7d0768
.
sidmuls Oct 16, 2019
0dbd5f2
feat(provider/aws): Function listing and searching functionality
sidmuls Oct 16, 2019
9f27c4f
feat(provider/aws): Function listing and searching functionality
sidmuls Oct 16, 2019
4caa90c
Merge branch 'master' of https://github.com/sidmuls/deck
sidmuls Oct 16, 2019
0d04734
refactor(provider/aws): Converting Function class component into func…
sidmuls Oct 16, 2019
aa9cdc0
refactor(provider/aws): Refactoring groupings into a separate component.
sidmuls Oct 16, 2019
1cbb844
refactor(provider/aws): Removing unnecessary state from FunctionGroup…
sidmuls Oct 17, 2019
d1b43d2
refactor(provider/aws): removing extra line. Tthis is actually for r…
sidmuls Oct 17, 2019
d96a32b
refactor(provider/aws): Adding tests for FunctionFilterService and ch…
sidmuls Oct 22, 2019
ab69450
refactor(provider/aws): removing unnecessary field from IFunction
sidmuls Oct 22, 2019
6ca3d99
Merge branch 'master' into master
mergify[bot] Oct 25, 2019
543ee1e
refactor(provider/aws): adding flag to turn off functions feature
sidmuls Oct 25, 2019
26d9043
Merge branch 'master' of https://github.com/sidmuls/deck
sidmuls Oct 25, 2019
06ad9e6
Merge branch 'master' into master
mergify[bot] Oct 25, 2019
2803afe
feat(provider/aws): Function CREATE EDIT and DELETE feature.
sidmuls Oct 31, 2019
5bddb8b
fix(provider/aws): fixing import statement
sidmuls Oct 31, 2019
7fbb282
Merge pull request #1 from sidmuls/function-crud
sidmuls Oct 31, 2019
718b2d7
Merge remote-tracking branch 'upstream/master'
sidmuls Oct 31, 2019
df45ecb
fix(provider/aws): resolving merge conflicts
sidmuls Oct 31, 2019
2261c12
fix(provider/aws): fixing property type for Entity Tags
sidmuls Oct 31, 2019
a47a3ba
Merge pull request #2 from sidmuls/function-crud
sidmuls Oct 31, 2019
d8a9404
fix(provider/aws): removing unnecessary component from AwsFunctionDet…
sidmuls Oct 31, 2019
65eb1b0
refactor(provider/aws): fixing review comments by @caseyhebebrand
sidmuls Nov 5, 2019
d838d3b
refactor(provider/aws): changes for following best practices as reque…
sidmuls Nov 7, 2019
990d82f
refactor(provider/aws): Adding message to display in case function i…
sidmuls Nov 8, 2019
c80bd9e
refactor(provider/aws): merging upstream changes
sidmuls Nov 8, 2019
dcf8f60
refactor(provider/aws): Replacing MapEditor with MapEditorInput in Fu…
sidmuls Nov 8, 2019
ff535ad
refactor(provider/aws): fixes for comments requested by @christheilen
sidmuls Nov 11, 2019
6c71651
refactor(provider/aws): changes as requested by @christhielen and a b…
sidmuls Nov 11, 2019
c793e9f
Merge branch 'master' into master
mergify[bot] Nov 11, 2019
10fc496
feat(provider/aws): ALB Lambda target support
sidmuls Nov 12, 2019
2f3c70b
refactor(provider/aws): merging upstream changes
sidmuls Nov 12, 2019
28ce7c8
Merge remote-tracking branch 'upstream/master'
sidmuls Nov 12, 2019
abd5615
fix(provider/aws): fixing error with tags and targetGroups
sidmuls Nov 12, 2019
7be7c75
fix(provider/aws): fixing error with target group field in function r…
sidmuls Nov 12, 2019
17bf6af
refactor(provider/aws): changes as requested by @christhielen
sidmuls Nov 12, 2019
2d64b83
fix(provider/aws): fixing multiValueHeadersEnabled flag usage in lamb…
sidmuls Nov 12, 2019
c6512ab
Merge branch 'master' into master
mergify[bot] Nov 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/scripts/modules/amazon/src/domain/IAmazonFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface IAmazonFunction extends IFunction {
subnetIds: [];
vpcId: string;
};
targetGroups: string | string[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this typed asstring | string[]? Why not just type these as string[]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we support adding only one target group instead of a list of target groups. Clouddriver expects it to be a string in Create/Update operation.
However, while fetching a function's details, AWS Lambda returns a list of string for the targetGroups field.
Hence the type string | string[]

}

export interface IAmazonFunctionUpsertCommand extends IFunctionUpsertCommand {
Expand All @@ -52,6 +53,7 @@ export interface IAmazonFunctionUpsertCommand extends IFunctionUpsertCommand {
securityGroupIds: string[];
subnetIds: string[];
vpcId: string;
targetGroups: string | string[];
}

export interface IAmazonFunctionDeleteCommand extends IFunctionDeleteCommand {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ export interface IAmazonFunctionSourceData extends IFunctionSourceData {
targetArn: string;
};
KMSKeyArn: string;
targetGroups: string[];
}
3 changes: 2 additions & 1 deletion app/scripts/modules/amazon/src/domain/IAmazonLoadBalancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export interface IALBTargetGroupDescription {
name: string;
protocol: 'HTTP' | 'HTTPS';
port: number;
targetType: 'instance' | 'ip';
targetType: 'instance' | 'ip' | 'lambda';
attributes: {
// Defaults to 300
deregistrationDelay?: number;
Expand All @@ -179,6 +179,7 @@ export interface IALBTargetGroupDescription {
stickinessType?: 'lb_cookie';
// Defaults to 86400
stickinessDuration?: number;
multiValueHeadersEnabled?: boolean;
};
// Defaults to 10
healthCheckInterval?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export interface IAmazonTargetGroupSourceData {
'stickiness.enabled': boolean;
'stickiness.lb_cookie.duration_seconds': number;
'stickiness.type': 'lb_cookie';
'lambda.multi_value_headers.enabled': boolean;
};
cloudProvider: string;
healthCheckIntervalSeconds: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,20 @@ export class FunctionSettings extends React.Component<IFunctionSettingsProps>
public render() {
return (
<div className="container-fluid form-horizontal ">
<div className="sp-margin-m-bottom">
<FormikFormField name="description" label="Description" input={props => <TextInput {...props} />} />
</div>
<div className="sp-margin-m-bottom">
<FormikFormField
name="memorySize"
label="Memory (MB)"
help={<HelpField id="aws.functionBasicSettings.memorySize" />}
input={props => <NumberInput {...props} min={128} max={3008} />}
/>
</div>
<div className="sp-margin-m-bottom">
<FormikFormField
name="timeout"
label="Timeout (seconds)"
help={<HelpField id="aws.functionBasicSettings.timeout" />}
input={props => <NumberInput {...props} min={1} max={900} />}
/>
</div>
<FormikFormField name="description" label="Description" input={props => <TextInput {...props} />} />
<FormikFormField
name="memorySize"
label="Memory (MB)"
help={<HelpField id="aws.functionBasicSettings.memorySize" />}
input={props => <NumberInput {...props} min={128} max={3008} />}
/>
<FormikFormField
name="timeout"
label="Timeout (seconds)"
help={<HelpField id="aws.functionBasicSettings.timeout" />}
input={props => <NumberInput {...props} min={1} max={900} />}
/>
<FormikFormField name="targetGroups" label="Target Group Name" input={props => <TextInput {...props} />} />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AWSProviderSettings } from 'amazon/aws.settings';
import { Application } from '@spinnaker/core';

import { IAmazonFunctionUpsertCommand, IAmazonFunction } from 'amazon/domain';
import { isEmpty } from 'lodash';

export class AwsFunctionTransformer {
public normalizeFunction(functionDef: IAmazonFunction): IAmazonFunction {
Expand All @@ -27,6 +28,7 @@ export class AwsFunctionTransformer {
operation: '',
cloudProvider: functionDef.cloudProvider,
region: functionDef.region,
targetGroups: isEmpty(functionDef.targetGroups) ? '' : functionDef.targetGroups,
});

public constructNewAwsFunctionTemplate(application: Application): IAmazonFunctionUpsertCommand {
Expand Down Expand Up @@ -63,6 +65,7 @@ export class AwsFunctionTransformer {
targetArn: '',
},
operation: '',
targetGroups: '',
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ export class CreateApplicationLoadBalancer extends React.Component<
public render() {
const { app, dismissModal, forPipelineConfig, loadBalancer } = this.props;
const { isNew, loadBalancerCommand, taskMonitor } = this.state;

let heading = forPipelineConfig ? 'Configure Application Load Balancer' : 'Create New Application Load Balancer';
if (!isNew) {
heading = `Edit ${loadBalancerCommand.name}: ${loadBalancerCommand.region}: ${loadBalancerCommand.credentials}`;
Expand Down
Loading