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
+17-38Lines changed: 17 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,7 @@ OpenAI-compatible RESTful APIs for Amazon Bedrock
6
6
7
7
## Breaking Changes
8
8
9
-
This solution can now **automatically detect** new models supported in Amazon Bedrock.
10
-
So whenever new models are added to Amazon Bedrock, you can immediately try them without the need to wait for code changes to this repo.
11
-
12
-
This is to use the `ListFoundationModels` api and the `ListInferenceProfiles` api by Amazon Bedrock, due to this change, additional IAM permissions are required to your Lambda/Fargate role.
13
-
14
-
If you are facing error: 'Unsupported model xxx, please use models API to get a list of supported models' even the model ID is correct,
15
-
please either update your existing stack (**Recommended**) with the new template in the deployment folder or manually add below permissions to the related Lambda/Fargate role.
16
-
17
-
```json
18
-
{
19
-
"Action": [
20
-
"bedrock:ListFoundationModels",
21
-
"bedrock:ListInferenceProfiles"
22
-
],
23
-
"Resource": "*",
24
-
"Effect": "Allow"
25
-
}
26
-
```
9
+
This solution now uses Secrets Manager to maintain API Key for security best practice. You **MUST** create the API Key first in Secrets Manager and rotate it frequently.
27
10
28
11
Please raise an GitHub issue if you still have problems.
29
12
@@ -74,42 +57,38 @@ Alternatively, you can use Lambda Function URL to replace ALB, see [example](htt
74
57
75
58
Please follow the steps below to deploy the Bedrock Proxy APIs into your AWS account. Only supports regions where Amazon Bedrock is available (such as `us-west-2`). The deployment will take approximately **3-5 minutes** 🕒.
76
59
77
-
**Step 1: Create your own custom API key (Optional)**
78
-
79
-
#### Store API Key in ParameterStore
60
+
**Step 1: Create your own API key in Secrets Manager (MUST)**
80
61
81
-
> **Note:** This step is to use any string (without spaces) you like to create a custom API Key (credential) that will be used to access the proxy API later. This key does not have to match your actual OpenAI key, and you don't need to have an OpenAI API key. It is recommended that you take this step and ensure that you keep the key safe and private.
82
62
83
-
1. Open the AWS Management Console and navigate to the Systems Manager service.
84
-
2. In the left-hand navigation pane, click on "Parameter Store".
85
-
3. Click on the "Create parameter" button.
86
-
4. In the "Create parameter" window, select the following options:
87
-
- Name: Enter a descriptive name for your parameter (e.g., "BedrockProxyAPIKey").
88
-
- Description: Optionally, provide a description for the parameter.
89
-
- Tier: Select **Standard**.
90
-
- Type: Select **SecureString**.
91
-
- Value: Any string (without spaces).
92
-
5. Click "Create parameter".
93
-
6. Make a note of the parameter name you used (e.g., "BedrockProxyAPIKey"). You'll need this in the next step.
63
+
> **Note:** This step is to use any string (without spaces) you like to create a custom API Key (credential) that will be used to access the proxy API later. This key does not have to match your actual OpenAI key, and you don't need to have an OpenAI API key. please keep the key safe and private.
94
64
95
-
#### Store API Key in ENV variable
65
+
1. Open the AWS Management Console and navigate to the AWS Secrets Manager service.
66
+
2. Click on "Store a new secret" button.
67
+
3. In the "Choose secret type" page, select:
96
68
97
-
1. Provide an ENV variable to the container named: `API_KEY` with the API key value.
69
+
Secret type: Other type of secret
70
+
Key/value pairs:
71
+
- Key: api_key
72
+
- Value: Enter your API key value
73
+
74
+
Click "Next"
75
+
4. In the "Configure secret" page:
76
+
Secret name: Enter a name (e.g., "BedrockProxyAPIKey")
77
+
Description: (Optional) Add a description of your secret
78
+
5. Click "Next" and review all your settings and click "Store"
98
79
99
80
**Step 2: Deploy the CloudFormation stack**
100
81
101
82
1. Sign in to AWS Management Console, switch to the region to deploy the CloudFormation Stack to.
102
83
2. Click the following button to launch the CloudFormation Stack in that region. Choose one of the following:
4. On the "Specify stack details" page, provide the following information:
111
90
- Stack name: Change the stack name if needed.
112
-
-ApiKeyParam (if you set up an API key in Step 1): Enter the parameter name you used for storing the API key (e.g., `BedrockProxyAPIKey`). If you did not set up an API key, leave this field blank. Click "Next".
91
+
-ApiKeySecretName: Enter the secret name you used for storing the API key (e.g., `BedrockProxyAPIKey`). Click "Next".
113
92
5. On the "Configure stack options" page, you can leave the default settings or customize them according to your needs.
114
93
6. Click "Next".
115
94
7. On the "Review" page, review the details of the stack you're about to create. Check the "I acknowledge that AWS CloudFormation might create IAM resources" checkbox at the bottom.
0 commit comments