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 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"])
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,
});
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
The UserGrant resource accepts the following input properties:
- User
Id string - ID of the user
- Org
Id string - ID of the organization
- Project
Grant stringId - ID of the granted project
- Project
Id string - ID of the project
- Role
Keys List<string> - List of roles granted
- User
Id string - ID of the user
- Org
Id string - ID of the organization
- Project
Grant stringId - ID of the granted project
- Project
Id string - ID of the project
- Role
Keys []string - List of roles granted
- user
Id String - ID of the user
- org
Id String - ID of the organization
- project
Grant StringId - ID of the granted project
- project
Id String - ID of the project
- role
Keys List<String> - List of roles granted
- user
Id string - ID of the user
- org
Id string - ID of the organization
- project
Grant stringId - ID of the granted project
- project
Id string - ID of the project
- role
Keys 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
- user
Id String - ID of the user
- org
Id String - ID of the organization
- project
Grant StringId - ID of the granted project
- project
Id String - ID of the project
- role
Keys 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) -> UserGrant
func 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)
Resource lookup is not supported in YAML
- 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.
- Org
Id string - ID of the organization
- Project
Grant stringId - ID of the granted project
- Project
Id string - ID of the project
- Role
Keys List<string> - List of roles granted
- User
Id string - ID of the user
- Org
Id string - ID of the organization
- Project
Grant stringId - ID of the granted project
- Project
Id string - ID of the project
- Role
Keys []string - List of roles granted
- User
Id string - ID of the user
- org
Id String - ID of the organization
- project
Grant StringId - ID of the granted project
- project
Id String - ID of the project
- role
Keys List<String> - List of roles granted
- user
Id String - ID of the user
- org
Id string - ID of the organization
- project
Grant stringId - ID of the granted project
- project
Id string - ID of the project
- role
Keys string[] - List of roles granted
- user
Id 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
- org
Id String - ID of the organization
- project
Grant StringId - ID of the granted project
- project
Id String - ID of the project
- role
Keys List<String> - List of roles granted
- user
Id 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
zitadel
Terraform Provider.