alicloud_security_groups

This data source provides a list of Security Groups in an Alibaba Cloud account according to the specified filters.

Example Usage

# Filter security groups and print the results into a file
data "alicloud_security_groups" "sec_groups_ds" {
  name_regex  = "^web-"
  output_file = "web_access.json"
}

# In conjunction with a VPC
resource "alicloud_vpc" "primary_vpc_ds" {
  # ...
}

data "alicloud_security_groups" "primary_sec_groups_ds" {
  vpc_id = "${alicloud_vpc.primary_vpc_ds.id}"
}

output "first_group_id" {
  value = "${data.alicloud_security_groups.primary_sec_groups_ds.groups.0.id}"
}

Argument Reference

The following arguments are supported:

  data "alicloud_security_groups" "taggedSecurityGroups" {
    tags = {
      tagKey1 = "tagValue1",
      tagKey2 = "tagValue2"
    }
  }

Attributes Reference

The following attributes are exported in addition to the arguments listed above: