kong.Consumer
Explore with Pulumi AI
# 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", {
username: "User1",
customId: "123",
tags: ["mySuperTag"],
});
import pulumi
import pulumi_kong as kong
consumer = kong.Consumer("consumer",
username="User1",
custom_id="123",
tags=["mySuperTag"])
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{
Username: pulumi.String("User1"),
CustomId: pulumi.String("123"),
Tags: pulumi.StringArray{
pulumi.String("mySuperTag"),
},
})
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()
{
Username = "User1",
CustomId = "123",
Tags = new[]
{
"mySuperTag",
},
});
});
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()
.username("User1")
.customId("123")
.tags("mySuperTag")
.build());
}
}
resources:
consumer:
type: kong:Consumer
properties:
username: User1
customId: '123'
tags:
- mySuperTag
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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Consumer resource accepts the following input properties:
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.
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.