1. Packages
  2. Kong
  3. API Docs
  4. ConsumerAcl
Kong v4.5.2 published on Thursday, Mar 21, 2024 by Pulumi

kong.ConsumerAcl

Explore with Pulumi AI

kong logo
Kong v4.5.2 published on Thursday, Mar 21, 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("myConsumer", {
        customId: "123",
        username: "User1",
    });
    const aclPlugin = new kong.Plugin("aclPlugin", {configJson: `	{
    		"allow": ["group1", "group2"]
    	}
    
    `});
    const consumerAcl = new kong.ConsumerAcl("consumerAcl", {
        consumerId: myConsumer.id,
        group: "group2",
        tags: [
            "myTag",
            "otherTag",
        ],
    });
    
    import pulumi
    import pulumi_kong as kong
    
    my_consumer = kong.Consumer("myConsumer",
        custom_id="123",
        username="User1")
    acl_plugin = kong.Plugin("aclPlugin", config_json="""	{
    		"allow": ["group1", "group2"]
    	}
    
    """)
    consumer_acl = kong.ConsumerAcl("consumerAcl",
        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, "myConsumer", &kong.ConsumerArgs{
    			CustomId: pulumi.String("123"),
    			Username: pulumi.String("User1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = kong.NewPlugin(ctx, "aclPlugin", &kong.PluginArgs{
    			ConfigJson: pulumi.String("	{\n		\"allow\": [\"group1\", \"group2\"]\n	}\n\n"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = kong.NewConsumerAcl(ctx, "consumerAcl", &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("myConsumer", new()
        {
            CustomId = "123",
            Username = "User1",
        });
    
        var aclPlugin = new Kong.Plugin("aclPlugin", new()
        {
            ConfigJson = @"	{
    		""allow"": [""group1"", ""group2""]
    	}
    
    ",
        });
    
        var consumerAcl = new Kong.ConsumerAcl("consumerAcl", 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()        
                .customId("123")
                .username("User1")
                .build());
    
            var aclPlugin = new Plugin("aclPlugin", PluginArgs.builder()        
                .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
        properties:
          customId: '123'
          username: User1
      aclPlugin:
        type: kong:Plugin
        properties:
          configJson: |+
            	{
            		"allow": ["group1", "group2"]
            	}        
    
      consumerAcl:
        type: kong:ConsumerAcl
        properties:
          consumerId: ${myConsumer.id}
          group: group2
          tags:
            - myTag
            - otherTag
    

    Create ConsumerAcl Resource

    new ConsumerAcl(name: string, args: ConsumerAclArgs, opts?: CustomResourceOptions);
    @overload
    def ConsumerAcl(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    consumer_id: Optional[str] = None,
                    group: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None)
    @overload
    def ConsumerAcl(resource_name: str,
                    args: ConsumerAclArgs,
                    opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    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.2 published on Thursday, Mar 21, 2024 by Pulumi