1. Packages
  2. Kong
  3. API Docs
  4. Consumer
Kong v4.5.3 published on Friday, Apr 12, 2024 by Pulumi

kong.Consumer

Explore with Pulumi AI

kong logo
Kong v4.5.3 published on Friday, Apr 12, 2024 by Pulumi

    # kong.Consumer

    The consumer resource maps directly onto the json for creating a Consumer in Kong. For more information on the parameters see the Kong Consumer create documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as kong from "@pulumi/kong";
    
    const consumer = new kong.Consumer("consumer", {
        customId: "123",
        tags: ["mySuperTag"],
        username: "User1",
    });
    
    import pulumi
    import pulumi_kong as kong
    
    consumer = kong.Consumer("consumer",
        custom_id="123",
        tags=["mySuperTag"],
        username="User1")
    
    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 {
    		_, err := kong.NewConsumer(ctx, "consumer", &kong.ConsumerArgs{
    			CustomId: pulumi.String("123"),
    			Tags: pulumi.StringArray{
    				pulumi.String("mySuperTag"),
    			},
    			Username: pulumi.String("User1"),
    		})
    		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 consumer = new Kong.Consumer("consumer", new()
        {
            CustomId = "123",
            Tags = new[]
            {
                "mySuperTag",
            },
            Username = "User1",
        });
    
    });
    
    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 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 consumer = new Consumer("consumer", ConsumerArgs.builder()        
                .customId("123")
                .tags("mySuperTag")
                .username("User1")
                .build());
    
        }
    }
    
    resources:
      consumer:
        type: kong:Consumer
        properties:
          customId: '123'
          tags:
            - mySuperTag
          username: User1
    

    Create Consumer Resource

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

    Constructor syntax

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

    Example

    The following reference example uses placeholder values for all input properties.

    var consumerResource = new Kong.Consumer("consumerResource", new()
    {
        CustomId = "string",
        Tags = new[]
        {
            "string",
        },
        Username = "string",
    });
    
    example, err := kong.NewConsumer(ctx, "consumerResource", &kong.ConsumerArgs{
    	CustomId: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Username: pulumi.String("string"),
    })
    
    var consumerResource = new Consumer("consumerResource", ConsumerArgs.builder()        
        .customId("string")
        .tags("string")
        .username("string")
        .build());
    
    consumer_resource = kong.Consumer("consumerResource",
        custom_id="string",
        tags=["string"],
        username="string")
    
    const consumerResource = new kong.Consumer("consumerResource", {
        customId: "string",
        tags: ["string"],
        username: "string",
    });
    
    type: kong:Consumer
    properties:
        customId: string
        tags:
            - string
        username: string
    

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

    CustomId string
    A custom id for the consumer, you must set either the username or custom_id
    Tags List<string>
    A list of strings associated with the Consumer for grouping and filtering
    Username string
    The username to use, you must set either the username or custom_id
    CustomId string
    A custom id for the consumer, you must set either the username or custom_id
    Tags []string
    A list of strings associated with the Consumer for grouping and filtering
    Username string
    The username to use, you must set either the username or custom_id
    customId String
    A custom id for the consumer, you must set either the username or custom_id
    tags List<String>
    A list of strings associated with the Consumer for grouping and filtering
    username String
    The username to use, you must set either the username or custom_id
    customId string
    A custom id for the consumer, you must set either the username or custom_id
    tags string[]
    A list of strings associated with the Consumer for grouping and filtering
    username string
    The username to use, you must set either the username or custom_id
    custom_id str
    A custom id for the consumer, you must set either the username or custom_id
    tags Sequence[str]
    A list of strings associated with the Consumer for grouping and filtering
    username str
    The username to use, you must set either the username or custom_id
    customId String
    A custom id for the consumer, you must set either the username or custom_id
    tags List<String>
    A list of strings associated with the Consumer for grouping and filtering
    username String
    The username to use, you must set either the username or custom_id

    Outputs

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

    Get an existing Consumer 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?: ConsumerState, opts?: CustomResourceOptions): Consumer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            custom_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            username: Optional[str] = None) -> Consumer
    func GetConsumer(ctx *Context, name string, id IDInput, state *ConsumerState, opts ...ResourceOption) (*Consumer, error)
    public static Consumer Get(string name, Input<string> id, ConsumerState? state, CustomResourceOptions? opts = null)
    public static Consumer get(String name, Output<String> id, ConsumerState 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:
    CustomId string
    A custom id for the consumer, you must set either the username or custom_id
    Tags List<string>
    A list of strings associated with the Consumer for grouping and filtering
    Username string
    The username to use, you must set either the username or custom_id
    CustomId string
    A custom id for the consumer, you must set either the username or custom_id
    Tags []string
    A list of strings associated with the Consumer for grouping and filtering
    Username string
    The username to use, you must set either the username or custom_id
    customId String
    A custom id for the consumer, you must set either the username or custom_id
    tags List<String>
    A list of strings associated with the Consumer for grouping and filtering
    username String
    The username to use, you must set either the username or custom_id
    customId string
    A custom id for the consumer, you must set either the username or custom_id
    tags string[]
    A list of strings associated with the Consumer for grouping and filtering
    username string
    The username to use, you must set either the username or custom_id
    custom_id str
    A custom id for the consumer, you must set either the username or custom_id
    tags Sequence[str]
    A list of strings associated with the Consumer for grouping and filtering
    username str
    The username to use, you must set either the username or custom_id
    customId String
    A custom id for the consumer, you must set either the username or custom_id
    tags List<String>
    A list of strings associated with the Consumer for grouping and filtering
    username String
    The username to use, you must set either the username or custom_id

    Import

    To import a consumer:

    $ pulumi import kong:index/consumer:Consumer <consumer_identifier> <consumer_id>
    

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

    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.3 published on Friday, Apr 12, 2024 by Pulumi