@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
114 lines • 4 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResourcesSearchAllOutput = exports.getResourcesSearchAll = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Retrieve all the resources within a given accessible CRM scope (project/folder/organization). See the
* [REST API](https://cloud.google.com/asset-inventory/docs/reference/rest/v1p1beta1/resources/searchAll)
* for more details.
*
* ## Example Usage
*
* ### Searching For All Projects In An Org
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const projects = gcp.cloudasset.getResourcesSearchAll({
* scope: "organizations/0123456789",
* assetTypes: ["cloudresourcemanager.googleapis.com/Project"],
* });
* ```
*
* ### Searching For All Projects With CloudBuild API Enabled
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const cloudBuildProjects = gcp.cloudasset.getResourcesSearchAll({
* scope: "organizations/0123456789",
* assetTypes: ["serviceusage.googleapis.com/Service"],
* query: "displayName:cloudbuild.googleapis.com AND state:ENABLED",
* });
* ```
*
* ### Searching For All Service Accounts In A Project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const projectServiceAccounts = gcp.cloudasset.getResourcesSearchAll({
* scope: "projects/my-project-id",
* assetTypes: ["iam.googleapis.com/ServiceAccount"],
* });
* ```
*/
function getResourcesSearchAll(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("gcp:cloudasset/getResourcesSearchAll:getResourcesSearchAll", {
"assetTypes": args.assetTypes,
"query": args.query,
"scope": args.scope,
}, opts);
}
exports.getResourcesSearchAll = getResourcesSearchAll;
/**
* Retrieve all the resources within a given accessible CRM scope (project/folder/organization). See the
* [REST API](https://cloud.google.com/asset-inventory/docs/reference/rest/v1p1beta1/resources/searchAll)
* for more details.
*
* ## Example Usage
*
* ### Searching For All Projects In An Org
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const projects = gcp.cloudasset.getResourcesSearchAll({
* scope: "organizations/0123456789",
* assetTypes: ["cloudresourcemanager.googleapis.com/Project"],
* });
* ```
*
* ### Searching For All Projects With CloudBuild API Enabled
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const cloudBuildProjects = gcp.cloudasset.getResourcesSearchAll({
* scope: "organizations/0123456789",
* assetTypes: ["serviceusage.googleapis.com/Service"],
* query: "displayName:cloudbuild.googleapis.com AND state:ENABLED",
* });
* ```
*
* ### Searching For All Service Accounts In A Project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const projectServiceAccounts = gcp.cloudasset.getResourcesSearchAll({
* scope: "projects/my-project-id",
* assetTypes: ["iam.googleapis.com/ServiceAccount"],
* });
* ```
*/
function getResourcesSearchAllOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("gcp:cloudasset/getResourcesSearchAll:getResourcesSearchAll", {
"assetTypes": args.assetTypes,
"query": args.query,
"scope": args.scope,
}, opts);
}
exports.getResourcesSearchAllOutput = getResourcesSearchAllOutput;
//# sourceMappingURL=getResourcesSearchAll.js.map
;