GlobalRole

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

Example Usage

using Pulumi;
using Rancher2 = Pulumi.Rancher2;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new rancher2 Global Role
        var foo = new Rancher2.GlobalRole("foo", new Rancher2.GlobalRoleArgs
        {
            Description = "Terraform global role acceptance test",
            NewUserDefault = true,
            Rules = 
            {
                new Rancher2.Inputs.GlobalRoleRuleArgs
                {
                    ApiGroups = 
                    {
                        "*",
                    },
                    Resources = 
                    {
                        "secrets",
                    },
                    Verbs = 
                    {
                        "create",
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-rancher2/sdk/v3/go/rancher2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, 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
	})
}
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"],
    )])
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"],
    }],
});

Create a 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,
               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)
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.

GlobalRole Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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)
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<GlobalRoleRuleArgs>
Global role policy rules (list)
Annotations map[string]interface{}
Annotations for global role object (map)
Description string
Global role description (string)
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 []GlobalRoleRule
Global role policy rules (list)
annotations {[key: string]: any}
Annotations for global role object (map)
description string
Global role description (string)
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 GlobalRoleRuleArgs[]
Global role policy rules (list)
annotations Mapping[str, Any]
Annotations for global role object (map)
description str
Global role description (string)
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)

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 bool
(Computed) Builtin global role (bool)
id str
The provider-assigned unique ID for this managed resource.

Look up an 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,
        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)
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.

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)
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<GlobalRoleRuleArgs>
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)
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 []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)
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 GlobalRoleRuleArgs[]
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)
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)

Supporting Types

GlobalRoleRule

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. create, delete, get, list, patch, update, view, watch 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. create, delete, get, list, patch, update, view, watch 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. create, delete, get, list, patch, update, view, watch 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. create, delete, get, list, patch, update, view, watch 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
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.