getFunctionIamPolicy

Retrieves the current IAM policy data for function

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const policy = gcp.cloudfunctionsv2.getFunctionIamPolicy({
project: _function.project,
location: _function.location,
cloudFunction: _function.name,
});
import pulumi
import pulumi_gcp as gcp
policy = gcp.cloudfunctionsv2.get_function_iam_policy(project=function["project"],
location=function["location"],
cloud_function=function["name"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var policy = Gcp.CloudFunctionsV2.GetFunctionIamPolicy.Invoke(new()
{
Project = function.Project,
Location = function.Location,
CloudFunction = function.Name,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudfunctionsv2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfunctionsv2.LookupFunctionIamPolicy(ctx, &cloudfunctionsv2.LookupFunctionIamPolicyArgs{
Project: pulumi.StringRef(function.Project),
Location: pulumi.StringRef(function.Location),
CloudFunction: function.Name,
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudfunctionsv2.Cloudfunctionsv2Functions;
import com.pulumi.gcp.cloudfunctionsv2.inputs.GetFunctionIamPolicyArgs;
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 policy = Cloudfunctionsv2Functions.getFunctionIamPolicy(GetFunctionIamPolicyArgs.builder()
.project(function.project())
.location(function.location())
.cloudFunction(function.name())
.build());
}
}
variables:
policy:
fn::invoke:
function: gcp:cloudfunctionsv2:getFunctionIamPolicy
arguments:
project: ${function.project}
location: ${function.location}
cloudFunction: ${function.name}

Return

A collection of values returned by getFunctionIamPolicy.

Parameters

argument

A collection of arguments for invoking getFunctionIamPolicy.


suspend fun getFunctionIamPolicy(cloudFunction: String, location: String? = null, project: String? = null): GetFunctionIamPolicyResult

Return

A collection of values returned by getFunctionIamPolicy.

Parameters

cloudFunction

Used to find the parent resource to bind the IAM policy to

location

The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no location is specified, it is taken from the provider configuration.

project

The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

See also


Return

A collection of values returned by getFunctionIamPolicy.

Parameters

argument

Builder for com.pulumi.gcp.cloudfunctionsv2.kotlin.inputs.GetFunctionIamPolicyPlainArgs.

See also