Viewing docs for Cloudflare v5.49.1 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for Cloudflare v5.49.1 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to lookup Account Roles.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const accountRoles = cloudflare.getAccountRoles({
accountId: "f037e56e89293a057740de681ac9abbe",
});
const rolesByName = accountRoles.then(accountRoles => .reduce((__obj, role) => ({ ...__obj, [role.name]: role })));
const member = new cloudflare.AccountMember("member", {
accountId: "f037e56e89293a057740de681ac9abbe",
emailAddress: "user@example.com",
roleIds: [rolesByName.Administrator?.id],
});
import pulumi
import pulumi_cloudflare as cloudflare
account_roles = cloudflare.get_account_roles(account_id="f037e56e89293a057740de681ac9abbe")
roles_by_name = {role.name: role for role in account_roles.roles}
member = cloudflare.AccountMember("member",
account_id="f037e56e89293a057740de681ac9abbe",
email_address="user@example.com",
role_ids=[roles_by_name["Administrator"]])
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var accountRoles = Cloudflare.GetAccountRoles.Invoke(new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
});
var rolesByName = ;
var member = new Cloudflare.AccountMember("member", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
EmailAddress = "user@example.com",
RoleIds = new[]
{
rolesByName.Apply(rolesByName => rolesByName.Administrator.Id),
},
});
});
Example coming soon!
Example coming soon!
Using getAccountRoles
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAccountRoles(args: GetAccountRolesArgs, opts?: InvokeOptions): Promise<GetAccountRolesResult>
function getAccountRolesOutput(args: GetAccountRolesOutputArgs, opts?: InvokeOptions): Output<GetAccountRolesResult>def get_account_roles(account_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAccountRolesResult
def get_account_roles_output(account_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAccountRolesResult]func GetAccountRoles(ctx *Context, args *GetAccountRolesArgs, opts ...InvokeOption) (*GetAccountRolesResult, error)
func GetAccountRolesOutput(ctx *Context, args *GetAccountRolesOutputArgs, opts ...InvokeOption) GetAccountRolesResultOutput> Note: This function is named GetAccountRoles in the Go SDK.
public static class GetAccountRoles
{
public static Task<GetAccountRolesResult> InvokeAsync(GetAccountRolesArgs args, InvokeOptions? opts = null)
public static Output<GetAccountRolesResult> Invoke(GetAccountRolesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAccountRolesResult> getAccountRoles(GetAccountRolesArgs args, InvokeOptions options)
public static Output<GetAccountRolesResult> getAccountRoles(GetAccountRolesArgs args, InvokeOptions options)
fn::invoke:
function: cloudflare:index/getAccountRoles:getAccountRoles
arguments:
# arguments dictionaryThe following arguments are supported:
- Account
Id string - The account identifier to target for the resource.
- Account
Id string - The account identifier to target for the resource.
- account
Id String - The account identifier to target for the resource.
- account
Id string - The account identifier to target for the resource.
- account_
id str - The account identifier to target for the resource.
- account
Id String - The account identifier to target for the resource.
getAccountRoles Result
The following output properties are available:
- Account
Id string - The account identifier to target for the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Roles
List<Get
Account Roles Role> - A list of roles object.
- Account
Id string - The account identifier to target for the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Roles
[]Get
Account Roles Role - A list of roles object.
- account
Id String - The account identifier to target for the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- roles
List<Get
Account Roles Role> - A list of roles object.
- account
Id string - The account identifier to target for the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- roles
Get
Account Roles Role[] - A list of roles object.
- account_
id str - The account identifier to target for the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- roles
Sequence[Get
Account Roles Role] - A list of roles object.
- account
Id String - The account identifier to target for the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- roles List<Property Map>
- A list of roles object.
Supporting Types
GetAccountRolesRole
- Description string
- Description of role's permissions.
- Id string
- Role identifier tag.
- Name string
- Role Name.
- Description string
- Description of role's permissions.
- Id string
- Role identifier tag.
- Name string
- Role Name.
- description String
- Description of role's permissions.
- id String
- Role identifier tag.
- name String
- Role Name.
- description string
- Description of role's permissions.
- id string
- Role identifier tag.
- name string
- Role Name.
- description str
- Description of role's permissions.
- id str
- Role identifier tag.
- name str
- Role Name.
- description String
- Description of role's permissions.
- id String
- Role identifier tag.
- name String
- Role Name.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflareTerraform Provider.
Viewing docs for Cloudflare v5.49.1 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
