- Node.js >= 18.19.0
- An AWS Account
- AWS CLI
- Configuration and credential file settings
- See the doc in detail
- Docker
- Stored
vertex.csv
andedge.csv
files in Amazon S3 in your AWS Account as the post mentioned
Copy config.sample.ts
and paste the file as config.ts
. Then modify the baseConfig
properties as your enviroment and requirements. For the reference, baseConfig
in the sample file as follows:
const baseConfig = {
appName: "graphApp",
region: "us-east-1",
adminEmail: "[email protected]",
allowedIps: [],
wafParamName: "graphAppWafWebACLID",
webBucketsRemovalPolicy: RemovalPolicy.DESTROY,
s3Uri: {
edge: "EDGE_S3_URI",
vertex: "VERTEX_S3_URI",
},
};
See the config doc if you check the properties in detail.
- Install the dependencies
npm ci
- Deploy backend
## Execute the bootstrapping if you have never executed bootstrap command with CDK in your region.
npm run cdk bootstrap -- --profile <YOUR_AWS_PROFILE>
## Also execute the bootstrapping command for us-east-1 if your region is different from `us-east-1`
npm run cdk bootstrap -- --profile <YOUR_AWS_PROFILE> --region us-east-1
npm run deployBackend -- --all --profile <YOUR_AWS_PROFILE>
You can see the following outputs after backend deployment.
Outputs:
graphApp-ApiStack.apiFunctionUrlAAAA = https://aaaa.lambda-url.us-east-1.on.aws/
graphApp-ApiStack.apiGraphqlUrlBBBB = https://bbbb.appsync-api.us-east-1.amazonaws.com/graphql
graphApp-ApiStack.cognitoIdentityPoolIdXXXX = us-east-1:xxxx
graphApp-ApiStack.cognitoUserPoolClientIdYYYY = yyyy
graphApp-ApiStack.cognitoUserPoolIdZZZZ = us-east-1_zzzz
- Generate env file for React
npm run generateEnv
- Deploy frontend
npm run deployFrontend -- --all --profile <YOUR_AWS_PROFILE>
You can see the graph application url as follows.
Outputs:
graphApp-WebappStack.webappurl4CF7BBD7 = xyz.cloudfront.net
Invoking the function url in AWS Lambda can do bulk load from S3 stored edge.csv
and vertex.csv
to Amazon Neptune. You can see the function url after deploying backend.
Outputs:
graphApp-ApiStack.apiFunctionUrlAAAA = https://aaaa.lambda-url.us-east-1.on.aws/
Set the variables as follows, and then invoke the function url with curl
.
export AWS_ACCESS_KEY_ID="YOUR_ACCESS_KEY"
export AWS_SECRET_ACCESS_KEY="YYY"
export AWS_SESSION_TOKEN="ZZZZ"
export FUNCTION_URL="YOUR_FUNCTION_URL"
curl ${FUNCTION_URL} \
-H "X-Amz-Security-Token: ${AWS_SESSION_TOKEN}" \
--aws-sigv4 "aws:amz:us-east-1:lambda" \
--user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}"
Start streaming response
Start bulk load of s3://YOUR_BUCKET/vertex.csv
Load status checking of s3://YOUR_BUCKET/vertex.csv
Waiting for load status change ................................
Load completed
200 OK
Start bulk load of s3://YOUR_BUCKET/edge.csv
Load status checking of s3://YOUR_BUCKET/edge.csv
Waiting for load status change ............................................................................................
Load completed
200 OK
End streaming response%
npm run deployBackend
- Deploy the infrastructure stack with AWS CDK
npm run deployFrontend
- Deploy the frontend stack with AWS CDK
npm run destroyBackend
- Destroy the infrastructure stack with AWS CDK
npm run destroyFrontend
- Destroy the frontend stack with AWS CDK
npm run generateEnv
- Generate the environment variables in
.env
for frontend.
- Generate the environment variables in
See CONTRIBUTING for more information.
This code is licensed under the MIT-0 License. See the LICENSE file.