1. Packages
  2. Vcd Provider
  3. API Docs
  4. getCatalogAccessControl
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getCatalogAccessControl

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a data source to read Access Control details from a Catalog in VMware Cloud Director.

    Note: Access control reads run in tenant context, meaning that, even if the user is a system administrator, in every request it uses headers items that define the tenant context as restricted to the organization to which the Catalog belongs.

    Supported in provider v3.14+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const catalog = vcd.getCatalog({
        name: "my-catalog",
    });
    const ac = catalog.then(catalog => vcd.getCatalogAccessControl({
        catalogId: catalog.id,
    }));
    export const sharedWith = ac.then(ac => ac.sharedWiths);
    
    import pulumi
    import pulumi_vcd as vcd
    
    catalog = vcd.get_catalog(name="my-catalog")
    ac = vcd.get_catalog_access_control(catalog_id=catalog.id)
    pulumi.export("sharedWith", ac.shared_withs)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		catalog, err := vcd.LookupCatalog(ctx, &vcd.LookupCatalogArgs{
    			Name: pulumi.StringRef("my-catalog"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ac, err := vcd.LookupCatalogAccessControl(ctx, &vcd.LookupCatalogAccessControlArgs{
    			CatalogId: catalog.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("sharedWith", ac.SharedWiths)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var catalog = Vcd.GetCatalog.Invoke(new()
        {
            Name = "my-catalog",
        });
    
        var ac = Vcd.GetCatalogAccessControl.Invoke(new()
        {
            CatalogId = catalog.Apply(getCatalogResult => getCatalogResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["sharedWith"] = ac.Apply(getCatalogAccessControlResult => getCatalogAccessControlResult.SharedWiths),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vcd.VcdFunctions;
    import com.pulumi.vcd.inputs.GetCatalogArgs;
    import com.pulumi.vcd.inputs.GetCatalogAccessControlArgs;
    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 catalog = VcdFunctions.getCatalog(GetCatalogArgs.builder()
                .name("my-catalog")
                .build());
    
            final var ac = VcdFunctions.getCatalogAccessControl(GetCatalogAccessControlArgs.builder()
                .catalogId(catalog.applyValue(getCatalogResult -> getCatalogResult.id()))
                .build());
    
            ctx.export("sharedWith", ac.applyValue(getCatalogAccessControlResult -> getCatalogAccessControlResult.sharedWiths()));
        }
    }
    
    variables:
      catalog:
        fn::invoke:
          function: vcd:getCatalog
          arguments:
            name: my-catalog
      ac:
        fn::invoke:
          function: vcd:getCatalogAccessControl
          arguments:
            catalogId: ${catalog.id}
    outputs:
      sharedWith: ${ac.sharedWiths}
    

    Using getCatalogAccessControl

    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 getCatalogAccessControl(args: GetCatalogAccessControlArgs, opts?: InvokeOptions): Promise<GetCatalogAccessControlResult>
    function getCatalogAccessControlOutput(args: GetCatalogAccessControlOutputArgs, opts?: InvokeOptions): Output<GetCatalogAccessControlResult>
    def get_catalog_access_control(catalog_id: Optional[str] = None,
                                   id: Optional[str] = None,
                                   org: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetCatalogAccessControlResult
    def get_catalog_access_control_output(catalog_id: Optional[pulumi.Input[str]] = None,
                                   id: Optional[pulumi.Input[str]] = None,
                                   org: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetCatalogAccessControlResult]
    func LookupCatalogAccessControl(ctx *Context, args *LookupCatalogAccessControlArgs, opts ...InvokeOption) (*LookupCatalogAccessControlResult, error)
    func LookupCatalogAccessControlOutput(ctx *Context, args *LookupCatalogAccessControlOutputArgs, opts ...InvokeOption) LookupCatalogAccessControlResultOutput

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

    public static class GetCatalogAccessControl 
    {
        public static Task<GetCatalogAccessControlResult> InvokeAsync(GetCatalogAccessControlArgs args, InvokeOptions? opts = null)
        public static Output<GetCatalogAccessControlResult> Invoke(GetCatalogAccessControlInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCatalogAccessControlResult> getCatalogAccessControl(GetCatalogAccessControlArgs args, InvokeOptions options)
    public static Output<GetCatalogAccessControlResult> getCatalogAccessControl(GetCatalogAccessControlArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getCatalogAccessControl:getCatalogAccessControl
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CatalogId string
    A unique identifier for the Catalog.
    Id string
    Org string
    The name of organization to which the Catalog belongs. Optional if defined at provider level.
    CatalogId string
    A unique identifier for the Catalog.
    Id string
    Org string
    The name of organization to which the Catalog belongs. Optional if defined at provider level.
    catalogId String
    A unique identifier for the Catalog.
    id String
    org String
    The name of organization to which the Catalog belongs. Optional if defined at provider level.
    catalogId string
    A unique identifier for the Catalog.
    id string
    org string
    The name of organization to which the Catalog belongs. Optional if defined at provider level.
    catalog_id str
    A unique identifier for the Catalog.
    id str
    org str
    The name of organization to which the Catalog belongs. Optional if defined at provider level.
    catalogId String
    A unique identifier for the Catalog.
    id String
    org String
    The name of organization to which the Catalog belongs. Optional if defined at provider level.

    getCatalogAccessControl Result

    The following output properties are available:

    Supporting Types

    GetCatalogAccessControlSharedWith

    AccessLevel string
    GroupId string
    OrgId string
    SubjectName string
    UserId string
    AccessLevel string
    GroupId string
    OrgId string
    SubjectName string
    UserId string
    accessLevel String
    groupId String
    orgId String
    subjectName String
    userId String
    accessLevel string
    groupId string
    orgId string
    subjectName string
    userId string
    accessLevel String
    groupId String
    orgId String
    subjectName String
    userId String

    Package Details

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