bedrock-access-gateway icon indicating copy to clipboard operation
bedrock-access-gateway copied to clipboard

AWS partition is hard coded. Can't deploy the stack in other paritions.

Open mjavadi opened this issue 10 months ago • 4 comments

Describe the bug A clear and concise description of what the bug is. ProxyApiHandlerServiceRoleDefaultPolicy86681202 CREATE_FAILED

Partition "aws" is not valid for resource "arn:aws:bedrock:::foundation-model/". (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID: a86171f2-0161-4940-964a-435f5955935a; Proxy: null)

Please complete the following information:

  • [ ] Which API you used: [e.g. /chat/completions]. N/A
  • [ ] Which model you used: [e.g. anthropic.claude-3-sonnet-20240229-v1:0] N/A

To Reproduce Deploy the stack in a different partition.

Expected behavior Resources should be all be deployed

Screenshots

Image

Additional context The CF template I used is: BedrockProxy.Template

mjavadi avatar Feb 05 '25 23:02 mjavadi

Is this for govcloud?

sean-smith avatar Feb 06 '25 18:02 sean-smith

Sorry, there is no plan to support other partitions for now. For other partitions that Bedrock supported, please manually change the ARNs in the CloudFormation template in the deployment folder in the current repo.

daixba avatar Feb 10 '25 08:02 daixba

@sean-smith yes it is for govcloud.

@daixba it is just a matter of being consistent in string replacement and using cloudformation built in stuff to determine the partition and region. It is already being done in other parts of the template. BUT i understand. It is not a show stopper for us.

mjavadi avatar Feb 10 '25 22:02 mjavadi

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-partition

In the templates AWS::Region and AWS::URLSuffix are already used.

If no one beats me to it I can work on a PR to replace arn:aws with arn:{AWS::PARTITON}

There are already places where it uses AWS::PARTITON: https://github.com/aws-samples/bedrock-access-gateway/blob/b26ee3e9eaea5547a724bf37dd1e33017295cc8a/deployment/BedrockProxy.template#L135

kevingoad-arcfield avatar Feb 20 '25 03:02 kevingoad-arcfield