aws-samples / amazon-bedrock-workshop

This is a workshop designed for Amazon Bedrock a foundational model service.
https://catalog.us-east-1.prod.workshops.aws/workshops/a4bdb007-5600-4368-81c5-ff5b4154f518/en-US/20-intro
MIT No Attribution
1.34k stars 576 forks source link

Possible Typo in IAM Policy for 07_Agents/insurance_claims_agent/without_kb/create_and_invoke_agent.ipynb #191

Open jmann-mdsol opened 6 months ago

jmann-mdsol commented 6 months ago

In the section Create Lambda function for Action Group of 07_Agents/insurance_claims_agent/without_kb/create_and_invoke_agent.ipynb there is an IAM policy document:

    assume_role_policy_document = {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": "bedrock:InvokeModel",
                "Principal": {
                    "Service": "lambda.amazonaws.com"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }

This contains a duplicate key Action. Based on the name and how python handles duplicate keys within dictionaries, I imagine it is supposed to be:

    assume_role_policy_document = {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Service": "lambda.amazonaws.com"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }

but am not sure. Please clarify. Thank you!

jmann-mdsol commented 6 months ago

This typo is also present in here:

w601sxs commented 4 months ago

us this still relevant in our new structure @mttanke ?

w601sxs commented 3 months ago

@mttanke can you take a look