Skip to content

Commit a6f3e11

Browse files
committed
fix secret access issue
1 parent 4d88731 commit a6f3e11

File tree

3 files changed

+19
-33
lines changed

3 files changed

+19
-33
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ Please follow the steps below to deploy the Bedrock Proxy APIs into your AWS acc
7777
Description: (Optional) Add a description of your secret
7878
5. Click "Next" and review all your settings and click "Store"
7979

80+
After creation, you'll see your secret in the Secrets Manager console. Make note of the secret ARN.
81+
82+
8083
**Step 2: Deploy the CloudFormation stack**
8184

8285
1. Sign in to AWS Management Console, switch to the region to deploy the CloudFormation Stack to.
@@ -88,11 +91,11 @@ Please follow the steps below to deploy the Bedrock Proxy APIs into your AWS acc
8891
3. Click "Next".
8992
4. On the "Specify stack details" page, provide the following information:
9093
- Stack name: Change the stack name if needed.
91-
- ApiKeySecretName: Enter the secret name you used for storing the API key (e.g., `BedrockProxyAPIKey`). Click "Next".
92-
5. On the "Configure stack options" page, you can leave the default settings or customize them according to your needs.
93-
6. Click "Next".
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.
95-
8. Click "Create stack".
94+
- ApiKeySecretArn: Enter the secret ARN you used for storing the API key.
95+
96+
Click "Next".
97+
5. On the "Configure stack options" page, you can leave the default settings or customize them according to your needs. Click "Next".
98+
6. 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. Click "Create stack".
9699

97100
That is it! 🎉 Once deployed, click the CloudFormation stack and go to **Outputs** tab, you can find the API Base URL from `APIBaseUrl`, the value should look like `http://xxxx.xxx.elb.amazonaws.com/api/v1`.
98101

README_CN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ OpenAI 的 API 或 SDK 无缝集成并试用 Amazon Bedrock 的模型,而无需
7676
4. 在 "配置密钥" 页面: 密钥名称:输入一个名称(例如:"BedrockProxyAPIKey") 描述:(可选)添加密钥的描述
7777
5. 点击 "下一步",检查所有设置后点击 "存储"
7878

79+
创建完成后,您将在 Secrets Manager 控制台中看到您的密钥。请记下密钥的 ARN。
7980

8081
**第二步: 部署CloudFormation堆栈**
8182

@@ -88,12 +89,11 @@ OpenAI 的 API 或 SDK 无缝集成并试用 Amazon Bedrock 的模型,而无需
8889
3. 单击"下一步"。
8990
4. 在"指定堆栈详细信息"页面,提供以下信息:
9091
- 堆栈名称: 可以根据需要更改名称。
91-
- ApiKeySecretName:输入您用于存储API 密钥的名称(例如"BedrockProxyAPIKey"),否则,请将此字段留空。
92-
单击"下一步"。
93-
5. 在"配置堆栈选项"页面,您可以保留默认设置或根据需要进行自定义。
94-
6. 单击"下一步"。
95-
7. 在"审核"页面,查看您即将创建的堆栈详细信息。勾选底部的"我确认,AWS CloudFormation 可能创建 IAM 资源。"复选框。
96-
8. 单击"创建堆栈"。
92+
- ApiKeySecretArn:输入您用于存储API 密钥的ARN。
93+
94+
单击"下一步"。
95+
5. 在"配置堆栈选项"页面,您可以保留默认设置或根据需要进行自定义。 单击"下一步"。
96+
6. 在"审核"页面,查看您即将创建的堆栈详细信息。勾选底部的"我确认,AWS CloudFormation 可能创建 IAM 资源。"复选框。 单击"创建堆栈"。
9797

9898
仅此而已 🎉 。部署完成后,点击CloudFormation堆栈,进入"输出"选项卡,你可以从"APIBaseUrl"
9999
中找到API Base URL,它应该类似于`http://xxxx.xxx.elb.amazonaws.com/api/v1` 这样的格式。

deployment/BedrockProxyFargate.template

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Description: Bedrock Access Gateway - OpenAI-compatible RESTful APIs for Amazon Bedrock
22
Transform: AWS::LanguageExtensions
33
Parameters:
4-
ApiKeySecretName:
4+
ApiKeySecretArn:
55
Type: String
6-
Default: ""
7-
Description: The secret name in Secrets Manager used to store the API Key
6+
AllowedPattern: ^arn:aws:secretsmanager:.*$
7+
Description: The secret ARN in Secrets Manager used to store the API Key
88
Resources:
99
VPCB9E5F0B4:
1010
Type: AWS::EC2::VPC
@@ -144,17 +144,7 @@ Resources:
144144
- secretsmanager:DescribeSecret
145145
Effect: Allow
146146
Resource:
147-
Fn::Join:
148-
- ""
149-
- - "arn:"
150-
- Ref: AWS::Partition
151-
- ":secretsmanager:"
152-
- Ref: AWS::Region
153-
- ":"
154-
- Ref: AWS::AccountId
155-
- ":secret:"
156-
- Ref: ApiKeySecretName
157-
- -??????
147+
Ref: ApiKeySecretArn
158148
- Action:
159149
- ecr:BatchCheckLayerAvailability
160150
- ecr:GetDownloadUrlForLayer
@@ -252,14 +242,7 @@ Resources:
252242
ValueFrom:
253243
Fn::Join:
254244
- ""
255-
- - "arn:"
256-
- Ref: AWS::Partition
257-
- ":secretsmanager:"
258-
- Ref: AWS::Region
259-
- ":"
260-
- Ref: AWS::AccountId
261-
- ":secret:"
262-
- Ref: ApiKeySecretName
245+
- - Ref: ApiKeySecretArn
263246
- ":api_key::"
264247
Cpu: "1024"
265248
ExecutionRoleArn:

0 commit comments

Comments
 (0)