GetSharedAccessPolicy

Use this data source to access information about an existing IotHub Shared Access Policy

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.Iot.GetSharedAccessPolicy.InvokeAsync(new Azure.Iot.GetSharedAccessPolicyArgs
        {
            Name = "example",
            ResourceGroupName = azurerm_resource_group.Example.Name,
            IothubName = azurerm_iothub.Example.Name,
        }));
    }

}
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
    })
}
import pulumi
import pulumi_azure as azure

example = azure.iot.get_shared_access_policy(name="example",
    resource_group_name=azurerm_resource_group["example"]["name"],
    iothub_name=azurerm_iothub["example"]["name"])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.iot.getSharedAccessPolicy({
    name: "example",
    resourceGroupName: azurerm_resource_group.example.name,
    iothubName: azurerm_iothub.example.name,
});

Using GetSharedAccessPolicy

function getSharedAccessPolicy(args: GetSharedAccessPolicyArgs, opts?: InvokeOptions): Promise<GetSharedAccessPolicyResult>
function  get_shared_access_policy(iothub_name=None, name=None, resource_group_name=None, opts=None)
func LookupSharedAccessPolicy(ctx *Context, args *LookupSharedAccessPolicyArgs, opts ...InvokeOption) (*LookupSharedAccessPolicyResult, error)

Note: This function is named LookupSharedAccessPolicy in the Go SDK.

public static class GetSharedAccessPolicy {
    public static Task<GetSharedAccessPolicyResult> InvokeAsync(GetSharedAccessPolicyArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

IothubName string

The name of the IoTHub to which this Shared Access Policy belongs.

Name string

Specifies the name of the IotHub Shared Access Policy resource.

ResourceGroupName string

The name of the resource group under which the IotHub Shared Access Policy resource has to be created.

IothubName string

The name of the IoTHub to which this Shared Access Policy belongs.

Name string

Specifies the name of the IotHub Shared Access Policy resource.

ResourceGroupName string

The name of the resource group under which the IotHub Shared Access Policy resource has to be created.

iothubName string

The name of the IoTHub to which this Shared Access Policy belongs.

name string

Specifies the name of the IotHub Shared Access Policy resource.

resourceGroupName string

The name of the resource group under which the IotHub Shared Access Policy resource has to be created.

iothub_name str

The name of the IoTHub to which this Shared Access Policy belongs.

name str

Specifies the name of the IotHub Shared Access Policy resource.

resource_group_name str

The name of the resource group under which the IotHub Shared Access Policy resource has to be created.

GetSharedAccessPolicy Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

IothubName string
Name string
PrimaryConnectionString string

The primary connection string of the Shared Access Policy.

PrimaryKey string

The primary key used to create the authentication token.

ResourceGroupName string
SecondaryConnectionString string

The secondary connection string of the Shared Access Policy.

SecondaryKey string

The secondary key used to create the authentication token.

Id string

The provider-assigned unique ID for this managed resource.

IothubName string
Name string
PrimaryConnectionString string

The primary connection string of the Shared Access Policy.

PrimaryKey string

The primary key used to create the authentication token.

ResourceGroupName string
SecondaryConnectionString string

The secondary connection string of the Shared Access Policy.

SecondaryKey string

The secondary key used to create the authentication token.

id string

The provider-assigned unique ID for this managed resource.

iothubName string
name string
primaryConnectionString string

The primary connection string of the Shared Access Policy.

primaryKey string

The primary key used to create the authentication token.

resourceGroupName string
secondaryConnectionString string

The secondary connection string of the Shared Access Policy.

secondaryKey string

The secondary key used to create the authentication token.

id str

The provider-assigned unique ID for this managed resource.

iothub_name str
name str
primary_connection_string str

The primary connection string of the Shared Access Policy.

primary_key str

The primary key used to create the authentication token.

resource_group_name str
secondary_connection_string str

The secondary connection string of the Shared Access Policy.

secondary_key str

The secondary key used to create the authentication token.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.