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

vra.ContentSharingPolicy

Explore with Pulumi AI

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

    Creates a VMware vRealize Automation Content Sharing Policy resource.

    Example Usage

    S

    The following example shows how to create a Content Sharing Policy resource:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = new vra.ContentSharingPolicy("this", {
        description: "My Content Sharing Policy",
        projectId: _var.project_id,
        catalogItemIds: [_var.catalog_item_id],
        catalogSourceIds: [_var.catalog_source_id],
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.ContentSharingPolicy("this",
        description="My Content Sharing Policy",
        project_id=var["project_id"],
        catalog_item_ids=[var["catalog_item_id"]],
        catalog_source_ids=[var["catalog_source_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.NewContentSharingPolicy(ctx, "this", &vra.ContentSharingPolicyArgs{
    			Description: pulumi.String("My Content Sharing Policy"),
    			ProjectId:   pulumi.Any(_var.Project_id),
    			CatalogItemIds: pulumi.StringArray{
    				_var.Catalog_item_id,
    			},
    			CatalogSourceIds: pulumi.StringArray{
    				_var.Catalog_source_id,
    			},
    		})
    		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 = new Vra.ContentSharingPolicy("this", new()
        {
            Description = "My Content Sharing Policy",
            ProjectId = @var.Project_id,
            CatalogItemIds = new[]
            {
                @var.Catalog_item_id,
            },
            CatalogSourceIds = new[]
            {
                @var.Catalog_source_id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.ContentSharingPolicy;
    import com.pulumi.vra.ContentSharingPolicyArgs;
    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) {
            var this_ = new ContentSharingPolicy("this", ContentSharingPolicyArgs.builder()
                .description("My Content Sharing Policy")
                .projectId(var_.project_id())
                .catalogItemIds(var_.catalog_item_id())
                .catalogSourceIds(var_.catalog_source_id())
                .build());
    
        }
    }
    
    resources:
      this:
        type: vra:ContentSharingPolicy
        properties:
          description: My Content Sharing Policy
          projectId: ${var.project_id}
          catalogItemIds:
            - ${var.catalog_item_id}
          catalogSourceIds:
            - ${var.catalog_source_id}
    

    Create ContentSharingPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ContentSharingPolicy(name: string, args: ContentSharingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ContentSharingPolicy(resource_name: str,
                             args: ContentSharingPolicyArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def ContentSharingPolicy(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             project_id: Optional[str] = None,
                             catalog_item_ids: Optional[Sequence[str]] = None,
                             catalog_source_ids: Optional[Sequence[str]] = None,
                             content_sharing_policy_id: Optional[str] = None,
                             description: Optional[str] = None,
                             name: Optional[str] = None)
    func NewContentSharingPolicy(ctx *Context, name string, args ContentSharingPolicyArgs, opts ...ResourceOption) (*ContentSharingPolicy, error)
    public ContentSharingPolicy(string name, ContentSharingPolicyArgs args, CustomResourceOptions? opts = null)
    public ContentSharingPolicy(String name, ContentSharingPolicyArgs args)
    public ContentSharingPolicy(String name, ContentSharingPolicyArgs args, CustomResourceOptions options)
    
    type: vra:ContentSharingPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ContentSharingPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ContentSharingPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ContentSharingPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContentSharingPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContentSharingPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var contentSharingPolicyResource = new Vra.ContentSharingPolicy("contentSharingPolicyResource", new()
    {
        ProjectId = "string",
        CatalogItemIds = new[]
        {
            "string",
        },
        CatalogSourceIds = new[]
        {
            "string",
        },
        ContentSharingPolicyId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := vra.NewContentSharingPolicy(ctx, "contentSharingPolicyResource", &vra.ContentSharingPolicyArgs{
    	ProjectId: pulumi.String("string"),
    	CatalogItemIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	CatalogSourceIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ContentSharingPolicyId: pulumi.String("string"),
    	Description:            pulumi.String("string"),
    	Name:                   pulumi.String("string"),
    })
    
    var contentSharingPolicyResource = new ContentSharingPolicy("contentSharingPolicyResource", ContentSharingPolicyArgs.builder()
        .projectId("string")
        .catalogItemIds("string")
        .catalogSourceIds("string")
        .contentSharingPolicyId("string")
        .description("string")
        .name("string")
        .build());
    
    content_sharing_policy_resource = vra.ContentSharingPolicy("contentSharingPolicyResource",
        project_id="string",
        catalog_item_ids=["string"],
        catalog_source_ids=["string"],
        content_sharing_policy_id="string",
        description="string",
        name="string")
    
    const contentSharingPolicyResource = new vra.ContentSharingPolicy("contentSharingPolicyResource", {
        projectId: "string",
        catalogItemIds: ["string"],
        catalogSourceIds: ["string"],
        contentSharingPolicyId: "string",
        description: "string",
        name: "string",
    });
    
    type: vra:ContentSharingPolicy
    properties:
        catalogItemIds:
            - string
        catalogSourceIds:
            - string
        contentSharingPolicyId: string
        description: string
        name: string
        projectId: string
    

    ContentSharingPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ContentSharingPolicy resource accepts the following input properties:

    ProjectId string

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    CatalogItemIds List<string>
    List of catalog item ids to share.
    CatalogSourceIds List<string>
    List of catalog source ids to share.
    ContentSharingPolicyId string
    Description string
    The policy description.
    Name string
    The policy name.
    ProjectId string

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    CatalogItemIds []string
    List of catalog item ids to share.
    CatalogSourceIds []string
    List of catalog source ids to share.
    ContentSharingPolicyId string
    Description string
    The policy description.
    Name string
    The policy name.
    projectId String

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    contentSharingPolicyId String
    description String
    The policy description.
    name String
    The policy name.
    projectId string

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalogItemIds string[]
    List of catalog item ids to share.
    catalogSourceIds string[]
    List of catalog source ids to share.
    contentSharingPolicyId string
    description string
    The policy description.
    name string
    The policy name.
    project_id str

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalog_item_ids Sequence[str]
    List of catalog item ids to share.
    catalog_source_ids Sequence[str]
    List of catalog source ids to share.
    content_sharing_policy_id str
    description str
    The policy description.
    name str
    The policy name.
    projectId String

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    contentSharingPolicyId String
    description String
    The policy description.
    name String
    The policy name.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ContentSharingPolicy resource produces the following output properties:

    CreatedAt string
    Policy creation timestamp.
    CreatedBy string
    Policy author.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedAt string
    Most recent policy update timestamp.
    LastUpdatedBy string
    Most recent policy editor.
    OrgId string
    The ID of the organization to which the policy belongs.
    CreatedAt string
    Policy creation timestamp.
    CreatedBy string
    Policy author.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedAt string
    Most recent policy update timestamp.
    LastUpdatedBy string
    Most recent policy editor.
    OrgId string
    The ID of the organization to which the policy belongs.
    createdAt String
    Policy creation timestamp.
    createdBy String
    Policy author.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt String
    Most recent policy update timestamp.
    lastUpdatedBy String
    Most recent policy editor.
    orgId String
    The ID of the organization to which the policy belongs.
    createdAt string
    Policy creation timestamp.
    createdBy string
    Policy author.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt string
    Most recent policy update timestamp.
    lastUpdatedBy string
    Most recent policy editor.
    orgId string
    The ID of the organization to which the policy belongs.
    created_at str
    Policy creation timestamp.
    created_by str
    Policy author.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated_at str
    Most recent policy update timestamp.
    last_updated_by str
    Most recent policy editor.
    org_id str
    The ID of the organization to which the policy belongs.
    createdAt String
    Policy creation timestamp.
    createdBy String
    Policy author.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt String
    Most recent policy update timestamp.
    lastUpdatedBy String
    Most recent policy editor.
    orgId String
    The ID of the organization to which the policy belongs.

    Look up Existing ContentSharingPolicy Resource

    Get an existing ContentSharingPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ContentSharingPolicyState, opts?: CustomResourceOptions): ContentSharingPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            catalog_item_ids: Optional[Sequence[str]] = None,
            catalog_source_ids: Optional[Sequence[str]] = None,
            content_sharing_policy_id: Optional[str] = None,
            created_at: Optional[str] = None,
            created_by: Optional[str] = None,
            description: Optional[str] = None,
            last_updated_at: Optional[str] = None,
            last_updated_by: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None) -> ContentSharingPolicy
    func GetContentSharingPolicy(ctx *Context, name string, id IDInput, state *ContentSharingPolicyState, opts ...ResourceOption) (*ContentSharingPolicy, error)
    public static ContentSharingPolicy Get(string name, Input<string> id, ContentSharingPolicyState? state, CustomResourceOptions? opts = null)
    public static ContentSharingPolicy get(String name, Output<String> id, ContentSharingPolicyState state, CustomResourceOptions options)
    resources:  _:    type: vra:ContentSharingPolicy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CatalogItemIds List<string>
    List of catalog item ids to share.
    CatalogSourceIds List<string>
    List of catalog source ids to share.
    ContentSharingPolicyId string
    CreatedAt string
    Policy creation timestamp.
    CreatedBy string
    Policy author.
    Description string
    The policy description.
    LastUpdatedAt string
    Most recent policy update timestamp.
    LastUpdatedBy string
    Most recent policy editor.
    Name string
    The policy name.
    OrgId string
    The ID of the organization to which the policy belongs.
    ProjectId string

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    CatalogItemIds []string
    List of catalog item ids to share.
    CatalogSourceIds []string
    List of catalog source ids to share.
    ContentSharingPolicyId string
    CreatedAt string
    Policy creation timestamp.
    CreatedBy string
    Policy author.
    Description string
    The policy description.
    LastUpdatedAt string
    Most recent policy update timestamp.
    LastUpdatedBy string
    Most recent policy editor.
    Name string
    The policy name.
    OrgId string
    The ID of the organization to which the policy belongs.
    ProjectId string

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    contentSharingPolicyId String
    createdAt String
    Policy creation timestamp.
    createdBy String
    Policy author.
    description String
    The policy description.
    lastUpdatedAt String
    Most recent policy update timestamp.
    lastUpdatedBy String
    Most recent policy editor.
    name String
    The policy name.
    orgId String
    The ID of the organization to which the policy belongs.
    projectId String

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalogItemIds string[]
    List of catalog item ids to share.
    catalogSourceIds string[]
    List of catalog source ids to share.
    contentSharingPolicyId string
    createdAt string
    Policy creation timestamp.
    createdBy string
    Policy author.
    description string
    The policy description.
    lastUpdatedAt string
    Most recent policy update timestamp.
    lastUpdatedBy string
    Most recent policy editor.
    name string
    The policy name.
    orgId string
    The ID of the organization to which the policy belongs.
    projectId string

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalog_item_ids Sequence[str]
    List of catalog item ids to share.
    catalog_source_ids Sequence[str]
    List of catalog source ids to share.
    content_sharing_policy_id str
    created_at str
    Policy creation timestamp.
    created_by str
    Policy author.
    description str
    The policy description.
    last_updated_at str
    Most recent policy update timestamp.
    last_updated_by str
    Most recent policy editor.
    name str
    The policy name.
    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.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    catalogItemIds List<String>
    List of catalog item ids to share.
    catalogSourceIds List<String>
    List of catalog source ids to share.
    contentSharingPolicyId String
    createdAt String
    Policy creation timestamp.
    createdBy String
    Policy author.
    description String
    The policy description.
    lastUpdatedAt String
    Most recent policy update timestamp.
    lastUpdatedBy String
    Most recent policy editor.
    name String
    The policy name.
    orgId String
    The ID of the organization to which the policy belongs.
    projectId String

    The ID of the project to which the policy belongs.

    Note: One of catalog_item_ids or catalog_source_ids must be specified.

    Import

    To import an existing content sharing policy, use the id as in the following example:

    $ pulumi import vra:index/contentSharingPolicy:ContentSharingPolicy `vra_content_sharing_policy 87c17193-39ee-4921-9a11-7e03e3df6029`
    

    To learn more about importing existing cloud resources, see Importing resources.

    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