1. Packages
  2. Vra Provider
  3. API Docs
  4. getContentSharingPolicy
vra 0.14.0 published on Saturday, Jul 12, 2025 by vmware

vra.getContentSharingPolicy

Explore with Pulumi AI

vra logo
vra 0.14.0 published on Saturday, Jul 12, 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 id of the policy instance.
    Name string

    The name of the policy instance.

    Note: One of id or name must be specified.

    Id string
    The id of the policy instance.
    Name string

    The name of the policy instance.

    Note: One of id or name must be specified.

    id String
    The id of the policy instance.
    name String

    The name of the policy instance.

    Note: One of id or name must be specified.

    id string
    The id of the policy instance.
    name string

    The name of the policy instance.

    Note: One of id or name must be specified.

    id str
    The id of the policy instance.
    name str

    The name of the policy instance.

    Note: One of id or name must be specified.

    id String
    The id of the policy instance.
    name String

    The name of the policy instance.

    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
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Description string
    A human-friendly description for the policy instance.
    EnforcementType string
    The type of enforcement for the policy.
    EntitlementType string
    Entitlement type.
    Id string
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    Name string
    OrgId string
    The id of the organization this entity belongs to.
    Principals List<GetContentSharingPolicyPrincipal>
    List of users or roles that can share content:
    ProjectCriterias List<ImmutableDictionary<string, string>>
    The project based criteria.
    ProjectId string
    The id of the project this entity belongs to.
    CatalogItemIds []string
    List of catalog item ids to share.
    CatalogSourceIds []string
    List of catalog source ids to share.
    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Description string
    A human-friendly description for the policy instance.
    EnforcementType string
    The type of enforcement for the policy.
    EntitlementType string
    Entitlement type.
    Id string
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    Name string
    OrgId string
    The id of the organization this entity belongs to.
    Principals []GetContentSharingPolicyPrincipal
    List of users or roles that can share content:
    ProjectCriterias []map[string]string
    The project based criteria.
    ProjectId string
    The id of the project this entity belongs to.
    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    description String
    A human-friendly description for the policy instance.
    enforcementType String
    The type of enforcement for the policy.
    entitlementType String
    Entitlement type.
    id String
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    name String
    orgId String
    The id of the organization this entity belongs to.
    principals List<GetContentSharingPolicyPrincipal>
    List of users or roles that can share content:
    projectCriterias List<Map<String,String>>
    The project based criteria.
    projectId String
    The id of the project this entity belongs to.
    catalogItemIds string[]
    List of catalog item ids to share.
    catalogSourceIds string[]
    List of catalog source ids to share.
    createdAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy string
    The user the entity was created by.
    description string
    A human-friendly description for the policy instance.
    enforcementType string
    The type of enforcement for the policy.
    entitlementType string
    Entitlement type.
    id string
    lastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy string
    The user the entity was last updated by.
    name string
    orgId string
    The id of the organization this entity belongs to.
    principals GetContentSharingPolicyPrincipal[]
    List of users or roles that can share content:
    projectCriterias {[key: string]: string}[]
    The project based criteria.
    projectId string
    The id of the project this entity belongs to.
    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
    Date when the entity was created. The date is in ISO 8601 and UTC.
    created_by str
    The user the entity was created by.
    description str
    A human-friendly description for the policy instance.
    enforcement_type str
    The type of enforcement for the policy.
    entitlement_type str
    Entitlement type.
    id str
    last_updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    last_updated_by str
    The user the entity was last updated by.
    name str
    org_id str
    The id of the organization this entity belongs to.
    principals Sequence[GetContentSharingPolicyPrincipal]
    List of users or roles that can share content:
    project_criterias Sequence[Mapping[str, str]]
    The project based criteria.
    project_id str
    The id of the project this entity belongs to.
    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    description String
    A human-friendly description for the policy instance.
    enforcementType String
    The type of enforcement for the policy.
    entitlementType String
    Entitlement type.
    id String
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    name String
    orgId String
    The id of the organization this entity belongs to.
    principals List<Property Map>
    List of users or roles that can share content:
    projectCriterias List<Map<String>>
    The project based criteria.
    projectId String
    The id of the project this entity belongs to.

    Supporting Types

    GetContentSharingPolicyPrincipal

    ReferenceId string
    The reference ID of the principal.
    Type string
    The type of the principal.
    ReferenceId string
    The reference ID of the principal.
    Type string
    The type of the principal.
    referenceId String
    The reference ID of the principal.
    type String
    The type of the principal.
    referenceId string
    The reference ID of the principal.
    type string
    The type of the principal.
    reference_id str
    The reference ID of the principal.
    type str
    The type of the principal.
    referenceId String
    The reference ID of the principal.
    type String
    The type of the principal.

    Package Details

    Repository
    vra vmware/terraform-provider-vra
    License
    Notes
    This Pulumi package is based on the vra Terraform Provider.
    vra logo
    vra 0.14.0 published on Saturday, Jul 12, 2025 by vmware