1. Packages
  2. OVH
  3. API Docs
  4. Iam
  5. getPolicy
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

ovh.Iam.getPolicy

Explore with Pulumi AI

ovh logo
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

    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/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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: ovh:Iam/getPolicy:getPolicy
      arguments:
        # arguments dictionary

    The 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 allow list.
    PermissionsGroups 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 allow list.
    PermissionsGroups []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 allow list.
    permissionsGroups 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 allow list.
    permissionsGroups 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 allow list.
    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 allow list.
    permissionsGroups List<String>
    Set of permissions groups that apply to the policy.

    getPolicy Result

    The following output properties are available:

    CreatedAt 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.
    ReadOnly bool
    Indicates that the policy is a default one.
    Resources List<string>
    Set of resources affected by the policy.
    UpdatedAt 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 allow list.
    PermissionsGroups List<string>
    Set of permissions groups that apply to the policy.
    CreatedAt 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.
    ReadOnly bool
    Indicates that the policy is a default one.
    Resources []string
    Set of resources affected by the policy.
    UpdatedAt 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 allow list.
    PermissionsGroups []string
    Set of permissions groups that apply to the policy.
    createdAt 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.
    readOnly Boolean
    Indicates that the policy is a default one.
    resources List<String>
    Set of resources affected by the policy.
    updatedAt 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 allow list.
    permissionsGroups List<String>
    Set of permissions groups that apply to the policy.
    createdAt 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.
    readOnly boolean
    Indicates that the policy is a default one.
    resources string[]
    Set of resources affected by the policy.
    updatedAt 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 allow list.
    permissionsGroups 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 allow list.
    permissions_groups Sequence[str]
    Set of permissions groups that apply to the policy.
    createdAt 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.
    readOnly Boolean
    Indicates that the policy is a default one.
    resources List<String>
    Set of resources affected by the policy.
    updatedAt 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 allow list.
    permissionsGroups 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 ovh Terraform Provider.
    ovh logo
    OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud