1. Packages
  2. Azure Native
  3. API Docs
  4. timeseriesinsights
  5. AccessPolicy
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

azure-native.timeseriesinsights.AccessPolicy

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

    An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs. Azure REST API version: 2020-05-15. Prior API version in Azure Native 1.x: 2020-05-15.

    Other available API versions: 2017-11-15, 2021-06-30-preview.

    Example Usage

    AccessPoliciesCreate

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var accessPolicy = new AzureNative.TimeSeriesInsights.AccessPolicy("accessPolicy", new()
        {
            AccessPolicyName = "ap1",
            Description = "some description",
            EnvironmentName = "env1",
            PrincipalObjectId = "aGuid",
            ResourceGroupName = "rg1",
            Roles = new[]
            {
                AzureNative.TimeSeriesInsights.AccessPolicyRole.Reader,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/timeseriesinsights/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := timeseriesinsights.NewAccessPolicy(ctx, "accessPolicy", &timeseriesinsights.AccessPolicyArgs{
    			AccessPolicyName:  pulumi.String("ap1"),
    			Description:       pulumi.String("some description"),
    			EnvironmentName:   pulumi.String("env1"),
    			PrincipalObjectId: pulumi.String("aGuid"),
    			ResourceGroupName: pulumi.String("rg1"),
    			Roles: pulumi.StringArray{
    				pulumi.String(timeseriesinsights.AccessPolicyRoleReader),
    			},
    		})
    		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.timeseriesinsights.AccessPolicy;
    import com.pulumi.azurenative.timeseriesinsights.AccessPolicyArgs;
    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 accessPolicy = new AccessPolicy("accessPolicy", AccessPolicyArgs.builder()        
                .accessPolicyName("ap1")
                .description("some description")
                .environmentName("env1")
                .principalObjectId("aGuid")
                .resourceGroupName("rg1")
                .roles("Reader")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    access_policy = azure_native.timeseriesinsights.AccessPolicy("accessPolicy",
        access_policy_name="ap1",
        description="some description",
        environment_name="env1",
        principal_object_id="aGuid",
        resource_group_name="rg1",
        roles=[azure_native.timeseriesinsights.AccessPolicyRole.READER])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const accessPolicy = new azure_native.timeseriesinsights.AccessPolicy("accessPolicy", {
        accessPolicyName: "ap1",
        description: "some description",
        environmentName: "env1",
        principalObjectId: "aGuid",
        resourceGroupName: "rg1",
        roles: [azure_native.timeseriesinsights.AccessPolicyRole.Reader],
    });
    
    resources:
      accessPolicy:
        type: azure-native:timeseriesinsights:AccessPolicy
        properties:
          accessPolicyName: ap1
          description: some description
          environmentName: env1
          principalObjectId: aGuid
          resourceGroupName: rg1
          roles:
            - Reader
    

    Create AccessPolicy Resource

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

    Constructor syntax

    new AccessPolicy(name: string, args: AccessPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def AccessPolicy(resource_name: str,
                     args: AccessPolicyArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccessPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     environment_name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     access_policy_name: Optional[str] = None,
                     description: Optional[str] = None,
                     principal_object_id: Optional[str] = None,
                     roles: Optional[Sequence[Union[str, AccessPolicyRole]]] = None)
    func NewAccessPolicy(ctx *Context, name string, args AccessPolicyArgs, opts ...ResourceOption) (*AccessPolicy, error)
    public AccessPolicy(string name, AccessPolicyArgs args, CustomResourceOptions? opts = null)
    public AccessPolicy(String name, AccessPolicyArgs args)
    public AccessPolicy(String name, AccessPolicyArgs args, CustomResourceOptions options)
    
    type: azure-native:timeseriesinsights:AccessPolicy
    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 AccessPolicyArgs
    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 AccessPolicyArgs
    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 AccessPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccessPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccessPolicyArgs
    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 exampleaccessPolicyResourceResourceFromTimeseriesinsights = new AzureNative.TimeSeriesInsights.AccessPolicy("exampleaccessPolicyResourceResourceFromTimeseriesinsights", new()
    {
        EnvironmentName = "string",
        ResourceGroupName = "string",
        AccessPolicyName = "string",
        Description = "string",
        PrincipalObjectId = "string",
        Roles = new[]
        {
            "string",
        },
    });
    
    example, err := timeseriesinsights.NewAccessPolicy(ctx, "exampleaccessPolicyResourceResourceFromTimeseriesinsights", &timeseriesinsights.AccessPolicyArgs{
    EnvironmentName: pulumi.String("string"),
    ResourceGroupName: pulumi.String("string"),
    AccessPolicyName: pulumi.String("string"),
    Description: pulumi.String("string"),
    PrincipalObjectId: pulumi.String("string"),
    Roles: pulumi.StringArray{
    pulumi.String("string"),
    },
    })
    
    var exampleaccessPolicyResourceResourceFromTimeseriesinsights = new AccessPolicy("exampleaccessPolicyResourceResourceFromTimeseriesinsights", AccessPolicyArgs.builder()        
        .environmentName("string")
        .resourceGroupName("string")
        .accessPolicyName("string")
        .description("string")
        .principalObjectId("string")
        .roles("string")
        .build());
    
    exampleaccess_policy_resource_resource_from_timeseriesinsights = azure_native.timeseriesinsights.AccessPolicy("exampleaccessPolicyResourceResourceFromTimeseriesinsights",
        environment_name="string",
        resource_group_name="string",
        access_policy_name="string",
        description="string",
        principal_object_id="string",
        roles=["string"])
    
    const exampleaccessPolicyResourceResourceFromTimeseriesinsights = new azure_native.timeseriesinsights.AccessPolicy("exampleaccessPolicyResourceResourceFromTimeseriesinsights", {
        environmentName: "string",
        resourceGroupName: "string",
        accessPolicyName: "string",
        description: "string",
        principalObjectId: "string",
        roles: ["string"],
    });
    
    type: azure-native:timeseriesinsights:AccessPolicy
    properties:
        accessPolicyName: string
        description: string
        environmentName: string
        principalObjectId: string
        resourceGroupName: string
        roles:
            - string
    

    AccessPolicy 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 AccessPolicy resource accepts the following input properties:

    EnvironmentName string
    The name of the Time Series Insights environment associated with the specified resource group.
    ResourceGroupName string
    Name of an Azure Resource group.
    AccessPolicyName string
    Name of the access policy.
    Description string
    An description of the access policy.
    PrincipalObjectId string
    The objectId of the principal in Azure Active Directory.
    Roles List<Union<string, Pulumi.AzureNative.TimeSeriesInsights.AccessPolicyRole>>
    The list of roles the principal is assigned on the environment.
    EnvironmentName string
    The name of the Time Series Insights environment associated with the specified resource group.
    ResourceGroupName string
    Name of an Azure Resource group.
    AccessPolicyName string
    Name of the access policy.
    Description string
    An description of the access policy.
    PrincipalObjectId string
    The objectId of the principal in Azure Active Directory.
    Roles []string
    The list of roles the principal is assigned on the environment.
    environmentName String
    The name of the Time Series Insights environment associated with the specified resource group.
    resourceGroupName String
    Name of an Azure Resource group.
    accessPolicyName String
    Name of the access policy.
    description String
    An description of the access policy.
    principalObjectId String
    The objectId of the principal in Azure Active Directory.
    roles List<Either<String,AccessPolicyRole>>
    The list of roles the principal is assigned on the environment.
    environmentName string
    The name of the Time Series Insights environment associated with the specified resource group.
    resourceGroupName string
    Name of an Azure Resource group.
    accessPolicyName string
    Name of the access policy.
    description string
    An description of the access policy.
    principalObjectId string
    The objectId of the principal in Azure Active Directory.
    roles (string | AccessPolicyRole)[]
    The list of roles the principal is assigned on the environment.
    environment_name str
    The name of the Time Series Insights environment associated with the specified resource group.
    resource_group_name str
    Name of an Azure Resource group.
    access_policy_name str
    Name of the access policy.
    description str
    An description of the access policy.
    principal_object_id str
    The objectId of the principal in Azure Active Directory.
    roles Sequence[Union[str, AccessPolicyRole]]
    The list of roles the principal is assigned on the environment.
    environmentName String
    The name of the Time Series Insights environment associated with the specified resource group.
    resourceGroupName String
    Name of an Azure Resource group.
    accessPolicyName String
    Name of the access policy.
    description String
    An description of the access policy.
    principalObjectId String
    The objectId of the principal in Azure Active Directory.
    roles List<String | "Reader" | "Contributor">
    The list of roles the principal is assigned on the environment.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AccessPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Resource name
    Type string
    Resource type
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Resource name
    Type string
    Resource type
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Resource name
    type String
    Resource type
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Resource name
    type string
    Resource type
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Resource name
    type str
    Resource type
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Resource name
    type String
    Resource type

    Supporting Types

    AccessPolicyRole, AccessPolicyRoleArgs

    Reader
    Reader
    Contributor
    Contributor
    AccessPolicyRoleReader
    Reader
    AccessPolicyRoleContributor
    Contributor
    Reader
    Reader
    Contributor
    Contributor
    Reader
    Reader
    Contributor
    Contributor
    READER
    Reader
    CONTRIBUTOR
    Contributor
    "Reader"
    Reader
    "Contributor"
    Contributor

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:timeseriesinsights:AccessPolicy ap1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi