@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
142 lines • 4.93 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "../types/output";
/**
* The `scaleway.account.getProjects` data source is used to list all Scaleway projects in an Organization.
*
* Refer to the Organizations and Projects [documentation](https://www.scaleway.com/en/docs/organizations-and-projects/) and [API documentation](https://www.scaleway.com/en/developers/api/account/project-api/) for more information.
*
* ## Retrieve a Scaleway Projects
*
* The following commands allow you to:
*
* - retrieve all Projects in an Organization
*
* ```typescript
* 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",
* });
* ```
*
* ## Example Usage
*
* ### Deploy an SSH key in all your organization's projects
*
* ```typescript
* 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),
* }));
* }
* });
* ```
*/
export declare function getProjects(args?: GetProjectsArgs, opts?: pulumi.InvokeOptions): Promise<GetProjectsResult>;
/**
* A collection of arguments for invoking getProjects.
*/
export interface GetProjectsArgs {
/**
* The unique identifier of the Organization with which the Projects are associated.
* If no default `organizationId` is set, one must be set explicitly in this datasource
*/
organizationId?: string;
}
/**
* A collection of values returned by getProjects.
*/
export interface GetProjectsResult {
/**
* (Computed) The date and time when the project was created.
*/
readonly createdAt: string;
/**
* (Computed) The description of the project.
*/
readonly description: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* (Computed) The name of the project.
*/
readonly name: string;
/**
* (Computed) The unique identifier of the organization with which the project is associated.
*/
readonly organizationId: string;
/**
* (Computed) A list of projects. Each project has the following attributes:
*/
readonly projects: outputs.account.GetProjectsProject[];
/**
* (Computed) The date and time when the project was updated.
*/
readonly updatedAt: string;
}
/**
* The `scaleway.account.getProjects` data source is used to list all Scaleway projects in an Organization.
*
* Refer to the Organizations and Projects [documentation](https://www.scaleway.com/en/docs/organizations-and-projects/) and [API documentation](https://www.scaleway.com/en/developers/api/account/project-api/) for more information.
*
* ## Retrieve a Scaleway Projects
*
* The following commands allow you to:
*
* - retrieve all Projects in an Organization
*
* ```typescript
* 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",
* });
* ```
*
* ## Example Usage
*
* ### Deploy an SSH key in all your organization's projects
*
* ```typescript
* 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),
* }));
* }
* });
* ```
*/
export declare function getProjectsOutput(args?: GetProjectsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetProjectsResult>;
/**
* A collection of arguments for invoking getProjects.
*/
export interface GetProjectsOutputArgs {
/**
* The unique identifier of the Organization with which the Projects are associated.
* If no default `organizationId` is set, one must be set explicitly in this datasource
*/
organizationId?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=getProjects.d.ts.map