1. Packages
  2. Nsxt Provider
  3. API Docs
  4. PolicyShare
nsxt 3.8.0 published on Monday, Apr 14, 2025 by vmware

nsxt.PolicyShare

Explore with Pulumi AI

Create PolicyShare Resource

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

Constructor syntax

new PolicyShare(name: string, args: PolicyShareArgs, opts?: CustomResourceOptions);
@overload
def PolicyShare(resource_name: str,
                args: PolicyShareArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def PolicyShare(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                display_name: Optional[str] = None,
                shared_withs: Optional[Sequence[str]] = None,
                context: Optional[PolicyShareContextArgs] = None,
                description: Optional[str] = None,
                nsx_id: Optional[str] = None,
                policy_share_id: Optional[str] = None,
                sharing_strategy: Optional[str] = None,
                tags: Optional[Sequence[PolicyShareTagArgs]] = None)
func NewPolicyShare(ctx *Context, name string, args PolicyShareArgs, opts ...ResourceOption) (*PolicyShare, error)
public PolicyShare(string name, PolicyShareArgs args, CustomResourceOptions? opts = null)
public PolicyShare(String name, PolicyShareArgs args)
public PolicyShare(String name, PolicyShareArgs args, CustomResourceOptions options)
type: nsxt:PolicyShare
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PolicyShareArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PolicyShareArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PolicyShareArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PolicyShareArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PolicyShareArgs
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 policyShareResource = new Nsxt.PolicyShare("policyShareResource", new()
{
    DisplayName = "string",
    SharedWiths = new[]
    {
        "string",
    },
    Context = new Nsxt.Inputs.PolicyShareContextArgs
    {
        ProjectId = "string",
    },
    Description = "string",
    NsxId = "string",
    PolicyShareId = "string",
    SharingStrategy = "string",
    Tags = new[]
    {
        new Nsxt.Inputs.PolicyShareTagArgs
        {
            Scope = "string",
            Tag = "string",
        },
    },
});
Copy
example, err := nsxt.NewPolicyShare(ctx, "policyShareResource", &nsxt.PolicyShareArgs{
DisplayName: pulumi.String("string"),
SharedWiths: pulumi.StringArray{
pulumi.String("string"),
},
Context: &.PolicyShareContextArgs{
ProjectId: pulumi.String("string"),
},
Description: pulumi.String("string"),
NsxId: pulumi.String("string"),
PolicyShareId: pulumi.String("string"),
SharingStrategy: pulumi.String("string"),
Tags: .PolicyShareTagArray{
&.PolicyShareTagArgs{
Scope: pulumi.String("string"),
Tag: pulumi.String("string"),
},
},
})
Copy
var policyShareResource = new PolicyShare("policyShareResource", PolicyShareArgs.builder()
    .displayName("string")
    .sharedWiths("string")
    .context(PolicyShareContextArgs.builder()
        .projectId("string")
        .build())
    .description("string")
    .nsxId("string")
    .policyShareId("string")
    .sharingStrategy("string")
    .tags(PolicyShareTagArgs.builder()
        .scope("string")
        .tag("string")
        .build())
    .build());
Copy
policy_share_resource = nsxt.PolicyShare("policyShareResource",
    display_name="string",
    shared_withs=["string"],
    context={
        "project_id": "string",
    },
    description="string",
    nsx_id="string",
    policy_share_id="string",
    sharing_strategy="string",
    tags=[{
        "scope": "string",
        "tag": "string",
    }])
Copy
const policyShareResource = new nsxt.PolicyShare("policyShareResource", {
    displayName: "string",
    sharedWiths: ["string"],
    context: {
        projectId: "string",
    },
    description: "string",
    nsxId: "string",
    policyShareId: "string",
    sharingStrategy: "string",
    tags: [{
        scope: "string",
        tag: "string",
    }],
});
Copy
type: nsxt:PolicyShare
properties:
    context:
        projectId: string
    description: string
    displayName: string
    nsxId: string
    policyShareId: string
    sharedWiths:
        - string
    sharingStrategy: string
    tags:
        - scope: string
          tag: string
Copy

PolicyShare 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 PolicyShare resource accepts the following input properties:

DisplayName This property is required. string
Display name of the resource.
SharedWiths This property is required. List<string>
Path of the context
Context PolicyShareContext
The context which the object belongs to
Description string
Description of the resource.
NsxId string
The NSX ID of this resource. If set, this ID will be used to create the resource.
PolicyShareId string
ID of the resource.
SharingStrategy string
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
Tags List<PolicyShareTag>
A list of scope + tag pairs to associate with this resource.
DisplayName This property is required. string
Display name of the resource.
SharedWiths This property is required. []string
Path of the context
Context PolicyShareContextArgs
The context which the object belongs to
Description string
Description of the resource.
NsxId string
The NSX ID of this resource. If set, this ID will be used to create the resource.
PolicyShareId string
ID of the resource.
SharingStrategy string
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
Tags []PolicyShareTagArgs
A list of scope + tag pairs to associate with this resource.
displayName This property is required. String
Display name of the resource.
sharedWiths This property is required. List<String>
Path of the context
context PolicyShareContext
The context which the object belongs to
description String
Description of the resource.
nsxId String
The NSX ID of this resource. If set, this ID will be used to create the resource.
policyShareId String
ID of the resource.
sharingStrategy String
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags List<PolicyShareTag>
A list of scope + tag pairs to associate with this resource.
displayName This property is required. string
Display name of the resource.
sharedWiths This property is required. string[]
Path of the context
context PolicyShareContext
The context which the object belongs to
description string
Description of the resource.
nsxId string
The NSX ID of this resource. If set, this ID will be used to create the resource.
policyShareId string
ID of the resource.
sharingStrategy string
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags PolicyShareTag[]
A list of scope + tag pairs to associate with this resource.
display_name This property is required. str
Display name of the resource.
shared_withs This property is required. Sequence[str]
Path of the context
context PolicyShareContextArgs
The context which the object belongs to
description str
Description of the resource.
nsx_id str
The NSX ID of this resource. If set, this ID will be used to create the resource.
policy_share_id str
ID of the resource.
sharing_strategy str
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags Sequence[PolicyShareTagArgs]
A list of scope + tag pairs to associate with this resource.
displayName This property is required. String
Display name of the resource.
sharedWiths This property is required. List<String>
Path of the context
context Property Map
The context which the object belongs to
description String
Description of the resource.
nsxId String
The NSX ID of this resource. If set, this ID will be used to create the resource.
policyShareId String
ID of the resource.
sharingStrategy String
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags List<Property Map>
A list of scope + tag pairs to associate with this resource.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Path string
The NSX path of the policy resource.
Revision double
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
Id string
The provider-assigned unique ID for this managed resource.
Path string
The NSX path of the policy resource.
Revision float64
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
id String
The provider-assigned unique ID for this managed resource.
path String
The NSX path of the policy resource.
revision Double
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
id string
The provider-assigned unique ID for this managed resource.
path string
The NSX path of the policy resource.
revision number
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
id str
The provider-assigned unique ID for this managed resource.
path str
The NSX path of the policy resource.
revision float
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
id String
The provider-assigned unique ID for this managed resource.
path String
The NSX path of the policy resource.
revision Number
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.

Look up Existing PolicyShare Resource

Get an existing PolicyShare 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?: PolicyShareState, opts?: CustomResourceOptions): PolicyShare
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        context: Optional[PolicyShareContextArgs] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        nsx_id: Optional[str] = None,
        path: Optional[str] = None,
        policy_share_id: Optional[str] = None,
        revision: Optional[float] = None,
        shared_withs: Optional[Sequence[str]] = None,
        sharing_strategy: Optional[str] = None,
        tags: Optional[Sequence[PolicyShareTagArgs]] = None) -> PolicyShare
