All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.cache.kotlin.AccessPolicyArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.cache.kotlin

import com.pulumi.azurenative.cache.AccessPolicyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Response to get/put access policy.
 * Azure REST API version: 2023-05-01-preview.
 * Other available API versions: 2023-08-01, 2024-03-01, 2024-04-01-preview.
 * ## Example Usage
 * ### RedisCacheAccessPolicyCreateUpdate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var accessPolicy = new AzureNative.Cache.AccessPolicy("accessPolicy", new()
 *     {
 *         AccessPolicyName = "accessPolicy1",
 *         CacheName = "cache1",
 *         Permissions = "+get +hget",
 *         ResourceGroupName = "rg1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	cache "github.com/pulumi/pulumi-azure-native-sdk/cache/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cache.NewAccessPolicy(ctx, "accessPolicy", &cache.AccessPolicyArgs{
 * 			AccessPolicyName:  pulumi.String("accessPolicy1"),
 * 			CacheName:         pulumi.String("cache1"),
 * 			Permissions:       pulumi.String("+get +hget"),
 * 			ResourceGroupName: pulumi.String("rg1"),
 * 		})
 * 		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.azurenative.cache.AccessPolicy;
 * import com.pulumi.azurenative.cache.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("accessPolicy1")
 *             .cacheName("cache1")
 *             .permissions("+get +hget")
 *             .resourceGroupName("rg1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:cache:AccessPolicy accessPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}
 * ```
 * @property accessPolicyName The name of the access policy that is being added to the Redis cache.
 * @property cacheName The name of the Redis cache.
 * @property permissions Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 */
public data class AccessPolicyArgs(
    public val accessPolicyName: Output? = null,
    public val cacheName: Output? = null,
    public val permissions: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.cache.AccessPolicyArgs =
        com.pulumi.azurenative.cache.AccessPolicyArgs.builder()
            .accessPolicyName(accessPolicyName?.applyValue({ args0 -> args0 }))
            .cacheName(cacheName?.applyValue({ args0 -> args0 }))
            .permissions(permissions?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AccessPolicyArgs].
 */
@PulumiTagMarker
public class AccessPolicyArgsBuilder internal constructor() {
    private var accessPolicyName: Output? = null

    private var cacheName: Output? = null

    private var permissions: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The name of the access policy that is being added to the Redis cache.
     */
    @JvmName("lkogfgssafvywmob")
    public suspend fun accessPolicyName(`value`: Output) {
        this.accessPolicyName = value
    }

    /**
     * @param value The name of the Redis cache.
     */
    @JvmName("sjxdqxegcmtpdkhi")
    public suspend fun cacheName(`value`: Output) {
        this.cacheName = value
    }

    /**
     * @param value Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
     */
    @JvmName("gogbpduobxaotlej")
    public suspend fun permissions(`value`: Output) {
        this.permissions = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("rnkfxuxkffyltess")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the access policy that is being added to the Redis cache.
     */
    @JvmName("jaupyrqtvxkgwswy")
    public suspend fun accessPolicyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accessPolicyName = mapped
    }

    /**
     * @param value The name of the Redis cache.
     */
    @JvmName("dgcdlkjfnhketjrs")
    public suspend fun cacheName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cacheName = mapped
    }

    /**
     * @param value Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
     */
    @JvmName("mgwkylyinfjotnsp")
    public suspend fun permissions(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.permissions = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("oqolcstsriucckhd")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    internal fun build(): AccessPolicyArgs = AccessPolicyArgs(
        accessPolicyName = accessPolicyName,
        cacheName = cacheName,
        permissions = permissions,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy