-
Notifications
You must be signed in to change notification settings - Fork 51
/
getSharedAccessPolicy.go
70 lines (65 loc) · 2.5 KB
/
getSharedAccessPolicy.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
// *** 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 (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to access information about an existing IotHub Shared Access Policy
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/iot"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := iot.LookupSharedAccessPolicy(ctx, &iot.LookupSharedAccessPolicyArgs{
// Name: "example",
// ResourceGroupName: azurerm_resource_group.Example.Name,
// IothubName: azurerm_iothub.Example.Name,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupSharedAccessPolicy(ctx *pulumi.Context, args *LookupSharedAccessPolicyArgs, opts ...pulumi.InvokeOption) (*LookupSharedAccessPolicyResult, error) {
var rv LookupSharedAccessPolicyResult
err := ctx.Invoke("azure:iot/getSharedAccessPolicy:getSharedAccessPolicy", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSharedAccessPolicy.
type LookupSharedAccessPolicyArgs struct {
// The name of the IoTHub to which this Shared Access Policy belongs.
IothubName string `pulumi:"iothubName"`
// Specifies the name of the IotHub Shared Access Policy resource.
Name string `pulumi:"name"`
// The name of the resource group under which the IotHub Shared Access Policy resource has to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getSharedAccessPolicy.
type LookupSharedAccessPolicyResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
IothubName string `pulumi:"iothubName"`
Name string `pulumi:"name"`
// The primary connection string of the Shared Access Policy.
PrimaryConnectionString string `pulumi:"primaryConnectionString"`
// The primary key used to create the authentication token.
PrimaryKey string `pulumi:"primaryKey"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The secondary connection string of the Shared Access Policy.
SecondaryConnectionString string `pulumi:"secondaryConnectionString"`
// The secondary key used to create the authentication token.
SecondaryKey string `pulumi:"secondaryKey"`
}