Skip to content

Commit

Permalink
feat: add optional props for name
Browse files Browse the repository at this point in the history
  • Loading branch information
gowrizrh committed May 3, 2024
1 parent ea16a27 commit 6bfa936
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

24 changes: 24 additions & 0 deletions packages/graphql-mesh-server/lib/fargate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ 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
}

export class MeshService extends Construct {
Expand Down Expand Up @@ -171,6 +192,7 @@ 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,
});
Expand Down Expand Up @@ -219,6 +241,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 } = {};
Expand Down
6 changes: 1 addition & 5 deletions packages/graphql-mesh-server/lib/maintenance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ export class Maintenance extends Construct {
resources: [efsVolume.fileSystemArn, accessPoint.accessPointArn],
});

efsVolumeSecGroup.addIngressRule(
Peer.anyIpv4(), // Can't get the IP address of each container as we don't know them at deploy time!
Port.tcp(2049),
"File access"
);
efsVolume.connections.allowDefaultPortFrom(props.fargateService.connections);

efsVolume.grantReadWrite(props.fargateService.taskDefinition.taskRole);
props.fargateService.taskDefinition.addToTaskRolePolicy(accessPolicy);
Expand Down

0 comments on commit 6bfa936

Please sign in to comment.