Scaleway v1.37.0 published on Friday, Nov 7, 2025 by pulumiverse
scaleway.account.getProjects
Start a Neo task
Explain and create a scaleway.account.getProjects resource
The scaleway.account.getProjects data source is used to list all Scaleway projects in an Organization.
Refer to the Organizations and Projects documentation and API documentation for more information.
Retrieve a Scaleway Projects
The following commands allow you to:
- retrieve all Projects in an Organization
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
// Get all Projects in an Organization
const all = scaleway.account.getProjects({
organizationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
});
import pulumi
import pulumi_scaleway as scaleway
# Get all Projects in an Organization
all = scaleway.account.get_projects(organization_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/account"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Get all Projects in an Organization
_, err := account.GetProjects(ctx, &account.GetProjectsArgs{
OrganizationId: pulumi.StringRef("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;
return await Deployment.RunAsync(() =>
{
// Get all Projects in an Organization
var all = Scaleway.Account.GetProjects.Invoke(new()
{
OrganizationId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.account.AccountFunctions;
import com.pulumi.scaleway.account.inputs.GetProjectsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Get all Projects in an Organization
final var all = AccountFunctions.getProjects(GetProjectsArgs.builder()
.organizationId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
.build());
}
}
variables:
# Get all Projects in an Organization
all:
fn::invoke:
function: scaleway:account:getProjects
arguments:
organizationId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Example Usage
Deploy an SSH key in all your organization’s projects
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const all = scaleway.account.getProjects({});
const main: scaleway.account.SshKey[] = [];
all.then(all => all.projects).length.apply(rangeBody => {
for (const range = {value: 0}; range.value < rangeBody; range.value++) {
main.push(new scaleway.account.SshKey(`main-${range.value}`, {
name: "main",
publicKey: publicKey,
projectId: all.then(all => all.projects[range.value].id),
}));
}
});
import pulumi
import pulumi_scaleway as scaleway
import pulumiverse_scaleway as scaleway
all = scaleway.account.get_projects()
main = []
def create_main(range_body):
for range in [{"value": i} for i in range(0, range_body)]:
main.append(scaleway.account.SshKey(f"main-{range['value']}",
name="main",
public_key=public_key,
project_id=all.projects[range["value"]].id))
(len(all.projects)).apply(create_main)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/account"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
all, err := account.GetProjects(ctx, &account.GetProjectsArgs{}, nil)
if err != nil {
return err
}
var main []*account.SshKey
for index := 0; index < int(len(all.Projects)); index++ {
key0 := index
val0 := index
__res, err := account.NewSshKey(ctx, fmt.Sprintf("main-%v", key0), &account.SshKeyArgs{
Name: pulumi.String("main"),
PublicKey: pulumi.Any(publicKey),
ProjectId: all.Projects[val0].Id,
})
if err != nil {
return err
}
main = append(main, __res)
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var all = Scaleway.Account.GetProjects.Invoke();
var main = new List<Scaleway.Account.SshKey>();
for (var rangeIndex = 0; rangeIndex < all.Apply(getProjectsResult => getProjectsResult.Projects).Length; rangeIndex++)
{
var range = new { Value = rangeIndex };
main.Add(new Scaleway.Account.SshKey($"main-{range.Value}", new()
{
Name = "main",
PublicKey = publicKey,
ProjectId = all.Apply(getProjectsResult => getProjectsResult.Projects)[range.Value].Id,
}));
}
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.account.AccountFunctions;
import com.pulumi.scaleway.account.inputs.GetProjectsArgs;
import com.pulumi.scaleway.account.SshKey;
import com.pulumi.scaleway.account.SshKeyArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var all = AccountFunctions.getProjects(GetProjectsArgs.builder()
.build());
for (var i = 0; i < all.projects().length(); i++) {
new SshKey("main-" + i, SshKeyArgs.builder()
.name("main")
.publicKey(publicKey)
.projectId(all.projects()[range.value()].id())
.build());
}
}
}
Example coming soon!
Using getProjects
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>def get_projects(organization_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectsResult
def get_projects_output(organization_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput> Note: This function is named GetProjects in the Go SDK.
public static class GetProjects
{
public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
public static Output<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
fn::invoke:
function: scaleway:account/getProjects:getProjects
arguments:
# arguments dictionaryThe following arguments are supported:
- Organization
Id string - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource
- Organization
Id string - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource
- organization
Id String - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource
- organization
Id string - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource
- organization_
id str - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource
- organization
Id String - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource
getProjects Result
The following output properties are available:
- Created
At string - (Computed) The date and time when the project was created.
- Description string
- (Computed) The description of the project.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- (Computed) The name of the project.
- Organization
Id string - (Computed) The unique identifier of the organization with which the project is associated.
- Projects
List<Pulumiverse.
Scaleway. Account. Outputs. Get Projects Project> - (Computed) A list of projects. Each project has the following attributes:
- Updated
At string - (Computed) The date and time when the project was updated.
- Created
At string - (Computed) The date and time when the project was created.
- Description string
- (Computed) The description of the project.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- (Computed) The name of the project.
- Organization
Id string - (Computed) The unique identifier of the organization with which the project is associated.
- Projects
[]Get
Projects Project - (Computed) A list of projects. Each project has the following attributes:
- Updated
At string - (Computed) The date and time when the project was updated.
- created
At String - (Computed) The date and time when the project was created.
- description String
- (Computed) The description of the project.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- (Computed) The name of the project.
- organization
Id String - (Computed) The unique identifier of the organization with which the project is associated.
- projects
List<Get
Projects Project> - (Computed) A list of projects. Each project has the following attributes:
- updated
At String - (Computed) The date and time when the project was updated.
- created
At string - (Computed) The date and time when the project was created.
- description string
- (Computed) The description of the project.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- (Computed) The name of the project.
- organization
Id string - (Computed) The unique identifier of the organization with which the project is associated.
- projects
Get
Projects Project[] - (Computed) A list of projects. Each project has the following attributes:
- updated
At string - (Computed) The date and time when the project was updated.
- created_
at str - (Computed) The date and time when the project was created.
- description str
- (Computed) The description of the project.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- (Computed) The name of the project.
- organization_
id str - (Computed) The unique identifier of the organization with which the project is associated.
- projects
Sequence[Get
Projects Project] - (Computed) A list of projects. Each project has the following attributes:
- updated_
at str - (Computed) The date and time when the project was updated.
- created
At String - (Computed) The date and time when the project was created.
- description String
- (Computed) The description of the project.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- (Computed) The name of the project.
- organization
Id String - (Computed) The unique identifier of the organization with which the project is associated.
- projects List<Property Map>
- (Computed) A list of projects. Each project has the following attributes:
- updated
At String - (Computed) The date and time when the project was updated.
Supporting Types
GetProjectsProject
- Created
At string - (Computed) The date and time when the project was created.
- Description string
- (Computed) The description of the project.
- Id string
- (Computed) The unique identifier of the project.
- Name string
- (Computed) The name of the project.
- Organization
Id string - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource - Updated
At string - (Computed) The date and time when the project was updated.
- Created
At string - (Computed) The date and time when the project was created.
- Description string
- (Computed) The description of the project.
- Id string
- (Computed) The unique identifier of the project.
- Name string
- (Computed) The name of the project.
- Organization
Id string - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource - Updated
At string - (Computed) The date and time when the project was updated.
- created
At String - (Computed) The date and time when the project was created.
- description String
- (Computed) The description of the project.
- id String
- (Computed) The unique identifier of the project.
- name String
- (Computed) The name of the project.
- organization
Id String - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource - updated
At String - (Computed) The date and time when the project was updated.
- created
At string - (Computed) The date and time when the project was created.
- description string
- (Computed) The description of the project.
- id string
- (Computed) The unique identifier of the project.
- name string
- (Computed) The name of the project.
- organization
Id string - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource - updated
At string - (Computed) The date and time when the project was updated.
- created_
at str - (Computed) The date and time when the project was created.
- description str
- (Computed) The description of the project.
- id str
- (Computed) The unique identifier of the project.
- name str
- (Computed) The name of the project.
- organization_
id str - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource - updated_
at str - (Computed) The date and time when the project was updated.
- created
At String - (Computed) The date and time when the project was created.
- description String
- (Computed) The description of the project.
- id String
- (Computed) The unique identifier of the project.
- name String
- (Computed) The name of the project.
- organization
Id String - The unique identifier of the Organization with which the Projects are associated.
If no default
organization_idis set, one must be set explicitly in this datasource - updated
At String - (Computed) The date and time when the project was updated.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scalewayTerraform Provider.
