get Testable Permissions
Retrieve a list of testable permissions for a resource. Testable permissions mean the permissions that user can add or remove in a role at a given resource. The resource can be referenced either via the full resource name or via a URI.
Example Usage
Retrieve all the supported permissions able to be set on my-project
that are in either GA or BETA. This is useful for dynamically constructing custom roles.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const perms = gcp.iam.getTestablePermissions({
fullResourceName: "//cloudresourcemanager.googleapis.com/projects/my-project",
stages: [
"GA",
"BETA",
],
});
import pulumi
import pulumi_gcp as gcp
perms = gcp.iam.get_testable_permissions(full_resource_name="//cloudresourcemanager.googleapis.com/projects/my-project",
stages=[
"GA",
"BETA",
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var perms = Gcp.Iam.GetTestablePermissions.Invoke(new()
{
FullResourceName = "//cloudresourcemanager.googleapis.com/projects/my-project",
Stages = new[]
{
"GA",
"BETA",
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.GetTestablePermissions(ctx, &iam.GetTestablePermissionsArgs{
FullResourceName: "//cloudresourcemanager.googleapis.com/projects/my-project",
Stages: []string{
"GA",
"BETA",
},
}, 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.iam.IamFunctions;
import com.pulumi.gcp.iam.inputs.GetTestablePermissionsArgs;
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 perms = IamFunctions.getTestablePermissions(GetTestablePermissionsArgs.builder()
.fullResourceName("//cloudresourcemanager.googleapis.com/projects/my-project")
.stages(
"GA",
"BETA")
.build());
}
}
variables:
perms:
fn::invoke:
Function: gcp:iam:getTestablePermissions
Arguments:
fullResourceName: //cloudresourcemanager.googleapis.com/projects/my-project
stages:
- GA
- BETA
Return
A collection of values returned by getTestablePermissions.
Parameters
A collection of arguments for invoking getTestablePermissions.
Return
A collection of values returned by getTestablePermissions.
Parameters
The level of support for custom roles. Can be one of "NOT_SUPPORTED"
, "SUPPORTED"
, "TESTING"
. Default is "SUPPORTED"
See full resource name documentation for more detail.
The acceptable release stages of the permission in the output. Note that BETA
does not include permissions in GA
, but you can specify both with ["GA", "BETA"]
for example. Can be a list of "ALPHA"
, "BETA"
, "GA"
, "DEPRECATED"
. Default is ["GA"]
.
See also
Return
A collection of values returned by getTestablePermissions.
Parameters
Builder for com.pulumi.gcp.iam.kotlin.inputs.GetTestablePermissionsPlainArgs.