get Roles
This data source provides a list of RAM Roles in an Alibaba Cloud account according to the specified filters.
NOTE: Available since v1.0.0+.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ram.RamFunctions;
import com.pulumi.alicloud.ram.inputs.GetRolesArgs;
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) {
final var rolesDs = RamFunctions.getRoles(GetRolesArgs.builder()
.nameRegex(".*test.*")
.outputFile("roles.txt")
.policyName("AliyunACSDefaultAccess")
.policyType("Custom")
.build());
ctx.export("firstRoleId", rolesDs.applyValue(getRolesResult -> getRolesResult.roles()[0].id()));
}
}
Return
A collection of values returned by getRoles.
Parameters
A collection of arguments for invoking getRoles.
Return
A collection of values returned by getRoles.
See also
Parameters
A list of ram role IDs.
A regex string to filter results by the role name.
File name where to save data source results (after running pulumi preview
).
Filter results by a specific policy name. If you set this parameter without setting policy_type
, the later will be automatically set to System
. The resulting roles will be attached to the specified policy.
Filter results by a specific policy type. Valid values are Custom
and System
. If you set this parameter, you must set policy_name
as well.
Return
A collection of values returned by getRoles.
See also
Parameters
Builder for com.pulumi.alicloud.ram.kotlin.inputs.GetRolesPlainArgs.