ibm.AppidUserRoles
Explore with Pulumi AI
Create, update, or delete an IBM Cloud AppID Management Services user roles resource. For more information, see assigning roles to users with the API
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const roles = new ibm.AppidUserRoles("roles", {
tenantId: _var.tenant_id,
subject: ibm_appid_cloud_directory_user.test_user.subject,
roleIds: [ibm_appid_role.test_role.role_id],
});
import pulumi
import pulumi_ibm as ibm
roles = ibm.AppidUserRoles("roles",
tenant_id=var["tenant_id"],
subject=ibm_appid_cloud_directory_user["test_user"]["subject"],
role_ids=[ibm_appid_role["test_role"]["role_id"]])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewAppidUserRoles(ctx, "roles", &ibm.AppidUserRolesArgs{
TenantId: pulumi.Any(_var.Tenant_id),
Subject: pulumi.Any(ibm_appid_cloud_directory_user.Test_user.Subject),
RoleIds: pulumi.StringArray{
ibm_appid_role.Test_role.Role_id,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var roles = new Ibm.AppidUserRoles("roles", new()
{
TenantId = @var.Tenant_id,
Subject = ibm_appid_cloud_directory_user.Test_user.Subject,
RoleIds = new[]
{
ibm_appid_role.Test_role.Role_id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.AppidUserRoles;
import com.pulumi.ibm.AppidUserRolesArgs;
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 roles = new AppidUserRoles("roles", AppidUserRolesArgs.builder()
.tenantId(var_.tenant_id())
.subject(ibm_appid_cloud_directory_user.test_user().subject())
.roleIds(ibm_appid_role.test_role().role_id())
.build());
}
}
resources:
roles:
type: ibm:AppidUserRoles
properties:
tenantId: ${var.tenant_id}
subject: ${ibm_appid_cloud_directory_user.test_user.subject}
roleIds:
- ${ibm_appid_role.test_role.role_id}
Create AppidUserRoles Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AppidUserRoles(name: string, args: AppidUserRolesArgs, opts?: CustomResourceOptions);
@overload
def AppidUserRoles(resource_name: str,
args: AppidUserRolesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AppidUserRoles(resource_name: str,
opts: Optional[ResourceOptions] = None,
role_ids: Optional[Sequence[str]] = None,
subject: Optional[str] = None,
tenant_id: Optional[str] = None,
appid_user_roles_id: Optional[str] = None)
func NewAppidUserRoles(ctx *Context, name string, args AppidUserRolesArgs, opts ...ResourceOption) (*AppidUserRoles, error)
public AppidUserRoles(string name, AppidUserRolesArgs args, CustomResourceOptions? opts = null)
public AppidUserRoles(String name, AppidUserRolesArgs args)
public AppidUserRoles(String name, AppidUserRolesArgs args, CustomResourceOptions options)
type: ibm:AppidUserRoles
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 AppidUserRolesArgs
- 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 AppidUserRolesArgs
- 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 AppidUserRolesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppidUserRolesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppidUserRolesArgs
- 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 appidUserRolesResource = new Ibm.AppidUserRoles("appidUserRolesResource", new()
{
RoleIds = new[]
{
"string",
},
Subject = "string",
TenantId = "string",
AppidUserRolesId = "string",
});
example, err := ibm.NewAppidUserRoles(ctx, "appidUserRolesResource", &ibm.AppidUserRolesArgs{
RoleIds: pulumi.StringArray{
pulumi.String("string"),
},
Subject: pulumi.String("string"),
TenantId: pulumi.String("string"),
AppidUserRolesId: pulumi.String("string"),
})
var appidUserRolesResource = new AppidUserRoles("appidUserRolesResource", AppidUserRolesArgs.builder()
.roleIds("string")
.subject("string")
.tenantId("string")
.appidUserRolesId("string")
.build());
appid_user_roles_resource = ibm.AppidUserRoles("appidUserRolesResource",
role_ids=["string"],
subject="string",
tenant_id="string",
appid_user_roles_id="string")
const appidUserRolesResource = new ibm.AppidUserRoles("appidUserRolesResource", {
roleIds: ["string"],
subject: "string",
tenantId: "string",
appidUserRolesId: "string",
});
type: ibm:AppidUserRoles
properties:
appidUserRolesId: string
roleIds:
- string
subject: string
tenantId: string
AppidUserRoles 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 AppidUserRoles resource accepts the following input properties:
- Role
Ids List<string> - The list of AppID role ids that you would like to assign to the user
- Subject string
- The user's identifier ('subject' in identity token)
- Tenant
Id string - The AppID instance GUID
- Appid
User stringRoles Id
- Role
Ids []string - The list of AppID role ids that you would like to assign to the user
- Subject string
- The user's identifier ('subject' in identity token)
- Tenant
Id string - The AppID instance GUID
- Appid
User stringRoles Id
- role
Ids List<String> - The list of AppID role ids that you would like to assign to the user
- subject String
- The user's identifier ('subject' in identity token)
- tenant
Id String - The AppID instance GUID
- appid
User StringRoles Id
- role
Ids string[] - The list of AppID role ids that you would like to assign to the user
- subject string
- The user's identifier ('subject' in identity token)
- tenant
Id string - The AppID instance GUID
- appid
User stringRoles Id
- role_
ids Sequence[str] - The list of AppID role ids that you would like to assign to the user
- subject str
- The user's identifier ('subject' in identity token)
- tenant_
id str - The AppID instance GUID
- appid_
user_ strroles_ id
- role
Ids List<String> - The list of AppID role ids that you would like to assign to the user
- subject String
- The user's identifier ('subject' in identity token)
- tenant
Id String - The AppID instance GUID
- appid
User StringRoles Id
Outputs
All input properties are implicitly available as output properties. Additionally, the AppidUserRoles resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AppidUserRoles Resource
Get an existing AppidUserRoles 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?: AppidUserRolesState, opts?: CustomResourceOptions): AppidUserRoles
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
appid_user_roles_id: Optional[str] = None,
role_ids: Optional[Sequence[str]] = None,
subject: Optional[str] = None,
tenant_id: Optional[str] = None) -> AppidUserRoles
func GetAppidUserRoles(ctx *Context, name string, id IDInput, state *AppidUserRolesState, opts ...ResourceOption) (*AppidUserRoles, error)
public static AppidUserRoles Get(string name, Input<string> id, AppidUserRolesState? state, CustomResourceOptions? opts = null)
public static AppidUserRoles get(String name, Output<String> id, AppidUserRolesState state, CustomResourceOptions options)
resources: _: type: ibm:AppidUserRoles 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.
- Appid
User stringRoles Id - Role
Ids List<string> - The list of AppID role ids that you would like to assign to the user
- Subject string
- The user's identifier ('subject' in identity token)
- Tenant
Id string - The AppID instance GUID
- Appid
User stringRoles Id - Role
Ids []string - The list of AppID role ids that you would like to assign to the user
- Subject string
- The user's identifier ('subject' in identity token)
- Tenant
Id string - The AppID instance GUID
- appid
User StringRoles Id - role
Ids List<String> - The list of AppID role ids that you would like to assign to the user
- subject String
- The user's identifier ('subject' in identity token)
- tenant
Id String - The AppID instance GUID
- appid
User stringRoles Id - role
Ids string[] - The list of AppID role ids that you would like to assign to the user
- subject string
- The user's identifier ('subject' in identity token)
- tenant
Id string - The AppID instance GUID
- appid_
user_ strroles_ id - role_
ids Sequence[str] - The list of AppID role ids that you would like to assign to the user
- subject str
- The user's identifier ('subject' in identity token)
- tenant_
id str - The AppID instance GUID
- appid
User StringRoles Id - role
Ids List<String> - The list of AppID role ids that you would like to assign to the user
- subject String
- The user's identifier ('subject' in identity token)
- tenant
Id String - The AppID instance GUID
Import
The ibm_appid_user_roles
resource can be imported by using the AppID tenant ID and user subject string.
Syntax
bash
$ pulumi import ibm:index/appidUserRoles:AppidUserRoles roles <tenant_id>/<subject>
Example
bash
$ pulumi import ibm:index/appidUserRoles:AppidUserRoles roles 5fa344a8-d361-4bc2-9051-58ca253f4b2b/03cd638a-b35a-43f2-a58a-c2d3fe26aaea
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.