You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,21 @@ Achieving this can be a bit confusing if you're new to VPCs. When you create you
70
70
71
71
If you want to learn more, here's some more info on [VPCs in the context of RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) and on [security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html).
72
72
73
-
Now, we just have to make sure that our Lambda is created within our VPC as well. For that just edit the AWS_VPC environment variables in the `.env.template` and they will be used in the `vpc` section of the `serverless.yml` file. You can find all these values in the RDS console under "Connectivity & Security". (As the securityGroupId it's enough to use the `default` one: this basically makes the Lambda function part of the VPC. There should be 3 subnetIds.)
73
+
Now, we just have to make sure that our Lambda is created within our VPC as well. For that just use the AWS_VPC environment variables from the `.env.template` and add the following to the specifications of your `graphql` function in your `serverless.yml` file:
74
+
75
+
```
76
+
vpc:
77
+
securityGroupIds:
78
+
"Fn::Split":
79
+
- ","
80
+
- ${env:AWS_VPC_SECURITY_GROUP_IDS}
81
+
subnetIds:
82
+
"Fn::Split":
83
+
- ","
84
+
- ${env:AWS_VPC_SUBNET_IDS}
85
+
```
86
+
87
+
You can find all these values in the RDS console under "Connectivity & Security". (As the securityGroupId it's enough to use the `default` one: this basically makes the Lambda function part of the VPC. There should be 3 subnetIds.)
74
88
75
89
(You will also need to add `"iam:AttachRolePolicy"` to the permissions of the Serverless IAM role policy you will later create.)
0 commit comments