Skip to content

Commit 6bd4354

Browse files
d-bytebaseclaude
andauthored
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]>
1 parent 5a28bd7 commit 6bd4354

File tree

9 files changed

+116
-107
lines changed

9 files changed

+116
-107
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

mintlify/get-started/instance.mdx

Lines changed: 116 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -143,70 +143,89 @@ Integrate with custom secret managers using your API:
143143

144144
## AWS Configuration
145145

146+
### Prerequisites: IAM Role Setup
147+
148+
Use attached IAM roles for secure, key-free authentication on EC2 instances. This eliminates the need to manage access keys.
149+
150+
References: [IAM roles for EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) | [IAM best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) | [Using instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html)
151+
152+
#### Create IAM Role
153+
154+
1. Go to [IAM Console → Roles](https://console.aws.amazon.com/iam/home#/roles)
155+
2. Click **Create role**
156+
3. Select trusted entity type: **AWS service****EC2**
157+
4. Attach policies as needed:
158+
- For RDS IAM authentication - see [RDS/Aurora section](#rdsaurora-with-iam-authentication)
159+
- For Secrets Manager access - see [AWS Secrets Manager section](#aws-secrets-manager)
160+
5. Name the role: `bytebase-role`
161+
162+
#### Attach IAM Role to EC2
163+
164+
**New EC2 Instance:**
165+
1. Launch instance in [EC2 Console](https://console.aws.amazon.com/ec2/)
166+
2. In **Advanced details****IAM instance profile**: Select `bytebase-role`
167+
168+
**Existing EC2 Instance:**
169+
1. Select instance → **Actions****Security****Modify IAM role**
170+
2. Select `bytebase-role`**Update IAM role**
171+
172+
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).
178+
</Warning>
179+
180+
1. Create an IAM user with required policies
181+
2. Generate access keys
182+
3. Set environment variables:
183+
```bash
184+
-e AWS_ACCESS_KEY_ID=xxx
185+
-e AWS_SECRET_ACCESS_KEY=yyy
186+
-e AWS_REGION=us-east-1
187+
```
188+
189+
Reference: [Managing access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
190+
146191
### RDS/Aurora with IAM Authentication
147192

148-
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>
149196

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)
154198

155199
#### Step 1: Configure RDS/Aurora Instance
156200

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)
166-
- No additional configuration needed
167-
168-
#### Step 2: Create IAM Role for EC2
169-
170-
1. **Create IAM Policy**
171-
- Go to IAM → Policies → Create policy
172-
- Choose JSON and paste:
173-
```json
174-
{
175-
"Version": "2012-10-17",
176-
"Statement": [
177-
{
178-
"Effect": "Allow",
179-
"Action": "rds-db:connect",
180-
"Resource": "arn:aws:rds-db:REGION:ACCOUNT_ID:dbuser:DB_INSTANCE_ID/DB_USER"
181-
}
182-
]
183-
}
184-
```
185-
- 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)
190204

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)
196206

197-
#### Step 3: Setup EC2 Instance with IAM Role
207+
#### Step 2: Grant Database Connect Permission
198208

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:
202210

203-
2. **Deploy Bytebase**
204-
- Install Bytebase on your EC2 instance
205-
- No AWS credentials configuration needed - the IAM role provides automatic authentication
211+
```json
212+
{
213+
"Version": "2012-10-17",
214+
"Statement": [
215+
{
216+
"Effect": "Allow",
217+
"Action": "rds-db:connect",
218+
"Resource": "arn:aws:rds-db:REGION:ACCOUNT_ID:dbuser:DB_RESOURCE_ID/bytebase"
219+
}
220+
]
221+
}
222+
```
206223

