1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getIamPolicy
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getIamPolicy

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    Provides the detail of an existing IAM policy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const foo = ucloud.getIamPolicy({
        name: "AdministratorAccess",
        type: "System",
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo = ucloud.get_iam_policy(name="AdministratorAccess",
        type="System")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ucloud.LookupIamPolicy(ctx, &ucloud.LookupIamPolicyArgs{
    			Name: "AdministratorAccess",
    			Type: "System",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Ucloud.GetIamPolicy.Invoke(new()
        {
            Name = "AdministratorAccess",
            Type = "System",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetIamPolicyArgs;
    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 foo = UcloudFunctions.getIamPolicy(GetIamPolicyArgs.builder()
                .name("AdministratorAccess")
                .type("System")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: ucloud:getIamPolicy
          arguments:
            name: AdministratorAccess
            type: System
    

    Using getIamPolicy

    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 getIamPolicy(args: GetIamPolicyArgs, opts?: InvokeOptions): Promise<GetIamPolicyResult>
    function getIamPolicyOutput(args: GetIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetIamPolicyResult>
    def get_iam_policy(id: Optional[str] = None,
                       name: Optional[str] = None,
                       type: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetIamPolicyResult
    def get_iam_policy_output(id: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       type: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetIamPolicyResult]
    func LookupIamPolicy(ctx *Context, args *LookupIamPolicyArgs, opts ...InvokeOption) (*LookupIamPolicyResult, error)
    func LookupIamPolicyOutput(ctx *Context, args *LookupIamPolicyOutputArgs, opts ...InvokeOption) LookupIamPolicyResultOutput

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

    public static class GetIamPolicy 
    {
        public static Task<GetIamPolicyResult> InvokeAsync(GetIamPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetIamPolicyResult> Invoke(GetIamPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamPolicyResult> getIamPolicy(GetIamPolicyArgs args, InvokeOptions options)
    public static Output<GetIamPolicyResult> getIamPolicy(GetIamPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getIamPolicy:getIamPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the IAM policy.
    Type string
    The type of the IAM policy, which can be System or Custom.
    Id string
    Name string
    The name of the IAM policy.
    Type string
    The type of the IAM policy, which can be System or Custom.
    Id string
    name String
    The name of the IAM policy.
    type String
    The type of the IAM policy, which can be System or Custom.
    id String
    name string
    The name of the IAM policy.
    type string
    The type of the IAM policy, which can be System or Custom.
    id string
    name str
    The name of the IAM policy.
    type str
    The type of the IAM policy, which can be System or Custom.
    id str
    name String
    The name of the IAM policy.
    type String
    The type of the IAM policy, which can be System or Custom.
    id String

    getIamPolicy Result

    The following output properties are available:

    Comment string
    Description of IAM policy
    CreateTime string
    The creation time of IAM policy, formatted in RFC3339 time string.
    Id string
    Name string
    Policy string
    The policy document.
    Scope string
    The policy scope, which value can be Project, Account or Mixed.
    Type string
    Urn string
    URN of the IAM policy.
    Comment string
    Description of IAM policy
    CreateTime string
    The creation time of IAM policy, formatted in RFC3339 time string.
    Id string
    Name string
    Policy string
    The policy document.
    Scope string
    The policy scope, which value can be Project, Account or Mixed.
    Type string
    Urn string
    URN of the IAM policy.
    comment String
    Description of IAM policy
    createTime String
    The creation time of IAM policy, formatted in RFC3339 time string.
    id String
    name String
    policy String
    The policy document.
    scope String
    The policy scope, which value can be Project, Account or Mixed.
    type String
    urn String
    URN of the IAM policy.
    comment string
    Description of IAM policy
    createTime string
    The creation time of IAM policy, formatted in RFC3339 time string.
    id string
    name string
    policy string
    The policy document.
    scope string
    The policy scope, which value can be Project, Account or Mixed.
    type string
    urn string
    URN of the IAM policy.
    comment str
    Description of IAM policy
    create_time str
    The creation time of IAM policy, formatted in RFC3339 time string.
    id str
    name str
    policy str
    The policy document.
    scope str
    The policy scope, which value can be Project, Account or Mixed.
    type str
    urn str
    URN of the IAM policy.
    comment String
    Description of IAM policy
    createTime String
    The creation time of IAM policy, formatted in RFC3339 time string.
    id String
    name String
    policy String
    The policy document.
    scope String
    The policy scope, which value can be Project, Account or Mixed.
    type String
    urn String
    URN of the IAM policy.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud