A Credential Policy
Uses Azure REST API version 2025-11-01-preview.
Example Usage
CreateOrReplace_Policies
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var policy = new AzureNative.DeviceRegistry.Policy("policy", new()
{
Certificate = new AzureNative.DeviceRegistry.Inputs.CertificateConfigurationArgs
{
CertificateAuthorityConfiguration = new AzureNative.DeviceRegistry.Inputs.CertificateAuthorityConfigurationArgs
{
KeyType = AzureNative.DeviceRegistry.SupportedKeyType.ECC,
},
LeafCertificateConfiguration = new AzureNative.DeviceRegistry.Inputs.LeafCertificateConfigurationArgs
{
ValidityPeriodInDays = 10,
},
},
Location = "zjqtuvprnxvimzkkxaobgkm",
NamespaceName = "mynamespace",
PolicyName = "mypolicy",
ResourceGroupName = "rgdeviceregistry",
Tags =
{
{ "key1088", "xzrpbqsac" },
},
});
});
package main
import (
deviceregistry "github.com/pulumi/pulumi-azure-native-sdk/deviceregistry/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := deviceregistry.NewPolicy(ctx, "policy", &deviceregistry.PolicyArgs{
Certificate: &deviceregistry.CertificateConfigurationArgs{
CertificateAuthorityConfiguration: &deviceregistry.CertificateAuthorityConfigurationArgs{
KeyType: pulumi.String(deviceregistry.SupportedKeyTypeECC),
},
LeafCertificateConfiguration: &deviceregistry.LeafCertificateConfigurationArgs{
ValidityPeriodInDays: pulumi.Int(10),
},
},
Location: pulumi.String("zjqtuvprnxvimzkkxaobgkm"),
NamespaceName: pulumi.String("mynamespace"),
PolicyName: pulumi.String("mypolicy"),
ResourceGroupName: pulumi.String("rgdeviceregistry"),
Tags: pulumi.StringMap{
"key1088": pulumi.String("xzrpbqsac"),
},
})
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.azurenative.deviceregistry.Policy;
import com.pulumi.azurenative.deviceregistry.PolicyArgs;
import com.pulumi.azurenative.deviceregistry.inputs.CertificateConfigurationArgs;
import com.pulumi.azurenative.deviceregistry.inputs.CertificateAuthorityConfigurationArgs;
import com.pulumi.azurenative.deviceregistry.inputs.LeafCertificateConfigurationArgs;
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 policy = new Policy("policy", PolicyArgs.builder()
.certificate(CertificateConfigurationArgs.builder()
.certificateAuthorityConfiguration(CertificateAuthorityConfigurationArgs.builder()
.keyType("ECC")
.build())
.leafCertificateConfiguration(LeafCertificateConfigurationArgs.builder()
.validityPeriodInDays(10)
.build())
.build())
.location("zjqtuvprnxvimzkkxaobgkm")
.namespaceName("mynamespace")
.policyName("mypolicy")
.resourceGroupName("rgdeviceregistry")
.tags(Map.of("key1088", "xzrpbqsac"))
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const policy = new azure_native.deviceregistry.Policy("policy", {
certificate: {
certificateAuthorityConfiguration: {
keyType: azure_native.deviceregistry.SupportedKeyType.ECC,
},
leafCertificateConfiguration: {
validityPeriodInDays: 10,
},
},
location: "zjqtuvprnxvimzkkxaobgkm",
namespaceName: "mynamespace",
policyName: "mypolicy",
resourceGroupName: "rgdeviceregistry",
tags: {
key1088: "xzrpbqsac",
},
});
import pulumi
import pulumi_azure_native as azure_native
policy = azure_native.deviceregistry.Policy("policy",
certificate={
"certificate_authority_configuration": {
"key_type": azure_native.deviceregistry.SupportedKeyType.ECC,
},
"leaf_certificate_configuration": {
"validity_period_in_days": 10,
},
},
location="zjqtuvprnxvimzkkxaobgkm",
namespace_name="mynamespace",
policy_name="mypolicy",
resource_group_name="rgdeviceregistry",
tags={
"key1088": "xzrpbqsac",
})
resources:
policy:
type: azure-native:deviceregistry:Policy
properties:
certificate:
certificateAuthorityConfiguration:
keyType: ECC
leafCertificateConfiguration:
validityPeriodInDays: 10
location: zjqtuvprnxvimzkkxaobgkm
namespaceName: mynamespace
policyName: mypolicy
resourceGroupName: rgdeviceregistry
tags:
key1088: xzrpbqsac
Create Policy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);@overload
def Policy(resource_name: str,
args: PolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Policy(resource_name: str,
opts: Optional[ResourceOptions] = None,
namespace_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
certificate: Optional[CertificateConfigurationArgs] = None,
location: Optional[str] = None,
policy_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: azure-native:deviceregistry:Policy
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 PolicyArgs
- 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 PolicyArgs
- 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 PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyArgs
- 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 examplepolicyResourceResourceFromDeviceregistry = new AzureNative.DeviceRegistry.Policy("examplepolicyResourceResourceFromDeviceregistry", new()
{
NamespaceName = "string",
ResourceGroupName = "string",
Certificate = new AzureNative.DeviceRegistry.Inputs.CertificateConfigurationArgs
{
CertificateAuthorityConfiguration = new AzureNative.DeviceRegistry.Inputs.CertificateAuthorityConfigurationArgs
{
KeyType = "string",
},
LeafCertificateConfiguration = new AzureNative.DeviceRegistry.Inputs.LeafCertificateConfigurationArgs
{
ValidityPeriodInDays = 0,
},
},
Location = "string",
PolicyName = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := deviceregistry.NewPolicy(ctx, "examplepolicyResourceResourceFromDeviceregistry", &deviceregistry.PolicyArgs{
NamespaceName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Certificate: &deviceregistry.CertificateConfigurationArgs{
CertificateAuthorityConfiguration: &deviceregistry.CertificateAuthorityConfigurationArgs{
KeyType: pulumi.String("string"),
},
LeafCertificateConfiguration: &deviceregistry.LeafCertificateConfigurationArgs{
ValidityPeriodInDays: pulumi.Int(0),
},
},
Location: pulumi.String("string"),
PolicyName: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var examplepolicyResourceResourceFromDeviceregistry = new com.pulumi.azurenative.deviceregistry.Policy("examplepolicyResourceResourceFromDeviceregistry", com.pulumi.azurenative.deviceregistry.PolicyArgs.builder()
.namespaceName("string")
.resourceGroupName("string")
.certificate(CertificateConfigurationArgs.builder()
.certificateAuthorityConfiguration(CertificateAuthorityConfigurationArgs.builder()
.keyType("string")
.build())
.leafCertificateConfiguration(LeafCertificateConfigurationArgs.builder()
.validityPeriodInDays(0)
.build())
.build())
.location("string")
.policyName("string")
.tags(Map.of("string", "string"))
.build());
examplepolicy_resource_resource_from_deviceregistry = azure_native.deviceregistry.Policy("examplepolicyResourceResourceFromDeviceregistry",
namespace_name="string",
resource_group_name="string",
certificate={
"certificate_authority_configuration": {
"key_type": "string",
},
"leaf_certificate_configuration": {
"validity_period_in_days": 0,
},
},
location="string",
policy_name="string",
tags={
"string": "string",
})
const examplepolicyResourceResourceFromDeviceregistry = new azure_native.deviceregistry.Policy("examplepolicyResourceResourceFromDeviceregistry", {
namespaceName: "string",
resourceGroupName: "string",
certificate: {
certificateAuthorityConfiguration: {
keyType: "string",
},
leafCertificateConfiguration: {
validityPeriodInDays: 0,
},
},
location: "string",
policyName: "string",
tags: {
string: "string",
},
});
type: azure-native:deviceregistry:Policy
properties:
certificate:
certificateAuthorityConfiguration:
keyType: string
leafCertificateConfiguration:
validityPeriodInDays: 0
location: string
namespaceName: string
policyName: string
resourceGroupName: string
tags:
string: string
Policy 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 Policy resource accepts the following input properties:
- Namespace
Name string - The name of the namespace.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Certificate
Pulumi.
Azure Native. Device Registry. Inputs. Certificate Configuration - The certificate configuration.
- Location string
- The geo-location where the resource lives
- Policy
Name string - The name of the Policy tracked resource.
- Dictionary<string, string>
- Resource tags.
- Namespace
Name string - The name of the namespace.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Certificate
Certificate
Configuration Args - The certificate configuration.
- Location string
- The geo-location where the resource lives
- Policy
Name string - The name of the Policy tracked resource.
- map[string]string
- Resource tags.
- namespace
Name String - The name of the namespace.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- certificate
Certificate
Configuration - The certificate configuration.
- location String
- The geo-location where the resource lives
- policy
Name String - The name of the Policy tracked resource.
- Map<String,String>
- Resource tags.
- namespace
Name string - The name of the namespace.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- certificate
Certificate
Configuration - The certificate configuration.
- location string
- The geo-location where the resource lives
- policy
Name string - The name of the Policy tracked resource.
- {[key: string]: string}
- Resource tags.
- namespace_
name str - The name of the namespace.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- certificate
Certificate
Configuration Args - The certificate configuration.
- location str
- The geo-location where the resource lives
- policy_
name str - The name of the Policy tracked resource.
- Mapping[str, str]
- Resource tags.
- namespace
Name String - The name of the namespace.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- certificate Property Map
- The certificate configuration.
- location String
- The geo-location where the resource lives
- policy
Name String - The name of the Policy tracked resource.
- Map<String>
- Resource tags.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
- Azure
Api stringVersion - The Azure API version of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- Provisioning
State string - The status of the last operation.
- System
Data Pulumi.Azure Native. Device Registry. Outputs. System Data Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Azure
Api stringVersion - The Azure API version of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- Provisioning
State string - The status of the last operation.
- System
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api StringVersion - The Azure API version of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- provisioning
State String - The status of the last operation.
- system
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api stringVersion - The Azure API version of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the resource
- provisioning
State string - The status of the last operation.
- system
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure_
api_ strversion - The Azure API version of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the resource
- provisioning_
state str - The status of the last operation.
- system_
data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type str
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api StringVersion - The Azure API version of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- provisioning
State String - The status of the last operation.
- system
Data Property Map - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Supporting Types
CertificateAuthorityConfiguration, CertificateAuthorityConfigurationArgs
The configuration to set up an ICA.- Key
Type string | Pulumi.Azure Native. Device Registry. Supported Key Type - Crypto type: ECC.
- Key
Type string | SupportedKey Type - Crypto type: ECC.
- key
Type String | SupportedKey Type - Crypto type: ECC.
- key
Type string | SupportedKey Type - Crypto type: ECC.
- key_
type str | SupportedKey Type - Crypto type: ECC.
CertificateAuthorityConfigurationResponse, CertificateAuthorityConfigurationResponseArgs
The configuration to set up an ICA.- Key
Type string - Crypto type: ECC.
- Subject string
- Certificate subject.
- Validity
Not stringAfter - Certificate is valid not after this date. Format ISO8601. Generated based on validity period.
- Validity
Not stringBefore - Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.
- Key
Type string - Crypto type: ECC.
- Subject string
- Certificate subject.
- Validity
Not stringAfter - Certificate is valid not after this date. Format ISO8601. Generated based on validity period.
- Validity
Not stringBefore - Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.
- key
Type String - Crypto type: ECC.
- subject String
- Certificate subject.
- validity
Not StringAfter - Certificate is valid not after this date. Format ISO8601. Generated based on validity period.
- validity
Not StringBefore - Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.
- key
Type string - Crypto type: ECC.
- subject string
- Certificate subject.
- validity
Not stringAfter - Certificate is valid not after this date. Format ISO8601. Generated based on validity period.
- validity
Not stringBefore - Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.
- key_
type str - Crypto type: ECC.
- subject str
- Certificate subject.
- validity_
not_ strafter - Certificate is valid not after this date. Format ISO8601. Generated based on validity period.
- validity_
not_ strbefore - Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.
- key
Type String - Crypto type: ECC.
- subject String
- Certificate subject.
- validity
Not StringAfter - Certificate is valid not after this date. Format ISO8601. Generated based on validity period.
- validity
Not StringBefore - Certificate is valid not before this date. Format ISO8601. Generated based on on validity period.
CertificateConfiguration, CertificateConfigurationArgs
The certificate configuration.-
Pulumi.
Azure Native. Device Registry. Inputs. Certificate Authority Configuration - The configuration to set up an ICA.
- Leaf
Certificate Pulumi.Configuration Azure Native. Device Registry. Inputs. Leaf Certificate Configuration - The leaf certificate configuration.
-
Certificate
Authority Configuration - The configuration to set up an ICA.
- Leaf
Certificate LeafConfiguration Certificate Configuration - The leaf certificate configuration.
-
Certificate
Authority Configuration - The configuration to set up an ICA.
- leaf
Certificate LeafConfiguration Certificate Configuration - The leaf certificate configuration.
-
Certificate
Authority Configuration - The configuration to set up an ICA.
- leaf
Certificate LeafConfiguration Certificate Configuration - The leaf certificate configuration.
-
Certificate
Authority Configuration - The configuration to set up an ICA.
- leaf_
certificate_ Leafconfiguration Certificate Configuration - The leaf certificate configuration.
- Property Map
- The configuration to set up an ICA.
- leaf
Certificate Property MapConfiguration - The leaf certificate configuration.
CertificateConfigurationResponse, CertificateConfigurationResponseArgs
The certificate configuration.-
Pulumi.
Azure Native. Device Registry. Inputs. Certificate Authority Configuration Response - The configuration to set up an ICA.
- Leaf
Certificate Pulumi.Configuration Azure Native. Device Registry. Inputs. Leaf Certificate Configuration Response - The leaf certificate configuration.
-
Certificate
Authority Configuration Response - The configuration to set up an ICA.
- Leaf
Certificate LeafConfiguration Certificate Configuration Response - The leaf certificate configuration.
-
Certificate
Authority Configuration Response - The configuration to set up an ICA.
- leaf
Certificate LeafConfiguration Certificate Configuration Response - The leaf certificate configuration.
-
Certificate
Authority Configuration Response - The configuration to set up an ICA.
- leaf
Certificate LeafConfiguration Certificate Configuration Response - The leaf certificate configuration.
-
Certificate
Authority Configuration Response - The configuration to set up an ICA.
- leaf_
certificate_ Leafconfiguration Certificate Configuration Response - The leaf certificate configuration.
- Property Map
- The configuration to set up an ICA.
- leaf
Certificate Property MapConfiguration - The leaf certificate configuration.
LeafCertificateConfiguration, LeafCertificateConfigurationArgs
The leaf certificate configuration.- Validity
Period intIn Days - The validity period in days.
- Validity
Period intIn Days - The validity period in days.
- validity
Period IntegerIn Days - The validity period in days.
- validity
Period numberIn Days - The validity period in days.
- validity_
period_ intin_ days - The validity period in days.
- validity
Period NumberIn Days - The validity period in days.
LeafCertificateConfigurationResponse, LeafCertificateConfigurationResponseArgs
The leaf certificate configuration.- Validity
Period intIn Days - The validity period in days.
- Validity
Period intIn Days - The validity period in days.
- validity
Period IntegerIn Days - The validity period in days.
- validity
Period numberIn Days - The validity period in days.
- validity_
period_ intin_ days - The validity period in days.
- validity
Period NumberIn Days - The validity period in days.
SupportedKeyType, SupportedKeyTypeArgs
- ECC
ECCIndicates the ECC key type.
- Supported
Key Type ECC ECCIndicates the ECC key type.
- ECC
ECCIndicates the ECC key type.
- ECC
ECCIndicates the ECC key type.
- ECC
ECCIndicates the ECC key type.
- "ECC"
ECCIndicates the ECC key type.
SystemDataResponse, SystemDataResponseArgs
Metadata pertaining to creation and last modification of the resource.- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:deviceregistry:Policy mypolicy /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0
