1. Packages
  2. Azure Classic
  3. API Docs
  4. iot
  5. TimeSeriesInsightsAccessPolicy

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

azure.iot.TimeSeriesInsightsAccessPolicy

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

    Manages an Azure IoT Time Series Insights Access Policy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleTimeSeriesInsightsStandardEnvironment = new azure.iot.TimeSeriesInsightsStandardEnvironment("example", {
        name: "example",
        location: example.location,
        resourceGroupName: example.name,
        skuName: "S1_1",
        dataRetentionTime: "P30D",
    });
    const exampleTimeSeriesInsightsAccessPolicy = new azure.iot.TimeSeriesInsightsAccessPolicy("example", {
        name: "example",
        timeSeriesInsightsEnvironmentId: exampleTimeSeriesInsightsStandardEnvironment.name,
        principalObjectId: "aGUID",
        roles: ["Reader"],
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("example",
        name="example",
        location=example.location,
        resource_group_name=example.name,
        sku_name="S1_1",
        data_retention_time="P30D")
    example_time_series_insights_access_policy = azure.iot.TimeSeriesInsightsAccessPolicy("example",
        name="example",
        time_series_insights_environment_id=example_time_series_insights_standard_environment.name,
        principal_object_id="aGUID",
        roles=["Reader"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTimeSeriesInsightsStandardEnvironment, err := iot.NewTimeSeriesInsightsStandardEnvironment(ctx, "example", &iot.TimeSeriesInsightsStandardEnvironmentArgs{
    			Name:              pulumi.String("example"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			SkuName:           pulumi.String("S1_1"),
    			DataRetentionTime: pulumi.String("P30D"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = iot.NewTimeSeriesInsightsAccessPolicy(ctx, "example", &iot.TimeSeriesInsightsAccessPolicyArgs{
    			Name:                            pulumi.String("example"),
    			TimeSeriesInsightsEnvironmentId: exampleTimeSeriesInsightsStandardEnvironment.Name,
    			PrincipalObjectId:               pulumi.String("aGUID"),
    			Roles: pulumi.StringArray{
    				pulumi.String("Reader"),
    			},
    		})
    		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.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleTimeSeriesInsightsStandardEnvironment = new Azure.Iot.TimeSeriesInsightsStandardEnvironment("example", new()
        {
            Name = "example",
            Location = example.Location,
            ResourceGroupName = example.Name,
            SkuName = "S1_1",
            DataRetentionTime = "P30D",
        });
    
        var exampleTimeSeriesInsightsAccessPolicy = new Azure.Iot.TimeSeriesInsightsAccessPolicy("example", new()
        {
            Name = "example",
            TimeSeriesInsightsEnvironmentId = exampleTimeSeriesInsightsStandardEnvironment.Name,
            PrincipalObjectId = "aGUID",
            Roles = new[]
            {
                "Reader",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.iot.TimeSeriesInsightsStandardEnvironment;
    import com.pulumi.azure.iot.TimeSeriesInsightsStandardEnvironmentArgs;
    import com.pulumi.azure.iot.TimeSeriesInsightsAccessPolicy;
    import com.pulumi.azure.iot.TimeSeriesInsightsAccessPolicyArgs;
    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 ResourceGroup("example", ResourceGroupArgs.builder()        
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleTimeSeriesInsightsStandardEnvironment = new TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", TimeSeriesInsightsStandardEnvironmentArgs.builder()        
                .name("example")
                .location(example.location())
                .resourceGroupName(example.name())
                .skuName("S1_1")
                .dataRetentionTime("P30D")
                .build());
    
            var exampleTimeSeriesInsightsAccessPolicy = new TimeSeriesInsightsAccessPolicy("exampleTimeSeriesInsightsAccessPolicy", TimeSeriesInsightsAccessPolicyArgs.builder()        
                .name("example")
                .timeSeriesInsightsEnvironmentId(exampleTimeSeriesInsightsStandardEnvironment.name())
                .principalObjectId("aGUID")
                .roles("Reader")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleTimeSeriesInsightsStandardEnvironment:
        type: azure:iot:TimeSeriesInsightsStandardEnvironment
        name: example
        properties:
          name: example
          location: ${example.location}
          resourceGroupName: ${example.name}
          skuName: S1_1
          dataRetentionTime: P30D
      exampleTimeSeriesInsightsAccessPolicy:
        type: azure:iot:TimeSeriesInsightsAccessPolicy
        name: example
        properties:
          name: example
          timeSeriesInsightsEnvironmentId: ${exampleTimeSeriesInsightsStandardEnvironment.name}
          principalObjectId: aGUID
          roles:
            - Reader
    

    Create TimeSeriesInsightsAccessPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TimeSeriesInsightsAccessPolicy(name: string, args: TimeSeriesInsightsAccessPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def TimeSeriesInsightsAccessPolicy(resource_name: str,
                                       args: TimeSeriesInsightsAccessPolicyArgs,
                                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def TimeSeriesInsightsAccessPolicy(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       principal_object_id: Optional[str] = None,
                                       roles: Optional[Sequence[str]] = None,
                                       time_series_insights_environment_id: Optional[str] = None,
                                       description: Optional[str] = None,
                                       name: Optional[str] = None)
    func NewTimeSeriesInsightsAccessPolicy(ctx *Context, name string, args TimeSeriesInsightsAccessPolicyArgs, opts ...ResourceOption) (*TimeSeriesInsightsAccessPolicy, error)
    public TimeSeriesInsightsAccessPolicy(string name, TimeSeriesInsightsAccessPolicyArgs args, CustomResourceOptions? opts = null)
    public TimeSeriesInsightsAccessPolicy(String name, TimeSeriesInsightsAccessPolicyArgs args)
    public TimeSeriesInsightsAccessPolicy(String name, TimeSeriesInsightsAccessPolicyArgs args, CustomResourceOptions options)
    
    type: azure:iot:TimeSeriesInsightsAccessPolicy
    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 TimeSeriesInsightsAccessPolicyArgs
    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 TimeSeriesInsightsAccessPolicyArgs
    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 TimeSeriesInsightsAccessPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TimeSeriesInsightsAccessPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TimeSeriesInsightsAccessPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var timeSeriesInsightsAccessPolicyResource = new Azure.Iot.TimeSeriesInsightsAccessPolicy("timeSeriesInsightsAccessPolicyResource", new()
    {
        PrincipalObjectId = "string",
        Roles = new[]
        {
            "string",
        },
        TimeSeriesInsightsEnvironmentId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := iot.NewTimeSeriesInsightsAccessPolicy(ctx, "timeSeriesInsightsAccessPolicyResource", &iot.TimeSeriesInsightsAccessPolicyArgs{
    	PrincipalObjectId: pulumi.String("string"),
    	Roles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TimeSeriesInsightsEnvironmentId: pulumi.String("string"),
    	Description:                     pulumi.String("string"),
    	Name:                            pulumi.String("string"),
    })
    
    var timeSeriesInsightsAccessPolicyResource = new TimeSeriesInsightsAccessPolicy("timeSeriesInsightsAccessPolicyResource", TimeSeriesInsightsAccessPolicyArgs.builder()        
        .principalObjectId("string")
        .roles("string")
        .timeSeriesInsightsEnvironmentId("string")
        .description("string")
        .name("string")
        .build());
    
    time_series_insights_access_policy_resource = azure.iot.TimeSeriesInsightsAccessPolicy("timeSeriesInsightsAccessPolicyResource",
        principal_object_id="string",
        roles=["string"],
        time_series_insights_environment_id="string",
        description="string",
        name="string")
    
    const timeSeriesInsightsAccessPolicyResource = new azure.iot.TimeSeriesInsightsAccessPolicy("timeSeriesInsightsAccessPolicyResource", {
        principalObjectId: "string",
        roles: ["string"],
        timeSeriesInsightsEnvironmentId: "string",
        description: "string",
        name: "string",
    });
    
    type: azure:iot:TimeSeriesInsightsAccessPolicy
    properties:
        description: string
        name: string
        principalObjectId: string
        roles:
            - string
        timeSeriesInsightsEnvironmentId: string
    

    TimeSeriesInsightsAccessPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The TimeSeriesInsightsAccessPolicy resource accepts the following input properties:

    PrincipalObjectId string
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    Roles List<string>
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    TimeSeriesInsightsEnvironmentId string
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    Description string
    The description of the Azure IoT Time Series Insights Access Policy.
    Name string
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    PrincipalObjectId string
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    Roles []string
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    TimeSeriesInsightsEnvironmentId string
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    Description string
    The description of the Azure IoT Time Series Insights Access Policy.
    Name string
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principalObjectId String
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles List<String>
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    timeSeriesInsightsEnvironmentId String
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description String
    The description of the Azure IoT Time Series Insights Access Policy.
    name String
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principalObjectId string
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles string[]
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    timeSeriesInsightsEnvironmentId string
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description string
    The description of the Azure IoT Time Series Insights Access Policy.
    name string
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principal_object_id str
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles Sequence[str]
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    time_series_insights_environment_id str
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description str
    The description of the Azure IoT Time Series Insights Access Policy.
    name str
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principalObjectId String
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles List<String>
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    timeSeriesInsightsEnvironmentId String
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description String
    The description of the Azure IoT Time Series Insights Access Policy.
    name String
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TimeSeriesInsightsAccessPolicy 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 TimeSeriesInsightsAccessPolicy Resource

    Get an existing TimeSeriesInsightsAccessPolicy 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?: TimeSeriesInsightsAccessPolicyState, opts?: CustomResourceOptions): TimeSeriesInsightsAccessPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            principal_object_id: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            time_series_insights_environment_id: Optional[str] = None) -> TimeSeriesInsightsAccessPolicy
    func GetTimeSeriesInsightsAccessPolicy(ctx *Context, name string, id IDInput, state *TimeSeriesInsightsAccessPolicyState, opts ...ResourceOption) (*TimeSeriesInsightsAccessPolicy, error)
    public static TimeSeriesInsightsAccessPolicy Get(string name, Input<string> id, TimeSeriesInsightsAccessPolicyState? state, CustomResourceOptions? opts = null)
    public static TimeSeriesInsightsAccessPolicy get(String name, Output<String> id, TimeSeriesInsightsAccessPolicyState 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.
    The following state arguments are supported:
    Description string
    The description of the Azure IoT Time Series Insights Access Policy.
    Name string
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    PrincipalObjectId string
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    Roles List<string>
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    TimeSeriesInsightsEnvironmentId string
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    Description string
    The description of the Azure IoT Time Series Insights Access Policy.
    Name string
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    PrincipalObjectId string
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    Roles []string
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    TimeSeriesInsightsEnvironmentId string
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description String
    The description of the Azure IoT Time Series Insights Access Policy.
    name String
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principalObjectId String
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles List<String>
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    timeSeriesInsightsEnvironmentId String
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description string
    The description of the Azure IoT Time Series Insights Access Policy.
    name string
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principalObjectId string
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles string[]
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    timeSeriesInsightsEnvironmentId string
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description str
    The description of the Azure IoT Time Series Insights Access Policy.
    name str
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principal_object_id str
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles Sequence[str]
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    time_series_insights_environment_id str
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.
    description String
    The description of the Azure IoT Time Series Insights Access Policy.
    name String
    Specifies the name of the Azure IoT Time Series Insights Access Policy. Changing this forces a new resource to be created. Must be globally unique.
    principalObjectId String
    The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
    roles List<String>
    A list of roles to apply to the Access Policy. Valid values include Contributor and Reader.
    timeSeriesInsightsEnvironmentId String
    The resource ID of the Azure IoT Time Series Insights Environment in which to create the Azure IoT Time Series Insights Reference Data Set. Changing this forces a new resource to be created.

    Import

    Azure IoT Time Series Insights Access Policy can be imported using the resource id, e.g.

    $ pulumi import azure:iot/timeSeriesInsightsAccessPolicy:TimeSeriesInsightsAccessPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.TimeSeriesInsights/environments/environment1/accessPolicies/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.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi