Skip to content

Commit 954dad6

Browse files
committed
2025-05-30
1 parent 699f600 commit 954dad6

File tree

4 files changed

+0
-90
lines changed

4 files changed

+0
-90
lines changed

apigw-lambda-bedrock-sam/README.md

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -43,61 +43,6 @@ Amazon Bedrock users need to request access to models before they are available
4343

4444
For production applications, you should [enable authentication for the API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-to-api.html) using one of several available options and [follow the API Gateway security best practices](https://docs.aws.amazon.com/apigateway/latest/developerguide/security-best-practices.html).
4545

46-
5. Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs which are used for next step as well as testing.
47-
6. Run the `create_lambda_layer.sh`. You may have to change the file permission to make it executable. This will create the lambda layer with necessary boto3 api for bedrock.
48-
```bash
49-
./create_lambda_layer.sh
50-
```
51-
7. Provide a name for the Lambda layer. Such as:
52-
```bash
53-
Enter the name of the Layer: boto3-lambda-layer
54-
```
55-
It will show output like below:
56-
```bash
57-
Publishing the layer. Please wait ...
58-
{
59-
"Content": {
60-
.....
61-
.....
62-
},
63-
"LayerArn": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:layer:boto3-lambda-layer",
64-
"LayerVersionArn": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:layer:boto3-lambda-layer:1",
65-
"Description": "",
66-
"CreatedDate": "YYYY-MM-DDT10:47:36.983+0000",
67-
"Version": 1
68-
}
69-
```
70-
8. You may have to press `q` to come out of the output. Copy the value of `LayerVersionArn` from the above output and provide it into the next step. Such as:
71-
```bash
72-
Enter the LayerVersionArn from the above command: arn:aws:lambda:us-east-1:xxxxxxxxxxxx:layer:boto3-lambda-layer:1
73-
```
74-
9. Please copy the value of `ContentGenerationLambdaFunction` from the `sam deploy --guided` output and provide that as response to next question. Such as:
75-
```bash
76-
Enter the Lambda function name from the SAM deploy output: your-stack-name-ContentGenerationLambdaXx-xxxxxxxxxxxx
77-
```
78-
The script will now run aws cli command to add the newly created layer to the Lambda function. It will show output as below:
79-
It will show output like below:
80-
```bash
81-
Adding the new layer to your Lambda function's configuration. Please wait ...
82-
{
83-
"FunctionName": "your-stack-name-ContentGenerationLambdaXx-xxxxxxxxxxxx",
84-
......
85-
......
86-
"State": "Active",
87-
"LastUpdateStatus": "InProgress",
88-
"LastUpdateStatusReason": "The function is being created.",
89-
"LastUpdateStatusReasonCode": "Creating",
90-
"PackageType": "Zip",
91-
"Architectures": [
92-
"arm64"
93-
],
94-
"EphemeralStorage": {
95-
"Size": 512
96-
}
97-
}
98-
```
99-
10. You may have to press `q` to come out of the output. The setup is ready for testing.
100-
10146
## How it works
10247

10348
This SAM project uses Amazon Bedrock API for Anthropic Claude 3.5 Sonnet model to generate content based on given prompt. This is exposed through a serverless REST API. Please refer to the architecture diagram below:
@@ -135,10 +80,6 @@ The API returns a response with generated content. Such as (Your out may vary):
13580
```bash
13681
sam delete
13782
```
138-
2. Delete the Lambda layer version using the `delete_lambda_layer.sh` script. You may have to give execution permission to the file. You will need to pass the Lambda layer name and the version in the inpout when requested:
139-
```bash
140-
./delete_lambda_layer.sh
141-
```
14283

14384
---
14485

-11.6 MB
Binary file not shown.

apigw-lambda-bedrock-sam/create_lambda_layer.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

apigw-lambda-bedrock-sam/delete_lambda_layer.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)