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

com.pulumi.aws.opsworks.kotlin.PermissionArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.opsworks.kotlin

import com.pulumi.aws.opsworks.PermissionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Provides an OpsWorks permission resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const myStackPermission = new aws.opsworks.Permission("my_stack_permission", {
 *     allowSsh: true,
 *     allowSudo: true,
 *     level: "iam_only",
 *     userArn: user.arn,
 *     stackId: stack.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * my_stack_permission = aws.opsworks.Permission("my_stack_permission",
 *     allow_ssh=True,
 *     allow_sudo=True,
 *     level="iam_only",
 *     user_arn=user["arn"],
 *     stack_id=stack["id"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var myStackPermission = new Aws.OpsWorks.Permission("my_stack_permission", new()
 *     {
 *         AllowSsh = true,
 *         AllowSudo = true,
 *         Level = "iam_only",
 *         UserArn = user.Arn,
 *         StackId = stack.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opsworks"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := opsworks.NewPermission(ctx, "my_stack_permission", &opsworks.PermissionArgs{
 * 			AllowSsh:  pulumi.Bool(true),
 * 			AllowSudo: pulumi.Bool(true),
 * 			Level:     pulumi.String("iam_only"),
 * 			UserArn:   pulumi.Any(user.Arn),
 * 			StackId:   pulumi.Any(stack.Id),
 * 		})
 * 		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.aws.opsworks.Permission;
 * import com.pulumi.aws.opsworks.PermissionArgs;
 * 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 myStackPermission = new Permission("myStackPermission", PermissionArgs.builder()
 *             .allowSsh(true)
 *             .allowSudo(true)
 *             .level("iam_only")
 *             .userArn(user.arn())
 *             .stackId(stack.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   myStackPermission:
 *     type: aws:opsworks:Permission
 *     name: my_stack_permission
 *     properties:
 *       allowSsh: true
 *       allowSudo: true
 *       level: iam_only
 *       userArn: ${user.arn}
 *       stackId: ${stack.id}
 * ```
 * 
 * @property allowSsh Whether the user is allowed to use SSH to communicate with the instance
 * @property allowSudo Whether the user is allowed to use sudo to elevate privileges
 * @property level The users permission level. Mus be one of `deny`, `show`, `deploy`, `manage`, `iam_only`
 * @property stackId The stack to set the permissions for
 * @property userArn The user's IAM ARN to set permissions for
 */
public data class PermissionArgs(
    public val allowSsh: Output? = null,
    public val allowSudo: Output? = null,
    public val level: Output? = null,
    public val stackId: Output? = null,
    public val userArn: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.opsworks.PermissionArgs =
        com.pulumi.aws.opsworks.PermissionArgs.builder()
            .allowSsh(allowSsh?.applyValue({ args0 -> args0 }))
            .allowSudo(allowSudo?.applyValue({ args0 -> args0 }))
            .level(level?.applyValue({ args0 -> args0 }))
            .stackId(stackId?.applyValue({ args0 -> args0 }))
            .userArn(userArn?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [PermissionArgs].
 */
@PulumiTagMarker
public class PermissionArgsBuilder internal constructor() {
    private var allowSsh: Output? = null

    private var allowSudo: Output? = null

    private var level: Output? = null

    private var stackId: Output? = null

    private var userArn: Output? = null

    /**
     * @param value Whether the user is allowed to use SSH to communicate with the instance
     */
    @JvmName("qqjnissgausmhapa")
    public suspend fun allowSsh(`value`: Output) {
        this.allowSsh = value
    }

    /**
     * @param value Whether the user is allowed to use sudo to elevate privileges
     */
    @JvmName("uhdxpoambqbvfgmq")
    public suspend fun allowSudo(`value`: Output) {
        this.allowSudo = value
    }

    /**
     * @param value The users permission level. Mus be one of `deny`, `show`, `deploy`, `manage`, `iam_only`
     */
    @JvmName("borqfrglpoyxnwjb")
    public suspend fun level(`value`: Output) {
        this.level = value
    }

    /**
     * @param value The stack to set the permissions for
     */
    @JvmName("hisvwhgbpivoiouy")
    public suspend fun stackId(`value`: Output) {
        this.stackId = value
    }

    /**
     * @param value The user's IAM ARN to set permissions for
     */
    @JvmName("ibpinygkybejmwqd")
    public suspend fun userArn(`value`: Output) {
        this.userArn = value
    }

    /**
     * @param value Whether the user is allowed to use SSH to communicate with the instance
     */
    @JvmName("hqbsyxjpcxyqkrtv")
    public suspend fun allowSsh(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowSsh = mapped
    }

    /**
     * @param value Whether the user is allowed to use sudo to elevate privileges
     */
    @JvmName("aqnloawljvbppdhn")
    public suspend fun allowSudo(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowSudo = mapped
    }

    /**
     * @param value The users permission level. Mus be one of `deny`, `show`, `deploy`, `manage`, `iam_only`
     */
    @JvmName("fxlxsdlgqkmuvshf")
    public suspend fun level(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.level = mapped
    }

    /**
     * @param value The stack to set the permissions for
     */
    @JvmName("vyapaggdsducboui")
    public suspend fun stackId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stackId = mapped
    }

    /**
     * @param value The user's IAM ARN to set permissions for
     */
    @JvmName("fbypugxuxucnhock")
    public suspend fun userArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userArn = mapped
    }

    internal fun build(): PermissionArgs = PermissionArgs(
        allowSsh = allowSsh,
        allowSudo = allowSudo,
        level = level,
        stackId = stackId,
        userArn = userArn,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy