Skip to content

Commit

Permalink
DO-1652: add top level props for rest, queue names
Browse files Browse the repository at this point in the history
  • Loading branch information
gowrizrh committed May 23, 2024
1 parent f739447 commit c67c463
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 c67c463

Please sign in to comment.