diff --git a/package-lock.json b/package-lock.json index 35878600..527cab4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9833,7 +9833,7 @@ }, "packages/prerender-fargate": { "name": "@aligent/cdk-prerender-fargate", - "version": "2.3.0", + "version": "2.3.4", "license": "GPL-3.0-only", "dependencies": { "@aws-cdk/aws-apigatewayv2-alpha": "2.30.0-alpha.0", diff --git a/packages/graphql-mesh-server/lib/fargate.ts b/packages/graphql-mesh-server/lib/fargate.ts index 3ed97d53..9942673b 100644 --- a/packages/graphql-mesh-server/lib/fargate.ts +++ b/packages/graphql-mesh-server/lib/fargate.ts @@ -141,6 +141,34 @@ export interface MeshServiceProps { * @default authentication-table */ authenticationTable?: string; + + /** + * Specify a name for the ECS cluster + * + * @default - AWS generated cluster name + */ + clusterName?: string; + + /** + * Specify a name for the GraphQL service + * + * @default - AWS generated service name + */ + serviceName?: string; + + /** + * Specify a name for the ECR repository + * + * @default - AWS generated repository name + */ + repositoryName?: string; + + /** + * Specify a name for the task definition family + * + * @default - AWS generated task definition family name + */ + taskDefinitionFamilyName?: string; } export class MeshService extends Construct { @@ -171,6 +199,8 @@ export class MeshService extends Construct { this.repository = props.repository || new ecr.Repository(this, "repo", { + repositoryName: + props.repositoryName !== undefined ? props.repositoryName : undefined, removalPolicy: RemovalPolicy.DESTROY, autoDeleteImages: true, }); @@ -219,6 +249,8 @@ export class MeshService extends Construct { vpc: this.vpc, containerInsights: props.containerInsights !== undefined ? props.containerInsights : true, + clusterName: + props.clusterName !== undefined ? props.clusterName : undefined, }); const environment: { [key: string]: string } = {}; @@ -267,6 +299,10 @@ export class MeshService extends Construct { taskRole: new iam.Role(this, "MeshTaskRole", { assumedBy: new iam.ServicePrincipal("ecs-tasks.amazonaws.com"), }), + family: + props.taskDefinitionFamilyName !== undefined + ? props.taskDefinitionFamilyName + : undefined, }, publicLoadBalancer: true, // default, taskSubnets: { diff --git a/packages/graphql-mesh-server/lib/graphql-mesh-server.ts b/packages/graphql-mesh-server/lib/graphql-mesh-server.ts index ce13c938..42cb94dd 100644 --- a/packages/graphql-mesh-server/lib/graphql-mesh-server.ts +++ b/packages/graphql-mesh-server/lib/graphql-mesh-server.ts @@ -171,6 +171,13 @@ export type MeshHostingProps = { * @default true */ maintenanceAuthKey?: string; + + /** + * Whether a DynamoDB table should be created to store session data + * + * @default authentication-table + */ + authenticationTable?: string; }; export class MeshHosting extends Construct { diff --git a/packages/graphql-mesh-server/lib/maintenance.ts b/packages/graphql-mesh-server/lib/maintenance.ts index 9c29fd40..faa38466 100644 --- a/packages/graphql-mesh-server/lib/maintenance.ts +++ b/packages/graphql-mesh-server/lib/maintenance.ts @@ -73,7 +73,7 @@ export class Maintenance extends Construct { }); efsVolumeSecGroup.addIngressRule( - Peer.anyIpv4(), // Can't get the IP address of each container as we don't know them at deploy time! + Peer.ipv4(props.vpc.vpcCidrBlock), Port.tcp(2049), "File access" ); diff --git a/packages/graphql-mesh-server/lib/pipeline.ts b/packages/graphql-mesh-server/lib/pipeline.ts index dce0d51c..13466401 100644 --- a/packages/graphql-mesh-server/lib/pipeline.ts +++ b/packages/graphql-mesh-server/lib/pipeline.ts @@ -48,6 +48,13 @@ export interface CodePipelineServiceProps { * CloudFront distribution ID to clear cache on. */ cloudFrontDistributionId?: string; + + /** + * Deployment pipeline name + * + * @default AWS CloudFormation generates an ID and uses that for the pipeline name + */ + pipelineName?: string; } export class CodePipelineService extends Construct { @@ -56,7 +63,10 @@ export class CodePipelineService extends Construct { constructor(scope: Construct, id: string, props: CodePipelineServiceProps) { super(scope, id); - this.pipeline = new Pipeline(this, "deploy-pipeline"); + this.pipeline = new Pipeline(this, "deploy-pipeline", { + pipelineName: + props.pipelineName !== undefined ? props.pipelineName : undefined, + }); const sourceOutput = new Artifact(); const sourceAction = new pipe_actions.EcrSourceAction({