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
docs: improve AWS IAM authentication documentation (#840)
- Restructure AWS Configuration section to match GCP style
- Emphasize IAM roles as the most secure authentication method
- Remove screenshots to reduce maintenance burden
- Add extensive AWS documentation links
- Use least-privilege IAM policies for Secrets Manager
- Simplify prerequisites section with references to detailed guides
- Delete 8 unused AWS Secrets Manager screenshot files
This change makes the AWS documentation more concise, secure, and
maintainable while following the same structure as the GCP section.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <[email protected]>
Deploy Bytebase on your EC2 instance - credentials are provided automatically through the instance metadata service.
173
+
174
+
#### Alternative: IAM User with Access Keys
175
+
176
+
<Warning>
177
+
Use only when running Bytebase outside AWS. See [why to use IAM roles instead of access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#access-keys-alternatives).
This guide demonstrates the most secure method for IAM authentication using EC2 instance profiles, which eliminates the need to manage access keys.
193
+
<Note>
194
+
Prerequisites: [IAM role](#prerequisites-iam-role-setup) with RDS connect permissions.
195
+
</Note>
149
196
150
-
For alternative authentication methods such as IAM users with access keys or cross-account access, refer to:
151
-
-[AWS RDS IAM Database Authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html)
152
-
-[Connecting using IAM authentication from the command line](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html)
153
-
-[IAM authentication for cross-account access](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.CrossAccount.html)
197
+
References: [IAM database authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) | [Connecting with IAM](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html)
154
198
155
199
#### Step 1: Configure RDS/Aurora Instance
156
200
157
-
Enable IAM authentication on your database instance:
158
-
159
-
1.**Enable IAM Database Authentication**
160
-
- For existing instances: Modify instance → Database authentication → IAM database authentication
161
-
- For new instances: Enable "Password and IAM database authentication" during creation
162
-
- Reference: [Enabling IAM authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Enabling.html)
163
-
164
-
2.**Verify SSL/TLS**
165
-
- SSL is enabled by default on RDS (required for IAM auth)
- Replace `REGION`, `ACCOUNT_ID`, `DB_INSTANCE_ID`, and `DB_USER` with your values
186
-
- Or use wildcards (*) for broader access
187
-
- Name the policy: `rds-iam-auth-policy`
188
-
189
-
> **Production Best Practice:** Use specific ARNs instead of wildcards. See [AWS IAM Policy examples](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.IAMPolicy.html).
201
+
1. In [RDS Console](https://console.aws.amazon.com/rds/), modify your instance
202
+
2. Enable **IAM database authentication** under Database authentication options
203
+
3. Save changes (SSL is enabled by default)
190
204
191
-
2.**Create IAM Role**
192
-
- Go to IAM → Roles → Create role
193
-
- Select trusted entity: `AWS service` → `EC2`
194
-
- Attach the `rds-iam-auth-policy` created above
195
-
- Name: `bytebase-rds-role`
205
+
Reference: [Enabling IAM authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Enabling.html)
196
206
197
-
#### Step 3: Setup EC2 Instance with IAM Role
207
+
#### Step 2: Grant Database Connect Permission
198
208
199
-
1.**Attach IAM Role to EC2**
200
-
- New instances: Select `bytebase-rds-role` during launch configuration
201
-
- Existing instances: EC2 console → Actions → Security → Modify IAM role → Select `bytebase-rds-role`
209
+
Add this policy to your IAM role to allow RDS IAM authentication:
202
210
203
-
2.**Deploy Bytebase**
204
-
- Install Bytebase on your EC2 instance
205
-
- No AWS credentials configuration needed - the IAM role provides automatic authentication
Replace `REGION`, `ACCOUNT_ID`, and `DB_RESOURCE_ID` with your values. Find DB_RESOURCE_ID in RDS console → Configuration tab. For easier setup, you can use wildcards: `arn:aws:rds-db:*:*:dbuser:*/*`
208
225
209
-
Connect to your RDS instance and create an IAM-authenticated user:
-**Host:** Your RDS endpoint (found in RDS console)
249
+
2.Configure connection:
250
+
-**Host:** Your RDS endpoint
234
251
-**Port:** 3306 (MySQL) or 5432 (PostgreSQL)
235
252
-**Username:**`bytebase`
236
253
-**Authentication:** Select `AWS RDS IAM`
237
-
238
254
3. Test and save the connection
239
255
240
-
Bytebase automatically handles IAM token generation and refresh using the EC2 instance role.
241
-
242
-
<Tip>
243
-
IAM authentication tokens expire after 15 minutes, but Bytebase automatically refreshes them using the instance profile. Learn more about [IAM database authentication limitations](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html#UsingWithRDS.IAMDBAuth.Limitations).
244
-
</Tip>
256
+
Bytebase automatically handles token generation and refresh using the EC2 instance profile.
245
257
246
258
### AWS Secrets Manager
247
259
248
-
#### Create an IAM user to access the Secrets Manager
249
-
250
-
<Tip>
251
-
It's recommended to create a dedicated IAM user for Bytebase to retrieve the secrets. You only need to do this once.
252
-
</Tip>
253
-
254
-
Visit [IAM](https://aws.amazon.com/iam/) to create a new IAM user. Name it `bytebase-external-secret`.
Store database passwords securely in AWS Secrets Manager instead of Bytebase.
269
261
270
-
Optionally set the description tag and in the `Retrieve access keys` screen, record `Access key` and `Secret access key`. They will be passed as environment variables when starting Bytebase.
Prerequisites: [IAM role](#prerequisites-iam-role-setup) with Secrets Manager permissions.
264
+
</Note>
275
265
276
-
Visit [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) to store a new secret. Select `Other type of secret`, and add a key/value pair. The key is `DB_PASSWORD` and the value is your database user password.
Go to instance setting, specify `bytebase` as the Secret name and `DB_PASSWORD` as the Secret key. These two correspond to the value you created in the AWS Secrets Manager.
0 commit comments