Provides a Resource Manager Shared Resource resource.
For information about Resource Manager Shared Resource and how to use it, see What is Shared Resource.
Basic Usage
variable "name" {
default = "tfexample"
}
data "alicloud_zones" "example" {
available_resource_creation = "VSwitch"
}
resource "alicloud_vpc" "example" {
vpc_name = var.name
cidr_block = "192.168.0.0/16"
}
resource "alicloud_vswitch" "example" {
zone_id = data.alicloud_zones.example.zones.0.id
cidr_block = "192.168.0.0/16"
vpc_id = alicloud_vpc.example.id
vswitch_name = var.name
}
resource "alicloud_resource_manager_resource_share" "example" {
resource_share_name = var.name
}
resource "alicloud_resource_manager_shared_resource" "example" {
resource_id = alicloud_vswitch.example.id
resource_share_id = alicloud_resource_manager_resource_share.example.id
resource_type = "VSwitch"
}
The following arguments are supported:
resource_id
- (Required, ForceNew) The resource ID need shared.resource_share_id
- (Required, ForceNew) The resource share ID of resource manager.resource_type
- (Required, ForceNew) The resource type of should shared. Valid values:
VSwitch
. ROSTemplate
and ServiceCatalogPortfolio
. PrefixList
and Image
. PublicIpAddressPool
.KMSInstance
.The following attributes are exported:
id
- The resource ID of Shared Resource. The value is formatted <resource_share_id>:<resource_id>:<resource_type>
.status
- The status of the Shared Resource.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 11 mins) Used when create the Shared Resource.delete
- (Defaults to 11 mins) Used when delete the Shared Resource.Resource Manager Shared Resource can be imported using the id, e.g.
$ terraform import alicloud_resource_manager_shared_resource.example <resource_share_id>:<resource_id>:<resource_type>