# SeaweedFSBuilderExtensions Methods

- Package: [CommunityToolkit.Aspire.Hosting.SeaweedFS](/reference/api/csharp/communitytoolkit.aspire.hosting.seaweedfs.md)
- Type: [SeaweedFSBuilderExtensions](/reference/api/csharp/communitytoolkit.aspire.hosting.seaweedfs/seaweedfsbuilderextensions.md)
- Kind: `Methods`
- Members: `9`

Provides extension methods for adding SeaweedFS resources to an `Hosting.IDistributedApplicationBuilder`.

<a id="addseaweedfs"></a>
<a id="addseaweedfs-idistributedapplicationbuilder-string"></a>

## AddSeaweedFS(IDistributedApplicationBuilder, string)

- Name: `AddSeaweedFS(IDistributedApplicationBuilder, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L37-L115)

Adds a base SeaweedFS container (Master and Volume APIs) to the application model. Chain with .WithS3() or .WithFiler() to enable additional APIs.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> AddSeaweedFS(
        this IDistributedApplicationBuilder builder,
        string name)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder`.
- `name` (`string`)
  The name of the resource. This name will be used as the connection string name when referenced in a dependency.

## Returns

`IResourceBuilder<SeaweedFSContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withaccesskey"></a>
<a id="withaccesskey-iresourcebuilder-seaweedfscontainerresource-iresourcebuilder-parameterresource"></a>

## WithAccessKey(IResourceBuilder<SeaweedFSContainerResource>, IResourceBuilder<ParameterResource>)

- Name: `WithAccessKey(IResourceBuilder<SeaweedFSContainerResource>, IResourceBuilder<ParameterResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L198-L202)

Configures the Access Key that the SeaweedFS S3 resource uses.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithAccessKey(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        IResourceBuilder<ParameterResource> accessKey)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `accessKey` (`IResourceBuilder<ParameterResource>`)

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withdatabindmount"></a>
<a id="withdatabindmount-iresourcebuilder-seaweedfscontainerresource-string-bool"></a>

## WithDataBindMount(IResourceBuilder<SeaweedFSContainerResource>, string, bool)

- Name: `WithDataBindMount(IResourceBuilder<SeaweedFSContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L261-L264)

Adds a bind mount for the SeaweedFS data folder.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithDataBindMount(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `source` (`string`)
- `isReadOnly` (`bool`) `optional`

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withdatavolume"></a>
<a id="withdatavolume-iresourcebuilder-seaweedfscontainerresource-string-bool"></a>

## WithDataVolume(IResourceBuilder<SeaweedFSContainerResource>, string?, bool)

- Name: `WithDataVolume(IResourceBuilder<SeaweedFSContainerResource>, string?, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L278-L282)

Adds a named volume for the SeaweedFS data folder.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithDataVolume(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        string? name = null,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `name` (`string?`) `optional`
- `isReadOnly` (`bool`) `optional`

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withfiler"></a>
<a id="withfiler-iresourcebuilder-seaweedfscontainerresource-int"></a>

## WithFiler(IResourceBuilder<SeaweedFSContainerResource>, int?)

- Name: `WithFiler(IResourceBuilder<SeaweedFSContainerResource>, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L159-L169)

Enables the SeaweedFS Native Filer API.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithFiler(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        int? filerPort = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `filerPort` (`int?`) `optional`

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withhostport"></a>
<a id="withhostport-iresourcebuilder-seaweedfscontainerresource-int"></a>

## WithHostPort(IResourceBuilder<SeaweedFSContainerResource>, int?)

- Name: `WithHostPort(IResourceBuilder<SeaweedFSContainerResource>, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L180-L185)

Configures the Master API host port that the SeaweedFS resource is exposed on.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithHostPort(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        int? port)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `port` (`int?`)

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withs3"></a>
<a id="withs3-iresourcebuilder-seaweedfscontainerresource-int"></a>

## WithS3(IResourceBuilder<SeaweedFSContainerResource>, int?)

- Name: `WithS3(IResourceBuilder<SeaweedFSContainerResource>, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L128-L146)

Enables the SeaweedFS S3-Compatible API Gateway.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithS3(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        int? s3Port = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `s3Port` (`int?`) `optional`

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withs3configfile"></a>
<a id="withs3configfile-iresourcebuilder-seaweedfscontainerresource-string"></a>

## WithS3ConfigFile(IResourceBuilder<SeaweedFSContainerResource>, string)

- Name: `WithS3ConfigFile(IResourceBuilder<SeaweedFSContainerResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L232-L247)

Configures the SeaweedFS S3 API to use a specific external security configuration file.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithS3ConfigFile(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        string configFilePath)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `configFilePath` (`string`)

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withsecretkey"></a>
<a id="withsecretkey-iresourcebuilder-seaweedfscontainerresource-iresourcebuilder-parameterresource"></a>

## WithSecretKey(IResourceBuilder<SeaweedFSContainerResource>, IResourceBuilder<ParameterResource>)

- Name: `WithSecretKey(IResourceBuilder<SeaweedFSContainerResource>, IResourceBuilder<ParameterResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<SeaweedFSContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.SeaweedFS/SeaweedFSBuilderExtensions.cs#L215-L219)

Configures the Secret Key that the SeaweedFS S3 resource uses.

```csharp
public static class SeaweedFSBuilderExtensions
{
    public static IResourceBuilder<SeaweedFSContainerResource> WithSecretKey(
        this IResourceBuilder<SeaweedFSContainerResource> builder,
        IResourceBuilder<ParameterResource> secretKey)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<SeaweedFSContainerResource>`)
- `secretKey` (`IResourceBuilder<ParameterResource>`)

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
