@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
100 lines • 3.5 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAccountOutput = exports.getAccount = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Get the service account from a project. For more information see
* the official [API](https://cloud.google.com/compute/docs/access/service-accounts) documentation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const objectViewer = gcp.serviceaccount.getAccount({
* accountId: "object-viewer",
* });
* ```
*
* ### Save Key In Kubernetes Secret
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as kubernetes from "@pulumi/kubernetes";
* import * as std from "@pulumi/std";
*
* const myaccount = gcp.serviceaccount.getAccount({
* accountId: "myaccount-id",
* });
* const mykey = new gcp.serviceaccount.Key("mykey", {serviceAccountId: myaccount.then(myaccount => myaccount.name)});
* const google_application_credentials = new kubernetes.core.v1.Secret("google-application-credentials", {
* metadata: {
* name: "google-application-credentials",
* },
* data: {
* json: std.base64decodeOutput({
* input: mykey.privateKey,
* }).apply(invoke => invoke.result),
* },
* });
* ```
*/
function getAccount(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("gcp:serviceaccount/getAccount:getAccount", {
"accountId": args.accountId,
"project": args.project,
}, opts);
}
exports.getAccount = getAccount;
/**
* Get the service account from a project. For more information see
* the official [API](https://cloud.google.com/compute/docs/access/service-accounts) documentation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const objectViewer = gcp.serviceaccount.getAccount({
* accountId: "object-viewer",
* });
* ```
*
* ### Save Key In Kubernetes Secret
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as kubernetes from "@pulumi/kubernetes";
* import * as std from "@pulumi/std";
*
* const myaccount = gcp.serviceaccount.getAccount({
* accountId: "myaccount-id",
* });
* const mykey = new gcp.serviceaccount.Key("mykey", {serviceAccountId: myaccount.then(myaccount => myaccount.name)});
* const google_application_credentials = new kubernetes.core.v1.Secret("google-application-credentials", {
* metadata: {
* name: "google-application-credentials",
* },
* data: {
* json: std.base64decodeOutput({
* input: mykey.privateKey,
* }).apply(invoke => invoke.result),
* },
* });
* ```
*/
function getAccountOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("gcp:serviceaccount/getAccount:getAccount", {
"accountId": args.accountId,
"project": args.project,
}, opts);
}
exports.getAccountOutput = getAccountOutput;
//# sourceMappingURL=getAccount.js.map