zitadel.UserGrant
Explore with Pulumi AI
Resource representing the authorization given to a user directly, including the given roles.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zitadel = Pulumiverse.Zitadel;
return await Deployment.RunAsync(() => 
{
    var @default = new Zitadel.UserGrant("default", new()
    {
        ProjectId = data.Zitadel_project.Default.Id,
        OrgId = data.Zitadel_org.Default.Id,
        RoleKeys = new[]
        {
            "super-user",
        },
        UserId = data.Zitadel_human_user.Default.Id,
    });
});
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := zitadel.NewUserGrant(ctx, "default", &zitadel.UserGrantArgs{
			ProjectId: pulumi.Any(data.Zitadel_project.Default.Id),
			OrgId:     pulumi.Any(data.Zitadel_org.Default.Id),
			RoleKeys: pulumi.StringArray{
				pulumi.String("super-user"),
			},
			UserId: pulumi.Any(data.Zitadel_human_user.Default.Id),
		})
		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.zitadel.UserGrant;
import com.pulumi.zitadel.UserGrantArgs;
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) {
        var default_ = new UserGrant("default", UserGrantArgs.builder()        
            .projectId(data.zitadel_project().default().id())
            .orgId(data.zitadel_org().default().id())
            .roleKeys("super-user")
            .userId(data.zitadel_human_user().default().id())
            .build());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as zitadel from "@pulumiverse/zitadel";
const _default = new zitadel.UserGrant("default", {
    projectId: data.zitadel_project["default"].id,
    orgId: data.zitadel_org["default"].id,
    roleKeys: ["super-user"],
    userId: data.zitadel_human_user["default"].id,
});
import pulumi
import pulumiverse_zitadel as zitadel
default = zitadel.UserGrant("default",
    project_id=data["zitadel_project"]["default"]["id"],
    org_id=data["zitadel_org"]["default"]["id"],
    role_keys=["super-user"],
    user_id=data["zitadel_human_user"]["default"]["id"])
resources:
  default:
    type: zitadel:UserGrant
    properties:
      projectId: ${data.zitadel_project.default.id}
      orgId: ${data.zitadel_org.default.id}
      roleKeys:
        - super-user
      userId: ${data.zitadel_human_user.default.id}
Create UserGrant Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserGrant(name: string, args: UserGrantArgs, opts?: CustomResourceOptions);@overload
def UserGrant(resource_name: str,
              args: UserGrantArgs,
              opts: Optional[ResourceOptions] = None)
@overload
def UserGrant(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              user_id: Optional[str] = None,
              org_id: Optional[str] = None,
              project_grant_id: Optional[str] = None,
              project_id: Optional[str] = None,
              role_keys: Optional[Sequence[str]] = None)func NewUserGrant(ctx *Context, name string, args UserGrantArgs, opts ...ResourceOption) (*UserGrant, error)public UserGrant(string name, UserGrantArgs args, CustomResourceOptions? opts = null)
public UserGrant(String name, UserGrantArgs args)
public UserGrant(String name, UserGrantArgs args, CustomResourceOptions options)
type: zitadel:UserGrant
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args UserGrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args UserGrantArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserGrantArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserGrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserGrantArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var userGrantResource = new Zitadel.UserGrant("userGrantResource", new()
{
    UserId = "string",
    OrgId = "string",
    ProjectGrantId = "string",
    ProjectId = "string",
    RoleKeys = new[]
    {
        "string",
    },
});
example, err := zitadel.NewUserGrant(ctx, "userGrantResource", &zitadel.UserGrantArgs{
	UserId:         pulumi.String("string"),
	OrgId:          pulumi.String("string"),
	ProjectGrantId: pulumi.String("string"),
	ProjectId:      pulumi.String("string"),
	RoleKeys: pulumi.StringArray{
		pulumi.String("string"),
	},
})
var userGrantResource = new UserGrant("userGrantResource", UserGrantArgs.builder()
    .userId("string")
    .orgId("string")
    .projectGrantId("string")
    .projectId("string")
    .roleKeys("string")
    .build());
user_grant_resource = zitadel.UserGrant("userGrantResource",
    user_id="string",
    org_id="string",
    project_grant_id="string",
    project_id="string",
    role_keys=["string"])
const userGrantResource = new zitadel.UserGrant("userGrantResource", {
    userId: "string",
    orgId: "string",
    projectGrantId: "string",
    projectId: "string",
    roleKeys: ["string"],
});
type: zitadel:UserGrant
properties:
    orgId: string
    projectGrantId: string
    projectId: string
    roleKeys:
        - string
    userId: string
UserGrant Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The UserGrant resource accepts the following input properties:
- UserId string
- ID of the user
- OrgId string
- ID of the organization
- ProjectGrant stringId 
- ID of the granted project
- ProjectId string
- ID of the project
- RoleKeys List<string>
- List of roles granted
- UserId string
- ID of the user
- OrgId string
- ID of the organization
- ProjectGrant stringId 
- ID of the granted project
- ProjectId string
- ID of the project
- RoleKeys []string
- List of roles granted
- userId String
- ID of the user
- orgId String
- ID of the organization
- projectGrant StringId 
- ID of the granted project
- projectId String
- ID of the project
- roleKeys List<String>
- List of roles granted
- userId string
- ID of the user
- orgId string
- ID of the organization
- projectGrant stringId 
- ID of the granted project
- projectId string
- ID of the project
- roleKeys string[]
- List of roles granted
- user_id str
- ID of the user
- org_id str
- ID of the organization
- project_grant_ strid 
- ID of the granted project
- project_id str
- ID of the project
- role_keys Sequence[str]
- List of roles granted
- userId String
- ID of the user
- orgId String
- ID of the organization
- projectGrant StringId 
- ID of the granted project
- projectId String
- ID of the project
- roleKeys List<String>
- List of roles granted
Outputs
All input properties are implicitly available as output properties. Additionally, the UserGrant resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing UserGrant Resource
Get an existing UserGrant resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserGrantState, opts?: CustomResourceOptions): UserGrant@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        org_id: Optional[str] = None,
        project_grant_id: Optional[str] = None,
        project_id: Optional[str] = None,
        role_keys: Optional[Sequence[str]] = None,
        user_id: Optional[str] = None) -> UserGrantfunc GetUserGrant(ctx *Context, name string, id IDInput, state *UserGrantState, opts ...ResourceOption) (*UserGrant, error)public static UserGrant Get(string name, Input<string> id, UserGrantState? state, CustomResourceOptions? opts = null)public static UserGrant get(String name, Output<String> id, UserGrantState state, CustomResourceOptions options)resources:  _:    type: zitadel:UserGrant    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- OrgId string
