1. Packages
  2. Vra Provider
  3. API Docs
  4. getContentSharingPolicy
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

vra.getContentSharingPolicy

Explore with Pulumi AI

vra logo
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

    This is an example of how to lookup a content sharing policy data source:

    Content sharing policy data source by id:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getContentSharingPolicy({
        id: _var.vra_content_sharing_policy_id,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_content_sharing_policy(id=var["vra_content_sharing_policy_id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.LookupContentSharingPolicy(ctx, &vra.LookupContentSharingPolicyArgs{
    			Id: pulumi.StringRef(_var.Vra_content_sharing_policy_id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetContentSharingPolicy.Invoke(new()
        {
            Id = @var.Vra_content_sharing_policy_id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetContentSharingPolicyArgs;
    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 this = VraFunctions.getContentSharingPolicy(GetContentSharingPolicyArgs.builder()
                .id(var_.vra_content_sharing_policy_id())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getContentSharingPolicy
          arguments:
            id: ${var.vra_content_sharing_policy_id}
    

    Content sharing policy data source by name:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getContentSharingPolicy({
        name: _var.vra_content_sharing_policy_name,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_content_sharing_policy(name=var["vra_content_sharing_policy_name"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.LookupContentSharingPolicy(ctx, &vra.LookupContentSharingPolicyArgs{
    			Name: pulumi.StringRef(_var.Vra_content_sharing_policy_name),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetContentSharingPolicy.Invoke(new()
        {
            Name = @var.Vra_content_sharing_policy_name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetContentSharingPolicyArgs;
    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 this = VraFunctions.getContentSharingPolicy(GetContentSharingPolicyArgs.builder()
                .name(var_.vra_content_sharing_policy_name())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getContentSharingPolicy
          arguments:
            name: ${var.vra_content_sharing_policy_name}
    

    Using getContentSharingPolicy

    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 getContentSharingPolicy(args: GetContentSharingPolicyArgs, opts?: InvokeOptions): Promise<GetContentSharingPolicyResult>
    function getContentSharingPolicyOutput(args: GetContentSharingPolicyOutputArgs, opts?: InvokeOptions): Output<GetContentSharingPolicyResult>
    def get_content_sharing_policy(id: Optional[str] = None,
                                   name: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetContentSharingPolicyResult
    def get_content_sharing_policy_output(id: Optional[pulumi.Input[str]] = None,
                                   name: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetContentSharingPolicyResult]
    func LookupContentSharingPolicy(ctx *Context, args *LookupContentSharingPolicyArgs, opts ...InvokeOption) (*LookupContentSharingPolicyResult, error)
    func LookupContentSharingPolicyOutput(ctx *Context, args *LookupContentSharingPolicyOutputArgs, opts ...InvokeOption) LookupContentSharingPolicyResultOutput

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

    public static class GetContentSharingPolicy 
    {
        public static Task<GetContentSharingPolicyResult> InvokeAsync(GetContentSharingPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetContentSharingPolicyResult> Invoke(GetContentSharingPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetContentSharingPolicyResult> getContentSharingPolicy(GetContentSharingPolicyArgs args, InvokeOptions options)
    public static Output<GetContentSharingPolicyResult> getContentSharingPolicy(GetContentSharingPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vra:index/getContentSharingPolicy:getContentSharingPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The policy ID.
    Name string

    The policy name.

    Note: One of id or name must be specified.

    Id string
    The policy ID.
    Name string

    The policy name.

    Note: One of id or name must be specified.

    id String
    The policy ID.
    name String

    The policy name.

    Note: One of id or name must be specified.

    id string
    The policy ID.
    name string

    The policy name.

    Note: One of id or name must be specified.

    id str
    The policy ID.
    name str

    The policy name.

    Note: One of id or name must be specified.

    id String
    The policy ID.
    name String

    The policy name.

    Note: One of id or name must be specified.

    getContentSharingPolicy Result

    The following output properties are available:

    CatalogItemIds List<string>
    List of catalog item ids to share.
    CatalogSourceIds List<string>
    List of catalog source ids to share.
    CreatedAt string
    Policy creation timestamp.
    CreatedBy string
    Policy author.
    Description string
    The policy description.
    Id string
    LastUpdatedAt string
    Most recent policy update timestamp.
    LastUpdatedBy string
    Most recent policy editor.
    Name string
    OrgId string
    The ID of the organization to which the policy belongs.
    ProjectId string
    The ID of the project to which the policy belongs.
    CatalogItemIds []string
    List of catalog item ids to share.
    CatalogSourceIds []string
    List of catalog source ids to share.
    CreatedAt string
    Policy creation timestamp.
    CreatedBy string
    Policy author.
    Description string
    The policy description.
    Id string
    LastUpdatedAt string
    Most recent policy update timestamp.
    LastUpdatedBy string
    Most recent policy editor.
    Name string
    OrgId string
    The ID of the organization to which the policy belongs.
    ProjectId string
    The ID of the project to which the policy belongs.
    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    createdAt String
    Policy creation timestamp.
    createdBy String
    Policy author.
    description String
    The policy description.
    id String
    lastUpdatedAt String
    Most recent policy update timestamp.
    lastUpdatedBy String
    Most recent policy editor.
    name String
    orgId String
    The ID of the organization to which the policy belongs.
    projectId String
    The ID of the project to which the policy belongs.
    catalogItemIds string[]
    List of catalog item ids to share.
    catalogSourceIds string[]
    List of catalog source ids to share.
    createdAt string
    Policy creation timestamp.
    createdBy string
    Policy author.
    description string
    The policy description.
    id string
    lastUpdatedAt string
    Most recent policy update timestamp.
    lastUpdatedBy string
    Most recent policy editor.
    name string
    orgId string
    The ID of the organization to which the policy belongs.
    projectId string
    The ID of the project to which the policy belongs.
    catalog_item_ids Sequence[str]
    List of catalog item ids to share.
    catalog_source_ids Sequence[str]
    List of catalog source ids to share.
    created_at str
    Policy creation timestamp.
    created_by str
    Policy author.
    description str
    The policy description.
    id str
    last_updated_at str
    Most recent policy update timestamp.
    last_updated_by str
    Most recent policy editor.
    name str
    org_id str
    The ID of the organization to which the policy belongs.
    project_id str
    The ID of the project to which the policy belongs.
    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    createdAt String
    Policy creation timestamp.
    createdBy String
    Policy author.
    description String
    The policy description.
    id String
    lastUpdatedAt String
    Most recent policy update timestamp.
    lastUpdatedBy String
    Most recent policy editor.
    name String
    orgId String
    The ID of the organization to which the policy belongs.
    projectId String
    The ID of the project to which the policy belongs.

    Package Details

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