@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
159 lines (158 loc) • 4.43 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "../types/output";
/**
* Gets a list of all service accounts from a project.
* See [the official documentation](https://cloud.google.com/iam/docs/service-account-overview)
* and [API](https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts).
*
* ## Example Usage
*
* Get all service accounts from a project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = gcp.serviceaccount.getS({
* project: "example-project",
* });
* ```
*
* Get all service accounts that are prefixed with `"foo"`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const foo = gcp.serviceaccount.getS({
* prefix: "foo",
* });
* ```
*
* Get all service accounts that contain `"bar"`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const bar = gcp.serviceaccount.getS({
* regex: ".*bar.*",
* });
* ```
*
* Get all service accounts that are prefixed with `"foo"` and contain `"bar"`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const fooBar = gcp.serviceaccount.getS({
* prefix: "foo",
* regex: ".*bar.*",
* });
* ```
*/
export declare function getS(args?: GetSArgs, opts?: pulumi.InvokeOptions): Promise<GetSResult>;
/**
* A collection of arguments for invoking getS.
*/
export interface GetSArgs {
/**
* A prefix for filtering. It's applied with the `accountId`.
*/
prefix?: string;
/**
* The ID of the project. If it is not provided, the provider project is used.
*/
project?: string;
/**
* A regular expression for filtering. It's applied with the `email`. Further information about the syntax can be found [here](https://github.com/google/re2/wiki/Syntax).
*/
regex?: string;
}
/**
* A collection of values returned by getS.
*/
export interface GetSResult {
/**
* A list of all retrieved service accounts. Structure is defined below.
*/
readonly accounts: outputs.serviceaccount.GetSAccount[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly prefix?: string;
readonly project?: string;
readonly regex?: string;
}
/**
* Gets a list of all service accounts from a project.
* See [the official documentation](https://cloud.google.com/iam/docs/service-account-overview)
* and [API](https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts).
*
* ## Example Usage
*
* Get all service accounts from a project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = gcp.serviceaccount.getS({
* project: "example-project",
* });
* ```
*
* Get all service accounts that are prefixed with `"foo"`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const foo = gcp.serviceaccount.getS({
* prefix: "foo",
* });
* ```
*
* Get all service accounts that contain `"bar"`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const bar = gcp.serviceaccount.getS({
* regex: ".*bar.*",
* });
* ```
*
* Get all service accounts that are prefixed with `"foo"` and contain `"bar"`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const fooBar = gcp.serviceaccount.getS({
* prefix: "foo",
* regex: ".*bar.*",
* });
* ```
*/
export declare function getSOutput(args?: GetSOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetSResult>;
/**
* A collection of arguments for invoking getS.
*/
export interface GetSOutputArgs {
/**
* A prefix for filtering. It's applied with the `accountId`.
*/
prefix?: pulumi.Input<string>;
/**
* The ID of the project. If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* A regular expression for filtering. It's applied with the `email`. Further information about the syntax can be found [here](https://github.com/google/re2/wiki/Syntax).
*/
regex?: pulumi.Input<string>;
}