-
Notifications
You must be signed in to change notification settings - Fork 39
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
Eks integ tests #77
Eks integ tests #77
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,14 +27,15 @@ export class LoadBalancerPlugin { | |
} | ||
|
||
public createLoadBalancer = ( | ||
appName: string, | ||
resourceId: string, | ||
params: LoadBalancerArgs | ||
): aws.lb.LoadBalancer => { | ||
let lb: aws.lb.LoadBalancer | ||
switch (params.loadBalancerType) { | ||
case 'application': | ||
lb = new aws.lb.LoadBalancer(`${resourceId}-alb`, { | ||
name: `${resourceId}-alb`, | ||
lb = new aws.lb.LoadBalancer(`${appName}-${resourceId}-alb`, { | ||
name: `${appName}-${resourceId}`, | ||
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this (and similar) conflict with @DavidSeptimus-Klotho's work? If so, probably just need to coordinate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i mentioned i was doing this to him, he said he hadnt touched these modules yet so should be good |
||
internal: params.internal || false, | ||
loadBalancerType: 'application', | ||
securityGroups: params.securityGroups, | ||
|
@@ -44,8 +45,8 @@ export class LoadBalancerPlugin { | |
}) | ||
break | ||
case 'network': | ||
lb = new aws.lb.LoadBalancer(`${resourceId}-nlb`, { | ||
name: `${resourceId}-nlb`, | ||
lb = new aws.lb.LoadBalancer(`${appName}-${resourceId}-nlb`, { | ||
name: `${appName}-${resourceId}`, | ||
internal: params.internal || true, | ||
loadBalancerType: 'network', | ||
subnets: params.subnets, | ||
|
@@ -60,8 +61,12 @@ export class LoadBalancerPlugin { | |
return lb | ||
} | ||
|
||
public createListener = (resourceId: string, params: ListenerArgs): aws.lb.Listener => { | ||
return new aws.lb.Listener(`${resourceId}-listener`, { | ||
public createListener = ( | ||
appName: string, | ||
resourceId: string, | ||
params: ListenerArgs | ||
): aws.lb.Listener => { | ||
return new aws.lb.Listener(`${appName}-${resourceId}-listener`, { | ||
loadBalancerArn: params.loadBalancerArn, | ||
defaultActions: params.defaultActions, | ||
port: params.port, | ||
|
@@ -70,26 +75,31 @@ export class LoadBalancerPlugin { | |
} | ||
|
||
public createListenerRule = ( | ||
appName: string, | ||
resourceId: string, | ||
params: ListenerRuleArgs | ||
): aws.lb.ListenerRule => { | ||
return new aws.lb.ListenerRule(`${resourceId}-listenerRule`, { | ||
return new aws.lb.ListenerRule(`${appName}-${resourceId}-listenerRule`, { | ||
listenerArn: params.listenerArn, | ||
actions: params.actions, | ||
conditions: params.conditions, | ||
priority: params.priority, | ||
}) | ||
} | ||
|
||
public createTargetGroup = (resourceId, params: TargetGroupArgs): aws.lb.TargetGroup => { | ||
public createTargetGroup = ( | ||
appName: string, | ||
resourceId, | ||
params: TargetGroupArgs | ||
): aws.lb.TargetGroup => { | ||
let targetGroup: aws.lb.TargetGroup | ||
if (params.targetType != 'lambda' && !(params.port && params.protocol)) { | ||
throw new Error('Port and Protocol must be specified for non lambda target types') | ||
} | ||
switch (params.targetType) { | ||
case 'ip': | ||
targetGroup = new aws.lb.TargetGroup(`${resourceId}-targetGroup`, { | ||
name: `${resourceId}-targetGroup`, | ||
targetGroup = new aws.lb.TargetGroup(`${appName}-${resourceId}-targetGroup`, { | ||
name: `${appName}-${resourceId}`, | ||
port: params.port, | ||
protocol: params.protocol, | ||
targetType: 'ip', | ||
|
@@ -98,17 +108,17 @@ export class LoadBalancerPlugin { | |
}) | ||
break | ||
case 'instance': | ||
targetGroup = new aws.lb.TargetGroup(`${resourceId}-targetGroup`, { | ||
name: `${resourceId}-targetGroup`, | ||
targetGroup = new aws.lb.TargetGroup(`${appName}-${resourceId}-targetGroup`, { | ||
name: `${appName}-${resourceId}`, | ||
port: params.port, | ||
protocol: params.protocol, | ||
vpcId: params.vpcId, | ||
tags: params.tags, | ||
}) | ||
break | ||
case 'alb': | ||
targetGroup = new aws.lb.TargetGroup(`${resourceId}-targetGroup`, { | ||
name: `${resourceId}-targetGroup`, | ||
targetGroup = new aws.lb.TargetGroup(`${appName}-${resourceId}-targetGroup`, { | ||
name: `${appName}-${resourceId}`, | ||
targetType: 'alb', | ||
port: params.port, | ||
protocol: params.protocol, | ||
|
@@ -118,8 +128,8 @@ export class LoadBalancerPlugin { | |
}) | ||
break | ||
case 'lambda': | ||
targetGroup = new aws.lb.TargetGroup(`${resourceId}-targetGroup`, { | ||
name: `${resourceId}-targetGroup`, | ||
targetGroup = new aws.lb.TargetGroup(`${appName}-${resourceId}-targetGroup`, { | ||
name: `${appName}-${resourceId}`, | ||
targetType: 'lambda', | ||
tags: params.tags, | ||
}) | ||
|
@@ -131,10 +141,11 @@ export class LoadBalancerPlugin { | |
} | ||
|
||
public attachTargetGroupToResource = ( | ||
appName: string, | ||
resourceId: string, | ||
params: TargetGroupAttachmentArgs | ||
): aws.lb.TargetGroupAttachment => { | ||
return new aws.lb.TargetGroupAttachment(`${resourceId}-targetGroupAttachment`, { | ||
return new aws.lb.TargetGroupAttachment(`${appName}-${resourceId}-targetGroupAttachment`, { | ||
targetGroupArn: params.targetGroupArn, | ||
targetId: params.targetId, | ||
port: params.port, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this one is still broken because of #48? (If so, let's update line 123 just for completeness)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well its broken because our current release branch is broken mainly. So we need 2 releases then can enable this and the helm one.