# ResourceWithArgs

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

Represents a resource that is associated with commandline arguments.

## Definition

```go
type ResourceWithArgs interface{}
```

## Methods

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

- [WithArgs](/reference/api/go/aspire.hosting/resourcewithargs/withargs.md) -- `method` -- Adds arguments to be passed to a resource that supports arguments when it is launched.
  ```go
  WithArgs(args []string) ResourceWithArgs
  ```
- [WithArgsCallback](/reference/api/go/aspire.hosting/resourcewithargs/withargscallback.md) -- `method` -- Adds a callback to be executed with a list of command-line arguments when a resource is started.
  ```go
  WithArgsCallback(callback func(obj CommandLineArgsCallbackContext)) ResourceWithArgs
  ```
- [WithArgsReplace](/reference/api/go/aspire.hosting/resourcewithargs/withargsreplace.md) -- `method` -- Replaces the arguments to be passed to a resource that supports arguments when it is launched.
  ```go
  WithArgsReplace(args []string) ResourceWithArgs
  ```
- [WithCertificateTrustEnvironment](/reference/api/go/aspire.hosting/resourcewithargs/withcertificatetrustenvironment.md) -- `method` -- Configures environment variables that point to Aspire-managed certificate trust paths.
  ```go
  WithCertificateTrustEnvironment(certificateBundleEnvironmentVariable string, options ...*WithCertificateTrustEnvironmentOptions) ResourceWithArgs
  ```

## Applies to

- [`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md)
- [`CSharpAppResource`](/reference/api/go/aspire.hosting/csharpappresource.md)
- [`DotnetToolResource`](/reference/api/go/aspire.hosting/dotnettoolresource.md)
- [`ExecutableResource`](/reference/api/go/aspire.hosting/executableresource.md)
- [`ProjectResource`](/reference/api/go/aspire.hosting/projectresource.md)
