getKey

suspend fun getKey(argument: GetKeyPlainArgs): GetKeyResult

Use this data source to get the name and value of a pre-existing API Key, for example to supply credentials for a dependency microservice.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.ApigatewayFunctions;
import com.pulumi.aws.apigateway.inputs.GetKeyArgs;
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) {
final var myApiKey = ApigatewayFunctions.getKey(GetKeyArgs.builder()
.id("ru3mpjgse6")
.build());
}
}

Return

A collection of values returned by getKey.

Parameters

argument

A collection of arguments for invoking getKey.


suspend fun getKey(id: String, tags: Map<String, String>? = null): GetKeyResult

Return

A collection of values returned by getKey.

Parameters

id

ID of the API Key to look up.

tags

Map of tags for the resource.

See also


suspend fun getKey(argument: suspend GetKeyPlainArgsBuilder.() -> Unit): GetKeyResult

Return

A collection of values returned by getKey.

Parameters

argument

Builder for com.pulumi.aws.apigateway.kotlin.inputs.GetKeyPlainArgs.

See also