1. Packages
  2. OVH
  3. API Docs
  4. Iam
  5. getResourceGroups
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

ovh.Iam.getResourceGroups

Explore with Pulumi AI

OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

Use this data source to list the existing IAM policies of an account.

Example Usage

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

const myGroups = ovh.Iam.getResourceGroups({});
Copy
import pulumi
import pulumi_ovh as ovh

my_groups = ovh.Iam.get_resource_groups()
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := iam.GetResourceGroups(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var myGroups = Ovh.Iam.GetResourceGroups.Invoke();

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Iam.IamFunctions;
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 myGroups = IamFunctions.getResourceGroups(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);

    }
}
Copy
variables:
  myGroups:
    fn::invoke:
      function: ovh:Iam:getResourceGroups
      arguments: {}
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(opts?: InvokeOptions): Promise<GetResourceGroupsResult>
function getResourceGroupsOutput(opts?: InvokeOptions): Output<GetResourceGroupsResult>
Copy
def get_resource_groups(opts: Optional[InvokeOptions] = None) -> GetResourceGroupsResult
def get_resource_groups_output(opts: Optional[InvokeOptions] = None) -> Output[GetResourceGroupsResult]
Copy
func GetResourceGroups(ctx *Context, opts ...InvokeOption) (*GetResourceGroupsResult, error)
func GetResourceGroupsOutput(ctx *Context, opts ...InvokeOption) GetResourceGroupsResultOutput
Copy

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

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

getResourceGroups Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
ResourceGroups List<string>
List of the resource groups IDs.
Id string
The provider-assigned unique ID for this managed resource.
ResourceGroups []string
List of the resource groups IDs.
id String
The provider-assigned unique ID for this managed resource.
resourceGroups List<String>
List of the resource groups IDs.
id string
The provider-assigned unique ID for this managed resource.
resourceGroups string[]
List of the resource groups IDs.
id str
The provider-assigned unique ID for this managed resource.
resource_groups Sequence[str]
List of the resource groups IDs.
id String
The provider-assigned unique ID for this managed resource.
resourceGroups List<String>
List of the resource groups IDs.

Package Details

Repository
ovh ovh/pulumi-ovh
License
Apache-2.0
Notes
This Pulumi package is based on the ovh Terraform Provider.
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud