1. Packages
  2. CockroachDB Cloud
  3. API Docs
  4. UserRoleGrant
CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse

cockroach.UserRoleGrant

Explore with Pulumi AI

cockroach logo
CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cockroach.UserRoleGrant;
    import com.pulumi.cockroach.UserRoleGrantArgs;
    import com.pulumi.cockroach.inputs.UserRoleGrantRoleArgs;
    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 config = ctx.config();
            final var userId = config.get("userId");
            var adminGrant = new UserRoleGrant("adminGrant", UserRoleGrantArgs.builder()
                .userId(userId)
                .role(UserRoleGrantRoleArgs.builder()
                    .role_name("CLUSTER_ADMIN")
                    .resource_type("CLUSTER")
                    .resource_id(example.id())
                    .build())
                .build());
    
        }
    }
    
    configuration:
      userId:
        type: string
    resources:
      adminGrant:
        type: cockroach:UserRoleGrant
        name: admin_grant
        properties:
          userId: ${userId}
          role:
            role_name: CLUSTER_ADMIN
            resource_type: CLUSTER
            resource_id: ${example.id}
    

    Create UserRoleGrant Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new UserRoleGrant(name: string, args: UserRoleGrantArgs, opts?: CustomResourceOptions);
    @overload
    def UserRoleGrant(resource_name: str,
                      args: UserRoleGrantArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserRoleGrant(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      role: Optional[UserRoleGrantRoleArgs] = None,
                      user_id: Optional[str] = None)
    func NewUserRoleGrant(ctx *Context, name string, args UserRoleGrantArgs, opts ...ResourceOption) (*UserRoleGrant, error)
    public UserRoleGrant(string name, UserRoleGrantArgs args, CustomResourceOptions? opts = null)
    public UserRoleGrant(String name, UserRoleGrantArgs args)
    public UserRoleGrant(String name, UserRoleGrantArgs args, CustomResourceOptions options)
    
    type: cockroach:UserRoleGrant
    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 UserRoleGrantArgs
    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 UserRoleGrantArgs
    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 UserRoleGrantArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserRoleGrantArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserRoleGrantArgs
    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 userRoleGrantResource = new Cockroach.UserRoleGrant("userRoleGrantResource", new()
    {
        Role = new Cockroach.Inputs.UserRoleGrantRoleArgs
        {
            ResourceType = "string",
            RoleName = "string",
            ResourceId = "string",
        },
        UserId = "string",
    });
    
    example, err := cockroach.NewUserRoleGrant(ctx, "userRoleGrantResource", &cockroach.UserRoleGrantArgs{
    	Role: &cockroach.UserRoleGrantRoleArgs{
    		ResourceType: pulumi.String("string"),
    		RoleName:     pulumi.String("string"),
    		ResourceId:   pulumi.String("string"),
    	},
    	UserId: pulumi.String("string"),
    })
    
    var userRoleGrantResource = new UserRoleGrant("userRoleGrantResource", UserRoleGrantArgs.builder()
        .role(UserRoleGrantRoleArgs.builder()
            .resourceType("string")
            .roleName("string")
            .resourceId("string")
            .build())
        .userId("string")
        .build());
    
    user_role_grant_resource = cockroach.UserRoleGrant("userRoleGrantResource",
        role={
            "resource_type": "string",
            "role_name": "string",
            "resource_id": "string",
        },
        user_id="string")
    
    const userRoleGrantResource = new cockroach.UserRoleGrant("userRoleGrantResource", {
        role: {
            resourceType: "string",
            roleName: "string",
            resourceId: "string",
        },
        userId: "string",
    });
    
    type: cockroach:UserRoleGrant
    properties:
        role:
            resourceId: string
            resourceType: string
            roleName: string
        userId: string
    

    UserRoleGrant 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 UserRoleGrant resource accepts the following input properties:

    Role Pulumiverse.Cockroach.Inputs.UserRoleGrantRole
    UserId string
    ID of the user to grant these roles to.
    Role UserRoleGrantRoleArgs
    UserId string
    ID of the user to grant these roles to.
    role UserRoleGrantRole
    userId String
    ID of the user to grant these roles to.
    role UserRoleGrantRole
    userId string
    ID of the user to grant these roles to.
    role UserRoleGrantRoleArgs
    user_id str
    ID of the user to grant these roles to.
    role Property Map
    userId String
    ID of the user to grant these roles to.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UserRoleGrant 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 UserRoleGrant Resource

    Get an existing UserRoleGrant 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?: UserRoleGrantState, opts?: CustomResourceOptions): UserRoleGrant
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            role: Optional[UserRoleGrantRoleArgs] = None,
            user_id: Optional[str] = None) -> UserRoleGrant
    func GetUserRoleGrant(ctx *Context, name string, id IDInput, state *UserRoleGrantState, opts ...ResourceOption) (*UserRoleGrant, error)
    public static UserRoleGrant Get(string name, Input<string> id, UserRoleGrantState? state, CustomResourceOptions? opts = null)
    public static UserRoleGrant get(String name, Output<String> id, UserRoleGrantState 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.
    The following state arguments are supported:
    Role Pulumiverse.Cockroach.Inputs.UserRoleGrantRole
    UserId string
    ID of the user to grant these roles to.
    Role UserRoleGrantRoleArgs
    UserId string
    ID of the user to grant these roles to.
    role UserRoleGrantRole
    userId String
    ID of the user to grant these roles to.
    role UserRoleGrantRole
    userId string
    ID of the user to grant these roles to.
    role UserRoleGrantRoleArgs
    user_id str
    ID of the user to grant these roles to.
    role Property Map
    userId String
    ID of the user to grant these roles to.

    Supporting Types

    UserRoleGrantRole, UserRoleGrantRoleArgs

    ResourceType string
    Type of resource. Allowed values are:

    • ORGANIZATION
    • CLUSTER
    • FOLDER
    RoleName string
    Name of the role to grant. Allowed values are:

    • BILLING_COORDINATOR
    • ORG_ADMIN
    • ORG_MEMBER
    • CLUSTER_ADMIN
    • CLUSTER_OPERATOR_WRITER
    • CLUSTER_DEVELOPER
    • CLUSTER_CREATOR
    • FOLDER_ADMIN
    • FOLDER_MOVER
    ResourceId string
    ID of the resource. Required if the resource_type is 'FOLDER' or 'CLUSTER'. It should be omitted otherwise.
    ResourceType string
    Type of resource. Allowed values are:

    • ORGANIZATION
    • CLUSTER
    • FOLDER
    RoleName string
    Name of the role to grant. Allowed values are:

    • BILLING_COORDINATOR
    • ORG_ADMIN
    • ORG_MEMBER
    • CLUSTER_ADMIN
    • CLUSTER_OPERATOR_WRITER
    • CLUSTER_DEVELOPER
    • CLUSTER_CREATOR
    • FOLDER_ADMIN
    • FOLDER_MOVER
    ResourceId string
    ID of the resource. Required if the resource_type is 'FOLDER' or 'CLUSTER'. It should be omitted otherwise.
    resourceType String
    Type of resource. Allowed values are:

    • ORGANIZATION
    • CLUSTER
    • FOLDER
    roleName String
    Name of the role to grant. Allowed values are:

    • BILLING_COORDINATOR
    • ORG_ADMIN
    • ORG_MEMBER
    • CLUSTER_ADMIN
    • CLUSTER_OPERATOR_WRITER
    • CLUSTER_DEVELOPER
    • CLUSTER_CREATOR
    • FOLDER_ADMIN
    • FOLDER_MOVER
    resourceId String
    ID of the resource. Required if the resource_type is 'FOLDER' or 'CLUSTER'. It should be omitted otherwise.
    resourceType string
    Type of resource. Allowed values are:

    • ORGANIZATION
    • CLUSTER
    • FOLDER
    roleName string
    Name of the role to grant. Allowed values are:

    • BILLING_COORDINATOR
    • ORG_ADMIN
    • ORG_MEMBER
    • CLUSTER_ADMIN
    • CLUSTER_OPERATOR_WRITER
    • CLUSTER_DEVELOPER
    • CLUSTER_CREATOR
    • FOLDER_ADMIN
    • FOLDER_MOVER
    resourceId string
    ID of the resource. Required if the resource_type is 'FOLDER' or 'CLUSTER'. It should be omitted otherwise.
    resource_type str
    Type of resource. Allowed values are:

    • ORGANIZATION
    • CLUSTER
    • FOLDER
    role_name str
    Name of the role to grant. Allowed values are:

    • BILLING_COORDINATOR
    • ORG_ADMIN
    • ORG_MEMBER
    • CLUSTER_ADMIN
    • CLUSTER_OPERATOR_WRITER
    • CLUSTER_DEVELOPER
    • CLUSTER_CREATOR
    • FOLDER_ADMIN
    • FOLDER_MOVER
    resource_id str
    ID of the resource. Required if the resource_type is 'FOLDER' or 'CLUSTER'. It should be omitted otherwise.
    resourceType String
    Type of resource. Allowed values are:

    • ORGANIZATION
    • CLUSTER
    • FOLDER
    roleName String
    Name of the role to grant. Allowed values are:

    • BILLING_COORDINATOR
    • ORG_ADMIN
    • ORG_MEMBER
    • CLUSTER_ADMIN
    • CLUSTER_OPERATOR_WRITER
    • CLUSTER_DEVELOPER
    • CLUSTER_CREATOR
    • FOLDER_ADMIN
    • FOLDER_MOVER
    resourceId String
    ID of the resource. Required if the resource_type is 'FOLDER' or 'CLUSTER'. It should be omitted otherwise.

    Import

    Cluster and folder level role grants can be imported using:

    <user_id>,<role_name>,<resource_type>,<resource_id>

    $ pulumi import cockroach:index/userRoleGrant:UserRoleGrant admin_grant 1f69fdd2-600a-4cfc-a9ba-16995df0d77d,CLUSTER_ADMIN,CLUSTER,9b9d23fe-3848-40b2-a3c5-d8ccb1c4f831
    

    Organization level grants can omit the resource_id

    $ pulumi import cockroach:index/userRoleGrant:UserRoleGrant org_level_grant 1f69fdd2-600a-4cfc-a9ba-16995df0d77d,ORG_ADMIN,ORGANIZATION
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    cockroach pulumiverse/pulumi-cockroach
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cockroach Terraform Provider.
    cockroach logo
    CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse