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

vcd.SecurityTag

Explore with Pulumi AI

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

    Provides a VMware Cloud Director Security Tag resource. This can be used to assign security tag to VMs.

    Supported in provider v3.7+ and requires VCD 10.3.0+

    Note: Only one of vcd.SecurityTag resource or security_tags attribute from vcd.VappVm should be used. Using both would cause a behavioral conflict.

    Note: This resource requires either system or org administrator privileges.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const myTag = new vcd.SecurityTag("myTag", {vmIds: [
        vcd_vm["my-vm-one"].id,
        vcd_vm["my-vm-two"].id,
    ]});
    
    import pulumi
    import pulumi_vcd as vcd
    
    my_tag = vcd.SecurityTag("myTag", vm_ids=[
        vcd_vm["my-vm-one"]["id"],
        vcd_vm["my-vm-two"]["id"],
    ])
    
    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 {
    		_, err := vcd.NewSecurityTag(ctx, "myTag", &vcd.SecurityTagArgs{
    			VmIds: pulumi.StringArray{
    				vcd_vm.MyVmOne.Id,
    				vcd_vm.MyVmTwo.Id,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var myTag = new Vcd.SecurityTag("myTag", new()
        {
            VmIds = new[]
            {
                vcd_vm.My_vm_one.Id,
                vcd_vm.My_vm_two.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vcd.SecurityTag;
    import com.pulumi.vcd.SecurityTagArgs;
    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 myTag = new SecurityTag("myTag", SecurityTagArgs.builder()
                .vmIds(            
                    vcd_vm.my-vm-one().id(),
                    vcd_vm.my-vm-two().id())
                .build());
    
        }
    }
    
    resources:
      myTag:
        type: vcd:SecurityTag
        properties:
          vmIds:
            - ${vcd_vm"my-vm-one"[%!s(MISSING)].id}
            - ${vcd_vm"my-vm-two"[%!s(MISSING)].id}
    

    Create SecurityTag Resource

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

    Constructor syntax

    new SecurityTag(name: string, args: SecurityTagArgs, opts?: CustomResourceOptions);
    @overload
    def SecurityTag(resource_name: str,
                    args: SecurityTagArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecurityTag(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    vm_ids: Optional[Sequence[str]] = None,
                    name: Optional[str] = None,
                    org: Optional[str] = None,
                    security_tag_id: Optional[str] = None)
    func NewSecurityTag(ctx *Context, name string, args SecurityTagArgs, opts ...ResourceOption) (*SecurityTag, error)
    public SecurityTag(string name, SecurityTagArgs args, CustomResourceOptions? opts = null)
    public SecurityTag(String name, SecurityTagArgs args)
    public SecurityTag(String name, SecurityTagArgs args, CustomResourceOptions options)
    
    type: vcd:SecurityTag
    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 SecurityTagArgs
    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 SecurityTagArgs
    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 SecurityTagArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecurityTagArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecurityTagArgs
    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 securityTagResource = new Vcd.SecurityTag("securityTagResource", new()
    {
        VmIds = new[]
        {
            "string",
        },
        Name = "string",
        Org = "string",
        SecurityTagId = "string",
    });
    
    example, err := vcd.NewSecurityTag(ctx, "securityTagResource", &vcd.SecurityTagArgs{
    	VmIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:          pulumi.String("string"),
    	Org:           pulumi.String("string"),
    	SecurityTagId: pulumi.String("string"),
    })
    
    var securityTagResource = new SecurityTag("securityTagResource", SecurityTagArgs.builder()
        .vmIds("string")
        .name("string")
        .org("string")
        .securityTagId("string")
        .build());
    
    security_tag_resource = vcd.SecurityTag("securityTagResource",
        vm_ids=["string"],
        name="string",
        org="string",
        security_tag_id="string")
    
    const securityTagResource = new vcd.SecurityTag("securityTagResource", {
        vmIds: ["string"],
        name: "string",
        org: "string",
        securityTagId: "string",
    });
    
    type: vcd:SecurityTag
    properties:
        name: string
        org: string
        securityTagId: string
        vmIds:
            - string
    

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

    VmIds List<string>
    List of VM IDs that the security tags is going to be tied to
    Name string
    The name of the security tag.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    SecurityTagId string
    VmIds []string
    List of VM IDs that the security tags is going to be tied to
    Name string
    The name of the security tag.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    SecurityTagId string
    vmIds List<String>
    List of VM IDs that the security tags is going to be tied to
    name String
    The name of the security tag.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    securityTagId String
    vmIds string[]
    List of VM IDs that the security tags is going to be tied to
    name string
    The name of the security tag.
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    securityTagId string
    vm_ids Sequence[str]
    List of VM IDs that the security tags is going to be tied to
    name str
    The name of the security tag.
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    security_tag_id str
    vmIds List<String>
    List of VM IDs that the security tags is going to be tied to
    name String
    The name of the security tag.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    securityTagId String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing SecurityTag Resource

    Get an existing SecurityTag 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?: SecurityTagState, opts?: CustomResourceOptions): SecurityTag
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            org: Optional[str] = None,
            security_tag_id: Optional[str] = None,
            vm_ids: Optional[Sequence[str]] = None) -> SecurityTag
    func GetSecurityTag(ctx *Context, name string, id IDInput, state *SecurityTagState, opts ...ResourceOption) (*SecurityTag, error)
    public static SecurityTag Get(string name, Input<string> id, SecurityTagState? state, CustomResourceOptions? opts = null)
    public static SecurityTag get(String name, Output<String> id, SecurityTagState state, CustomResourceOptions options)
    resources:  _:    type: vcd:SecurityTag    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:
    Name string
    The name of the security tag.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    SecurityTagId string
    VmIds List<string>
    List of VM IDs that the security tags is going to be tied to
    Name string
    The name of the security tag.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    SecurityTagId string
    VmIds []string
    List of VM IDs that the security tags is going to be tied to
    name String
    The name of the security tag.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    securityTagId String
    vmIds List<String>
    List of VM IDs that the security tags is going to be tied to
    name string
    The name of the security tag.
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    securityTagId string
    vmIds string[]
    List of VM IDs that the security tags is going to be tied to
    name str
    The name of the security tag.
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    security_tag_id str
    vm_ids Sequence[str]
    List of VM IDs that the security tags is going to be tied to
    name String
    The name of the security tag.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    securityTagId String
    vmIds List<String>
    List of VM IDs that the security tags is going to be tied to

    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