# ExternalDockerCredentialOptions

Options for defining credentials for a Docker Credential.

- Source: [`pipelines/lib/docker-credentials.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/pipelines/lib/docker-credentials.ts#L68)

## Example

```ts
const dockerHubSecret = secretsmanager.Secret.fromSecretCompleteArn(
  this,
  'DHSecret',
  'arn:aws:...'
);
// Only the image asset publishing actions will be granted read access to the secret.
const creds = pipelines.DockerCredential.dockerHub(dockerHubSecret, {
  usages: [pipelines.DockerCredentialUsage.ASSET_PUBLISHING],
});
```

## Properties

- `assumeRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — An IAM role to assume prior to accessing the secret.

  **Default:** none. The current execution role will be used.

- `secretPasswordField`: string = 'secret' — The name of the JSON field of the secret which contains the secret/password.

- `secretUsernameField`: string = 'username' — The name of the JSON field of the secret which contains the user/login name.

- `usages`: [DockerCredentialUsage](/cdk/api/v2/docs/aws-cdk-lib.pipelines.DockerCredentialUsage.html)[] — Defines which stages of the pipeline should be granted access to these credentials.

  **Default:** all relevant stages (synth, self-update, asset publishing) are granted access.
