vkcs.IamServiceUser
Manages an IAM service user within VKCS.
!> Security Note: password
is marked as sensitive, and, therefore, will not be shown in outputs by default, but you should consider protecting it as input variable and state value. To get more information on the topic, you can refer to the official tutorial.
To get information on available roles for service accounts, refer to to the VK Cloud documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vkcs from "@pulumi/vkcs";
const serviceUser = new vkcs.IamServiceUser("serviceUser", {
description: "Service user created by Terraform example",
roleNames: [
"mcs_admin_vm",
"mcs_admin_network",
],
});
export const credentials = {
login: serviceUser.login,
password: serviceUser.password,
};
import pulumi
import pulumi_vkcs as vkcs
service_user = vkcs.IamServiceUser("serviceUser",
description="Service user created by Terraform example",
role_names=[
"mcs_admin_vm",
"mcs_admin_network",
])
pulumi.export("credentials", {
"login": service_user.login,
"password": service_user.password,
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
serviceUser, err := vkcs.NewIamServiceUser(ctx, "serviceUser", &vkcs.IamServiceUserArgs{
Description: pulumi.String("Service user created by Terraform example"),
RoleNames: pulumi.StringArray{
pulumi.String("mcs_admin_vm"),
pulumi.String("mcs_admin_network"),
},
})
if err != nil {
return err
}
ctx.Export("credentials", pulumi.StringMap{
"login": serviceUser.Login,
"password": serviceUser.Password,
})
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vkcs = Pulumi.Vkcs;
return await Deployment.RunAsync(() =>
{
var serviceUser = new Vkcs.IamServiceUser("serviceUser", new()
{
Description = "Service user created by Terraform example",
RoleNames = new[]
{
"mcs_admin_vm",
"mcs_admin_network",
},
});
return new Dictionary<string, object?>
{
["credentials"] =
{
{ "login", serviceUser.Login },
{ "password", serviceUser.Password },
},
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vkcs.IamServiceUser;
import com.pulumi.vkcs.IamServiceUserArgs;
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 serviceUser = new IamServiceUser("serviceUser", IamServiceUserArgs.builder()
.description("Service user created by Terraform example")
.roleNames(
"mcs_admin_vm",
"mcs_admin_network")
.build());
ctx.export("credentials", Map.ofEntries(
Map.entry("login", serviceUser.login()),
Map.entry("password", serviceUser.password())
));
}
}
resources:
serviceUser:
type: vkcs:IamServiceUser
properties:
description: Service user created by Terraform example
roleNames:
- mcs_admin_vm
- mcs_admin_network
outputs:
credentials:
login: ${serviceUser.login}
password: ${serviceUser.password}
Create IamServiceUser Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IamServiceUser(name: string, args: IamServiceUserArgs, opts?: CustomResourceOptions);
@overload
def IamServiceUser(resource_name: str,
args: IamServiceUserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IamServiceUser(resource_name: str,
opts: Optional[ResourceOptions] = None,
role_names: Optional[Sequence[str]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None)
func NewIamServiceUser(ctx *Context, name string, args IamServiceUserArgs, opts ...ResourceOption) (*IamServiceUser, error)
public IamServiceUser(string name, IamServiceUserArgs args, CustomResourceOptions? opts = null)
public IamServiceUser(String name, IamServiceUserArgs args)
public IamServiceUser(String name, IamServiceUserArgs args, CustomResourceOptions options)
type: vkcs:IamServiceUser
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 IamServiceUserArgs
- 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 IamServiceUserArgs
- 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 IamServiceUserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IamServiceUserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IamServiceUserArgs
- 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 iamServiceUserResource = new Vkcs.IamServiceUser("iamServiceUserResource", new()
{
RoleNames = new[]
{
"string",
},
Description = "string",
Name = "string",
Region = "string",
});
example, err := vkcs.NewIamServiceUser(ctx, "iamServiceUserResource", &vkcs.IamServiceUserArgs{
RoleNames: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Region: pulumi.String("string"),
})
var iamServiceUserResource = new IamServiceUser("iamServiceUserResource", IamServiceUserArgs.builder()
.roleNames("string")
.description("string")
.name("string")
.region("string")
.build());
iam_service_user_resource = vkcs.IamServiceUser("iamServiceUserResource",
role_names=["string"],
description="string",
name="string",
region="string")
const iamServiceUserResource = new vkcs.IamServiceUser("iamServiceUserResource", {
roleNames: ["string"],
description: "string",
name: "string",
region: "string",
});
type: vkcs:IamServiceUser
properties:
description: string
name: string
region: string
roleNames:
- string
IamServiceUser Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IamServiceUser resource accepts the following input properties:
- Role
Names List<string> - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- Description string
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- Name string
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- Region string
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource.
- Role
Names []string - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- Description string
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- Name string
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- Region string
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource.
- role
Names List<String> - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- description String
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- name String
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- region String
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource.
- role
Names string[] - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- description string
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- name string
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- region string
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource.
- role_
names Sequence[str] - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- description str
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- name str
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- region str
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource.
- role
Names List<String> - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- description String
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- name String
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- region String
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the IamServiceUser resource produces the following output properties:
- Created
At string - string → Service user creation timestamp.
- Creator
Name string - string → Name of the user who created the service user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Login string
- string → Login name of the service user.
- Password string
- string → Password of the service user. Note: This is a sensitive attribute.
- Created
At string - string → Service user creation timestamp.
- Creator
Name string - string → Name of the user who created the service user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Login string
- string → Login name of the service user.
- Password string
- string → Password of the service user. Note: This is a sensitive attribute.
- created
At String - string → Service user creation timestamp.
- creator
Name String - string → Name of the user who created the service user.
- id String
- The provider-assigned unique ID for this managed resource.
- login String
- string → Login name of the service user.
- password String
- string → Password of the service user. Note: This is a sensitive attribute.
- created
At string - string → Service user creation timestamp.
- creator
Name string - string → Name of the user who created the service user.
- id string
- The provider-assigned unique ID for this managed resource.
- login string
- string → Login name of the service user.
- password string
- string → Password of the service user. Note: This is a sensitive attribute.
- created_
at str - string → Service user creation timestamp.
- creator_
name str - string → Name of the user who created the service user.
- id str
- The provider-assigned unique ID for this managed resource.
- login str
- string → Login name of the service user.
- password str
- string → Password of the service user. Note: This is a sensitive attribute.
- created
At String - string → Service user creation timestamp.
- creator
Name String - string → Name of the user who created the service user.
- id String
- The provider-assigned unique ID for this managed resource.
- login String
- string → Login name of the service user.
- password String
- string → Password of the service user. Note: This is a sensitive attribute.
Look up Existing IamServiceUser Resource
Get an existing IamServiceUser resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: IamServiceUserState, opts?: CustomResourceOptions): IamServiceUser
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
creator_name: Optional[str] = None,
description: Optional[str] = None,
login: Optional[str] = None,
name: Optional[str] = None,
password: Optional[str] = None,
region: Optional[str] = None,
role_names: Optional[Sequence[str]] = None) -> IamServiceUser
func GetIamServiceUser(ctx *Context, name string, id IDInput, state *IamServiceUserState, opts ...ResourceOption) (*IamServiceUser, error)
public static IamServiceUser Get(string name, Input<string> id, IamServiceUserState? state, CustomResourceOptions? opts = null)
public static IamServiceUser get(String name, Output<String> id, IamServiceUserState state, CustomResourceOptions options)
resources: _: type: vkcs:IamServiceUser get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created
At string - string → Service user creation timestamp.
- Creator
Name string - string → Name of the user who created the service user.
- Description string
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- Login string
- string → Login name of the service user.
- Name string
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- Password string
- string → Password of the service user. Note: This is a sensitive attribute.
- Region string
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource. - Role
Names List<string> - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- Created
At string - string → Service user creation timestamp.
- Creator
Name string - string → Name of the user who created the service user.
- Description string
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- Login string
- string → Login name of the service user.
- Name string
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- Password string
- string → Password of the service user. Note: This is a sensitive attribute.
- Region string
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource. - Role
Names []string - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- created
At String - string → Service user creation timestamp.
- creator
Name String - string → Name of the user who created the service user.
- description String
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- login String
- string → Login name of the service user.
- name String
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- password String
- string → Password of the service user. Note: This is a sensitive attribute.
- region String
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource. - role
Names List<String> - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- created
At string - string → Service user creation timestamp.
- creator
Name string - string → Name of the user who created the service user.
- description string
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- login string
- string → Login name of the service user.
- name string
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- password string
- string → Password of the service user. Note: This is a sensitive attribute.
- region string
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource. - role
Names string[] - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- created_
at str - string → Service user creation timestamp.
- creator_
name str - string → Name of the user who created the service user.
- description str
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- login str
- string → Login name of the service user.
- name str
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- password str
- string → Password of the service user. Note: This is a sensitive attribute.
- region str
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource. - role_
names Sequence[str] - required string → Names of roles assigned to the service user. Changing this creates a new resource.
- created
At String - string → Service user creation timestamp.
- creator
Name String - string → Name of the user who created the service user.
- description String
- optional string → Description of the service user. The maximum length is 256 characters. Changing this creates a new resource.
- login String
- string → Login name of the service user.
- name String
- required string → Name of the service user. The name must be unique. The length must be between 3 and 32 characters. Changing this creates a new resource.
- password String
- string → Password of the service user. Note: This is a sensitive attribute.
- region String
- optional string → The region in which to obtain the IAM Service Users client. If omitted, the
region
argument of the provider is used. Changing this creates a new resource. - role
Names List<String> - required string → Names of roles assigned to the service user. Changing this creates a new resource.
Import
An IAM service account can be imported using the id
, e.g.
$ pulumi import vkcs:index/iamServiceUser:IamServiceUser service_user <service_user_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vkcs vk-cs/terraform-provider-vkcs
- License
- Notes
- This Pulumi package is based on the
vkcs
Terraform Provider.