CommunityToolkit / CommunityToolkit/Aspire
[Feature] Add GCS Hosting Integration
- Dominant language
- C#
- Stars
- 627
- Forks
- 196
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 35
Description
We want to contribute an Aspire Hosting Integration for GCS. This is the proposed API:
```c#
var projectId = builder.AddParameter("project-id");
// Optional initDataDirectory
var gcs = builder.AddGcs("gcs", projectId, certPath: "path/to/ssl/cert", initDataDirectory: "path/to/preinitialize/content/directory");
//optional custom templating of bucket name
var bucket = gcs.AddBucket("bucket-name", ReferenceExpression.Create($"{projectId}-bucket-name"));
//usage - supports WaitFor and environment passing for buckets
var service = builder.AddContainer(...)
.WithEnvironemnt("GCP_PROJECT_ID", gcs.Resource.ProjectId)
.WithEnvironment("GCS_BUCKET_NAME", bucket)
.WaitFor(bucket); // will wait for bucket creation
if (builder.ExecutionContext.IsRunMode)
{
service
.WithEnvironment("GCS_ENDPOINT", gcs) // will automatically pass the correct endpoint
.WithEnvironment("GCP_APPLICATION_CREDENTIALS", "path/to/ssl/cert")
}
```
Contributor guide
Assessment
This issue has not been assessed yet.