Skip to content

Commit

Permalink
Merge pull request #1367 from aligent/feature/prerender-update
Browse files Browse the repository at this point in the history
DO-1652: Add name props, remove dependabot
  • Loading branch information
gowrizrh authored May 14, 2024
2 parents 87dc02a + f739447 commit 85c7f11
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions packages/prerender-fargate/lib/prerender-fargate-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ export interface PrerenderFargateOptions {
* @default - false
*/
usePrivateSubnets?: boolean;

/**
* Specify a name for the ECS cluster
*
* @default - AWS generated cluster name
*/
clusterName?: string;

/**
* Specify a name for the task definition family
*
* @default - AWS generated task definition family name
*/
taskDefinitionFamilyName?: string;

/**
* Specify a name for the load balancer
*
* @default - AWS generated load balancer name
*/
loadBalancerName?: string;
}

/**
Expand Down
10 changes: 10 additions & 0 deletions packages/prerender-fargate/lib/prerender-fargate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export class PrerenderFargate extends Construct {

const cluster = new ecs.Cluster(this, `${prerenderName}-cluster`, {
vpc: vpc,
clusterName:
props.clusterName !== undefined ? props.clusterName : undefined,
});

const directory = path.join(__dirname, "prerender");
Expand Down Expand Up @@ -162,8 +164,16 @@ export class PrerenderFargate extends Construct {
containerPort: 3000,
environment,
secrets,
family:
props.taskDefinitionFamilyName !== undefined
? props.taskDefinitionFamilyName
: undefined,
},
publicLoadBalancer: true,
loadBalancerName:
props.loadBalancerName !== undefined
? props.loadBalancerName
: undefined,
assignPublicIp: true,
listenerPort: 443,
redirectHTTP: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export interface PrerenderRecacheApiOptions {
* { "tokenABC": "https://URL_A,https://URL_B,...", ..., "tokenXYZ":"https://URL_Y,https://URL_Z" }
*/
tokenSecret: string;

/**
* A name for the recache queue
*
* @default CloudFormation-generated name
*/
queueName?: string;
}

/**
Expand Down Expand Up @@ -83,7 +90,11 @@ export class PrerenderRecacheApi extends Construct {
timeout: Duration.seconds(120),
}),
deployDeadLetterQueue: false,
queueProps: { visibilityTimeout: Duration.minutes(60) },
queueProps: {
visibilityTimeout: Duration.minutes(60),
queueName:
options.queueName !== undefined ? options.queueName : undefined,
},
});
}
}
Expand Down

0 comments on commit 85c7f11

Please sign in to comment.