AccessPolicy

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. API Version: 2020-05-15.

Example Usage

AccessPoliciesCreate

using System.Collections.Generic;
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[]
        {
            "Reader",
        },
    });

});
package main

import (
	timeseriesinsights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/timeseriesinsights"
	"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("Reader"),
			},
		})
		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=["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: ["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

new AccessPolicy(name: string, args: AccessPolicyArgs, opts?: CustomResourceOptions);
@overload
def AccessPolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 access_policy_name: Optional[str] = None,
                 description: Optional[str] = None,
                 environment_name: Optional[str] = None,
                 principal_object_id: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 roles: Optional[Sequence[Union[str, AccessPolicyRole]]] = None)
@overload
def AccessPolicy(resource_name: str,
                 args: AccessPolicyArgs,
                 opts: Optional[ResourceOptions] = 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.

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.

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

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/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/accessPolicies/ap1 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0