Skip to main content

Amazon Bedrock conversation

Type: conversation.aws.bedrock

Status: alpha

Reference: https://docs.dapr.io/reference/components-reference/supported-conversation/aws-bedrock/

Example​

apiVersion: cra.diagrid.io/v1beta1
kind: Component
metadata:
name: <name>
spec:
type: conversation.aws.bedrock
version: v1
metadata:
# ARN of the IAM role to assume.
- name: assumeRoleArn
value: "arn:aws:iam::123456789012:role/dapr-bedrock"
# Audience of the JWT SVID. Must be a client ID (audience) of the IAM OIDC identity provider.
- name: webIdentityAudience
value: "sts.amazonaws.com"
# The session name for the assumed role. (Optional)
#- name: assumeRoleSessionName
# value: "dapr-bedrock"
# AWS endpoint for the component to use, to connect to emulators. Do not use this when running against production AWS. (Optional)
#- name: endpoint
# value: "http://mycompany.com:4566"
# Default maximum number of tokens the model may generate per request. A request-level maxTokens value greater than zero overrides this default. When unset, no cap is sent and the provider's own default applies. (Optional)
#- name: maxTokens
# value: "2048"
# The model identifier or inference profile ARN to use. Defaults to Bedrock's default provider model from Amazon. You can specify either: - A model ID (e.g., "amazon.titan-text-express-v1") that supports on-demand throughput - An inference profile ARN for models that require it (found in the AWS Bedrock console under "Cross-Region Inference") (Optional)
#- name: model
# value: "amazon.titan-text-express-v1"
# A time-to-live value for a prompt/response cache to expire. Uses Go duration strings (e.g. "5m", "1h"). The component also supports the legacy key `cacheTTL` via mapstructure aliases. (Optional)
#- name: responseCacheTTL
# value: "10m"

Authentication profiles​

Available authentication profiles:

  • AWS: Web identity federation (SPIFFE)

  • AWS: Access Key ID and Secret Access Key

  • AWS: Assume IAM Role

  • AWS: IAM Roles Anywhere

AWS: Web identity federation (SPIFFE)​

Assume an IAM role with AssumeRoleWithWebIdentity, using a JWT SVID minted by the Dapr runtime for the app's SPIFFE ID. Requires mTLS and Sentry JWT issuing, with Sentry registered as an IAM OIDC identity provider that the role trusts.

assumeRoleArn (string)​

Required - ARN of the IAM role to assume.

Example value: arn:aws:iam::123456789012:role/dapr-bedrock

webIdentityAudience (string)​

Required - Audience of the JWT SVID. Must be a client ID (audience) of the IAM OIDC identity provider.

Example value: sts.amazonaws.com

assumeRoleSessionName (string)​

The session name for the assumed role.

Example value: dapr-bedrock

AWS: Access Key ID and Secret Access Key​

Authenticate using an Access Key ID and Secret Access Key included in the metadata

accessKey​

AWS access key associated with an IAM account

Example value: AKIAIOSFODNN7EXAMPLE

awsRegion (string)​

This maintains backwards compatibility with existing fields. It will be deprecated as of Dapr 1.17. Use 'region' instead. The AWS Region where the AWS resource is deployed to.

Example value: us-east-1

region (string)​

The AWS Region where the AWS resource is deployed to. This will be marked required in Dapr 1.17.

Example value: us-east-1

secretKey​

The secret key associated with the access key

Example value: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

sessionToken (string)​

AWS session token to use. A session token is only required if you are using temporary security credentials.

Example value: TOKEN

AWS: Assume IAM Role​

Assume a specific IAM role. Note: This is only supported for Kafka and PostgreSQL.

region (string)​

Required - The AWS Region where the AWS resource is deployed to.

Example value: us-east-1

assumeRoleArn (string)​

IAM role that has access to AWS resource. This is another option to authenticate with MSK and RDS Aurora aside from the AWS Credentials. This will be marked required in Dapr 1.17.

Example value: arn:aws:iam::123456789:role/mskRole

sessionName (string)​

The session name for assuming a role.

Default value: DaprDefaultSession

Example value: MyAppSession

AWS: IAM Roles Anywhere​

Use AWS IAM Roles Anywhere to establish trust between your AWS account and Diagrid.

assumeRoleArn​

Required - ARN of the AWS IAM role to assume in the trusting AWS account.

Example value: arn:aws:iam:012345678910:role/exampleIAMRoleName

trustAnchorArn​

Required - ARN of the AWS Trust Anchor in the AWS account granting trust to the Dapr Certificate Authority.

Example value: arn:aws:rolesanywhere:us-west-1:012345678910:trust-anchor/01234568-0123-0123-0123-012345678901

trustProfileArn​

Required - ARN of the AWS IAM Profile in the trusting AWS account.

Example value: arn:aws:rolesanywhere:us-west-1:012345678910:profile/01234568-0123-0123-0123-012345678901

Metadata​

endpoint (string)​

AWS endpoint for the component to use, to connect to emulators. Do not use this when running against production AWS.

Example value: http://mycompany.com:4566

maxTokens (number)​

Default maximum number of tokens the model may generate per request. A request-level maxTokens value greater than zero overrides this default. When unset, no cap is sent and the provider's own default applies.

Example value: 2048

model (string)​

The model identifier or inference profile ARN to use. Defaults to Bedrock's default provider model from Amazon. You can specify either: - A model ID (e.g., "amazon.titan-text-express-v1") that supports on-demand throughput - An inference profile ARN for models that require it (found in the AWS Bedrock console under "Cross-Region Inference")

Example value: amazon.titan-text-express-v1

responseCacheTTL (string)​

A time-to-live value for a prompt/response cache to expire. Uses Go duration strings (e.g. "5m", "1h"). The component also supports the legacy key cacheTTL via mapstructure aliases.

Example value: 10m