You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::EC2::Types::TagSpecification

  • Object
show all
Defined in:



When passing TagSpecification as input to an Aws::Client method, you can use a vanilla Hash:

  resource_type: "client-vpn-endpoint", # accepts client-vpn-endpoint, customer-gateway, dedicated-host, dhcp-options, elastic-ip, fleet, fpga-image, host-reservation, image, instance, internet-gateway, launch-template, natgateway, network-acl, network-interface, reserved-instances, route-table, security-group, snapshot, spot-instances-request, subnet, traffic-mirror-filter, traffic-mirror-session, traffic-mirror-target, transit-gateway, transit-gateway-attachment, transit-gateway-route-table, volume, vpc, vpc-peering-connection, vpn-connection, vpn-gateway
  tags: [
      key: "String",
      value: "String",

The tags to apply to a resource when the resource is being created.

Instance Attribute Summary collapse

Instance Attribute Details


The type of resource to tag. Currently, the resource types that support tagging on creation are fleet, dedicated-host, instance, snapshot, and volume. To tag a resource after it has been created, see CreateTags.

Possible values:

  • client-vpn-endpoint
  • customer-gateway
  • dedicated-host
  • dhcp-options
  • elastic-ip
  • fleet
  • fpga-image
  • host-reservation
  • image
  • instance
  • internet-gateway
  • launch-template
  • natgateway
  • network-acl
  • network-interface
  • reserved-instances
  • route-table
  • security-group
  • snapshot
  • spot-instances-request
  • subnet
  • traffic-mirror-filter
  • traffic-mirror-session
  • traffic-mirror-target
  • transit-gateway
  • transit-gateway-attachment
  • transit-gateway-route-table
  • volume
  • vpc
  • vpc-peering-connection
  • vpn-connection
  • vpn-gateway


  • (String)

    The type of resource to tag.


The tags to apply to the resource.


  • (Array<Types::Tag>)

    The tags to apply to the resource.