From 1a9eab2cbe177c7837d80c997bc17ea1d55df22b Mon Sep 17 00:00:00 2001 From: Scott Lowe Date: Wed, 16 Dec 2015 16:36:00 -0700 Subject: [PATCH] Add section on referencing security groups by name Added new section to end of Markdown file for OpenStack security groups, recommending that security groups are referenced by the name attribute instead of by the ID attribute. --- .../openstack/r/compute_secgroup_v2.html.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/website/source/docs/providers/openstack/r/compute_secgroup_v2.html.markdown b/website/source/docs/providers/openstack/r/compute_secgroup_v2.html.markdown index 49e1c3ebf..e7d88ead7 100644 --- a/website/source/docs/providers/openstack/r/compute_secgroup_v2.html.markdown +++ b/website/source/docs/providers/openstack/r/compute_secgroup_v2.html.markdown @@ -99,3 +99,17 @@ rule { ``` A list of ICMP types and codes can be found [here](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages). + +### Referencing Security Groups + +When referencing a security group in a configuration (for example, a configuration creates a new security group and then needs to apply it to an instance being created in the same configuration), it is currently recommended to reference the security group by name and not by ID, like this: + +``` +resource "openstack_compute_instance_v2" "test-server" { + name = "tf-test" + image_id = "ad091b52-742f-469e-8f3c-fd81cadf0743" + flavor_id = "3" + key_pair = "my_key_pair_name" + security_groups = ["${openstack_compute_secgroup_v2.secgroup_1.name}"] +} +```