Skip to content
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

DO-1652: Add name props, remove dependabot #1367

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to have this as props.clusterName ? props.clusterName : undefined so that it equates null as false too along with the other ternaries.
feel free to ignore and merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense

Although all (most?) props define propName? so only assigning the actual type or undefined is possible

Keeping this for consistency's sake as most other things check explicitly for undefined but we should reconsider this in a future major version

});

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
Loading