207-
#### Step 4: Create Database User
224+
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:*/*`
208225

209-
Connect to your RDS instance and create an IAM-authenticated user:
226+
Reference: [IAM policy examples](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.IAMPolicy.html)
227+
228+
#### Step 3: Create Database User
210229

211230
**MySQL/Aurora MySQL:**
212231
```sql
@@ -219,85 +238,75 @@ GRANT ALL PRIVILEGES ON *.* TO 'bytebase'@'%';
219238
```sql
220239
CREATE USER bytebase;
221240
GRANT rds_iam TO bytebase;
222-
-- Grant appropriate database permissions as needed
241+
-- Grant appropriate permissions
223242
```
224243

225-
Reference: [MySQL setup](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html#UsingWithRDS.IAMDBAuth.DBAccounts.MySQL) | [PostgreSQL setup](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html#UsingWithRDS.IAMDBAuth.DBAccounts.PostgreSQL)
226-
227-
#### Step 5: Connect from Bytebase
244+
References: [MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html#UsingWithRDS.IAMDBAuth.DBAccounts.MySQL) | [PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html#UsingWithRDS.IAMDBAuth.DBAccounts.PostgreSQL)
228245

229-
Configure the database connection in Bytebase:
246+
#### Step 4: Connect from Bytebase
230247

231248
1. Click **New Instance** in Bytebase
232-
2. Enter connection details:
233-
- **Host:** Your RDS endpoint (found in RDS console)
249+
2. Configure connection:
250+
- **Host:** Your RDS endpoint
234251
- **Port:** 3306 (MySQL) or 5432 (PostgreSQL)
235252
- **Username:** `bytebase`
236253
- **Authentication:** Select `AWS RDS IAM`
237-
238254
3. Test and save the connection
239255

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.
245257

246258
### AWS Secrets Manager
247259

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`.
255-
256-
![](/content/docs/get-started/instance/aws-secrets-manager/iam-user-detail.webp)
257-
258-
Attach `SecretsManagerReadWrite` permission.
259-
260-
![](/content/docs/get-started/instance/aws-secrets-manager/iam-set-permission.webp)
261-
262-
After creating the IAM user, create an Access Key to be used by Bytebase later.
263-
264-
![](/content/docs/get-started/instance/aws-secrets-manager/iam-create-access-key.webp)
265-
266-
Select `Third-party service` as the use case.
267-
268-
![](/content/docs/get-started/instance/aws-secrets-manager/iam-access-key-use-case.webp)
260+
Store database passwords securely in AWS Secrets Manager instead of Bytebase.
269261

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.
271-
272-
![](/content/docs/get-started/instance/aws-secrets-manager/iam-access-key-info.webp)
273-
274-
#### Create secret
262+
<Note>
263+
Prerequisites: [IAM role](#prerequisites-iam-role-setup) with Secrets Manager permissions.
264+
</Note>
275265

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.
266+
#### Step 1: Grant Secrets Manager Access
277267

278-
![](/content/docs/get-started/instance/aws-secrets-manager/secret-type.webp)
268+
Add this policy to your IAM role to read secrets:
279269

280-
Next to the `Configure secret`, use `bytebase` as the Secret name
270+
```json
271+
{
272+
"Version": "2012-10-17",
273+
"Statement": [
274+
{
275+
"Effect": "Allow",
276+
"Action": [
277+
"secretsmanager:GetSecretValue",
278+
"secretsmanager:DescribeSecret"
279+
],
280+
"Resource": "arn:aws:secretsmanager:REGION:ACCOUNT_ID:secret:SECRET_NAME-*"
281+
}
282+
]
283+
}
284+
```
281285

282-
![](/content/docs/get-started/instance/aws-secrets-manager/configure-secret.webp)
286+
Replace `REGION`, `ACCOUNT_ID`, and `SECRET_NAME` with your values. For easier setup, you can use wildcards: `arn:aws:secretsmanager:*:*:secret:*`
283287

284-
Skip rotation, review and create the secret.
288+
Reference: [Secrets Manager IAM permissions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_identity-based-policies.html)
285289

286-
#### Use secret in Bytebase
290+
#### Step 2: Create Secret
287291

288-
Restart Bytebase with the following environment variables:
292+
1. Go to [AWS Secrets Manager Console](https://console.aws.amazon.com/secretsmanager/)
293+
2. Click **Store a new secret**
294+
3. Select **Other type of secret**
295+
4. Add key/value pair: Key = `DB_PASSWORD`, Value = your password
296+
5. Name the secret (e.g., `bytebase-db-password`)
297+
6. Complete creation and note the ARN
289298

290-
```bash
291-
docker run --init \
292-
-e AWS_REGION=us-east-1 \
293-
-e AWS_ACCESS_KEY_ID=xxx \
294-
-e AWS_SECRET_ACCESS_KEY=yyy \
295-
...
296-
```
299+
Reference: [Creating secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_secret.html)
297300

298-
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.
301+
#### Step 3: Configure in Bytebase
299302

300-
![](/content/docs/get-started/instance/aws-secrets-manager/auth.webp)
303+
1. In your database instance settings, find the password field
304+
2. Click the key icon to use external secret
305+
3. Select **AWS Secrets Manager**
306+
4. Enter:
307+
- **Secret Name:** Your secret name from Step 2
308+
- **Secret Key:** `DB_PASSWORD`
309+
5. Test connection and save
301310

302311
## GCP Configuration
303312

0 commit comments

Comments
 (0)