getRoleDefinition

Deprecated

azure.role.getRoleDefinition has been deprecated in favor of azure.authorization.getRoleDefinition

Use this data source to access information about an existing Role Definition.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
import com.pulumi.azure.authorization.RoleDefinition;
import com.pulumi.azure.authorization.RoleDefinitionArgs;
import com.pulumi.azure.authorization.AuthorizationFunctions;
import com.pulumi.azure.authorization.inputs.GetRoleDefinitionArgs;
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 primary = CoreFunctions.getSubscription();
var customRoleDefinition = new RoleDefinition("customRoleDefinition", RoleDefinitionArgs.builder()
.roleDefinitionId("00000000-0000-0000-0000-000000000000")
.name("CustomRoleDef")
.scope(primary.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.build());
final var custom = AuthorizationFunctions.getRoleDefinition(GetRoleDefinitionArgs.builder()
.roleDefinitionId(customRoleDefinition.roleDefinitionId())
.scope(primary.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.build());
final var custom-byname = AuthorizationFunctions.getRoleDefinition(GetRoleDefinitionArgs.builder()
.name(customRoleDefinition.name())
.scope(primary.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
.build());
final var builtin = AuthorizationFunctions.getRoleDefinition(GetRoleDefinitionArgs.builder()
.name("Contributor")
.build());
ctx.export("customRoleDefinitionId", custom.applyValue(getRoleDefinitionResult -> getRoleDefinitionResult).applyValue(custom -> custom.applyValue(getRoleDefinitionResult -> getRoleDefinitionResult.id())));
ctx.export("contributorRoleDefinitionId", builtin.applyValue(getRoleDefinitionResult -> getRoleDefinitionResult.id()));
}
}

Return

A collection of values returned by getRoleDefinition.

Parameters

argument

A collection of arguments for invoking getRoleDefinition.


suspend fun getRoleDefinition(name: String? = null, roleDefinitionId: String? = null, scope: String? = null): GetRoleDefinitionResult

Deprecated

azure.role.getRoleDefinition has been deprecated in favor of azure.authorization.getRoleDefinition

Return

A collection of values returned by getRoleDefinition.

See also

Parameters

name

Specifies the Name of either a built-in or custom Role Definition.

You can also use this for built-in roles such as Contributor, Owner, Reader and Virtual Machine Contributor

roleDefinitionId

Specifies the ID of the Role Definition as a UUID/GUID.

scope

Specifies the Scope at which the Custom Role Definition exists.

Note: One of name or role_definition_id must be specified.


Deprecated

azure.role.getRoleDefinition has been deprecated in favor of azure.authorization.getRoleDefinition

Return

A collection of values returned by getRoleDefinition.

See also

Parameters

argument

Builder for com.pulumi.azure.role.kotlin.inputs.GetRoleDefinitionPlainArgs.