Skip to content

Commit

Permalink
feat: add codepipeline name prop
Browse files Browse the repository at this point in the history
update security group to vpc cidr so lambda can access
  • Loading branch information
gowrizrh committed May 3, 2024
1 parent 3418070 commit 0c75c5e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
7 changes: 7 additions & 0 deletions packages/graphql-mesh-server/lib/graphql-mesh-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions packages/graphql-mesh-server/lib/maintenance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Duration, RemovalPolicy } from "aws-cdk-lib";
import * as apigateway from "aws-cdk-lib/aws-apigateway";
import { IVpc, SecurityGroup } from "aws-cdk-lib/aws-ec2";
import { IVpc, Peer, Port, SecurityGroup } from "aws-cdk-lib/aws-ec2";
import * as lambda from "aws-cdk-lib/aws-lambda";
import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";
import { Construct } from "constructs";
Expand Down Expand Up @@ -72,8 +72,10 @@ export class Maintenance extends Construct {
resources: [efsVolume.fileSystemArn, accessPoint.accessPointArn],
});

efsVolume.connections.allowDefaultPortFrom(
props.fargateService.connections
efsVolumeSecGroup.addIngressRule(
Peer.ipv4(props.vpc.vpcCidrBlock),
Port.tcp(2049),
"File access"
);

efsVolume.grantReadWrite(props.fargateService.taskDefinition.taskRole);
Expand Down
12 changes: 11 additions & 1 deletion packages/graphql-mesh-server/lib/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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({
Expand Down

0 comments on commit 0c75c5e

Please sign in to comment.