ApiKeyCredentialProviderProps
- class aws_cdk.aws_bedrock_agentcore_alpha.ApiKeyCredentialProviderProps(*, provider_arn, secret_arn, credential_location=None)
Bases:
object(experimental) API Key configuration.
- Parameters:
provider_arn (
str) – (experimental) The API key credential provider ARN. This is returned when creating the API key credential provider via Console or API. Format: arn:aws:bedrock-agentcore:region:account:token-vault/id/apikeycredentialprovider/namesecret_arn (
str) – (experimental) The ARN of the Secrets Manager secret containing the API key. This is returned when creating the API key credential provider via Console or API. Format: arn:aws:secretsmanager:region:account:secret:namecredential_location (
Optional[ApiKeyCredentialLocation]) – (experimental) The location of the API key credential. This field specifies where in the request the API key should be placed. Default: - HEADER
- Stability:
experimental
- ExampleMetadata:
infused
Example:
gateway = agentcore.Gateway(self, "MyGateway", gateway_name="my-gateway" ) # These ARNs are returned when creating the API key credential provider via Console or API api_key_provider_arn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey" api_key_secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123" bucket = s3.Bucket.from_bucket_name(self, "ExistingBucket", "my-schema-bucket") s3my_schema = agentcore.ApiSchema.from_s3_file(bucket, "schemas/myschema.yaml") # Add an OpenAPI target directly to the gateway target = gateway.add_open_api_target("MyTarget", gateway_target_name="my-api-target", description="Target for external API integration", api_schema=s3my_schema, credential_provider_configurations=[ agentcore.GatewayCredentialProvider.from_api_key_identity_arn( provider_arn=api_key_provider_arn, secret_arn=api_key_secret_arn, credential_location=agentcore.ApiKeyCredentialLocation.header( credential_parameter_name="X-API-Key" ) ) ] ) # This make sure your s3 bucket is available before target target.node.add_dependency(bucket)
Attributes
- credential_location
(experimental) The location of the API key credential.
This field specifies where in the request the API key should be placed.
- Default:
HEADER
- Stability:
experimental
- provider_arn
(experimental) The API key credential provider ARN.
This is returned when creating the API key credential provider via Console or API. Format: arn:aws:bedrock-agentcore:region:account:token-vault/id/apikeycredentialprovider/name
- Stability:
experimental
- secret_arn
(experimental) The ARN of the Secrets Manager secret containing the API key.
This is returned when creating the API key credential provider via Console or API. Format: arn:aws:secretsmanager:region:account:secret:name
- Stability:
experimental