published on Friday, Nov 6, 2026 by kong
published on Friday, Nov 6, 2026 by kong
IdentityPrincipalAPIKey Resource
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as konnect from "@pulumi/konnect";
const myIdentityprincipalapikey = new konnect.IdentityPrincipalApiKey("my_identityprincipalapikey", {
directoryId: "99b4dbd8-6f80-482d-9d71-6253fa017915",
expiresAt: "2022-11-04T20:10:06.927Z",
managedBy: {
key: "value",
},
name: "...my_name...",
principalId: "a7bed842-b5bd-419a-87a7-bd011f1c692e",
secret: "...my_secret...",
type: "v1",
});
import pulumi
import pulumi_konnect as konnect
my_identityprincipalapikey = konnect.IdentityPrincipalApiKey("my_identityprincipalapikey",
directory_id="99b4dbd8-6f80-482d-9d71-6253fa017915",
expires_at="2022-11-04T20:10:06.927Z",
managed_by={
"key": "value",
},
name="...my_name...",
principal_id="a7bed842-b5bd-419a-87a7-bd011f1c692e",
secret="...my_secret...",
type="v1")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/konnect/v3/konnect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := konnect.NewIdentityPrincipalApiKey(ctx, "my_identityprincipalapikey", &konnect.IdentityPrincipalApiKeyArgs{
DirectoryId: pulumi.String("99b4dbd8-6f80-482d-9d71-6253fa017915"),
ExpiresAt: pulumi.String("2022-11-04T20:10:06.927Z"),
ManagedBy: pulumi.StringMap{
"key": pulumi.String("value"),
},
Name: pulumi.String("...my_name..."),
PrincipalId: pulumi.String("a7bed842-b5bd-419a-87a7-bd011f1c692e"),
Secret: pulumi.String("...my_secret..."),
Type: pulumi.String("v1"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Konnect = Pulumi.Konnect;
return await Deployment.RunAsync(() =>
{
var myIdentityprincipalapikey = new Konnect.IdentityPrincipalApiKey("my_identityprincipalapikey", new()
{
DirectoryId = "99b4dbd8-6f80-482d-9d71-6253fa017915",
ExpiresAt = "2022-11-04T20:10:06.927Z",
ManagedBy =
{
{ "key", "value" },
},
Name = "...my_name...",
PrincipalId = "a7bed842-b5bd-419a-87a7-bd011f1c692e",
Secret = "...my_secret...",
Type = "v1",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.konnect.IdentityPrincipalApiKey;
import com.pulumi.konnect.IdentityPrincipalApiKeyArgs;
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 myIdentityprincipalapikey = new IdentityPrincipalApiKey("myIdentityprincipalapikey", IdentityPrincipalApiKeyArgs.builder()
.directoryId("99b4dbd8-6f80-482d-9d71-6253fa017915")
.expiresAt("2022-11-04T20:10:06.927Z")
.managedBy(Map.of("key", "value"))
.name("...my_name...")
.principalId("a7bed842-b5bd-419a-87a7-bd011f1c692e")
.secret("...my_secret...")
.type("v1")
.build());
}
}
resources:
myIdentityprincipalapikey:
type: konnect:IdentityPrincipalApiKey
name: my_identityprincipalapikey
properties:
directoryId: 99b4dbd8-6f80-482d-9d71-6253fa017915
expiresAt: 2022-11-04T20:10:06.927Z
managedBy:
key: value
name: '...my_name...'
principalId: a7bed842-b5bd-419a-87a7-bd011f1c692e
secret: '...my_secret...'
type: v1
Example coming soon!
Create IdentityPrincipalApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IdentityPrincipalApiKey(name: string, args: IdentityPrincipalApiKeyArgs, opts?: CustomResourceOptions);@overload
def IdentityPrincipalApiKey(resource_name: str,
args: IdentityPrincipalApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IdentityPrincipalApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
directory_id: Optional[str] = None,
principal_id: Optional[str] = None,
type: Optional[str] = None,
expires_at: Optional[str] = None,
managed_by: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
secret: Optional[str] = None)func NewIdentityPrincipalApiKey(ctx *Context, name string, args IdentityPrincipalApiKeyArgs, opts ...ResourceOption) (*IdentityPrincipalApiKey, error)public IdentityPrincipalApiKey(string name, IdentityPrincipalApiKeyArgs args, CustomResourceOptions? opts = null)
public IdentityPrincipalApiKey(String name, IdentityPrincipalApiKeyArgs args)
public IdentityPrincipalApiKey(String name, IdentityPrincipalApiKeyArgs args, CustomResourceOptions options)
type: konnect:IdentityPrincipalApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "konnect_identity_principal_api_key" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args IdentityPrincipalApiKeyArgs
- 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 IdentityPrincipalApiKeyArgs
- 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 IdentityPrincipalApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IdentityPrincipalApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IdentityPrincipalApiKeyArgs
- 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 identityPrincipalApiKeyResource = new Konnect.IdentityPrincipalApiKey("identityPrincipalApiKeyResource", new()
{
DirectoryId = "string",
PrincipalId = "string",
Type = "string",
ExpiresAt = "string",
ManagedBy =
{
{ "string", "string" },
},
Name = "string",
Secret = "string",
});
example, err := konnect.NewIdentityPrincipalApiKey(ctx, "identityPrincipalApiKeyResource", &konnect.IdentityPrincipalApiKeyArgs{
DirectoryId: pulumi.String("string"),
PrincipalId: pulumi.String("string"),
Type: pulumi.String("string"),
ExpiresAt: pulumi.String("string"),
ManagedBy: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Secret: pulumi.String("string"),
})
resource "konnect_identity_principal_api_key" "identityPrincipalApiKeyResource" {
lifecycle {
create_before_destroy = true
}
directory_id = "string"
principal_id = "string"
type = "string"
expires_at = "string"
managed_by = {
"string" = "string"
}
name = "string"
secret = "string"
}
var identityPrincipalApiKeyResource = new IdentityPrincipalApiKey("identityPrincipalApiKeyResource", IdentityPrincipalApiKeyArgs.builder()
.directoryId("string")
.principalId("string")
.type("string")
.expiresAt("string")
.managedBy(Map.of("string", "string"))
.name("string")
.secret("string")
.build());
identity_principal_api_key_resource = konnect.IdentityPrincipalApiKey("identityPrincipalApiKeyResource",
directory_id="string",
principal_id="string",
type="string",
expires_at="string",
managed_by={
"string": "string",
},
name="string",
secret="string")
const identityPrincipalApiKeyResource = new konnect.IdentityPrincipalApiKey("identityPrincipalApiKeyResource", {
directoryId: "string",
principalId: "string",
type: "string",
expiresAt: "string",
managedBy: {
string: "string",
},
name: "string",
secret: "string",
});
type: konnect:IdentityPrincipalApiKey
properties:
directoryId: string
expiresAt: string
managedBy:
string: string
name: string
principalId: string
secret: string
type: string
IdentityPrincipalApiKey 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 IdentityPrincipalApiKey resource accepts the following input properties:
- Directory
Id string - ID of the directory
- Principal
Id string - Unique identifier of the principal (UUID format)
- Type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- Expires
At string - An ISO-8601 timestamp representation of entity expiration date.
- Managed
By Dictionary<string, string> - Name string
- Human-readable name of the API key.
nullif the key has no name. - Secret string
- Required if
typeisimported. Requires replacement if changed.
- Directory
Id string - ID of the directory
- Principal
Id string - Unique identifier of the principal (UUID format)
- Type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- Expires
At string - An ISO-8601 timestamp representation of entity expiration date.
- Managed
By map[string]string - Name string
- Human-readable name of the API key.
nullif the key has no name. - Secret string
- Required if
typeisimported. Requires replacement if changed.
- directory_
id string - ID of the directory
- principal_
id string - Unique identifier of the principal (UUID format)
- type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- expires_
at string - An ISO-8601 timestamp representation of entity expiration date.
- managed_
by map(string) - name string
- Human-readable name of the API key.
nullif the key has no name. - secret string
- Required if
typeisimported. Requires replacement if changed.
- directory
Id String - ID of the directory
- principal
Id String - Unique identifier of the principal (UUID format)
- type String
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- expires
At String - An ISO-8601 timestamp representation of entity expiration date.
- managed
By Map<String,String> - name String
- Human-readable name of the API key.
nullif the key has no name. - secret String
- Required if
typeisimported. Requires replacement if changed.
- directory
Id string - ID of the directory
- principal
Id string - Unique identifier of the principal (UUID format)
- type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- expires
At string - An ISO-8601 timestamp representation of entity expiration date.
- managed
By {[key: string]: string} - name string
- Human-readable name of the API key.
nullif the key has no name. - secret string
- Required if
typeisimported. Requires replacement if changed.
- directory_
id str - ID of the directory
- principal_
id str - Unique identifier of the principal (UUID format)
- type str
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- expires_
at str - An ISO-8601 timestamp representation of entity expiration date.
- managed_
by Mapping[str, str] - name str
- Human-readable name of the API key.
nullif the key has no name. - secret str
- Required if
typeisimported. Requires replacement if changed.
- directory
Id String - ID of the directory
- principal
Id String - Unique identifier of the principal (UUID format)
- type String
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- expires
At String - An ISO-8601 timestamp representation of entity expiration date.
- managed
By Map<String> - name String
- Human-readable name of the API key.
nullif the key has no name. - secret String
- Required if
typeisimported. Requires replacement if changed.
Outputs
All input properties are implicitly available as output properties. Additionally, the IdentityPrincipalApiKey resource produces the following output properties:
- created_
at string - An ISO-8601 timestamp representation of entity creation date.
- id string
- The provider-assigned unique ID for this managed resource.
- updated_
at string - An ISO-8601 timestamp representation of entity update date.
- created_
at str - An ISO-8601 timestamp representation of entity creation date.
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
at str - An ISO-8601 timestamp representation of entity update date.
Look up Existing IdentityPrincipalApiKey Resource
Get an existing IdentityPrincipalApiKey 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?: IdentityPrincipalApiKeyState, opts?: CustomResourceOptions): IdentityPrincipalApiKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
directory_id: Optional[str] = None,
expires_at: Optional[str] = None,
managed_by: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
principal_id: Optional[str] = None,
secret: Optional[str] = None,
type: Optional[str] = None,
updated_at: Optional[str] = None) -> IdentityPrincipalApiKeyfunc GetIdentityPrincipalApiKey(ctx *Context, name string, id IDInput, state *IdentityPrincipalApiKeyState, opts ...ResourceOption) (*IdentityPrincipalApiKey, error)public static IdentityPrincipalApiKey Get(string name, Input<string> id, IdentityPrincipalApiKeyState? state, CustomResourceOptions? opts = null)public static IdentityPrincipalApiKey get(String name, Output<String> id, IdentityPrincipalApiKeyState state, CustomResourceOptions options)resources: _: type: konnect:IdentityPrincipalApiKey get: id: ${id}import {
to = konnect_identity_principal_api_key.example
id = "${id}"
}
- 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.
- Created
At string - An ISO-8601 timestamp representation of entity creation date.
- Directory
Id string - ID of the directory
- Expires
At string - An ISO-8601 timestamp representation of entity expiration date.
- Managed
By Dictionary<string, string> - Name string
- Human-readable name of the API key.
nullif the key has no name. - Principal
Id string - Unique identifier of the principal (UUID format)
- Secret string
- Required if
typeisimported. Requires replacement if changed. - Type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- Updated
At string - An ISO-8601 timestamp representation of entity update date.
- Created
At string - An ISO-8601 timestamp representation of entity creation date.
- Directory
Id string - ID of the directory
- Expires
At string - An ISO-8601 timestamp representation of entity expiration date.
- Managed
By map[string]string - Name string
- Human-readable name of the API key.
nullif the key has no name. - Principal
Id string - Unique identifier of the principal (UUID format)
- Secret string
- Required if
typeisimported. Requires replacement if changed. - Type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- Updated
At string - An ISO-8601 timestamp representation of entity update date.
- created_
at string - An ISO-8601 timestamp representation of entity creation date.
- directory_
id string - ID of the directory
- expires_
at string - An ISO-8601 timestamp representation of entity expiration date.
- managed_
by map(string) - name string
- Human-readable name of the API key.
nullif the key has no name. - principal_
id string - Unique identifier of the principal (UUID format)
- secret string
- Required if
typeisimported. Requires replacement if changed. - type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- updated_
at string - An ISO-8601 timestamp representation of entity update date.
- created
At String - An ISO-8601 timestamp representation of entity creation date.
- directory
Id String - ID of the directory
- expires
At String - An ISO-8601 timestamp representation of entity expiration date.
- managed
By Map<String,String> - name String
- Human-readable name of the API key.
nullif the key has no name. - principal
Id String - Unique identifier of the principal (UUID format)
- secret String
- Required if
typeisimported. Requires replacement if changed. - type String
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- updated
At String - An ISO-8601 timestamp representation of entity update date.
- created
At string - An ISO-8601 timestamp representation of entity creation date.
- directory
Id string - ID of the directory
- expires
At string - An ISO-8601 timestamp representation of entity expiration date.
- managed
By {[key: string]: string} - name string
- Human-readable name of the API key.
nullif the key has no name. - principal
Id string - Unique identifier of the principal (UUID format)
- secret string
- Required if
typeisimported. Requires replacement if changed. - type string
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- updated
At string - An ISO-8601 timestamp representation of entity update date.
- created_
at str - An ISO-8601 timestamp representation of entity creation date.
- directory_
id str - ID of the directory
- expires_
at str - An ISO-8601 timestamp representation of entity expiration date.
- managed_
by Mapping[str, str] - name str
- Human-readable name of the API key.
nullif the key has no name. - principal_
id str - Unique identifier of the principal (UUID format)
- secret str
- Required if
typeisimported. Requires replacement if changed. - type str
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- updated_
at str - An ISO-8601 timestamp representation of entity update date.
- created
At String - An ISO-8601 timestamp representation of entity creation date.
- directory
Id String - ID of the directory
- expires
At String - An ISO-8601 timestamp representation of entity expiration date.
- managed
By Map<String> - name String
- Human-readable name of the API key.
nullif the key has no name. - principal
Id String - Unique identifier of the principal (UUID format)
- secret String
- Required if
typeisimported. Requires replacement if changed. - type String
- possible known values include one of ["imported", "v1"]; Requires replacement if changed.
- updated
At String - An ISO-8601 timestamp representation of entity update date.
Import
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
terraform
import {
to = konnect_identity_principal_api_key.my_konnect_identity_principal_api_key
id = jsonencode({
directory_id = "..."
id = "..."
principal_id = "..."
})
}
The pulumi import command can be used, for example:
$ pulumi import konnect:index/identityPrincipalApiKey:IdentityPrincipalApiKey my_konnect_identity_principal_api_key '{"directory_id": "...", "id": "...", "principal_id": "..."}'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- konnect kong/terraform-provider-konnect
- License
- Notes
- This Pulumi package is based on the
konnectTerraform Provider.
published on Friday, Nov 6, 2026 by kong