func GetPolicyShare(ctx *Context, name string, id IDInput, state *PolicyShareState, opts ...ResourceOption) (*PolicyShare, error)
public static PolicyShare Get(string name, Input<string> id, PolicyShareState? state, CustomResourceOptions? opts = null)
public static PolicyShare get(String name, Output<String> id, PolicyShareState state, CustomResourceOptions options)
resources:  _:    type: nsxt:PolicyShare    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Context PolicyShareContext
The context which the object belongs to
Description string
Description of the resource.
DisplayName string
Display name of the resource.
NsxId string
The NSX ID of this resource. If set, this ID will be used to create the resource.
Path string
The NSX path of the policy resource.
PolicyShareId string
ID of the resource.
Revision double
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
SharedWiths List<string>
Path of the context
SharingStrategy string
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
Tags List<PolicyShareTag>
A list of scope + tag pairs to associate with this resource.
Context PolicyShareContextArgs
The context which the object belongs to
Description string
Description of the resource.
DisplayName string
Display name of the resource.
NsxId string
The NSX ID of this resource. If set, this ID will be used to create the resource.
Path string
The NSX path of the policy resource.
PolicyShareId string
ID of the resource.
Revision float64
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
SharedWiths []string
Path of the context
SharingStrategy string
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
Tags []PolicyShareTagArgs
A list of scope + tag pairs to associate with this resource.
context PolicyShareContext
The context which the object belongs to
description String
Description of the resource.
displayName String
Display name of the resource.
nsxId String
The NSX ID of this resource. If set, this ID will be used to create the resource.
path String
The NSX path of the policy resource.
policyShareId String
ID of the resource.
revision Double
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
sharedWiths List<String>
Path of the context
sharingStrategy String
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags List<PolicyShareTag>
A list of scope + tag pairs to associate with this resource.
context PolicyShareContext
The context which the object belongs to
description string
Description of the resource.
displayName string
Display name of the resource.
nsxId string
The NSX ID of this resource. If set, this ID will be used to create the resource.
path string
The NSX path of the policy resource.
policyShareId string
ID of the resource.
revision number
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
sharedWiths string[]
Path of the context
sharingStrategy string
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags PolicyShareTag[]
A list of scope + tag pairs to associate with this resource.
context PolicyShareContextArgs
The context which the object belongs to
description str
Description of the resource.
display_name str
Display name of the resource.
nsx_id str
The NSX ID of this resource. If set, this ID will be used to create the resource.
path str
The NSX path of the policy resource.
policy_share_id str
ID of the resource.
revision float
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
shared_withs Sequence[str]
Path of the context
sharing_strategy str
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags Sequence[PolicyShareTagArgs]
A list of scope + tag pairs to associate with this resource.
context Property Map
The context which the object belongs to
description String
Description of the resource.
displayName String
Display name of the resource.
nsxId String
The NSX ID of this resource. If set, this ID will be used to create the resource.
path String
The NSX path of the policy resource.
policyShareId String
ID of the resource.
revision Number
Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
sharedWiths List<String>
Path of the context
sharingStrategy String
Sharing Strategy. Accepted values: 'NONE_DESCENDANTS', 'ALL_DESCENDANTS'. Default: 'NONE_DESCENDANTS'.
tags List<Property Map>
A list of scope + tag pairs to associate with this resource.

Supporting Types

PolicyShareContext
, PolicyShareContextArgs

ProjectId This property is required. string
The ID of the project which the object belongs to
ProjectId This property is required. string
The ID of the project which the object belongs to
projectId This property is required. String
The ID of the project which the object belongs to
projectId This property is required. string
The ID of the project which the object belongs to
project_id This property is required. str
The ID of the project which the object belongs to
projectId This property is required. String
The ID of the project which the object belongs to

PolicyShareTag
, PolicyShareTagArgs

Scope string
Tag string
A list of scope + tag pairs to associate with this resource.
Scope string
Tag string
A list of scope + tag pairs to associate with this resource.
scope String
tag String
A list of scope + tag pairs to associate with this resource.
scope string
tag string
A list of scope + tag pairs to associate with this resource.
scope str
tag str
A list of scope + tag pairs to associate with this resource.
scope String
tag String
A list of scope + tag pairs to associate with this resource.

Package Details

Repository
nsxt vmware/terraform-provider-nsxt
License
Notes
This Pulumi package is based on the nsxt Terraform Provider.