We recommend using Azure Native.
azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicy
Explore with Pulumi AI
Manages a Managed HSM Key rotation policy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.keyvault.ManagedHardwareSecurityModuleKey("example", {
name: "example-key",
managedHsmId: exampleAzurermKeyVaultManagedHardwareSecurityModule.id,
keyType: "EC-HSM",
curve: "P-521",
keyOpts: ["sign"],
});
const exampleManagedHardwareSecurityModuleKeyRotationPolicy = new azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicy("example", {
managedHsmKeyId: example.id,
expireAfter: "P60D",
timeBeforeExpiry: "P30D",
});
import pulumi
import pulumi_azure as azure
example = azure.keyvault.ManagedHardwareSecurityModuleKey("example",
name="example-key",
managed_hsm_id=example_azurerm_key_vault_managed_hardware_security_module["id"],
key_type="EC-HSM",
curve="P-521",
key_opts=["sign"])
example_managed_hardware_security_module_key_rotation_policy = azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicy("example",
managed_hsm_key_id=example.id,
expire_after="P60D",
time_before_expiry="P30D")
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/keyvault"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := keyvault.NewManagedHardwareSecurityModuleKey(ctx, "example", &keyvault.ManagedHardwareSecurityModuleKeyArgs{
Name: pulumi.String("example-key"),
ManagedHsmId: pulumi.Any(exampleAzurermKeyVaultManagedHardwareSecurityModule.Id),
KeyType: pulumi.String("EC-HSM"),
Curve: pulumi.String("P-521"),
KeyOpts: pulumi.StringArray{
pulumi.String("sign"),
},
})
if err != nil {
return err
}
_, err = keyvault.NewManagedHardwareSecurityModuleKeyRotationPolicy(ctx, "example", &keyvault.ManagedHardwareSecurityModuleKeyRotationPolicyArgs{
ManagedHsmKeyId: example.ID(),
ExpireAfter: pulumi.String("P60D"),
TimeBeforeExpiry: pulumi.String("P30D"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.KeyVault.ManagedHardwareSecurityModuleKey("example", new()
{
Name = "example-key",
ManagedHsmId = exampleAzurermKeyVaultManagedHardwareSecurityModule.Id,
KeyType = "EC-HSM",
Curve = "P-521",
KeyOpts = new[]
{
"sign",
},
});
var exampleManagedHardwareSecurityModuleKeyRotationPolicy = new Azure.KeyVault.ManagedHardwareSecurityModuleKeyRotationPolicy("example", new()
{
ManagedHsmKeyId = example.Id,
ExpireAfter = "P60D",
TimeBeforeExpiry = "P30D",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleKey;
import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleKeyArgs;
import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicy;
import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicyArgs;
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 example = new ManagedHardwareSecurityModuleKey("example", ManagedHardwareSecurityModuleKeyArgs.builder()
.name("example-key")
.managedHsmId(exampleAzurermKeyVaultManagedHardwareSecurityModule.id())
.keyType("EC-HSM")
.curve("P-521")
.keyOpts("sign")
.build());
var exampleManagedHardwareSecurityModuleKeyRotationPolicy = new ManagedHardwareSecurityModuleKeyRotationPolicy("exampleManagedHardwareSecurityModuleKeyRotationPolicy", ManagedHardwareSecurityModuleKeyRotationPolicyArgs.builder()
.managedHsmKeyId(example.id())
.expireAfter("P60D")
.timeBeforeExpiry("P30D")
.build());
}
}
resources:
example:
type: azure:keyvault:ManagedHardwareSecurityModuleKey
properties:
name: example-key
managedHsmId: ${exampleAzurermKeyVaultManagedHardwareSecurityModule.id}
keyType: EC-HSM
curve: P-521
keyOpts:
- sign
exampleManagedHardwareSecurityModuleKeyRotationPolicy:
type: azure:keyvault:ManagedHardwareSecurityModuleKeyRotationPolicy
name: example
properties:
managedHsmKeyId: ${example.id}
expireAfter: P60D
timeBeforeExpiry: P30D
Create ManagedHardwareSecurityModuleKeyRotationPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedHardwareSecurityModuleKeyRotationPolicy(name: string, args: ManagedHardwareSecurityModuleKeyRotationPolicyArgs, opts?: CustomResourceOptions);
@overload
def ManagedHardwareSecurityModuleKeyRotationPolicy(resource_name: str,
args: ManagedHardwareSecurityModuleKeyRotationPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagedHardwareSecurityModuleKeyRotationPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
expire_after: Optional[str] = None,
managed_hsm_key_id: Optional[str] = None,
time_after_creation: Optional[str] = None,
time_before_expiry: Optional[str] = None)
func NewManagedHardwareSecurityModuleKeyRotationPolicy(ctx *Context, name string, args ManagedHardwareSecurityModuleKeyRotationPolicyArgs, opts ...ResourceOption) (*ManagedHardwareSecurityModuleKeyRotationPolicy, error)
public ManagedHardwareSecurityModuleKeyRotationPolicy(string name, ManagedHardwareSecurityModuleKeyRotationPolicyArgs args, CustomResourceOptions? opts = null)
public ManagedHardwareSecurityModuleKeyRotationPolicy(String name, ManagedHardwareSecurityModuleKeyRotationPolicyArgs args)
public ManagedHardwareSecurityModuleKeyRotationPolicy(String name, ManagedHardwareSecurityModuleKeyRotationPolicyArgs args, CustomResourceOptions options)
type: azure:keyvault:ManagedHardwareSecurityModuleKeyRotationPolicy
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 ManagedHardwareSecurityModuleKeyRotationPolicyArgs
- 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 ManagedHardwareSecurityModuleKeyRotationPolicyArgs
- 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 ManagedHardwareSecurityModuleKeyRotationPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedHardwareSecurityModuleKeyRotationPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedHardwareSecurityModuleKeyRotationPolicyArgs
- 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 managedHardwareSecurityModuleKeyRotationPolicyResource = new Azure.KeyVault.ManagedHardwareSecurityModuleKeyRotationPolicy("managedHardwareSecurityModuleKeyRotationPolicyResource", new()
{
ExpireAfter = "string",
ManagedHsmKeyId = "string",
TimeAfterCreation = "string",
TimeBeforeExpiry = "string",
});
example, err := keyvault.NewManagedHardwareSecurityModuleKeyRotationPolicy(ctx, "managedHardwareSecurityModuleKeyRotationPolicyResource", &keyvault.ManagedHardwareSecurityModuleKeyRotationPolicyArgs{
ExpireAfter: pulumi.String("string"),
ManagedHsmKeyId: pulumi.String("string"),
TimeAfterCreation: pulumi.String("string"),
TimeBeforeExpiry: pulumi.String("string"),
})
var managedHardwareSecurityModuleKeyRotationPolicyResource = new ManagedHardwareSecurityModuleKeyRotationPolicy("managedHardwareSecurityModuleKeyRotationPolicyResource", ManagedHardwareSecurityModuleKeyRotationPolicyArgs.builder()
.expireAfter("string")
.managedHsmKeyId("string")
.timeAfterCreation("string")
.timeBeforeExpiry("string")
.build());
managed_hardware_security_module_key_rotation_policy_resource = azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicy("managedHardwareSecurityModuleKeyRotationPolicyResource",
expire_after="string",
managed_hsm_key_id="string",
time_after_creation="string",
time_before_expiry="string")
const managedHardwareSecurityModuleKeyRotationPolicyResource = new azure.keyvault.ManagedHardwareSecurityModuleKeyRotationPolicy("managedHardwareSecurityModuleKeyRotationPolicyResource", {
expireAfter: "string",
managedHsmKeyId: "string",
timeAfterCreation: "string",
timeBeforeExpiry: "string",
});
type: azure:keyvault:ManagedHardwareSecurityModuleKeyRotationPolicy
properties:
expireAfter: string
managedHsmKeyId: string
timeAfterCreation: string
timeBeforeExpiry: string
ManagedHardwareSecurityModuleKeyRotationPolicy 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 ManagedHardwareSecurityModuleKeyRotationPolicy resource accepts the following input properties:
- Expire
After string - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - Managed
Hsm stringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- Time
After stringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - Time
Before stringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- Expire
After string - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - Managed
Hsm stringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- Time
After stringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - Time
Before stringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire
After String - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed
Hsm StringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time
After StringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time
Before StringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire
After string - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed
Hsm stringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time
After stringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time
Before stringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire_
after str - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed_
hsm_ strkey_ id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time_
after_ strcreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time_
before_ strexpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire
After String - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed
Hsm StringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time
After StringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time
Before StringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagedHardwareSecurityModuleKeyRotationPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ManagedHardwareSecurityModuleKeyRotationPolicy Resource
Get an existing ManagedHardwareSecurityModuleKeyRotationPolicy 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?: ManagedHardwareSecurityModuleKeyRotationPolicyState, opts?: CustomResourceOptions): ManagedHardwareSecurityModuleKeyRotationPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
expire_after: Optional[str] = None,
managed_hsm_key_id: Optional[str] = None,
time_after_creation: Optional[str] = None,
time_before_expiry: Optional[str] = None) -> ManagedHardwareSecurityModuleKeyRotationPolicy
func GetManagedHardwareSecurityModuleKeyRotationPolicy(ctx *Context, name string, id IDInput, state *ManagedHardwareSecurityModuleKeyRotationPolicyState, opts ...ResourceOption) (*ManagedHardwareSecurityModuleKeyRotationPolicy, error)
public static ManagedHardwareSecurityModuleKeyRotationPolicy Get(string name, Input<string> id, ManagedHardwareSecurityModuleKeyRotationPolicyState? state, CustomResourceOptions? opts = null)
public static ManagedHardwareSecurityModuleKeyRotationPolicy get(String name, Output<String> id, ManagedHardwareSecurityModuleKeyRotationPolicyState 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.
- Expire
After string - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - Managed
Hsm stringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- Time
After stringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - Time
Before stringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- Expire
After string - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - Managed
Hsm stringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- Time
After stringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - Time
Before stringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire
After String - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed
Hsm StringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time
After StringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time
Before StringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire
After string - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed
Hsm stringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time
After stringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time
Before stringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire_
after str - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed_
hsm_ strkey_ id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time_
after_ strcreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time_
before_ strexpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
- expire
After String - Specify the expiration duration on a newly rotated key as an ISO 8601 duration. The minimum duration is
P28D
. - managed
Hsm StringKey Id - The ID of the Managed HSM Key. Changing this forces a new Managed HSM Key rotation policy to be created.
- time
After StringCreation - Rotate automatically at a duration after key creation as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified. - time
Before StringExpiry - Rotate automatically at a duration before key expiry as an ISO 8601 duration. Exactly one of
time_after_creation
ortime_before_expiry
should be specified.
Import
Managed HSM Key rotation policy can be imported using the resource id
, e.g.
$ pulumi import azure:keyvault/managedHardwareSecurityModuleKeyRotationPolicy:ManagedHardwareSecurityModuleKeyRotationPolicy example https://example-hsm.managedhsm.azure.net/keys/example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.