Skip to content

Commit

Permalink
Merge pull request #1375 from aligent/feature/prerender-update
Browse files Browse the repository at this point in the history
DO-1652: Add top level props for rest, queue names
  • Loading branch information
gowrizrh authored May 23, 2024
2 parents f75110d + c67c463 commit d1b4d5b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/prerender-fargate/lib/prerender-fargate-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ export interface PrerenderFargateOptions {
* @default - AWS generated load balancer name
*/
loadBalancerName?: string;

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

/**
* A name for the API Gateway RestApi resource.
*
* @default - ID of the RestApi construct.
*/
restApiName?: string;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/prerender-fargate/lib/prerender-fargate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export class PrerenderFargate extends Construct {
enableRecache,
enablePrerenderHeader,
usePrivateSubnets,
queueName,
restApiName,
} = props;

// Create bucket for prerender storage
Expand Down Expand Up @@ -253,6 +255,8 @@ export class PrerenderFargate extends Construct {
maxConcurrentExecutions:
prerenderFargateRecachingOptions?.maxConcurrentExecutions || 1,
tokenSecret,
queueName,
restApiName,
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export interface PrerenderRecacheApiOptions {
* @default CloudFormation-generated name
*/
queueName?: string;

/**
* A name for the API Gateway RestApi resource.
*
* @default - ID of the RestApi construct.
*/
restApiName?: string;
}

/**
Expand Down Expand Up @@ -78,6 +85,8 @@ export class PrerenderRecacheApi extends Construct {
this.api = new LambdaRestApi(this, "prerenderRecacheApi", {
handler: apiHandler,
proxy: false,
restApiName:
options.restApiName !== undefined ? options.restApiName : undefined,
});

const recache = this.api.root.addResource("recache");
Expand Down

0 comments on commit d1b4d5b

Please sign in to comment.