LocalUser

class LocalUser : KotlinCustomResource

The local user associated with the storage accounts. Uses Azure REST API version 2024-01-01. In version 2.x of the Azure Native provider, it used API version 2022-09-01. Other available API versions: 2022-09-01, 2023-01-01, 2023-04-01, 2023-05-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native storage [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

CreateLocalUser

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var localUser = new AzureNative.Storage.LocalUser("localUser", new()
{
AccountName = "sto2527",
AllowAclAuthorization = true,
GroupId = 2000,
HasSshPassword = true,
HomeDirectory = "homedirectory",
PermissionScopes = new[]
{
new AzureNative.Storage.Inputs.PermissionScopeArgs
{
Permissions = "rwd",
ResourceName = "share1",
Service = "file",
},
new AzureNative.Storage.Inputs.PermissionScopeArgs
{
Permissions = "rw",
ResourceName = "share2",
Service = "file",
},
},
ResourceGroupName = "res6977",
SshAuthorizedKeys = new[]
{
new AzureNative.Storage.Inputs.SshPublicKeyArgs
{
Description = "key name",
Key = "ssh-rsa keykeykeykeykey=",
},
},
Username = "user1",
});
});
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewLocalUser(ctx, "localUser", &storage.LocalUserArgs{
AccountName: pulumi.String("sto2527"),
AllowAclAuthorization: pulumi.Bool(true),
GroupId: pulumi.Int(2000),
HasSshPassword: pulumi.Bool(true),
HomeDirectory: pulumi.String("homedirectory"),
PermissionScopes: storage.PermissionScopeArray{
&storage.PermissionScopeArgs{
Permissions: pulumi.String("rwd"),
ResourceName: pulumi.String("share1"),
Service: pulumi.String("file"),
},
&storage.PermissionScopeArgs{
Permissions: pulumi.String("rw"),
ResourceName: pulumi.String("share2"),
Service: pulumi.String("file"),
},
},
ResourceGroupName: pulumi.String("res6977"),
SshAuthorizedKeys: storage.SshPublicKeyArray{
&storage.SshPublicKeyArgs{
Description: pulumi.String("key name"),
Key: pulumi.String("ssh-rsa keykeykeykeykey="),
},
},
Username: pulumi.String("user1"),
})
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.storage.LocalUser;
import com.pulumi.azurenative.storage.LocalUserArgs;
import com.pulumi.azurenative.storage.inputs.PermissionScopeArgs;
import com.pulumi.azurenative.storage.inputs.SshPublicKeyArgs;
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 localUser = new LocalUser("localUser", LocalUserArgs.builder()
.accountName("sto2527")
.allowAclAuthorization(true)
.groupId(2000)
.hasSshPassword(true)
.homeDirectory("homedirectory")
.permissionScopes(
PermissionScopeArgs.builder()
.permissions("rwd")
.resourceName("share1")
.service("file")
.build(),
PermissionScopeArgs.builder()
.permissions("rw")
.resourceName("share2")
.service("file")
.build())
.resourceGroupName("res6977")
.sshAuthorizedKeys(SshPublicKeyArgs.builder()
.description("key name")
.key("ssh-rsa keykeykeykeykey=")
.build())
.username("user1")
.build());
}
}

CreateNFSv3EnabledLocalUser

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var localUser = new AzureNative.Storage.LocalUser("localUser", new()
{
AccountName = "sto2527",
ExtendedGroups = new[]
{
1001,
1005,
2005,
},
IsNFSv3Enabled = true,
ResourceGroupName = "res6977",
Username = "user1",
});
});
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewLocalUser(ctx, "localUser", &storage.LocalUserArgs{
AccountName: pulumi.String("sto2527"),
ExtendedGroups: pulumi.IntArray{
pulumi.Int(1001),
pulumi.Int(1005),
pulumi.Int(2005),
},
IsNFSv3Enabled: pulumi.Bool(true),
ResourceGroupName: pulumi.String("res6977"),
Username: pulumi.String("user1"),
})
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.storage.LocalUser;
import com.pulumi.azurenative.storage.LocalUserArgs;
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 localUser = new LocalUser("localUser", LocalUserArgs.builder()
.accountName("sto2527")
.extendedGroups(
1001,
1005,
2005)
.isNFSv3Enabled(true)
.resourceGroupName("res6977")
.username("user1")
.build());
}
}

UpdateLocalUser

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var localUser = new AzureNative.Storage.LocalUser("localUser", new()
{
AccountName = "sto2527",
AllowAclAuthorization = false,
ExtendedGroups = new[]
{
1001,
1005,
2005,
},
GroupId = 3000,
HasSharedKey = false,
HasSshKey = false,
HasSshPassword = false,
HomeDirectory = "homedirectory2",
IsNFSv3Enabled = true,
ResourceGroupName = "res6977",
Username = "user1",
});
});
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewLocalUser(ctx, "localUser", &storage.LocalUserArgs{
AccountName: pulumi.String("sto2527"),
AllowAclAuthorization: pulumi.Bool(false),
ExtendedGroups: pulumi.IntArray{
pulumi.Int(1001),
pulumi.Int(1005),
pulumi.Int(2005),
},
GroupId: pulumi.Int(3000),
HasSharedKey: pulumi.Bool(false),
HasSshKey: pulumi.Bool(false),
HasSshPassword: pulumi.Bool(false),
HomeDirectory: pulumi.String("homedirectory2"),
IsNFSv3Enabled: pulumi.Bool(true),
ResourceGroupName: pulumi.String("res6977"),
Username: pulumi.String("user1"),
})
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.storage.LocalUser;
import com.pulumi.azurenative.storage.LocalUserArgs;
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 localUser = new LocalUser("localUser", LocalUserArgs.builder()
.accountName("sto2527")
.allowAclAuthorization(false)
.extendedGroups(
1001,
1005,
2005)
.groupId(3000)
.hasSharedKey(false)
.hasSshKey(false)
.hasSshPassword(false)
.homeDirectory("homedirectory2")
.isNFSv3Enabled(true)
.resourceGroupName("res6977")
.username("user1")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:storage:LocalUser user1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}

Properties

Link copied to clipboard

Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val extendedGroups: Output<List<Int>>?

Supplementary group membership. Only applicable for local users enabled for NFSv3 access.

Link copied to clipboard
val groupId: Output<Int>?

An identifier for associating a group of users.

Link copied to clipboard
val hasSharedKey: Output<Boolean>?

Indicates whether shared key exists. Set it to false to remove existing shared key.

Link copied to clipboard
val hasSshKey: Output<Boolean>?

Indicates whether ssh key exists. Set it to false to remove existing SSH key.

Link copied to clipboard
val hasSshPassword: Output<Boolean>?

Indicates whether ssh password exists. Set it to false to remove existing SSH password.

Link copied to clipboard
val homeDirectory: Output<String>?

Optional, local user home directory.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val isNFSv3Enabled: Output<Boolean>?

Indicates if the local user is enabled for access with NFSv3 protocol.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard

The permission scopes of the local user.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val sid: Output<String>

A unique Security Identifier that is generated by the server.

Link copied to clipboard

Optional, local user ssh authorized keys for SFTP.

Link copied to clipboard

Metadata pertaining to creation and last modification of the resource.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userId: Output<Int>

A unique Identifier that is generated by the server.