1. Packages
  2. Kong Provider
  3. API Docs
  4. ConsumerAcl
Kong v4.5.6 published on Wednesday, Oct 16, 2024 by Pulumi

kong.ConsumerAcl

Explore with Pulumi AI

kong logo
Kong v4.5.6 published on Wednesday, Oct 16, 2024 by Pulumi

    # kong.ConsumerAcl

    Consumer ACL is a resource that allows you to configure the acl plugin for a consumer.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as kong from "@pulumi/kong";
    
    const myConsumer = new kong.Consumer("my_consumer", {
        username: "User1",
        customId: "123",
    });
    const aclPlugin = new kong.Plugin("acl_plugin", {
        name: "acl",
        configJson: `\x09{
    \x09\x09"allow": ["group1", "group2"]
    \x09}
    `,
    });
    const consumerAcl = new kong.ConsumerAcl("consumer_acl", {
        consumerId: myConsumer.id,
        group: "group2",
        tags: [
            "myTag",
            "otherTag",
        ],
    });
    
    import pulumi
    import pulumi_kong as kong
    
    my_consumer = kong.Consumer("my_consumer",
        username="User1",
        custom_id="123")
    acl_plugin = kong.Plugin("acl_plugin",
        name="acl",
        config_json="""\x09{
    \x09\x09"allow": ["group1", "group2"]
    \x09}
    """)
    consumer_acl = kong.ConsumerAcl("consumer_acl",
        consumer_id=my_consumer.id,
        group="group2",
        tags=[
            "myTag",
            "otherTag",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-kong/sdk/v4/go/kong"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myConsumer, err := kong.NewConsumer(ctx, "my_consumer", &kong.ConsumerArgs{
    			Username: pulumi.String("User1"),
    			CustomId: pulumi.String("123"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = kong.NewPlugin(ctx, "acl_plugin", &kong.PluginArgs{
    			Name:       pulumi.String("acl"),
    			ConfigJson: pulumi.String("	{\n		\"allow\": [\"group1\", \"group2\"]\n	}\n"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = kong.NewConsumerAcl(ctx, "consumer_acl", &kong.ConsumerAclArgs{
    			ConsumerId: myConsumer.ID(),
    			Group:      pulumi.String("group2"),
    			Tags: pulumi.StringArray{
    				pulumi.String("myTag"),
    				pulumi.String("otherTag"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Kong = Pulumi.Kong;
    
    return await Deployment.RunAsync(() => 
    {
        var myConsumer = new Kong.Consumer("my_consumer", new()
        {
            Username = "User1",
            CustomId = "123",
        });
    
        var aclPlugin = new Kong.Plugin("acl_plugin", new()
        {
            Name = "acl",
            ConfigJson = @"	{
    		""allow"": [""group1"", ""group2""]
    	}
    ",
        });
    
        var consumerAcl = new Kong.ConsumerAcl("consumer_acl", new()
        {
            ConsumerId = myConsumer.Id,
            Group = "group2",
            Tags = new[]
            {
                "myTag",
                "otherTag",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.kong.Consumer;
    import com.pulumi.kong.ConsumerArgs;
    import com.pulumi.kong.Plugin;
    import com.pulumi.kong.PluginArgs;
    import com.pulumi.kong.ConsumerAcl;
    import com.pulumi.kong.ConsumerAclArgs;
    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 myConsumer = new Consumer("myConsumer", ConsumerArgs.builder()
                .username("User1")
                .customId("123")
                .build());
    
            var aclPlugin = new Plugin("aclPlugin", PluginArgs.builder()
                .name("acl")
                .configJson("""
    	{
    		"allow": ["group1", "group2"]
    	}
                """)
                .build());
    
            var consumerAcl = new ConsumerAcl("consumerAcl", ConsumerAclArgs.builder()
                .consumerId(myConsumer.id())
                .group("group2")
                .tags(            
                    "myTag",
                    "otherTag")
                .build());
    
        }
    }
    
    resources:
      myConsumer:
        type: kong:Consumer
        name: my_consumer
        properties:
          username: User1
          customId: '123'
      aclPlugin:
        type: kong:Plugin
        name: acl_plugin
        properties:
          name: acl
          configJson: |
            	{
            		"allow": ["group1", "group2"]
            	}        
      consumerAcl:
        type: kong:ConsumerAcl
        name: consumer_acl
        properties:
          consumerId: ${myConsumer.id}
          group: group2
          tags:
            - myTag
            - otherTag
    

    Create ConsumerAcl Resource

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

    Constructor syntax

    new ConsumerAcl(name: string, args: ConsumerAclArgs, opts?: CustomResourceOptions);
    @overload
    def ConsumerAcl(resource_name: str,
                    args: ConsumerAclArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConsumerAcl(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    consumer_id: Optional[str] = None,
                    group: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None)
    func NewConsumerAcl(ctx *Context, name string, args ConsumerAclArgs, opts ...ResourceOption) (*ConsumerAcl, error)
    public ConsumerAcl(string name, ConsumerAclArgs args, CustomResourceOptions? opts = null)
    public ConsumerAcl(String name, ConsumerAclArgs args)
    public ConsumerAcl(String name, ConsumerAclArgs args, CustomResourceOptions options)
    
    type: kong:ConsumerAcl
    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 ConsumerAclArgs
    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 ConsumerAclArgs
    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 ConsumerAclArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConsumerAclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConsumerAclArgs
    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 consumerAclResource = new Kong.ConsumerAcl("consumerAclResource", new()
    {
        ConsumerId = "string",
        Group = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := kong.NewConsumerAcl(ctx, "consumerAclResource", &kong.ConsumerAclArgs{
    	ConsumerId: pulumi.String("string"),
    	Group:      pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var consumerAclResource = new ConsumerAcl("consumerAclResource", ConsumerAclArgs.builder()
        .consumerId("string")
        .group("string")
        .tags("string")
        .build());
    
    consumer_acl_resource = kong.ConsumerAcl("consumerAclResource",
        consumer_id="string",
        group="string",
        tags=["string"])
    
    const consumerAclResource = new kong.ConsumerAcl("consumerAclResource", {
        consumerId: "string",
        group: "string",
        tags: ["string"],
    });
    
    type: kong:ConsumerAcl
    properties:
        consumerId: string
        group: string
        tags:
            - string
    

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

    ConsumerId string
    the id of the consumer to be configured
    Group string
    the acl group
    Tags List<string>
    A list of strings associated with the consumer acl for grouping and filtering
    ConsumerId string
    the id of the consumer to be configured
    Group string
    the acl group
    Tags []string
    A list of strings associated with the consumer acl for grouping and filtering
    consumerId String
    the id of the consumer to be configured
    group String
    the acl group
    tags List<String>
    A list of strings associated with the consumer acl for grouping and filtering
    consumerId string
    the id of the consumer to be configured
    group string
    the acl group
    tags string[]
    A list of strings associated with the consumer acl for grouping and filtering
    consumer_id str
    the id of the consumer to be configured
    group str
    the acl group
    tags Sequence[str]
    A list of strings associated with the consumer acl for grouping and filtering
    consumerId String
    the id of the consumer to be configured
    group String
    the acl group
    tags List<String>
    A list of strings associated with the consumer acl for grouping and filtering

    Outputs

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

    Get an existing ConsumerAcl 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?: ConsumerAclState, opts?: CustomResourceOptions): ConsumerAcl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            consumer_id: Optional[str] = None,
            group: Optional[str] = None,
            tags: Optional[Sequence[str]] = None) -> ConsumerAcl
    func GetConsumerAcl(ctx *Context, name string, id IDInput, state *ConsumerAclState, opts ...ResourceOption) (*ConsumerAcl, error)
    public static ConsumerAcl Get(string name, Input<string> id, ConsumerAclState? state, CustomResourceOptions? opts = null)
    public static ConsumerAcl get(String name, Output<String> id, ConsumerAclState 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:
    ConsumerId string
    the id of the consumer to be configured
    Group string
    the acl group
    Tags List<string>
    A list of strings associated with the consumer acl for grouping and filtering
    ConsumerId string
    the id of the consumer to be configured
    Group string
    the acl group
    Tags []string
    A list of strings associated with the consumer acl for grouping and filtering
    consumerId String
    the id of the consumer to be configured
    group String
    the acl group
    tags List<String>
    A list of strings associated with the consumer acl for grouping and filtering
    consumerId string
    the id of the consumer to be configured
    group string
    the acl group
    tags string[]
    A list of strings associated with the consumer acl for grouping and filtering
    consumer_id str
    the id of the consumer to be configured
    group str
    the acl group
    tags Sequence[str]
    A list of strings associated with the consumer acl for grouping and filtering
    consumerId String
    the id of the consumer to be configured
    group String
    the acl group
    tags List<String>
    A list of strings associated with the consumer acl for grouping and filtering

    Package Details

    Repository
    Kong pulumi/pulumi-kong
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the kong Terraform Provider.
    kong logo
    Kong v4.5.6 published on Wednesday, Oct 16, 2024 by Pulumi