1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getResourceGroups
Cloudflare v6.1.0 published on Friday, Apr 18, 2025 by Pulumi

cloudflare.getResourceGroups

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleResourceGroups = cloudflare.getResourceGroups({
    accountId: "eb78d65290b24279ba6f44721b3ea3c4",
    id: "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
    name: "NameOfTheResourceGroup",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_resource_groups = cloudflare.get_resource_groups(account_id="eb78d65290b24279ba6f44721b3ea3c4",
    id="6d7f2f5f5b1d4a0e9081fdc98d432fd1",
    name="NameOfTheResourceGroup")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.LookupResourceGroups(ctx, &cloudflare.LookupResourceGroupsArgs{
			AccountId: "eb78d65290b24279ba6f44721b3ea3c4",
			Id:        pulumi.StringRef("6d7f2f5f5b1d4a0e9081fdc98d432fd1"),
			Name:      pulumi.StringRef("NameOfTheResourceGroup"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroups = Cloudflare.GetResourceGroups.Invoke(new()
    {
        AccountId = "eb78d65290b24279ba6f44721b3ea3c4",
        Id = "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
        Name = "NameOfTheResourceGroup",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetResourceGroupsArgs;
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 exampleResourceGroups = CloudflareFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
            .accountId("eb78d65290b24279ba6f44721b3ea3c4")
            .id("6d7f2f5f5b1d4a0e9081fdc98d432fd1")
            .name("NameOfTheResourceGroup")
            .build());

    }
}
Copy
variables:
  exampleResourceGroups:
    fn::invoke:
      function: cloudflare:getResourceGroups
      arguments:
        accountId: eb78d65290b24279ba6f44721b3ea3c4
        id: 6d7f2f5f5b1d4a0e9081fdc98d432fd1
        name: NameOfTheResourceGroup
Copy

Using getResourceGroups

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 getResourceGroups(args: GetResourceGroupsArgs, opts?: InvokeOptions): Promise<GetResourceGroupsResult>
function getResourceGroupsOutput(args: GetResourceGroupsOutputArgs, opts?: InvokeOptions): Output<GetResourceGroupsResult>
Copy
def get_resource_groups(account_id: Optional[str] = None,
                        id: Optional[str] = None,
                        max_items: Optional[int] = None,
                        name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetResourceGroupsResult
def get_resource_groups_output(account_id: Optional[pulumi.Input[str]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        max_items: Optional[pulumi.Input[int]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetResourceGroupsResult]
Copy
func LookupResourceGroups(ctx *Context, args *LookupResourceGroupsArgs, opts ...InvokeOption) (*LookupResourceGroupsResult, error)
func LookupResourceGroupsOutput(ctx *Context, args *LookupResourceGroupsOutputArgs, opts ...InvokeOption) LookupResourceGroupsResultOutput
Copy

> Note: This function is named LookupResourceGroups in the Go SDK.

public static class GetResourceGroups 
{
    public static Task<GetResourceGroupsResult> InvokeAsync(GetResourceGroupsArgs args, InvokeOptions? opts = null)
    public static Output<GetResourceGroupsResult> Invoke(GetResourceGroupsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetResourceGroupsResult> getResourceGroups(GetResourceGroupsArgs args, InvokeOptions options)
public static Output<GetResourceGroupsResult> getResourceGroups(GetResourceGroupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getResourceGroups:getResourceGroups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId This property is required. string
Account identifier tag.
Id string
ID of the resource group to be fetched.
MaxItems int
Max items to fetch, default: 1000
Name string
Name of the resource group to be fetched.
AccountId This property is required. string
Account identifier tag.
Id string
ID of the resource group to be fetched.
MaxItems int
Max items to fetch, default: 1000
Name string
Name of the resource group to be fetched.
accountId This property is required. String
Account identifier tag.
id String
ID of the resource group to be fetched.
maxItems Integer
Max items to fetch, default: 1000
name String
Name of the resource group to be fetched.
accountId This property is required. string
Account identifier tag.
id string
ID of the resource group to be fetched.
maxItems number
Max items to fetch, default: 1000
name string
Name of the resource group to be fetched.
account_id This property is required. str
Account identifier tag.
id str
ID of the resource group to be fetched.
max_items int
Max items to fetch, default: 1000
name str
Name of the resource group to be fetched.
accountId This property is required. String
Account identifier tag.
id String
ID of the resource group to be fetched.
maxItems Number
Max items to fetch, default: 1000
name String
Name of the resource group to be fetched.

getResourceGroups Result

The following output properties are available:

AccountId string
Account identifier tag.
Results List<GetResourceGroupsResult>
The items returned by the data source
Id string
ID of the resource group to be fetched.
MaxItems int
Max items to fetch, default: 1000
Name string
Name of the resource group to be fetched.
AccountId string
Account identifier tag.
Results []GetResourceGroupsResult
The items returned by the data source
Id string
ID of the resource group to be fetched.
MaxItems int
Max items to fetch, default: 1000
Name string
Name of the resource group to be fetched.
accountId String
Account identifier tag.
results List<GetResourceGroupsResult>
The items returned by the data source
id String
ID of the resource group to be fetched.
maxItems Integer
Max items to fetch, default: 1000
name String
Name of the resource group to be fetched.
accountId string
Account identifier tag.
results GetResourceGroupsResult[]
The items returned by the data source
id string
ID of the resource group to be fetched.
maxItems number
Max items to fetch, default: 1000
name string
Name of the resource group to be fetched.
account_id str
Account identifier tag.
results Sequence[GetResourceGroupsResult]
The items returned by the data source
id str
ID of the resource group to be fetched.
max_items int
Max items to fetch, default: 1000
name str
Name of the resource group to be fetched.
accountId String
Account identifier tag.
results List<Property Map>
The items returned by the data source
id String
ID of the resource group to be fetched.
maxItems Number
Max items to fetch, default: 1000
name String
Name of the resource group to be fetched.

Supporting Types

GetResourceGroupsResult

Id This property is required. string
Identifier of the group.
Meta This property is required. GetResourceGroupsResultMeta
Attributes associated to the resource group.
Name This property is required. string
Name of the resource group.
Scopes This property is required. List<GetResourceGroupsResultScope>
The scope associated to the resource group
Id This property is required. string
Identifier of the group.
Meta This property is required. GetResourceGroupsResultMeta
Attributes associated to the resource group.
Name This property is required. string
Name of the resource group.
Scopes This property is required. []GetResourceGroupsResultScope
The scope associated to the resource group
id This property is required. String
Identifier of the group.
meta This property is required. GetResourceGroupsResultMeta
Attributes associated to the resource group.
name This property is required. String
Name of the resource group.
scopes This property is required. List<GetResourceGroupsResultScope>
The scope associated to the resource group
id This property is required. string
Identifier of the group.
meta This property is required. GetResourceGroupsResultMeta
Attributes associated to the resource group.
name This property is required. string
Name of the resource group.
scopes This property is required. GetResourceGroupsResultScope[]
The scope associated to the resource group
id This property is required. str
Identifier of the group.
meta This property is required. GetResourceGroupsResultMeta
Attributes associated to the resource group.
name This property is required. str
Name of the resource group.
scopes This property is required. Sequence[GetResourceGroupsResultScope]
The scope associated to the resource group
id This property is required. String
Identifier of the group.
meta This property is required. Property Map
Attributes associated to the resource group.
name This property is required. String
Name of the resource group.
scopes This property is required. List<Property Map>
The scope associated to the resource group

GetResourceGroupsResultMeta

Key This property is required. string
Value This property is required. string
Key This property is required. string
Value This property is required. string
key This property is required. String
value This property is required. String
key This property is required. string
value This property is required. string
key This property is required. str
value This property is required. str
key This property is required. String
value This property is required. String

GetResourceGroupsResultScope

Key This property is required. string
This is a combination of pre-defined resource name and identifier (like Account ID etc.)
Objects This property is required. List<GetResourceGroupsResultScopeObject>
A list of scope objects for additional context.
Key This property is required. string
This is a combination of pre-defined resource name and identifier (like Account ID etc.)
Objects This property is required. []GetResourceGroupsResultScopeObject
A list of scope objects for additional context.
key This property is required. String
This is a combination of pre-defined resource name and identifier (like Account ID etc.)
objects This property is required. List<GetResourceGroupsResultScopeObject>
A list of scope objects for additional context.
key This property is required. string
This is a combination of pre-defined resource name and identifier (like Account ID etc.)
objects This property is required. GetResourceGroupsResultScopeObject[]
A list of scope objects for additional context.
key This property is required. str
This is a combination of pre-defined resource name and identifier (like Account ID etc.)
objects This property is required. Sequence[GetResourceGroupsResultScopeObject]
A list of scope objects for additional context.
key This property is required. String
This is a combination of pre-defined resource name and identifier (like Account ID etc.)
objects This property is required. List<Property Map>
A list of scope objects for additional context.

GetResourceGroupsResultScopeObject

Key This property is required. string
This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
Key This property is required. string
This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
key This property is required. String
This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
key This property is required. string
This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
key This property is required. str
This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
key This property is required. String
This is a combination of pre-defined resource name and identifier (like Zone ID etc.)

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.