OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud
ovh.Iam.getPolicy
Explore with Pulumi AI
Use this data source to retrieve am IAM policy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";
const myPolicy = ovh.Iam.getPolicy({
    id: "my_policy_id",
});
import pulumi
import pulumi_ovh as ovh
my_policy = ovh.Iam.get_policy(id="my_policy_id")
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.GetPolicy(ctx, &iam.GetPolicyArgs{
			Id: "my_policy_id",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() => 
{
    var myPolicy = Ovh.Iam.GetPolicy.Invoke(new()
    {
        Id = "my_policy_id",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Iam.IamFunctions;
import com.pulumi.ovh.Iam.inputs.GetPolicyArgs;
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 myPolicy = IamFunctions.getPolicy(GetPolicyArgs.builder()
            .id("my_policy_id")
            .build());
    }
}
variables:
  myPolicy:
    fn::invoke:
      function: ovh:Iam:getPolicy
      arguments:
        id: my_policy_id
Using getPolicy
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 getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>
function getPolicyOutput(args: GetPolicyOutputArgs, opts?: InvokeOptions): Output<GetPolicyResult>def get_policy(allows: Optional[Sequence[str]] = None,
               denies: Optional[Sequence[str]] = None,
               description: Optional[str] = None,
               excepts: Optional[Sequence[str]] = None,
               id: Optional[str] = None,
               permissions_groups: Optional[Sequence[str]] = None,
               opts: Optional[InvokeOptions] = None) -> GetPolicyResult
def get_policy_output(allows: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               denies: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               description: Optional[pulumi.Input[str]] = None,
               excepts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               id: Optional[pulumi.Input[str]] = None,
               permissions_groups: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetPolicyResult]func GetPolicy(ctx *Context, args *GetPolicyArgs, opts ...InvokeOption) (*GetPolicyResult, error)
func GetPolicyOutput(ctx *Context, args *GetPolicyOutputArgs, opts ...InvokeOption) GetPolicyResultOutput> Note: This function is named GetPolicy in the Go SDK.
public static class GetPolicy 
{
    public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicyResult> Invoke(GetPolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
public static Output<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
fn::invoke:
  function: ovh:Iam/getPolicy:getPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Id string
 - UUID of the policy.
 - Allows List<string>
 - Set of actions allowed by the policy.
 - Denies List<string>
 - Set of actions that will be denied no matter what policy exists.
 - Description string
 - Group description.
 - Excepts List<string>
 - Set of actions that will be subtracted from the 
allowlist. - Permissions
Groups List<string> - Set of permissions groups that apply to the policy.
 
- Id string
 - UUID of the policy.
 - Allows []string
 - Set of actions allowed by the policy.
 - Denies []string
 - Set of actions that will be denied no matter what policy exists.
 - Description string
 - Group description.
 - Excepts []string
 - Set of actions that will be subtracted from the 
allowlist. - Permissions
Groups []string - Set of permissions groups that apply to the policy.
 
- id String
 - UUID of the policy.
 - allows List<String>
 - Set of actions allowed by the policy.
 - denies List<String>
 - Set of actions that will be denied no matter what policy exists.
 - description String
 - Group description.
 - excepts List<String>
 - Set of actions that will be subtracted from the 
allowlist. - permissions
Groups List<String> - Set of permissions groups that apply to the policy.
 
- id string
 - UUID of the policy.
 - allows string[]
 - Set of actions allowed by the policy.
 - denies string[]
 - Set of actions that will be denied no matter what policy exists.
 - description string
 - Group description.
 - excepts string[]
 - Set of actions that will be subtracted from the 
allowlist. - permissions
Groups string[] - Set of permissions groups that apply to the policy.
 
- id str
 - UUID of the policy.
 - allows Sequence[str]
 - Set of actions allowed by the policy.
 - denies Sequence[str]
 - Set of actions that will be denied no matter what policy exists.
 - description str
 - Group description.
 - excepts Sequence[str]
 - Set of actions that will be subtracted from the 
allowlist. - permissions_
groups Sequence[str] - Set of permissions groups that apply to the policy.
 
- id String
 - UUID of the policy.
 - allows List<String>
 - Set of actions allowed by the policy.
 - denies List<String>
 - Set of actions that will be denied no matter what policy exists.
 - description String
 - Group description.
 - excepts List<String>
 - Set of actions that will be subtracted from the 
allowlist. - permissions
Groups List<String> - Set of permissions groups that apply to the policy.
 
getPolicy Result
The following output properties are available:
- Created
At string - Creation date of this group.
 - Id string
 - Identities List<string>
 - Set of identities affected by the policy.
 - Name string
 - Name of the policy.
 - Owner string
 - Owner of the policy.
 - Read
Only bool - Indicates that the policy is a default one.
 - Resources List<string>
 - Set of resources affected by the policy.
 - Updated
At string - Date of the last update of this group.
 - Allows List<string>
 - Set of actions allowed by the policy.
 - Denies List<string>
 - Set of actions that will be denied no matter what policy exists.
 - Description string
 - Group description.
 - Excepts List<string>
 - Set of actions that will be subtracted from the 
allowlist. - Permissions
Groups List<string> - Set of permissions groups that apply to the policy.
 
- Created
At string - Creation date of this group.
 - Id string
 - Identities []string
 - Set of identities affected by the policy.
 - Name string
 - Name of the policy.
 - Owner string
 - Owner of the policy.
 - Read
Only bool - Indicates that the policy is a default one.
 - Resources []string
 - Set of resources affected by the policy.
 - Updated
At string - Date of the last update of this group.
 - Allows []string
 - Set of actions allowed by the policy.
 - Denies []string
 - Set of actions that will be denied no matter what policy exists.
 - Description string
 - Group description.
 - Excepts []string
 - Set of actions that will be subtracted from the 
allowlist. - Permissions
Groups []string - Set of permissions groups that apply to the policy.
 
- created
At String - Creation date of this group.
 - id String
 - identities List<String>
 - Set of identities affected by the policy.
 - name String
 - Name of the policy.
 - owner String
 - Owner of the policy.
 - read
Only Boolean - Indicates that the policy is a default one.
 - resources List<String>
 - Set of resources affected by the policy.
 - updated
At String - Date of the last update of this group.
 - allows List<String>
 - Set of actions allowed by the policy.
 - denies List<String>
 - Set of actions that will be denied no matter what policy exists.
 - description String
 - Group description.
 - excepts List<String>
 - Set of actions that will be subtracted from the 
allowlist. - permissions
Groups List<String> - Set of permissions groups that apply to the policy.
 
- created
At string - Creation date of this group.
 - id string
 - identities string[]
 - Set of identities affected by the policy.
 - name string
 - Name of the policy.
 - owner string
 - Owner of the policy.
 - read
Only boolean - Indicates that the policy is a default one.
 - resources string[]
 - Set of resources affected by the policy.
 - updated
At string - Date of the last update of this group.
 - allows string[]
 - Set of actions allowed by the policy.
 - denies string[]
 - Set of actions that will be denied no matter what policy exists.
 - description string
 - Group description.
 - excepts string[]
 - Set of actions that will be subtracted from the 
allowlist. - permissions
Groups string[] - Set of permissions groups that apply to the policy.
 
- created_
at str - Creation date of this group.
 - id str
 - identities Sequence[str]
 - Set of identities affected by the policy.
 - name str
 - Name of the policy.
 - owner str
 - Owner of the policy.
 - read_
only bool - Indicates that the policy is a default one.
 - resources Sequence[str]
 - Set of resources affected by the policy.
 - updated_
at str - Date of the last update of this group.
 - allows Sequence[str]
 - Set of actions allowed by the policy.
 - denies Sequence[str]
 - Set of actions that will be denied no matter what policy exists.
 - description str
 - Group description.
 - excepts Sequence[str]
 - Set of actions that will be subtracted from the 
allowlist. - permissions_
groups Sequence[str] - Set of permissions groups that apply to the policy.
 
- created
At String - Creation date of this group.
 - id String
 - identities List<String>
 - Set of identities affected by the policy.
 - name String
 - Name of the policy.
 - owner String
 - Owner of the policy.
 - read
Only Boolean - Indicates that the policy is a default one.
 - resources List<String>
 - Set of resources affected by the policy.
 - updated
At String - Date of the last update of this group.
 - allows List<String>
 - Set of actions allowed by the policy.
 - denies List<String>
 - Set of actions that will be denied no matter what policy exists.
 - description String
 - Group description.
 - excepts List<String>
 - Set of actions that will be subtracted from the 
allowlist. - permissions
Groups List<String> - Set of permissions groups that apply to the policy.
 
Package Details
- Repository
 - ovh ovh/pulumi-ovh
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
ovhTerraform Provider.