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. 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 (
timeseriesinsights "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", ×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(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.
Constructor 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", ×eriesinsights.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:
- 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/{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