1. Packages
  2. Rancher2
  3. API Docs
  4. GlobalRole
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

rancher2.GlobalRole

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

    Provides a Rancher v2 Global Role resource. This can be used to create Global Role for Rancher v2 and retrieve their information.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as rancher2 from "@pulumi/rancher2";
    
    // Create a new rancher2 Global Role
    const foo = new rancher2.GlobalRole("foo", {
        description: "Terraform global role acceptance test",
        newUserDefault: true,
        rules: [{
            apiGroups: ["*"],
            resources: ["secrets"],
            verbs: ["create"],
        }],
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    # Create a new rancher2 Global Role
    foo = rancher2.GlobalRole("foo",
        description="Terraform global role acceptance test",
        new_user_default=True,
        rules=[rancher2.GlobalRoleRuleArgs(
            api_groups=["*"],
            resources=["secrets"],
            verbs=["create"],
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new rancher2 Global Role
    		_, err := rancher2.NewGlobalRole(ctx, "foo", &rancher2.GlobalRoleArgs{
    			Description:    pulumi.String("Terraform global role acceptance test"),
    			NewUserDefault: pulumi.Bool(true),
    			Rules: rancher2.GlobalRoleRuleArray{
    				&rancher2.GlobalRoleRuleArgs{
    					ApiGroups: pulumi.StringArray{
    						pulumi.String("*"),
    					},
    					Resources: pulumi.StringArray{
    						pulumi.String("secrets"),
    					},
    					Verbs: pulumi.StringArray{
    						pulumi.String("create"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rancher2 = Pulumi.Rancher2;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new rancher2 Global Role
        var foo = new Rancher2.GlobalRole("foo", new()
        {
            Description = "Terraform global role acceptance test",
            NewUserDefault = true,
            Rules = new[]
            {
                new Rancher2.Inputs.GlobalRoleRuleArgs
                {
                    ApiGroups = new[]
                    {
                        "*",
                    },
                    Resources = new[]
                    {
                        "secrets",
                    },
                    Verbs = new[]
                    {
                        "create",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.GlobalRole;
    import com.pulumi.rancher2.GlobalRoleArgs;
    import com.pulumi.rancher2.inputs.GlobalRoleRuleArgs;
    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 foo = new GlobalRole("foo", GlobalRoleArgs.builder()        
                .description("Terraform global role acceptance test")
                .newUserDefault(true)
                .rules(GlobalRoleRuleArgs.builder()
                    .apiGroups("*")
                    .resources("secrets")
                    .verbs("create")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create a new rancher2 Global Role
      foo:
        type: rancher2:GlobalRole
        properties:
          description: Terraform global role acceptance test
          newUserDefault: true
          rules:
            - apiGroups:
                - '*'
              resources:
                - secrets
              verbs:
                - create
    

    Create GlobalRole Resource

    new GlobalRole(name: string, args?: GlobalRoleArgs, opts?: CustomResourceOptions);
    @overload
    def GlobalRole(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   annotations: Optional[Mapping[str, Any]] = None,
                   description: Optional[str] = None,
                   inherited_cluster_roles: Optional[Sequence[str]] = None,
                   labels: Optional[Mapping[str, Any]] = None,
                   name: Optional[str] = None,
                   new_user_default: Optional[bool] = None,
                   rules: Optional[Sequence[GlobalRoleRuleArgs]] = None)
    @overload
    def GlobalRole(resource_name: str,
                   args: Optional[GlobalRoleArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    func NewGlobalRole(ctx *Context, name string, args *GlobalRoleArgs, opts ...ResourceOption) (*GlobalRole, error)
    public GlobalRole(string name, GlobalRoleArgs? args = null, CustomResourceOptions? opts = null)
    public GlobalRole(String name, GlobalRoleArgs args)
    public GlobalRole(String name, GlobalRoleArgs args, CustomResourceOptions options)
    
    type: rancher2:GlobalRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args GlobalRoleArgs
    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 GlobalRoleArgs
    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 GlobalRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GlobalRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GlobalRoleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Annotations Dictionary<string, object>
    Annotations for global role object (map)
    Description string
    Global role description (string)
    InheritedClusterRoles List<string>
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    Labels Dictionary<string, object>
    Labels for global role object (map)
    Name string
    Global role name (string)
    NewUserDefault bool
    Whether or not this role should be added to new users. Default false (bool)
    Rules List<GlobalRoleRule>
    Global role policy rules (list)
    Annotations map[string]interface{}
    Annotations for global role object (map)
    Description string
    Global role description (string)
    InheritedClusterRoles []string
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    Labels map[string]interface{}
    Labels for global role object (map)
    Name string
    Global role name (string)
    NewUserDefault bool
    Whether or not this role should be added to new users. Default false (bool)
    Rules []GlobalRoleRuleArgs
    Global role policy rules (list)
    annotations Map<String,Object>
    Annotations for global role object (map)
    description String
    Global role description (string)
    inheritedClusterRoles List<String>
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels Map<String,Object>
    Labels for global role object (map)
    name String
    Global role name (string)
    newUserDefault Boolean
    Whether or not this role should be added to new users. Default false (bool)
    rules List<GlobalRoleRule>
    Global role policy rules (list)
    annotations {[key: string]: any}
    Annotations for global role object (map)
    description string
    Global role description (string)
    inheritedClusterRoles string[]
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels {[key: string]: any}
    Labels for global role object (map)
    name string
    Global role name (string)
    newUserDefault boolean
    Whether or not this role should be added to new users. Default false (bool)
    rules GlobalRoleRule[]
    Global role policy rules (list)
    annotations Mapping[str, Any]
    Annotations for global role object (map)
    description str
    Global role description (string)
    inherited_cluster_roles Sequence[str]
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels Mapping[str, Any]
    Labels for global role object (map)
    name str
    Global role name (string)
    new_user_default bool
    Whether or not this role should be added to new users. Default false (bool)
    rules Sequence[GlobalRoleRuleArgs]
    Global role policy rules (list)
    annotations Map<Any>
    Annotations for global role object (map)
    description String
    Global role description (string)
    inheritedClusterRoles List<String>
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels Map<Any>
    Labels for global role object (map)
    name String
    Global role name (string)
    newUserDefault Boolean
    Whether or not this role should be added to new users. Default false (bool)
    rules List<Property Map>
    Global role policy rules (list)

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GlobalRole resource produces the following output properties:

    Builtin bool
    (Computed) Builtin global role (bool)
    Id string
    The provider-assigned unique ID for this managed resource.
    Builtin bool
    (Computed) Builtin global role (bool)
    Id string
    The provider-assigned unique ID for this managed resource.
    builtin Boolean
    (Computed) Builtin global role (bool)
    id String
    The provider-assigned unique ID for this managed resource.
    builtin boolean
    (Computed) Builtin global role (bool)
    id string
    The provider-assigned unique ID for this managed resource.
    builtin bool
    (Computed) Builtin global role (bool)
    id str
    The provider-assigned unique ID for this managed resource.
    builtin Boolean
    (Computed) Builtin global role (bool)
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GlobalRole Resource

    Get an existing GlobalRole 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?: GlobalRoleState, opts?: CustomResourceOptions): GlobalRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Mapping[str, Any]] = None,
            builtin: Optional[bool] = None,
            description: Optional[str] = None,
            inherited_cluster_roles: Optional[Sequence[str]] = None,
            labels: Optional[Mapping[str, Any]] = None,
            name: Optional[str] = None,
            new_user_default: Optional[bool] = None,
            rules: Optional[Sequence[GlobalRoleRuleArgs]] = None) -> GlobalRole
    func GetGlobalRole(ctx *Context, name string, id IDInput, state *GlobalRoleState, opts ...ResourceOption) (*GlobalRole, error)
    public static GlobalRole Get(string name, Input<string> id, GlobalRoleState? state, CustomResourceOptions? opts = null)
    public static GlobalRole get(String name, Output<String> id, GlobalRoleState 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:
    Annotations Dictionary<string, object>
    Annotations for global role object (map)
    Builtin bool
    (Computed) Builtin global role (bool)
    Description string
    Global role description (string)
    InheritedClusterRoles List<string>
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    Labels Dictionary<string, object>
    Labels for global role object (map)
    Name string
    Global role name (string)
    NewUserDefault bool
    Whether or not this role should be added to new users. Default false (bool)
    Rules List<GlobalRoleRule>
    Global role policy rules (list)
    Annotations map[string]interface{}
    Annotations for global role object (map)
    Builtin bool
    (Computed) Builtin global role (bool)
    Description string
    Global role description (string)
    InheritedClusterRoles []string
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    Labels map[string]interface{}
    Labels for global role object (map)
    Name string
    Global role name (string)
    NewUserDefault bool
    Whether or not this role should be added to new users. Default false (bool)
    Rules []GlobalRoleRuleArgs
    Global role policy rules (list)
    annotations Map<String,Object>
    Annotations for global role object (map)
    builtin Boolean
    (Computed) Builtin global role (bool)
    description String
    Global role description (string)
    inheritedClusterRoles List<String>
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels Map<String,Object>
    Labels for global role object (map)
    name String
    Global role name (string)
    newUserDefault Boolean
    Whether or not this role should be added to new users. Default false (bool)
    rules List<GlobalRoleRule>
    Global role policy rules (list)
    annotations {[key: string]: any}
    Annotations for global role object (map)
    builtin boolean
    (Computed) Builtin global role (bool)
    description string
    Global role description (string)
    inheritedClusterRoles string[]
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels {[key: string]: any}
    Labels for global role object (map)
    name string
    Global role name (string)
    newUserDefault boolean
    Whether or not this role should be added to new users. Default false (bool)
    rules GlobalRoleRule[]
    Global role policy rules (list)
    annotations Mapping[str, Any]
    Annotations for global role object (map)
    builtin bool
    (Computed) Builtin global role (bool)
    description str
    Global role description (string)
    inherited_cluster_roles Sequence[str]
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels Mapping[str, Any]
    Labels for global role object (map)
    name str
    Global role name (string)
    new_user_default bool
    Whether or not this role should be added to new users. Default false (bool)
    rules Sequence[GlobalRoleRuleArgs]
    Global role policy rules (list)
    annotations Map<Any>
    Annotations for global role object (map)
    builtin Boolean
    (Computed) Builtin global role (bool)
    description String
    Global role description (string)
    inheritedClusterRoles List<String>
    Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster
    labels Map<Any>
    Labels for global role object (map)
    name String
    Global role name (string)
    newUserDefault Boolean
    Whether or not this role should be added to new users. Default false (bool)
    rules List<Property Map>
    Global role policy rules (list)

    Supporting Types

    GlobalRoleRule, GlobalRoleRuleArgs

    ApiGroups List<string>
    Policy rule api groups (list)
    NonResourceUrls List<string>
    Policy rule non resource urls (list)
    ResourceNames List<string>
    Policy rule resource names (list)
    Resources List<string>
    Policy rule resources (list)
    Verbs List<string>
    Policy rule verbs. bind, create, delete, deletecollection, escalate, get, impersonate, list, patch, update, use, view, watch, own and * values are supported (list)
    ApiGroups []string
    Policy rule api groups (list)
    NonResourceUrls []string
    Policy rule non resource urls (list)
    ResourceNames []string
    Policy rule resource names (list)
    Resources []string
    Policy rule resources (list)
    Verbs []string
    Policy rule verbs. bind, create, delete, deletecollection, escalate, get, impersonate, list, patch, update, use, view, watch, own and * values are supported (list)
    apiGroups List<String>
    Policy rule api groups (list)
    nonResourceUrls List<String>
    Policy rule non resource urls (list)
    resourceNames List<String>
    Policy rule resource names (list)
    resources List<String>
    Policy rule resources (list)
    verbs List<String>
    Policy rule verbs. bind, create, delete, deletecollection, escalate, get, impersonate, list, patch, update, use, view, watch, own and * values are supported (list)
    apiGroups string[]
    Policy rule api groups (list)
    nonResourceUrls string[]
    Policy rule non resource urls (list)
    resourceNames string[]
    Policy rule resource names (list)
    resources string[]
    Policy rule resources (list)
    verbs string[]
    Policy rule verbs. bind, create, delete, deletecollection, escalate, get, impersonate, list, patch, update, use, view, watch, own and * values are supported (list)
    api_groups Sequence[str]
    Policy rule api groups (list)
    non_resource_urls Sequence[str]
    Policy rule non resource urls (list)
    resource_names Sequence[str]
    Policy rule resource names (list)
    resources Sequence[str]
    Policy rule resources (list)
    verbs Sequence[str]
    Policy rule verbs. bind, create, delete, deletecollection, escalate, get, impersonate, list, patch, update, use, view, watch, own and * values are supported (list)
    apiGroups List<String>
    Policy rule api groups (list)
    nonResourceUrls List<String>
    Policy rule non resource urls (list)
    resourceNames List<String>
    Policy rule resource names (list)
    resources List<String>
    Policy rule resources (list)
    verbs List<String>
    Policy rule verbs. bind, create, delete, deletecollection, escalate, get, impersonate, list, patch, update, use, view, watch, own and * values are supported (list)

    Import

    Global Role can be imported using the Rancher Global Role ID

    $ pulumi import rancher2:index/globalRole:GlobalRole foo &lt;global_role_id&gt;
    

    Package Details

    Repository
    Rancher2 pulumi/pulumi-rancher2
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rancher2 Terraform Provider.
    rancher2 logo
    Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi