1. Packages
  2. RedisCloud
  3. API Docs
  4. AclRole
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

rediscloud.AclRole

Explore with Pulumi AI

rediscloud logo
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

    Creates a Role in your Redis Enterprise Cloud Account.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rediscloud = RedisLabs.Rediscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var rule_resource = new Rediscloud.AclRule("rule-resource", new()
        {
            Rule = "+@read ~cache:*",
        });
    
        var role_resource = new Rediscloud.AclRole("role-resource", new()
        {
            Rules = new[]
            {
                new Rediscloud.Inputs.AclRoleRuleArgs
                {
                    Name = rule_resource.Name,
                    Databases = new[]
                    {
                        new Rediscloud.Inputs.AclRoleRuleDatabaseArgs
                        {
                            Subscription = rediscloud_subscription.Subscription_resource.Id,
                            Database = rediscloud_subscription_database.Database_resource.Db_id,
                        },
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rediscloud.NewAclRule(ctx, "rule-resource", &rediscloud.AclRuleArgs{
    			Rule: pulumi.String("+@read ~cache:*"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = rediscloud.NewAclRole(ctx, "role-resource", &rediscloud.AclRoleArgs{
    			Rules: rediscloud.AclRoleRuleArray{
    				&rediscloud.AclRoleRuleArgs{
    					Name: rule_resource.Name,
    					Databases: rediscloud.AclRoleRuleDatabaseArray{
    						&rediscloud.AclRoleRuleDatabaseArgs{
    							Subscription: pulumi.Any(rediscloud_subscription.SubscriptionResource.Id),
    							Database:     pulumi.Any(rediscloud_subscription_database.DatabaseResource.Db_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.rediscloud.AclRule;
    import com.pulumi.rediscloud.AclRuleArgs;
    import com.pulumi.rediscloud.AclRole;
    import com.pulumi.rediscloud.AclRoleArgs;
    import com.pulumi.rediscloud.inputs.AclRoleRuleArgs;
    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 rule_resource = new AclRule("rule-resource", AclRuleArgs.builder()        
                .rule("+@read ~cache:*")
                .build());
    
            var role_resource = new AclRole("role-resource", AclRoleArgs.builder()        
                .rules(AclRoleRuleArgs.builder()
                    .name(rule_resource.name())
                    .databases(AclRoleRuleDatabaseArgs.builder()
                        .subscription(rediscloud_subscription.subscription-resource().id())
                        .database(rediscloud_subscription_database.database-resource().db_id())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_rediscloud as rediscloud
    
    rule_resource = rediscloud.AclRule("rule-resource", rule="+@read ~cache:*")
    role_resource = rediscloud.AclRole("role-resource", rules=[rediscloud.AclRoleRuleArgs(
        name=rule_resource.name,
        databases=[rediscloud.AclRoleRuleDatabaseArgs(
            subscription=rediscloud_subscription["subscription-resource"]["id"],
            database=rediscloud_subscription_database["database-resource"]["db_id"],
        )],
    )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as rediscloud from "@rediscloud/pulumi-rediscloud";
    
    const rule_resource = new rediscloud.AclRule("rule-resource", {rule: "+@read ~cache:*"});
    const role_resource = new rediscloud.AclRole("role-resource", {rules: [{
        name: rule_resource.name,
        databases: [{
            subscription: rediscloud_subscription["subscription-resource"].id,
            database: rediscloud_subscription_database["database-resource"].db_id,
        }],
    }]});
    
    resources:
      rule-resource:
        type: rediscloud:AclRule
        properties:
          rule: +@read ~cache:*
      role-resource:
        type: rediscloud:AclRole
        properties:
          rules:
            - name: ${["rule-resource"].name}
              databases:
                - subscription: ${rediscloud_subscription"subscription-resource"[%!s(MISSING)].id}
                  database: ${rediscloud_subscription_database"database-resource"[%!s(MISSING)].db_id}
    

    Create AclRole Resource

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

    Constructor syntax

    new AclRole(name: string, args: AclRoleArgs, opts?: CustomResourceOptions);
    @overload
    def AclRole(resource_name: str,
                args: AclRoleArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def AclRole(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                rules: Optional[Sequence[AclRoleRuleArgs]] = None,
                name: Optional[str] = None)
    func NewAclRole(ctx *Context, name string, args AclRoleArgs, opts ...ResourceOption) (*AclRole, error)
    public AclRole(string name, AclRoleArgs args, CustomResourceOptions? opts = null)
    public AclRole(String name, AclRoleArgs args)
    public AclRole(String name, AclRoleArgs args, CustomResourceOptions options)
    
    type: rediscloud:AclRole
    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 AclRoleArgs
    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 AclRoleArgs
    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 AclRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AclRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AclRoleArgs
    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 aclRoleResource = new Rediscloud.AclRole("aclRoleResource", new()
    {
        Rules = new[]
        {
            new Rediscloud.Inputs.AclRoleRuleArgs
            {
                Databases = new[]
                {
                    new Rediscloud.Inputs.AclRoleRuleDatabaseArgs
                    {
                        Database = 0,
                        Subscription = 0,
                        Regions = new[]
                        {
                            "string",
                        },
                    },
                },
                Name = "string",
            },
        },
        Name = "string",
    });
    
    example, err := rediscloud.NewAclRole(ctx, "aclRoleResource", &rediscloud.AclRoleArgs{
    	Rules: rediscloud.AclRoleRuleArray{
    		&rediscloud.AclRoleRuleArgs{
    			Databases: rediscloud.AclRoleRuleDatabaseArray{
    				&rediscloud.AclRoleRuleDatabaseArgs{
    					Database:     pulumi.Int(0),
    					Subscription: pulumi.Int(0),
    					Regions: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    			Name: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var aclRoleResource = new AclRole("aclRoleResource", AclRoleArgs.builder()
        .rules(AclRoleRuleArgs.builder()
            .databases(AclRoleRuleDatabaseArgs.builder()
                .database(0)
                .subscription(0)
                .regions("string")
                .build())
            .name("string")
            .build())
        .name("string")
        .build());
    
    acl_role_resource = rediscloud.AclRole("aclRoleResource",
        rules=[{
            "databases": [{
                "database": 0,
                "subscription": 0,
                "regions": ["string"],
            }],
            "name": "string",
        }],
        name="string")
    
    const aclRoleResource = new rediscloud.AclRole("aclRoleResource", {
        rules: [{
            databases: [{
                database: 0,
                subscription: 0,
                regions: ["string"],
            }],
            name: "string",
        }],
        name: "string",
    });
    
    type: rediscloud:AclRole
    properties:
        name: string
        rules:
            - databases:
                - database: 0
                  regions:
                    - string
                  subscription: 0
              name: string
    

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

    Rules List<RedisLabs.Rediscloud.Inputs.AclRoleRule>
    A set of rule association objects, documented below.
    Name string
    A meaningful name for the role. Must be unique.
    Rules []AclRoleRuleArgs
    A set of rule association objects, documented below.
    Name string
    A meaningful name for the role. Must be unique.
    rules List<AclRoleRule>
    A set of rule association objects, documented below.
    name String
    A meaningful name for the role. Must be unique.
    rules AclRoleRule[]
    A set of rule association objects, documented below.
    name string
    A meaningful name for the role. Must be unique.
    rules Sequence[AclRoleRuleArgs]
    A set of rule association objects, documented below.
    name str
    A meaningful name for the role. Must be unique.
    rules List<Property Map>
    A set of rule association objects, documented below.
    name String
    A meaningful name for the role. Must be unique.

    Outputs

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

    Get an existing AclRole 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?: AclRoleState, opts?: CustomResourceOptions): AclRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            rules: Optional[Sequence[AclRoleRuleArgs]] = None) -> AclRole
    func GetAclRole(ctx *Context, name string, id IDInput, state *AclRoleState, opts ...ResourceOption) (*AclRole, error)
    public static AclRole Get(string name, Input<string> id, AclRoleState? state, CustomResourceOptions? opts = null)
    public static AclRole get(String name, Output<String> id, AclRoleState 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:
    Name string
    A meaningful name for the role. Must be unique.
    Rules List<RedisLabs.Rediscloud.Inputs.AclRoleRule>
    A set of rule association objects, documented below.
    Name string
    A meaningful name for the role. Must be unique.
    Rules []AclRoleRuleArgs
    A set of rule association objects, documented below.
    name String
    A meaningful name for the role. Must be unique.
    rules List<AclRoleRule>
    A set of rule association objects, documented below.
    name string
    A meaningful name for the role. Must be unique.
    rules AclRoleRule[]
    A set of rule association objects, documented below.
    name str
    A meaningful name for the role. Must be unique.
    rules Sequence[AclRoleRuleArgs]
    A set of rule association objects, documented below.
    name String
    A meaningful name for the role. Must be unique.
    rules List<Property Map>
    A set of rule association objects, documented below.

    Supporting Types

    AclRoleRule, AclRoleRuleArgs

    Databases List<RedisLabs.Rediscloud.Inputs.AclRoleRuleDatabase>
    a set of database association objects, documented below.
    Name string
    Name of the Rule.
    Databases []AclRoleRuleDatabase
    a set of database association objects, documented below.
    Name string
    Name of the Rule.
    databases List<AclRoleRuleDatabase>
    a set of database association objects, documented below.
    name String
    Name of the Rule.
    databases AclRoleRuleDatabase[]
    a set of database association objects, documented below.
    name string
    Name of the Rule.
    databases Sequence[AclRoleRuleDatabase]
    a set of database association objects, documented below.
    name str
    Name of the Rule.
    databases List<Property Map>
    a set of database association objects, documented below.
    name String
    Name of the Rule.

    AclRoleRuleDatabase, AclRoleRuleDatabaseArgs

    Database int
    ID of the database to which the Rule should apply.
    Subscription int
    ID of the subscription containing the database.
    Regions List<string>
    For databases in Active/Active subscriptions only, the regions to which the Rule should apply.
    Database int
    ID of the database to which the Rule should apply.
    Subscription int
    ID of the subscription containing the database.
    Regions []string
    For databases in Active/Active subscriptions only, the regions to which the Rule should apply.
    database Integer
    ID of the database to which the Rule should apply.
    subscription Integer
    ID of the subscription containing the database.
    regions List<String>
    For databases in Active/Active subscriptions only, the regions to which the Rule should apply.
    database number
    ID of the database to which the Rule should apply.
    subscription number
    ID of the subscription containing the database.
    regions string[]
    For databases in Active/Active subscriptions only, the regions to which the Rule should apply.
    database int
    ID of the database to which the Rule should apply.
    subscription int
    ID of the subscription containing the database.
    regions Sequence[str]
    For databases in Active/Active subscriptions only, the regions to which the Rule should apply.
    database Number
    ID of the database to which the Rule should apply.
    subscription Number
    ID of the subscription containing the database.
    regions List<String>
    For databases in Active/Active subscriptions only, the regions to which the Rule should apply.

    Import

    rediscloud_acl_role can be imported using the Identifier of the Role, e.g.

     $ pulumi import rediscloud:index/aclRole:AclRole role-resource 123456
    

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

    Package Details

    Repository
    rediscloud RedisLabs/pulumi-rediscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rediscloud Terraform Provider.
    rediscloud logo
    Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs