com.pulumi.kong.ConsumerJwtAuth Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kong Show documentation
Show all versions of kong Show documentation
A Pulumi package for creating and managing Kong resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kong;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.kong.ConsumerJwtAuthArgs;
import com.pulumi.kong.Utilities;
import com.pulumi.kong.inputs.ConsumerJwtAuthState;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## # kong.ConsumerJwtAuth
*
* Consumer jwt auth is a resource that allows you to configure the jwt auth plugin for a consumer.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.ConsumerJwtAuth;
* import com.pulumi.kong.ConsumerJwtAuthArgs;
* 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()
* .username("User1")
* .customId("123")
* .build());
*
* var jwtPlugin = new Plugin("jwtPlugin", PluginArgs.builder()
* .name("jwt")
* .configJson("""
* {
* "claims_to_verify": ["exp"]
* }
* """)
* .build());
*
* var consumerJwtConfig = new ConsumerJwtAuth("consumerJwtConfig", ConsumerJwtAuthArgs.builder()
* .consumerId(myConsumer.id())
* .algorithm("HS256")
* .key("my_key")
* .rsaPublicKey("foo")
* .secret("my_secret")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
@ResourceType(type="kong:index/consumerJwtAuth:ConsumerJwtAuth")
public class ConsumerJwtAuth extends com.pulumi.resources.CustomResource {
/**
* The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is `HS256`
*
*/
@Export(name="algorithm", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> algorithm;
/**
* @return The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is `HS256`
*
*/
public Output> algorithm() {
return Codegen.optional(this.algorithm);
}
/**
* the id of the consumer to be configured with jwt auth
*
*/
@Export(name="consumerId", refs={String.class}, tree="[0]")
private Output consumerId;
/**
* @return the id of the consumer to be configured with jwt auth
*
*/
public Output consumerId() {
return this.consumerId;
}
/**
* A unique string identifying the credential. If left out, it will be auto-generated.
*
*/
@Export(name="key", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> key;
/**
* @return A unique string identifying the credential. If left out, it will be auto-generated.
*
*/
public Output> key() {
return Codegen.optional(this.key);
}
/**
* If algorithm is `RS256` or `ES256`, the public key (in PEM format) to use to verify the token’s signature
*
*/
@Export(name="rsaPublicKey", refs={String.class}, tree="[0]")
private Output rsaPublicKey;
/**
* @return If algorithm is `RS256` or `ES256`, the public key (in PEM format) to use to verify the token’s signature
*
*/
public Output rsaPublicKey() {
return this.rsaPublicKey;
}
/**
* If algorithm is `HS256` or `ES256`, the secret used to sign JWTs for this credential. If left out, will be auto-generated
*
*/
@Export(name="secret", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> secret;
/**
* @return If algorithm is `HS256` or `ES256`, the secret used to sign JWTs for this credential. If left out, will be auto-generated
*
*/
public Output> secret() {
return Codegen.optional(this.secret);
}
/**
* A list of strings associated with the consumer JWT auth for grouping and filtering
*
*/
@Export(name="tags", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> tags;
/**
* @return A list of strings associated with the consumer JWT auth for grouping and filtering
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ConsumerJwtAuth(java.lang.String name) {
this(name, ConsumerJwtAuthArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ConsumerJwtAuth(java.lang.String name, ConsumerJwtAuthArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public ConsumerJwtAuth(java.lang.String name, ConsumerJwtAuthArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("kong:index/consumerJwtAuth:ConsumerJwtAuth", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ConsumerJwtAuth(java.lang.String name, Output id, @Nullable ConsumerJwtAuthState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("kong:index/consumerJwtAuth:ConsumerJwtAuth", name, state, makeResourceOptions(options, id), false);
}
private static ConsumerJwtAuthArgs makeArgs(ConsumerJwtAuthArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ConsumerJwtAuthArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static ConsumerJwtAuth get(java.lang.String name, Output id, @Nullable ConsumerJwtAuthState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ConsumerJwtAuth(name, id, state, options);
}
}