-
Notifications
You must be signed in to change notification settings - Fork 51
/
iotHubCertificate.go
114 lines (101 loc) · 5.94 KB
/
iotHubCertificate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package iot
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages an IotHub Device Provisioning Service Certificate.
type IotHubCertificate struct {
pulumi.CustomResourceState
// The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
CertificateContent pulumi.StringOutput `pulumi:"certificateContent"`
// The name of the IoT Device Provisioning Service that this certificate will be attached to. Changing this forces a new resource to be created.
IotDpsName pulumi.StringOutput `pulumi:"iotDpsName"`
// Specifies the name of the Iot Device Provisioning Service Certificate resource. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group under which the Iot Device Provisioning Service Certificate resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewIotHubCertificate registers a new resource with the given unique name, arguments, and options.
func NewIotHubCertificate(ctx *pulumi.Context,
name string, args *IotHubCertificateArgs, opts ...pulumi.ResourceOption) (*IotHubCertificate, error) {
if args == nil || args.CertificateContent == nil {
return nil, errors.New("missing required argument 'CertificateContent'")
}
if args == nil || args.IotDpsName == nil {
return nil, errors.New("missing required argument 'IotDpsName'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil {
args = &IotHubCertificateArgs{}
}
var resource IotHubCertificate
err := ctx.RegisterResource("azure:iot/iotHubCertificate:IotHubCertificate", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIotHubCertificate gets an existing IotHubCertificate resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetIotHubCertificate(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IotHubCertificateState, opts ...pulumi.ResourceOption) (*IotHubCertificate, error) {
var resource IotHubCertificate
err := ctx.ReadResource("azure:iot/iotHubCertificate:IotHubCertificate", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IotHubCertificate resources.
type iotHubCertificateState struct {
// The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
CertificateContent *string `pulumi:"certificateContent"`
// The name of the IoT Device Provisioning Service that this certificate will be attached to. Changing this forces a new resource to be created.
IotDpsName *string `pulumi:"iotDpsName"`
// Specifies the name of the Iot Device Provisioning Service Certificate resource. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group under which the Iot Device Provisioning Service Certificate resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type IotHubCertificateState struct {
// The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
CertificateContent pulumi.StringPtrInput
// The name of the IoT Device Provisioning Service that this certificate will be attached to. Changing this forces a new resource to be created.
IotDpsName pulumi.StringPtrInput
// Specifies the name of the Iot Device Provisioning Service Certificate resource. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group under which the Iot Device Provisioning Service Certificate resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
}
func (IotHubCertificateState) ElementType() reflect.Type {
return reflect.TypeOf((*iotHubCertificateState)(nil)).Elem()
}
type iotHubCertificateArgs struct {
// The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
CertificateContent string `pulumi:"certificateContent"`
// The name of the IoT Device Provisioning Service that this certificate will be attached to. Changing this forces a new resource to be created.
IotDpsName string `pulumi:"iotDpsName"`
// Specifies the name of the Iot Device Provisioning Service Certificate resource. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group under which the Iot Device Provisioning Service Certificate resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a IotHubCertificate resource.
type IotHubCertificateArgs struct {
// The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
CertificateContent pulumi.StringInput
// The name of the IoT Device Provisioning Service that this certificate will be attached to. Changing this forces a new resource to be created.
IotDpsName pulumi.StringInput
// Specifies the name of the Iot Device Provisioning Service Certificate resource. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group under which the Iot Device Provisioning Service Certificate resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
}
func (IotHubCertificateArgs) ElementType() reflect.Type {
return reflect.TypeOf((*iotHubCertificateArgs)(nil)).Elem()
}