# NamespaceKeyEntryProperty

A namespace variable key definition with optional validation rules.

- Source: Generated at build time
- Type last changed: v2.272.0 · 30 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
const namespaceKeyEntryProperty: bedrockagentcore.CfnMemory.NamespaceKeyEntryProperty = {
  key: 'key',

  // the properties below are optional
  validation: {
    allowedValues: ['allowedValues'],
    regexPattern: 'regexPattern',
  },
};
```

Python:

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

namespace_key_entry_property = bedrockagentcore.CfnMemory.NamespaceKeyEntryProperty(
    key="key",

    # the properties below are optional
    validation=bedrockagentcore.CfnMemory.NamespaceKeyValidationProperty(
        allowed_values=["allowedValues"],
        regex_pattern="regexPattern"
    )
)
```

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.bedrockagentcore.*;

NamespaceKeyEntryProperty namespaceKeyEntryProperty = NamespaceKeyEntryProperty.builder()
        .key("key")

        // the properties below are optional
        .validation(NamespaceKeyValidationProperty.builder()
                .allowedValues(List.of("allowedValues"))
                .regexPattern("regexPattern")
                .build())
        .build();
```

C# / .NET:

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

var namespaceKeyEntryProperty = new NamespaceKeyEntryProperty {
    Key = "key",

    // the properties below are optional
    Validation = new NamespaceKeyValidationProperty {
        AllowedValues = new [] { "allowedValues" },
        RegexPattern = "regexPattern"
    }
};
```

Golang:

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

namespaceKeyEntryProperty := &NamespaceKeyEntryProperty{
	Key: jsii.String("key"),

	// the properties below are optional
	Validation: &NamespaceKeyValidationProperty{
		AllowedValues: []*string{
			jsii.String("allowedValues"),
		},
		RegexPattern: jsii.String("regexPattern"),
	},
}
```

## Properties

- `key`: string (required) — A namespace variable key name.

  Must start with a lowercase letter and contain only lowercase alphanumeric characters. Cannot be a built-in variable (memoryStrategyId, sessionId, actorId).

- `validation`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnMemory.NamespaceKeyValidationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.CfnMemory.NamespaceKeyValidationProperty.html) — Validation rules for namespace variable values.

  Multiple rules can be specified and all must pass.
