zitadel.MachineKey
Explore with Pulumi AI
Resource representing a machine key
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zitadel = Pulumiverse.Zitadel;
return await Deployment.RunAsync(() =>
{
var @default = new Zitadel.MachineKey("default", new()
{
OrgId = data.Zitadel_org.Default.Id,
UserId = data.Zitadel_machine_user.Default.Id,
KeyType = "KEY_TYPE_JSON",
ExpirationDate = "2519-04-01T08:45:00Z",
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := zitadel.NewMachineKey(ctx, "default", &zitadel.MachineKeyArgs{
OrgId: pulumi.Any(data.Zitadel_org.Default.Id),
UserId: pulumi.Any(data.Zitadel_machine_user.Default.Id),
KeyType: pulumi.String("KEY_TYPE_JSON"),
ExpirationDate: pulumi.String("2519-04-01T08:45:00Z"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zitadel.MachineKey;
import com.pulumi.zitadel.MachineKeyArgs;
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 default_ = new MachineKey("default", MachineKeyArgs.builder()
.orgId(data.zitadel_org().default().id())
.userId(data.zitadel_machine_user().default().id())
.keyType("KEY_TYPE_JSON")
.expirationDate("2519-04-01T08:45:00Z")
.build());
}
}
import pulumi
import pulumiverse_zitadel as zitadel
default = zitadel.MachineKey("default",
org_id=data["zitadel_org"]["default"]["id"],
user_id=data["zitadel_machine_user"]["default"]["id"],
key_type="KEY_TYPE_JSON",
expiration_date="2519-04-01T08:45:00Z")
import * as pulumi from "@pulumi/pulumi";
import * as zitadel from "@pulumiverse/zitadel";
const _default = new zitadel.MachineKey("default", {
orgId: data.zitadel_org["default"].id,
userId: data.zitadel_machine_user["default"].id,
keyType: "KEY_TYPE_JSON",
expirationDate: "2519-04-01T08:45:00Z",
});
resources:
default:
type: zitadel:MachineKey
properties:
orgId: ${data.zitadel_org.default.id}
userId: ${data.zitadel_machine_user.default.id}
keyType: KEY_TYPE_JSON
expirationDate: 2519-04-01T08:45:00Z
Create MachineKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MachineKey(name: string, args: MachineKeyArgs, opts?: CustomResourceOptions);
@overload
def MachineKey(resource_name: str,
args: MachineKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MachineKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
key_type: Optional[str] = None,
user_id: Optional[str] = None,
expiration_date: Optional[str] = None,
org_id: Optional[str] = None)
func NewMachineKey(ctx *Context, name string, args MachineKeyArgs, opts ...ResourceOption) (*MachineKey, error)
public MachineKey(string name, MachineKeyArgs args, CustomResourceOptions? opts = null)
public MachineKey(String name, MachineKeyArgs args)
public MachineKey(String name, MachineKeyArgs args, CustomResourceOptions options)
type: zitadel:MachineKey
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 MachineKeyArgs
- 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 MachineKeyArgs
- 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 MachineKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MachineKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MachineKeyArgs
- 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 machineKeyResource = new Zitadel.MachineKey("machineKeyResource", new()
{
KeyType = "string",
UserId = "string",
ExpirationDate = "string",
OrgId = "string",
});
example, err := zitadel.NewMachineKey(ctx, "machineKeyResource", &zitadel.MachineKeyArgs{
KeyType: pulumi.String("string"),
UserId: pulumi.String("string"),
ExpirationDate: pulumi.String("string"),
OrgId: pulumi.String("string"),
})
var machineKeyResource = new MachineKey("machineKeyResource", MachineKeyArgs.builder()
.keyType("string")
.userId("string")
.expirationDate("string")
.orgId("string")
.build());
machine_key_resource = zitadel.MachineKey("machineKeyResource",
key_type="string",
user_id="string",
expiration_date="string",
org_id="string")
const machineKeyResource = new zitadel.MachineKey("machineKeyResource", {
keyType: "string",
userId: "string",
expirationDate: "string",
orgId: "string",
});
type: zitadel:MachineKey
properties:
expirationDate: string
keyType: string
orgId: string
userId: string
MachineKey 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 MachineKey resource accepts the following input properties:
- Key
Type string - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- User
Id string - ID of the user
- Expiration
Date string - Expiration date of the machine key in the RFC3339 format
- Org
Id string - ID of the organization
- Key
Type string - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- User
Id string - ID of the user
- Expiration
Date string - Expiration date of the machine key in the RFC3339 format
- Org
Id string - ID of the organization
- key
Type String - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- user
Id String - ID of the user
- expiration
Date String - Expiration date of the machine key in the RFC3339 format
- org
Id String - ID of the organization
- key
Type string - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- user
Id string - ID of the user
- expiration
Date string - Expiration date of the machine key in the RFC3339 format
- org
Id string - ID of the organization
- key_
type str - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- user_
id str - ID of the user
- expiration_
date str - Expiration date of the machine key in the RFC3339 format
- org_
id str - ID of the organization
- key
Type String - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- user
Id String - ID of the user
- expiration
Date String - Expiration date of the machine key in the RFC3339 format
- org
Id String - ID of the organization
Outputs
All input properties are implicitly available as output properties. Additionally, the MachineKey resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Details string - Value of the machine key
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Details string - Value of the machine key
- id String
- The provider-assigned unique ID for this managed resource.
- key
Details String - Value of the machine key
- id string
- The provider-assigned unique ID for this managed resource.
- key
Details string - Value of the machine key
- id str
- The provider-assigned unique ID for this managed resource.
- key_
details str - Value of the machine key
- id String
- The provider-assigned unique ID for this managed resource.
- key
Details String - Value of the machine key
Look up Existing MachineKey Resource
Get an existing MachineKey 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?: MachineKeyState, opts?: CustomResourceOptions): MachineKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
expiration_date: Optional[str] = None,
key_details: Optional[str] = None,
key_type: Optional[str] = None,
org_id: Optional[str] = None,
user_id: Optional[str] = None) -> MachineKey
func GetMachineKey(ctx *Context, name string, id IDInput, state *MachineKeyState, opts ...ResourceOption) (*MachineKey, error)
public static MachineKey Get(string name, Input<string> id, MachineKeyState? state, CustomResourceOptions? opts = null)
public static MachineKey get(String name, Output<String> id, MachineKeyState 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.
- Expiration
Date string - Expiration date of the machine key in the RFC3339 format
- Key
Details string - Value of the machine key
- Key
Type string - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- Org
Id string - ID of the organization
- User
Id string - ID of the user
- Expiration
Date string - Expiration date of the machine key in the RFC3339 format
- Key
Details string - Value of the machine key
- Key
Type string - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- Org
Id string - ID of the organization
- User
Id string - ID of the user
- expiration
Date String - Expiration date of the machine key in the RFC3339 format
- key
Details String - Value of the machine key
- key
Type String - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- org
Id String - ID of the organization
- user
Id String - ID of the user
- expiration
Date string - Expiration date of the machine key in the RFC3339 format
- key
Details string - Value of the machine key
- key
Type string - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- org
Id string - ID of the organization
- user
Id string - ID of the user
- expiration_
date str - Expiration date of the machine key in the RFC3339 format
- key_
details str - Value of the machine key
- key_
type str - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- org_
id str - ID of the organization
- user_
id str - ID of the user
- expiration
Date String - Expiration date of the machine key in the RFC3339 format
- key
Details String - Value of the machine key
- key
Type String - Type of the machine key, supported values: KEYTYPEUNSPECIFIED, KEYTYPEJSON
- org
Id String - ID of the organization
- user
Id String - ID of the user
Import
terraform The resource can be imported using the ID format <id:user_id[:org_id][:key_details]>
, e.g.
$ pulumi import zitadel:index/machineKey:MachineKey imported '123456789012345678:123456789012345678:123456789012345678:{"type":"serviceaccount","keyId":"123456789012345678","key":"-----BEGIN RSA PRIVATE KEY-----\nMIIEpQ...-----END RSA PRIVATE KEY-----\n","userId":"123456789012345678"}'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zitadel pulumiverse/pulumi-zitadel
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
zitadel
Terraform Provider.