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

cockroach.UserRoleGrants

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.UserRoleGrants;
    import com.pulumi.cockroach.UserRoleGrantsArgs;
    import com.pulumi.cockroach.inputs.UserRoleGrantsRoleArgs;
    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 cockroach = new UserRoleGrants("cockroach", UserRoleGrantsArgs.builder()
                .userId(userId)
                .roles(            
                    UserRoleGrantsRoleArgs.builder()
                        .role_name("ORG_MEMBER")
                        .resource_type("ORGANIZATION")
                        .resource_id("")
                        .build(),
                    UserRoleGrantsRoleArgs.builder()
                        .role_name("ORG_ADMIN")
                        .resource_type("ORGANIZATION")
                        .resource_id("")
                        .build(),
                    UserRoleGrantsRoleArgs.builder()
                        .role_name("CLUSTER_ADMIN")
                        .resource_type("CLUSTER")
                        .resource_id(prod.id())
                        .build(),
                    UserRoleGrantsRoleArgs.builder()
                        .role_name("FOLDER_ADMIN")
                        .resource_type("FOLDER")
                        .resource_id(dev.id())
                        .build())
                .build());
    
        }
    }
    
    configuration:
      userId:
        type: string
    resources:
      cockroach:
        type: cockroach:UserRoleGrants
        properties:
          userId: ${userId}
          roles:
            - role_name: ORG_MEMBER
              resource_type: ORGANIZATION
              resource_id:
            - role_name: ORG_ADMIN
              resource_type: ORGANIZATION
              resource_id:
            - role_name: CLUSTER_ADMIN
              resource_type: CLUSTER
              resource_id: ${prod.id}
            - role_name: FOLDER_ADMIN
              resource_type: FOLDER
              resource_id: ${dev.id}
    

    Create UserRoleGrants Resource

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

    Constructor syntax

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

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

    Roles List<Pulumiverse.Cockroach.Inputs.UserRoleGrantsRole>
    The list of roles to include. ORG_MEMBER must be included.
    UserId string
    ID of the user to grant these roles to.
    Roles []UserRoleGrantsRoleArgs
    The list of roles to include. ORG_MEMBER must be included.
    UserId string
    ID of the user to grant these roles to.
    roles List<UserRoleGrantsRole>
    The list of roles to include. ORG_MEMBER must be included.
    userId String
    ID of the user to grant these roles to.
    roles UserRoleGrantsRole[]
    The list of roles to include. ORG_MEMBER must be included.
    userId string
    ID of the user to grant these roles to.
    roles Sequence[UserRoleGrantsRoleArgs]
    The list of roles to include. ORG_MEMBER must be included.
    user_id str
    ID of the user to grant these roles to.
    roles List<Property Map>
    The list of roles to include. ORG_MEMBER must be included.
    userId String
    ID of the user to grant these roles to.

    Outputs

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

    Get an existing UserRoleGrants 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?: UserRoleGrantsState, opts?: CustomResourceOptions): UserRoleGrants
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            roles: Optional[Sequence[UserRoleGrantsRoleArgs]] = None,
            user_id: Optional[str] = None) -> UserRoleGrants
    func GetUserRoleGrants(ctx *Context, name string, id IDInput, state *UserRoleGrantsState, opts ...ResourceOption) (*UserRoleGrants, error)
    public static UserRoleGrants Get(string name, Input<string> id, UserRoleGrantsState? state, CustomResourceOptions? opts = null)
    public static UserRoleGrants get(String name, Output<String> id, UserRoleGrantsState 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:
    Roles List<Pulumiverse.Cockroach.Inputs.UserRoleGrantsRole>
    The list of roles to include. ORG_MEMBER must be included.
    UserId string
    ID of the user to grant these roles to.
    Roles []UserRoleGrantsRoleArgs
    The list of roles to include. ORG_MEMBER must be included.
    UserId string
    ID of the user to grant these roles to.
    roles List<UserRoleGrantsRole>
    The list of roles to include. ORG_MEMBER must be included.
    userId String
    ID of the user to grant these roles to.
    roles UserRoleGrantsRole[]
    The list of roles to include. ORG_MEMBER must be included.
    userId string
    ID of the user to grant these roles to.
    roles Sequence[UserRoleGrantsRoleArgs]
    The list of roles to include. ORG_MEMBER must be included.
    user_id str
    ID of the user to grant these roles to.
    roles List<Property Map>
    The list of roles to include. ORG_MEMBER must be included.
    userId String
    ID of the user to grant these roles to.

    Supporting Types

    UserRoleGrantsRole, UserRoleGrantsRoleArgs

    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

    format:

    $ pulumi import cockroach:index/userRoleGrants:UserRoleGrants service_account 1f69fdd2-600a-4cfc-a9ba-16995df0d77d
    

    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