# DomainlessCredentialSpec

Credential specification for domainless gMSA.

Extends: CredentialSpec › DomainlessCredentialSpec

- Source: [`aws-ecs/lib/credential-spec.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ecs/lib/credential-spec.ts#L91)
- Type last changed: v2.129.0 · 21 Feb 2024

## Example

```ts
// Make sure the task definition's execution role has permissions to read from the S3 bucket or SSM parameter where the CredSpec file is stored.
declare const bucket: s3.Bucket;
declare const taskDefinition: ecs.TaskDefinition;

// Domainless gMSA container from a S3 bucket object.
taskDefinition.addContainer('gmsa-domainless-container', {
  image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
  cpu: 128,
  memoryLimitMiB: 256,
  credentialSpecs: [ecs.DomainlessCredentialSpec.fromS3Bucket(bucket, 'credSpec')],
});
```

## Initializer

```ts
new DomainlessCredentialSpec(fileLocation: string)
```

## Properties

- `fileLocation`: string — Location or ARN from where to retrieve the CredSpec file.

- `prefixId`: string — Prefix string based on the type of CredSpec.

## Methods

- `bind(): CredentialSpecConfig` — Called when the container is initialized to allow this object to bind to the stack.

- `fromS3Bucket(bucket: IBucket, key: string): DomainlessCredentialSpec // chainable` (static) — Loads the CredSpec from a S3 bucket object.

  **Parameters**

  - `bucket` — The S3 bucket.
  - `key` — The object key.

  **Returns:** CredSpec with it's locations set to the S3 object's ARN.

- `fromSsmParameter(parameter: IParameter): DomainlessCredentialSpec // chainable` (static) — Loads the CredSpec from a SSM parameter.

  **Parameters**

  - `parameter` — The SSM parameter.

  **Returns:** CredSpec with it's locations set to the SSM parameter's ARN.
