Skip to content

[Feature] Add GCS Hosting Integration #823

Description

@tjwald

We want to contribute an Aspire Hosting Integration for GCS. This is the proposed API:

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")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions