# ApiKeyCredentialLocation

API Key location within the request.

Obtainable from: ApiKeyCredentialLocation.header, ApiKeyCredentialLocation.queryParameter

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

## 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';
const apiKeyCredentialLocation = bedrock_agentcore_alpha.ApiKeyCredentialLocation.header(/* all optional props */ {
  credentialParameterName: 'credentialParameterName',
  credentialPrefix: 'credentialPrefix',
});
```

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.header(
    credential_parameter_name="credentialParameterName",
    credential_prefix="credentialPrefix"
)
```

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 = ApiKeyCredentialLocation.header(ApiKeyAdditionalConfiguration.builder()
        .credentialParameterName("credentialParameterName")
        .credentialPrefix("credentialPrefix")
        .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;

var apiKeyCredentialLocation = ApiKeyCredentialLocation.Header(new ApiKeyAdditionalConfiguration {
    CredentialParameterName = "credentialParameterName",
    CredentialPrefix = "credentialPrefix"
});
```

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"

apiKeyCredentialLocation := bedrock_agentcore_alpha.ApiKeyCredentialLocation_Header(&ApiKeyAdditionalConfiguration{
	CredentialParameterName: jsii.String("credentialParameterName"),
	CredentialPrefix: jsii.String("credentialPrefix"),
})
```

## Properties

- `credentialLocationType`: string — The type of credential location (HEADER or QUERY_PARAMETER).

- `credentialParameterName`: string — The name of the credential parameter.

- `credentialPrefix`: string — The prefix for the credential value.

## Methods

- `header(config?: ApiKeyAdditionalConfiguration): ApiKeyCredentialLocation // chainable` (static) — Create a header-based API key credential location.

  **Parameters**

  - `config` — - Optional configuration for the credential location.

  **Returns:** ApiKeyCredentialLocation configured for header placement

- `queryParameter(config?: ApiKeyAdditionalConfiguration): ApiKeyCredentialLocation // chainable` (static) — Create a query parameter-based API key credential location.

  **Parameters**

  - `config` — - Optional configuration for the credential location.

  **Returns:** ApiKeyCredentialLocation configured for query parameter placement
