published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Import
You can import a Kafka API Key by using the Environment ID and Kafka API Key ID in the format <Environment ID>/<Kafka API Key ID>, for example$ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>" $ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>" $ export API_KEY_SECRET="<api_key_secret>" # Option #1Kafka API Key
$ pulumi import confluentcloud:index/apiKey:ApiKey example_kafka_api_key "env-abc123/UTT6WDRXX7FHD2GV"
You can import a Cloud API Key by using Cloud API Key ID, for example$ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>" $ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>" $ export API_KEY_SECRET="<api_key_secret>" # Option #2Cloud API Key
$ pulumi import confluentcloud:index/apiKey:ApiKey example_cloud_api_key "4UEXOMMWIBE5KZQG"
!> Warning: Do not forget to delete terminal command history afterwards for security purposes.
Create ApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);@overload
def ApiKey(resource_name: str,
args: ApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
owner: Optional[ApiKeyOwnerArgs] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
managed_resource: Optional[ApiKeyManagedResourceArgs] = None)func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: confluentcloud:ApiKey
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 ApiKeyArgs
- 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 ApiKeyArgs
- 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 ApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiKeyArgs
- 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 apiKeyResource = new ConfluentCloud.ApiKey("apiKeyResource", new()
{
Owner = new ConfluentCloud.Inputs.ApiKeyOwnerArgs
{
ApiVersion = "string",
Id = "string",
Kind = "string",
},
Description = "string",
DisplayName = "string",
ManagedResource = new ConfluentCloud.Inputs.ApiKeyManagedResourceArgs
{
ApiVersion = "string",
Environment = new ConfluentCloud.Inputs.ApiKeyManagedResourceEnvironmentArgs
{
Id = "string",
},
Id = "string",
Kind = "string",
},
});
example, err := confluentcloud.NewApiKey(ctx, "apiKeyResource", &confluentcloud.ApiKeyArgs{
Owner: &confluentcloud.ApiKeyOwnerArgs{
ApiVersion: pulumi.String("string"),
Id: pulumi.String("string"),
Kind: pulumi.String("string"),
},
Description: pulumi.String("string"),
DisplayName: pulumi.String("string"),
ManagedResource: &confluentcloud.ApiKeyManagedResourceArgs{
ApiVersion: pulumi.String("string"),
Environment: &confluentcloud.ApiKeyManagedResourceEnvironmentArgs{
Id: pulumi.String("string"),
},
Id: pulumi.String("string"),
Kind: pulumi.String("string"),
},
})
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
.owner(ApiKeyOwnerArgs.builder()
.apiVersion("string")
.id("string")
.kind("string")
.build())
.description("string")
.displayName("string")
.managedResource(ApiKeyManagedResourceArgs.builder()
.apiVersion("string")
.environment(ApiKeyManagedResourceEnvironmentArgs.builder()
.id("string")
.build())
.id("string")
.kind("string")
.build())
.build());
api_key_resource = confluentcloud.ApiKey("apiKeyResource",
owner={
"api_version": "string",
"id": "string",
"kind": "string",
},
description="string",
display_name="string",
managed_resource={
"api_version": "string",
"environment": {
"id": "string",
},
"id": "string",
"kind": "string",
})
const apiKeyResource = new confluentcloud.ApiKey("apiKeyResource", {
owner: {
apiVersion: "string",
id: "string",
kind: "string",
},
description: "string",
displayName: "string",
managedResource: {
apiVersion: "string",
environment: {
id: "string",
},
id: "string",
kind: "string",
},
});
type: confluentcloud:ApiKey
properties:
description: string
displayName: string
managedResource:
apiVersion: string
environment:
id: string
id: string
kind: string
owner:
apiVersion: string
id: string
kind: string
ApiKey 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 ApiKey resource accepts the following input properties:
- Owner
Pulumi.
Confluent Cloud. Inputs. Api Key Owner - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- Description string
- A free-form description of the API Account.
- Display
Name string - A human-readable name for the API Key.
- Managed
Resource Pulumi.Confluent Cloud. Inputs. Api Key Managed Resource - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- Owner
Api
Key Owner Args - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- Description string
- A free-form description of the API Account.
- Display
Name string - A human-readable name for the API Key.
- Managed
Resource ApiKey Managed Resource Args - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner
Api
Key Owner - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- description String
- A free-form description of the API Account.
- display
Name String - A human-readable name for the API Key.
- managed
Resource ApiKey Managed Resource - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner
Api
Key Owner - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- description string
- A free-form description of the API Account.
- display
Name string - A human-readable name for the API Key.
- managed
Resource ApiKey Managed Resource - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner
Api
Key Owner Args - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- description str
- A free-form description of the API Account.
- display_
name str - A human-readable name for the API Key.
- managed_
resource ApiKey Managed Resource Args - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner Property Map
- The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- description String
- A free-form description of the API Account.
- display
Name String - A human-readable name for the API Key.
- managed
Resource Property Map - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:
Look up Existing ApiKey Resource
Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
managed_resource: Optional[ApiKeyManagedResourceArgs] = None,
owner: Optional[ApiKeyOwnerArgs] = None,
secret: Optional[str] = None) -> ApiKeyfunc GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)resources: _: type: confluentcloud:ApiKey get: 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.
- Description string
- A free-form description of the API Account.
- Display
Name string - A human-readable name for the API Key.
- Managed
Resource Pulumi.Confluent Cloud. Inputs. Api Key Managed Resource - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- Owner
Pulumi.
Confluent Cloud. Inputs. Api Key Owner - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- Secret string
- (Required String) The secret of the API Key.
- Description string
- A free-form description of the API Account.
- Display
Name string - A human-readable name for the API Key.
- Managed
Resource ApiKey Managed Resource Args - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- Owner
Api
Key Owner Args - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- Secret string
- (Required String) The secret of the API Key.
- description String
- A free-form description of the API Account.
- display
Name String - A human-readable name for the API Key.
- managed
Resource ApiKey Managed Resource - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner
Api
Key Owner - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- secret String
- (Required String) The secret of the API Key.
- description string
- A free-form description of the API Account.
- display
Name string - A human-readable name for the API Key.
- managed
Resource ApiKey Managed Resource - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner
Api
Key Owner - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- secret string
- (Required String) The secret of the API Key.
- description str
- A free-form description of the API Account.
- display_
name str - A human-readable name for the API Key.
- managed_
resource ApiKey Managed Resource Args - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner
Api
Key Owner Args - The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- secret str
- (Required String) The secret of the API Key.
- description String
- A free-form description of the API Account.
- display
Name String - A human-readable name for the API Key.
- managed
Resource Property Map - The resource associated with this object. The only resource that is supported is 'cmk.v2.KafkaCluster'.
- owner Property Map
- The owner to which the API Key belongs. The owner can be one of 'iam.v2.User', 'iam.v2.ServiceAccount'.
- secret String
- (Required String) The secret of the API Key.
Supporting Types
ApiKeyManagedResource, ApiKeyManagedResourceArgs
- Api
Version string - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - Environment
Pulumi.
Confluent Cloud. Inputs. Api Key Managed Resource Environment - Id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - Kind string
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- Api
Version string - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - Environment
Api
Key Managed Resource Environment - Id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - Kind string
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api
Version String - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - environment
Api
Key Managed Resource Environment - id String
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind String
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api
Version string - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - environment
Api
Key Managed Resource Environment - id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind string
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api_
version str - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - environment
Api
Key Managed Resource Environment - id str
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind str
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api
Version String - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - environment Property Map
- id String
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind String
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
ApiKeyManagedResourceEnvironment, ApiKeyManagedResourceEnvironmentArgs
- Id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123.
- Id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123.
- id String
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123.
- id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123.
- id str
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123.
- id String
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123.
ApiKeyOwner, ApiKeyOwnerArgs
- Api
Version string - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - Id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - Kind string
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- Api
Version string - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - Id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - Kind string
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api
Version String - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - id String
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind String
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api
Version string - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - id string
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind string
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api_
version str - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - id str
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind str
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
- api
Version String - The API group and version of the managed resource that the API Key associated with, for example,
cmk/v2. - id String
- The ID of the Environment that the managed resource belongs to, for example,
env-abc123. - kind String
- The kind of the managed resource that the API Key associated with, for example,
Cluster.
Package Details
- Repository
- Confluent Cloud pulumi/pulumi-confluentcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
confluentTerraform Provider.
published on Monday, Mar 9, 2026 by Pulumi
