Skip to content

Commit

Permalink
feat(deadline): allow providing subnets for RenderQueue's ALB (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddneilson authored Jan 5, 2021
1 parent c5d881a commit 53088fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/aws-rfdk/lib/deadline/lib/render-queue-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ export interface RenderQueueProps {
*/
readonly vpcSubnets?: SubnetSelection;

/**
* The subnets into which to place the Application Load Balancer that is deployed.
*
* @default - One Private subnet from each AZ.
*/
readonly vpcSubnetsAlb?: SubnetSelection;

/**
* Hostname to use to connect to the RenderQueue.
*
Expand Down
1 change: 1 addition & 0 deletions packages/aws-rfdk/lib/deadline/lib/render-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export class RenderQueue extends RenderQueueBase implements IGrantable {

const loadBalancer = new ApplicationLoadBalancer(this, 'LB', {
vpc: this.cluster.vpc,
vpcSubnets: props.vpcSubnetsAlb ?? { subnetType: SubnetType.PRIVATE, onePerAz: true },
internetFacing: false,
deletionProtection: props.deletionProtection ?? true,
});
Expand Down
9 changes: 9 additions & 0 deletions packages/aws-rfdk/lib/deadline/test/render-queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,9 @@ describe('RenderQueue', () => {
vpcSubnets: {
subnets,
},
vpcSubnetsAlb: {
subnets,
},
};
const isolatedStack = new Stack(app, 'IsolatedStack');

Expand All @@ -1708,6 +1711,12 @@ describe('RenderQueue', () => {
'SubnetID2',
),
}));
expectCDK(isolatedStack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', {
Subnets: [
'SubnetID1',
'SubnetID2',
],
}));
});

test('can specify instance type', () => {
Expand Down

0 comments on commit 53088fb

Please sign in to comment.