# Secret

- Module: [Aspire.Hosting.Docker](/reference/api/go/aspire.hosting.docker.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Represents a Secret object in a Docker Compose configuration file.

## Remarks

A Secret object is used to define sensitive information to be shared with containers,
such as passwords, keys, or certificates. These secrets can either be externally managed
or provided locally from a specific file.

## Definition

```go
type Secret interface{}
```

## Properties

- `External`: `*bool` `get/set` -- Indicates whether the secret is managed externally. If set to true, the secret must already exist, as it will not be created or modified.
- `File`: `*string` `get/set` -- Represents the file path associated with the secret. This specifies the location of the file on the host system that will be used as the source for the secret in the container.
- `Labels`: `*Dict[string, string]` `get/set` -- Gets or sets a collection of key-value pairs representing metadata or additional information associated with the secret. These labels can be used for categorization, identification, or other purposes as determined by the user.
- `Name`: `*string` `get/set` -- Gets or sets the name of the secret in the Docker Compose configuration.
