ConsumerAcl

# kong.ConsumerAcl

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

Example Usage

using Pulumi;
using Kong = Pulumi.Kong;

class MyStack : Stack
{
    public MyStack()
    {
        var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs
        {
            CustomId = "123",
            Username = "User1",
        });
        var aclPlugin = new Kong.Plugin("aclPlugin", new Kong.PluginArgs
        {
            ConfigJson = @"	{
		""allow"": [""group1"", ""group2""]
	}

",
        });
        var consumerAcl = new Kong.ConsumerAcl("consumerAcl", new Kong.ConsumerAclArgs
        {
            ConsumerId = myConsumer.Id,
            Group = "group2",
            Tags = 
            {
                "myTag",
                "otherTag",
            },
        });
    }

}
package main

import (
	"fmt"

	"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(fmt.Sprintf("%v%v%v%v", "	{\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
	})
}
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",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as kong from "@pulumi/kong";

const myConsumer = new kong.Consumer("my_consumer", {
    customId: "123",
    username: "User1",
});
const aclPlugin = new kong.Plugin("acl_plugin", {
    configJson: `	{
		"allow": ["group1", "group2"]
	}
`,
});
const consumerAcl = new kong.ConsumerAcl("consumer_acl", {
    consumerId: myConsumer.id,
    group: "group2",
    tags: [
        "myTag",
        "otherTag",
    ],
});

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

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 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

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 str
The provider-assigned unique ID for this managed resource.

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

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 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

Package Details

Repository
https://github.com/pulumi/pulumi-kong
License
Apache-2.0
Notes
This Pulumi package is based on the kong Terraform Provider.