claude-code
claude-code copied to clipboard
How to configure the Amazon Bedrock Guardrails and Endpoint URL in the Claude-code
I am using application inference profile ARN model configured using the environment variables (access key). Now the model needs to have endpoint url and guardrail set to be able to invoke the model. In the code we do:
bedrock_runtime = boto3.client('bedrock-runtime', region_name="AWS_REGION", endpoint_url=os.getenv("AWS_ENDPOINT"))
# Invoke the model
response = bedrock_runtime.invoke_model(
body=body_bytes,
contentType=payload['contentType'],
accept=payload['accept'],
modelId=payload['modelId'],
guardrailIdentifier=os.getenv("AWS_GUARDRAIL_ID"),
guardrailVersion='1'
)
So how can we configure endpoint url and amazon bedrock guardrails while using the claude-code?