# FromApiKeyIdentityOptions

Optional gateway settings when binding an {@link IApiKeyCredentialProvider} to a target.

Used as argument in: [GatewayCredentialProvider.fromApiKeyIdentity](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.GatewayCredentialProvider.html#fromapikeyidentity)

- Source: [`lib/gateway/outbound-auth/credential-provider.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/outbound-auth/credential-provider.ts#L68)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';

declare const apiKeyCredentialLocation: bedrock_agentcore_alpha.ApiKeyCredentialLocation;
const fromApiKeyIdentityOptions: bedrock_agentcore_alpha.FromApiKeyIdentityOptions = {
  credentialLocation: apiKeyCredentialLocation,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha

# api_key_credential_location: bedrock_agentcore_alpha.ApiKeyCredentialLocation

from_api_key_identity_options = bedrock_agentcore_alpha.FromApiKeyIdentityOptions(
    credential_location=api_key_credential_location
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;

ApiKeyCredentialLocation apiKeyCredentialLocation;

FromApiKeyIdentityOptions fromApiKeyIdentityOptions = FromApiKeyIdentityOptions.builder()
        .credentialLocation(apiKeyCredentialLocation)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;

ApiKeyCredentialLocation apiKeyCredentialLocation;

var fromApiKeyIdentityOptions = new FromApiKeyIdentityOptions {
    CredentialLocation = apiKeyCredentialLocation
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"

var apiKeyCredentialLocation ApiKeyCredentialLocation

fromApiKeyIdentityOptions := &FromApiKeyIdentityOptions{
	CredentialLocation: apiKeyCredentialLocation,
}
```

## Properties

- `credentialLocation`: [ApiKeyCredentialLocation](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ApiKeyCredentialLocation.html) — Where to place the API key on outbound requests.

  **Default:** header `Authorization` with `Bearer ` prefix
