ConsumerBasicAuth

# kong.ConsumerBasicAuth

Consumer basic auth is a resource that allows you to configure the basic auth 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 basicAuthPlugin = new Kong.Plugin("basicAuthPlugin", new Kong.PluginArgs
        {
        });
        var consumerBasicAuth = new Kong.ConsumerBasicAuth("consumerBasicAuth", new Kong.ConsumerBasicAuthArgs
        {
            ConsumerId = myConsumer.Id,
            Password = "bar_updated",
            Tags = 
            {
                "myTag",
                "anotherTag",
            },
            Username = "foo_updated",
        });
    }

}
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, "basicAuthPlugin", nil)
		if err != nil {
			return err
		}
		_, err = kong.NewConsumerBasicAuth(ctx, "consumerBasicAuth", &kong.ConsumerBasicAuthArgs{
			ConsumerId: myConsumer.ID(),
			Password:   pulumi.String("bar_updated"),
			Tags: pulumi.StringArray{
				pulumi.String("myTag"),
				pulumi.String("anotherTag"),
			},
			Username: pulumi.String("foo_updated"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_kong as kong

my_consumer = kong.Consumer("myConsumer",
    custom_id="123",
    username="User1")
basic_auth_plugin = kong.Plugin("basicAuthPlugin")
consumer_basic_auth = kong.ConsumerBasicAuth("consumerBasicAuth",
    consumer_id=my_consumer.id,
    password="bar_updated",
    tags=[
        "myTag",
        "anotherTag",
    ],
    username="foo_updated")
import * as pulumi from "@pulumi/pulumi";
import * as kong from "@pulumi/kong";

const myConsumer = new kong.Consumer("my_consumer", {
    customId: "123",
    username: "User1",
});
const basicAuthPlugin = new kong.Plugin("basic_auth_plugin", {});
const consumerBasicAuth = new kong.ConsumerBasicAuth("consumer_basic_auth", {
    consumerId: myConsumer.id,
    password: "bar_updated",
    tags: [
        "myTag",
        "anotherTag",
    ],
    username: "foo_updated",
});

Create a ConsumerBasicAuth Resource

new ConsumerBasicAuth(name: string, args: ConsumerBasicAuthArgs, opts?: CustomResourceOptions);
@overload
def ConsumerBasicAuth(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      consumer_id: Optional[str] = None,
                      password: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None,
                      username: Optional[str] = None)
@overload
def ConsumerBasicAuth(resource_name: str,
                      args: ConsumerBasicAuthArgs,
                      opts: Optional[ResourceOptions] = None)
func NewConsumerBasicAuth(ctx *Context, name string, args ConsumerBasicAuthArgs, opts ...ResourceOption) (*ConsumerBasicAuth, error)
public ConsumerBasicAuth(string name, ConsumerBasicAuthArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ConsumerBasicAuthArgs
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 ConsumerBasicAuthArgs
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 ConsumerBasicAuthArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ConsumerBasicAuthArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

ConsumerId string
the id of the consumer to be configured with basic auth
Password string
password to be used for basic auth
Username string
username to be used for basic auth
Tags List<string>
A list of strings associated with the consumer basic auth for grouping and filtering
ConsumerId string
the id of the consumer to be configured with basic auth
Password string
password to be used for basic auth
Username string
username to be used for basic auth
Tags []string
A list of strings associated with the consumer basic auth for grouping and filtering
consumerId string
the id of the consumer to be configured with basic auth
password string
password to be used for basic auth
username string
username to be used for basic auth
tags string[]
A list of strings associated with the consumer basic auth for grouping and filtering
consumer_id str
the id of the consumer to be configured with basic auth
password str
password to be used for basic auth
username str
username to be used for basic auth
tags Sequence[str]
A list of strings associated with the consumer basic auth for grouping and filtering

Outputs

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

Get an existing ConsumerBasicAuth 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?: ConsumerBasicAuthState, opts?: CustomResourceOptions): ConsumerBasicAuth
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        consumer_id: Optional[str] = None,
        password: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        username: Optional[str] = None) -> ConsumerBasicAuth
func GetConsumerBasicAuth(ctx *Context, name string, id IDInput, state *ConsumerBasicAuthState, opts ...ResourceOption) (*ConsumerBasicAuth, error)
public static ConsumerBasicAuth Get(string name, Input<string> id, ConsumerBasicAuthState? 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 with basic auth
Password string
password to be used for basic auth
Tags List<string>
A list of strings associated with the consumer basic auth for grouping and filtering
Username string
username to be used for basic auth
ConsumerId string
the id of the consumer to be configured with basic auth
Password string
password to be used for basic auth
Tags []string
A list of strings associated with the consumer basic auth for grouping and filtering
Username string
username to be used for basic auth
consumerId string
the id of the consumer to be configured with basic auth
password string
password to be used for basic auth
tags string[]
A list of strings associated with the consumer basic auth for grouping and filtering
username string
username to be used for basic auth
consumer_id str
the id of the consumer to be configured with basic auth
password str
password to be used for basic auth
tags Sequence[str]
A list of strings associated with the consumer basic auth for grouping and filtering
username str
username to be used for basic auth

Package Details

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