# CredentialSpec

Base construct for a credential specification (CredSpec).

Superclass of: [DomainJoinedCredentialSpec](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.DomainJoinedCredentialSpec.html), [DomainlessCredentialSpec](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.DomainlessCredentialSpec.html)

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

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const credentialSpec = new ecs.CredentialSpec('prefixId', 'fileLocation');
```

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_ecs as ecs

credential_spec = ecs.CredentialSpec("prefixId", "fileLocation")
```

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

CredentialSpec credentialSpec = new CredentialSpec("prefixId", "fileLocation");
```

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.ECS;

var credentialSpec = new CredentialSpec("prefixId", "fileLocation");
```

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"

credentialSpec := awscdk.Aws_ecs.NewCredentialSpec(jsii.String("prefixId"), jsii.String("fileLocation"))
```

## Initializer

TypeScript:

```ts
new CredentialSpec(prefixId: string, fileLocation: string)
```

Python:

```python
CredentialSpec(prefix_id: str, file_location: str)
```

Java:

```java
new CredentialSpec(String prefixId, String fileLocation)
```

C# / .NET:

```csharp
new CredentialSpec(string prefixId, string fileLocation)
```

Golang:

```go
NewCredentialSpec(PrefixId *string, 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.
