azure-native.timeseriesinsights.AccessPolicy
Explore with Pulumi AI
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 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[]
{
"Reader",
},
});
});
package main
import (
timeseriesinsights "github.com/pulumi/pulumi-azure-native-sdk/timeseriesinsights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := timeseriesinsights.NewAccessPolicy(ctx, "accessPolicy", ×eriesinsights.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
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.
Constructor example
The following reference example uses placeholder values for all input properties.
var accessPolicyResource = new AzureNative.Timeseriesinsights.AccessPolicy("accessPolicyResource", new()
{
EnvironmentName = "string",
ResourceGroupName = "string",
AccessPolicyName = "string",
Description = "string",
PrincipalObjectId = "string",
Roles = new[]
{
"string",
},
});
example, err := timeseriesinsights.NewAccessPolicy(ctx, "accessPolicyResource", ×eriesinsights.AccessPolicyArgs{
EnvironmentName: "string",
ResourceGroupName: "string",
AccessPolicyName: "string",
Description: "string",
PrincipalObjectId: "string",
Roles: []string{
"string",
},
})
var accessPolicyResource = new AccessPolicy("accessPolicyResource", AccessPolicyArgs.builder()
.environmentName("string")
.resourceGroupName("string")
.accessPolicyName("string")
.description("string")
.principalObjectId("string")
.roles("string")
.build());
access_policy_resource = azure_native.timeseriesinsights.AccessPolicy("accessPolicyResource",
environment_name=string,
resource_group_name=string,
access_policy_name=string,
description=string,
principal_object_id=string,
roles=[string])
const accessPolicyResource = new azure_native.timeseriesinsights.AccessPolicy("accessPolicyResource", {
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:
- Environment
Name string - The name of the Time Series Insights environment associated with the specified resource group.
- Resource
Group stringName - Name of an Azure Resource group.
- Access
Policy stringName - Name of the access policy.
- Description string
- An description of the access policy.
- Principal
Object stringId - The objectId of the principal in Azure Active Directory.
- Roles
List<Union<string, Pulumi.
Azure Native. Time Series Insights. Access Policy Role>> - The list of roles the principal is assigned on the environment.
- Environment
Name string - The name of the Time Series Insights environment associated with the specified resource group.
- Resource
Group stringName - Name of an Azure Resource group.
- Access
Policy stringName - Name of the access policy.
- Description string
- An description of the access policy.
- Principal
Object stringId - The objectId of the principal in Azure Active Directory.
- Roles []string
- The list of roles the principal is assigned on the environment.
- environment
Name String - The name of the Time Series Insights environment associated with the specified resource group.
- resource
Group StringName - Name of an Azure Resource group.
- access
Policy StringName - Name of the access policy.
- description String
- An description of the access policy.
- principal
Object StringId - The objectId of the principal in Azure Active Directory.
- roles
List<Either<String,Access
Policy Role>> - The list of roles the principal is assigned on the environment.
- environment
Name string - The name of the Time Series Insights environment associated with the specified resource group.
- resource
Group stringName - Name of an Azure Resource group.
- access
Policy stringName - Name of the access policy.
- description string
- An description of the access policy.
- principal
Object stringId - The objectId of the principal in Azure Active Directory.
- roles
(string | Access
Policy Role)[] - 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_ strname - Name of an Azure Resource group.
- access_
policy_ strname - Name of the access policy.
- description str
- An description of the access policy.
- principal_
object_ strid - The objectId of the principal in Azure Active Directory.
- roles
Sequence[Union[str, Access
Policy Role]] - The list of roles the principal is assigned on the environment.
- environment
Name String - The name of the Time Series Insights environment associated with the specified resource group.
- resource
Group StringName - Name of an Azure Resource group.
- access
Policy StringName - Name of the access policy.
- description String
- An description of the access policy.
- principal
Object StringId - 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:
Supporting Types
AccessPolicyRole, AccessPolicyRoleArgs
- Reader
- Reader
- Contributor
- Contributor
- Access
Policy Role Reader - Reader
- Access
Policy Role Contributor - 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0