Skip to content

Commit c06bea7

Browse files
private-ddn: update byoc permission (#175)
This pull request updates the documentation for creating a data plane in a Bring Your Own Cloud (BYOC) setup. The changes include enhancements to the CloudFormation template, updates to AWS permissions, and adjustments to GCP configurations, ensuring improved flexibility and clarity for users. ### AWS CloudFormation Template Enhancements: * Changed the syntax from `bash` to `yaml` and added a new `ExternalId` parameter for trust relationships. This parameter allows customization with validation rules for length and allowed characters. * Updated `sts:ExternalId` in the trust relationship to reference the newly added `ExternalId` parameter instead of the hardcoded value. ### AWS Permissions Updates: * Added permissions for additional AWS services, including `ec2:DescribeVpcEndpoints`, `rds:DescribeDBInstances`, `ec2:CreateSecurityGroup`, and `iam:UpdateAssumeRolePolicy`. These changes expand the scope of supported operations. [[1]](diffhunk://#diff-4e65397b3c1d1f1985ff681841ddc06fbe6766c099cc5f84f94a709b5c1d55deR107-R108) [[2]](diffhunk://#diff-4e65397b3c1d1f1985ff681841ddc06fbe6766c099cc5f84f94a709b5c1d55deR132-R134) [[3]](diffhunk://#diff-4e65397b3c1d1f1985ff681841ddc06fbe6766c099cc5f84f94a709b5c1d55deR182-R190) * Included `rds.amazonaws.com` in the list of trusted service principals and added `rds:*` to the allowed actions, enabling support for RDS-related operations. ### GCP Configuration Adjustments: * Added `sqladmin.googleapis.com` and `servicenetworking.googleapis.com` to the list of enabled APIs for GCP projects. * Granted the `roles/cloudsql.admin` IAM role to the service account for managing Cloud SQL resources. ### Documentation Updates: * Clarified the requirements for sharing the `ExternalId` parameter with Hasura, emphasizing its importance when customized. * Expanded the valid range for VPC CIDR blocks from `/16` to `/16-/19` for both AWS and GCP, providing more flexibility in network configurations. [[1]](diffhunk://#diff-4e65397b3c1d1f1985ff681841ddc06fbe6766c099cc5f84f94a709b5c1d55deL311-R343) [[2]](diffhunk://#diff-4e65397b3c1d1f1985ff681841ddc06fbe6766c099cc5f84f94a709b5c1d55deL406-R444)
1 parent d3109da commit c06bea7

File tree

1 file changed

+44
-6
lines changed
  • docs/private-ddn/creating-a-data-plane

1 file changed

+44
-6
lines changed

docs/private-ddn/creating-a-data-plane/byoc.mdx

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ The setup involves creating an IAM role in your AWS account that establishes a t
5454
<details>
5555

5656
<summary>cloudformation.yaml</summary>
57-
```bash
57+
```yaml
58+
Parameters:
59+
ExternalId:
60+
Type: String
61+
Default: hasura-cloud
62+
Description: External ID for the trust relationship with Hasura Cloud
63+
MinLength: 2
64+
MaxLength: 1224
65+
AllowedPattern: "[A-Za-z0-9+=,.@:\\/-]*"
66+
5867
Resources:
5968
BootstrapRole:
6069
Type: AWS::IAM::Role
@@ -69,7 +78,7 @@ Resources:
6978
Action: sts:AssumeRole
7079
Condition:
7180
StringEquals:
72-
sts:ExternalId: hasura-cloud
81+
sts:ExternalId: !Ref ExternalId
7382
BootstrapPolicy:
7483
Type: AWS::IAM::Policy
7584
Properties:
@@ -95,6 +104,8 @@ Resources:
95104
- ec2:DescribeTags
96105
- ec2:DescribeVpcAttribute
97106
- ec2:DescribeVpcs
107+
- ec2:DescribeVpcEndpointServices
108+
- ec2:DescribeVpcEndpoints
98109
- eks:DeleteAddon
99110
- eks:DescribeAddon
100111
- eks:DescribeCluster
@@ -103,6 +114,8 @@ Resources:
103114
- iam:GetRole
104115
- iam:GetServiceLinkedRoleDeletionStatus
105116
- sqs:GetQueueAttributes
117+
- rds:DescribeDBInstances
118+
- rds:DescribeOrderableDBInstanceOptions
106119
Resource: '*'
107120
- Effect: Allow
108121
Action:
@@ -116,6 +129,9 @@ Resources:
116129
- ec2:CreateSubnet
117130
- ec2:CreateTags
118131
- ec2:CreateVpc
132+
- ec2:CreateSecurityGroup
133+
- ec2:AuthorizeSecurityGroupIngress
134+
- ec2:CreateVpcEndpoint
119135
- eks:CreateCluster
120136
- eks:CreateNodegroup
121137
- globalaccelerator:CreateAccelerator
@@ -129,6 +145,8 @@ Resources:
129145
- events:TagResource
130146
- iam:CreateOpenIDConnectProvider
131147
- iam:TagOpenIDConnectProvider
148+
- rds:CreateDBSubnetGroup
149+
- rds:CreateDBInstance
132150
Resource: '*'
133151
Condition:
134152
StringEquals:
@@ -161,12 +179,15 @@ Resources:
161179
- iam:CreateInstanceProfile
162180
- iam:CreatePolicy
163181
- iam:CreateRole
182+
- iam:CreatePolicyVersion
164183
- iam:DeleteInstanceProfile
165184
- iam:DeleteOpenIDConnectProvider
166185
- iam:DeletePolicy
167186
- iam:DeleteRole
168187
- iam:DeleteServiceLinkedRole
169188
- iam:DetachRolePolicy
189+
- iam:UpdateAssumeRolePolicy
190+
- iam:UpdateOpenIDConnectProviderThumbprint
170191
- iam:GetInstanceProfile
171192
- iam:GetOpenIDConnectProvider
172193
- iam:GetPolicy
@@ -217,13 +238,15 @@ Resources:
217238
- globalaccelerator.amazonaws.com
218239
- eks.amazonaws.com
219240
- eks-nodegroup.amazonaws.com
241+
- rds.amazonaws.com
220242
- Effect: Allow
221243
Action:
222244
- eks:*
223245
- globalaccelerator:*
224246
- sqs:*
225247
- acm:*
226248
- events:*
249+
- rds:*
227250
Resource: '*'
228251
Condition:
229252
StringEquals:
@@ -257,7 +280,8 @@ Outputs:
257280
aws cloudformation create-stack \
258281
--stack-name hasura-cloud-byoc \
259282
--template-body file://cloudformation.yaml \
260-
--capabilities CAPABILITY_NAMED_IAM
283+
--capabilities CAPABILITY_NAMED_IAM \
284+
--parameters ParameterKey=ExternalId,ParameterValue=hasura-cloud
261285

262286
# Wait for creation to complete
263287
aws cloudformation wait stack-create-complete \
@@ -270,7 +294,8 @@ Outputs:
270294
aws cloudformation update-stack \
271295
--stack-name hasura-cloud-byoc \
272296
--template-body file://cloudformation.yaml \
273-
--capabilities CAPABILITY_NAMED_IAM
297+
--capabilities CAPABILITY_NAMED_IAM \
298+
--parameters ParameterKey=ExternalId,ParameterValue=hasura-cloud
274299

275300
# Wait for update to complete
276301
aws cloudformation wait stack-update-complete \
@@ -298,6 +323,13 @@ Share the following with the Hasura team:
298323

299324
- (Required) Role ARN (From output above)
300325
- (Required) AWS Region
326+
- (Optional) External ID
327+
- The external ID used in the trust relationship between your AWS account and Hasura's AWS account
328+
- This is the value you specified for the `ExternalId` parameter in the CloudFormation template
329+
- If not specified, the default value "hasura-cloud" will be used
330+
- Must have a minimum of 2 characters and a maximum of 1,224 characters
331+
- Must be alphanumeric without white space, but can include the following symbols: plus (+), equal (=), comma (,), period (.), at (@), colon (:), forward slash (/), and hyphen (-)
332+
- **Important**: Make sure to provide this value to the Hasura team if you've customized it
301333
- (Optional) Preferred Availability Zones
302334
- Use AZ IDs (e.g., use1-az1, use1-az2) instead of AZ names (us-east-1a, us-east-1b)
303335
- You can get the AZ IDs by running:
@@ -308,7 +340,7 @@ Share the following with the Hasura team:
308340
--query "AvailabilityZones[?State=='available'] | [].{ZoneName: ZoneName, ZoneId: ZoneId}"
309341
```
310342
- If you have specific zones which you'd like to use, please pass it along. Otherwise, Hasura will assign accordingly.
311-
- (Optional) VPC CIDR (/16 CIDR)
343+
- (Optional) VPC CIDR (/16-/19 CIDR)
312344
- If you have a specific CIDR in mind for the VPC setup, please pass it along. If not specified, Hasura will assign 10.0.0.0/16.
313345
- Note: If you are planning to use VPC Peering, this CIDR should not conflict with any networks on your side.
314346
- (Optional) Kubernetes Service CIDR (/16-20 CIDR)
@@ -338,6 +370,8 @@ gcloud services enable \
338370
multiclusterservicediscovery.googleapis.com \
339371
trafficdirector.googleapis.com \
340372
multiclusteringress.googleapis.com \
373+
sqladmin.googleapis.com \
374+
servicenetworking.googleapis.com \
341375
container.googleapis.com \
342376
certificatemanager.googleapis.com --project ${GCP_PROJECT_ID}
343377
```
@@ -389,6 +423,10 @@ gcloud projects add-iam-policy-binding ${GCP_PROJECT_ID} \
389423
--member "serviceAccount:[email protected]" \
390424
--role roles/iam.serviceAccountAdmin
391425

426+
gcloud projects add-iam-policy-binding ${GCP_PROJECT_ID} \
427+
--member "serviceAccount:[email protected]" \
428+
--role roles/cloudsql.admin
429+
392430
gcloud projects add-iam-policy-binding ${GCP_PROJECT_ID} \
393431
--member "serviceAccount:[email protected]" \
394432
--role roles/iam.workloadIdentityPoolAdmin
@@ -403,7 +441,7 @@ Share the following with the Hasura team:
403441
- (Required) GCP Region
404442
- (Optional) Preferred Availability Zones
405443
- If you have specific zones which you'd like to use, please pass it along. Otherwise, Hasura will assign accordingly.
406-
- (Optional) VPC CIDR (/16 CIDR)
444+
- (Optional) VPC CIDR (/16-/19 CIDR)
407445
- If you have a specific CIDR in mind for the VPC setup, please pass it along. If not specified, Hasura will assign 10.0.0.0/16.
408446
- Note: If you are planning to use VPC Peering, this CIDR should not conflict with any networks on your side.
409447

0 commit comments

Comments
 (0)