com.pulumi.azure.iot.kotlin.TimeSeriesInsightsAccessPolicy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.iot.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [TimeSeriesInsightsAccessPolicy].
*/
@PulumiTagMarker
public class TimeSeriesInsightsAccessPolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: TimeSeriesInsightsAccessPolicyArgs = TimeSeriesInsightsAccessPolicyArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend TimeSeriesInsightsAccessPolicyArgsBuilder.() -> Unit) {
val builder = TimeSeriesInsightsAccessPolicyArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): TimeSeriesInsightsAccessPolicy {
val builtJavaResource =
com.pulumi.azure.iot.TimeSeriesInsightsAccessPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return TimeSeriesInsightsAccessPolicy(builtJavaResource)
}
}
/**
* Manages an Azure IoT Time Series Insights Access Policy.
* ## Example Usage
*
* ```typescript
* 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"],
* });
* ```
* ```python
* 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"])
* ```
* ```csharp
* 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",
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## Import
* Azure IoT Time Series Insights Access Policy can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:iot/timeSeriesInsightsAccessPolicy:TimeSeriesInsightsAccessPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.TimeSeriesInsights/environments/environment1/accessPolicies/example
* ```
*/
public class TimeSeriesInsightsAccessPolicy internal constructor(
override val javaResource: com.pulumi.azure.iot.TimeSeriesInsightsAccessPolicy,
) : KotlinCustomResource(javaResource, TimeSeriesInsightsAccessPolicyMapper) {
/**
* The description of the Azure IoT Time Series Insights Access Policy.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* 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.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The id of the principal in Azure Active Directory. Changing this forces a new resource to be created.
*/
public val principalObjectId: Output
get() = javaResource.principalObjectId().applyValue({ args0 -> args0 })
/**
* A list of roles to apply to the Access Policy. Valid values include `Contributor` and `Reader`.
*/
public val roles: Output>
get() = javaResource.roles().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* 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.
*/
public val timeSeriesInsightsEnvironmentId: Output
get() = javaResource.timeSeriesInsightsEnvironmentId().applyValue({ args0 -> args0 })
}
public object TimeSeriesInsightsAccessPolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.iot.TimeSeriesInsightsAccessPolicy::class == javaResource::class
override fun map(javaResource: Resource): TimeSeriesInsightsAccessPolicy =
TimeSeriesInsightsAccessPolicy(
javaResource as
com.pulumi.azure.iot.TimeSeriesInsightsAccessPolicy,
)
}
/**
* @see [TimeSeriesInsightsAccessPolicy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [TimeSeriesInsightsAccessPolicy].
*/
public suspend fun timeSeriesInsightsAccessPolicy(
name: String,
block: suspend TimeSeriesInsightsAccessPolicyResourceBuilder.() -> Unit,
):
TimeSeriesInsightsAccessPolicy {
val builder = TimeSeriesInsightsAccessPolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [TimeSeriesInsightsAccessPolicy].
* @param name The _unique_ name of the resulting resource.
*/
public fun timeSeriesInsightsAccessPolicy(name: String): TimeSeriesInsightsAccessPolicy {
val builder = TimeSeriesInsightsAccessPolicyResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy