# ConfigMapKeySelectorV1 Properties

- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Type: [ConfigMapKeySelectorV1](/reference/api/csharp/aspire.hosting.kubernetes/configmapkeyselectorv1.md)
- Kind: `Properties`
- Members: `3`

ConfigMapKeySelectorV1 represents a selector for a specific key in a ConfigMap. It is used to select a named key from a ConfigMap, with an optional flag to indicate if the key or ConfigMap is optional.

## Key

- Name: `Key`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ConfigMapKeySelectorV1.cs)

Specifies the key to select from the referenced ConfigMap. This property identifies a specific entry within the ConfigMap that should be used.

```csharp
public string Key { get; set; }
```

## Name

- Name: `Name`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ConfigMapKeySelectorV1.cs)

Gets or sets the name of the ConfigMap whose key-value pair is to be selected.

```csharp
public string Name { get; set; }
```

## Optional

- Name: `Optional`
- Modifiers: `nullable` `get; set`
- Returns: `bool?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ConfigMapKeySelectorV1.cs)

Indicates whether the specific key in the ConfigMap is optional. If set to true, the absence of the specified key will not raise an error. If set to false or null, the specified key must exist in the ConfigMap; otherwise, an error may be raised.

```csharp
public bool? Optional { get; set; }
```