- ID of the organization
- ProjectGrant stringId 
- ID of the granted project
- ProjectId string
- ID of the project
- RoleKeys List<string>
- List of roles granted
- UserId string
- ID of the user
- OrgId string
- ID of the organization
- ProjectGrant stringId 
- ID of the granted project
- ProjectId string
- ID of the project
- RoleKeys []string
- List of roles granted
- UserId string
- ID of the user
- orgId String
- ID of the organization
- projectGrant StringId 
- ID of the granted project
- projectId String
- ID of the project
- roleKeys List<String>
- List of roles granted
- userId String
- ID of the user
- orgId string
- ID of the organization
- projectGrant stringId 
- ID of the granted project
- projectId string
- ID of the project
- roleKeys string[]
- List of roles granted
- userId string
- ID of the user
- org_id str
- ID of the organization
- project_grant_ strid 
- ID of the granted project
- project_id str
- ID of the project
- role_keys Sequence[str]
- List of roles granted
- user_id str
- ID of the user
- orgId String
- ID of the organization
- projectGrant StringId 
- ID of the granted project
- projectId String
- ID of the project
- roleKeys List<String>
- List of roles granted
- userId String
- ID of the user
Import
terraform The resource can be imported using the ID format <flow_type:trigger_type[:org_id]>, e.g.
 $ pulumi import zitadel:index/userGrant:UserGrant imported '123456789012345678:123456789012345678:123456789012345678'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zitadel pulumiverse/pulumi-zitadel
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the zitadelTerraform Provider.