provider/openstack: Documenting resources that support importing (#7716)

Also removing some unneeded region arguments in the examples.
This commit is contained in:
Joe Topjian 2016-07-20 09:37:17 -06:00 committed by Paul Stack
parent af26350f49
commit f529cae42a
21 changed files with 152 additions and 8 deletions

View File

@ -73,3 +73,11 @@ The following attributes are exported:
* `attachment` - If a volume is attached to an instance, this attribute will
display the Attachment ID, Instance ID, and the Device as the Instance
sees it.
## Import
Volumes can be imported using the `id`, e.g.
```
terraform import openstack_blockstorage_volume_v1.volume_1 ea257959-eeb1-4c10-8d33-26f0409a755d
```

View File

@ -78,3 +78,11 @@ The following attributes are exported:
* `attachment` - If a volume is attached to an instance, this attribute will
display the Attachment ID, Instance ID, and the Device as the Instance
sees it.
## Import
Volumes can be imported using the `id`, e.g.
```
terraform import openstack_blockstorage_volume_v2.volume_1 ea257959-eeb1-4c10-8d33-26f0409a755d
```

View File

@ -17,7 +17,6 @@ but only networking floating IPs can be used with load balancers.
```
resource "openstack_compute_floatingip_v2" "floatip_1" {
region = ""
pool = "public"
}
```
@ -44,3 +43,11 @@ The following attributes are exported:
* `address` - The actual floating IP address itself.
* `fixed_ip` - The fixed IP address corresponding to the floating IP.
* `instance_id` - UUID of the compute instance associated with the floating IP.
## Import
Floating IPs can be imported using the `id`, e.g.
```
terraform import openstack_compute_floatingip_v2.floatip_1 89c60255-9bd6-460c-822a-e2b959ede9d2
```

View File

@ -41,3 +41,11 @@ The following attributes are exported:
* `region` - See Argument Reference above.
* `name` - See Argument Reference above.
* `public_key` - See Argument Reference above.
## Import
Keypairs can be imported using the `name`, e.g.
```
terraform import openstack_compute_keypair_v2.my-keypair test-keypair
```

View File

@ -114,3 +114,11 @@ resource "openstack_compute_instance_v2" "test-server" {
security_groups = ["${openstack_compute_secgroup_v2.secgroup_1.name}"]
}
```
## Import
Security Groups can be imported using the `id`, e.g.
```
terraform import openstack_compute_secgroup_v2.my_secgroup 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf
```

View File

@ -51,3 +51,11 @@ The following attributes are exported:
* `name` - See Argument Reference above.
* `policies` - See Argument Reference above.
* `members` - The instances that are part of this server group.
## Import
Server Groups can be imported using the `id`, e.g.
```
terraform import openstack_compute_servergroup_v2.test-sg 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf
```

View File

@ -32,14 +32,12 @@ resource "openstack_fw_rule_v1" "rule_2" {
}
resource "openstack_fw_policy_v1" "policy_1" {
region = ""
name = "my-policy"
rules = ["${openstack_fw_rule_v1.rule_1.id}",
"${openstack_fw_rule_v1.rule_2.id}"]
}
resource "openstack_fw_firewall_v1" "firewall_1" {
region = ""
name = "my-firewall"
policy_id = "${openstack_fw_policy_v1.policy_1.id}"
}
@ -81,3 +79,11 @@ The following attributes are exported:
* `description` - See Argument Reference above.
* `admin_state_up` - See Argument Reference above.
* `tenant_id` - See Argument Reference above.
## Import
Firewalls can be imported using the `id`, e.g.
```
terraform import openstack_fw_firewall_v1.firewall_1 c9e39fb2-ce20-46c8-a964-25f3898c7a97
```

View File

@ -32,7 +32,6 @@ resource "openstack_fw_rule_v1" "rule_2" {
}
resource "openstack_fw_policy_v1" "policy_1" {
region = ""
name = "my-policy"
rules = ["${openstack_fw_rule_v1.rule_1.id}",
"${openstack_fw_rule_v1.rule_2.id}"]
@ -78,3 +77,11 @@ The following attributes are exported:
* `description` - See Argument Reference above.
* `audited` - See Argument Reference above.
* `shared` - See Argument Reference above.
## Import
Firewall Policies can be imported using the `id`, e.g.
```
terraform import openstack_fw_policy_v1.policy_1 07f422e6-c596-474b-8b94-fe2c12506ce0
```

View File

@ -88,3 +88,11 @@ The following attributes are exported:
* `destination_port` - See Argument Reference above.
* `enabled` - See Argument Reference above.
* `tenant_id` - See Argument Reference above.
## Import
Firewall Rules can be imported using the `id`, e.g.
```
terraform import openstack_fw_rule_v1.rule_1 8dbc0c28-e49c-463f-b712-5c5d1bbac327
```

View File

@ -56,3 +56,11 @@ The following attributes are exported:
* `admin_state_up` - See Argument Reference above.
* `weight` - The load balancing weight of the member. This is currently unable
to be set through Terraform.
## Import
Load Balancer Members can be imported using the `id`, e.g.
```
terraform import openstack_lb_member_v1.member_1 a7498676-4fe4-4243-a864-2eaaf18c73df
```

View File

@ -80,3 +80,11 @@ The following attributes are exported:
* `expected_codes` - See Argument Reference above.
* `admin_state_up` - See Argument Reference above.
* `tenant_id` - See Argument Reference above.
## Import
Load Balancer Members can be imported using the `id`, e.g.
```
terraform import openstack_lb_monitor_v1.monitor_1 119d7530-72e9-449a-aa97-124a5ef1992c
```

View File

@ -178,3 +178,11 @@ The following attributes are exported:
## Notes
The `member` block is deprecated in favor of the `openstack_lb_member_v1` resource.
## Import
Load Balancer Pools can be imported using the `id`, e.g.
```
terraform import openstack_lb_pool_v1.pool_1 b255e6ba-02ad-43e6-8951-3428ca26b713
```

View File

@ -98,3 +98,11 @@ The following attributes are exported:
* `floating_ip` - See Argument Reference above.
* `admin_state_up` - See Argument Reference above.
* `port_id` - Port UUID for this VIP at associated floating IP (if any).
## Import
Load Balancer VIPs can be imported using the `id`, e.g.
```
terraform import openstack_lb_vip_v1.vip_1 50e16b26-89c1-475e-a492-76167182511e
```

View File

@ -17,7 +17,6 @@ but only compute floating IPs can be used with compute instances.
```
resource "openstack_networking_floatingip_v2" "floatip_1" {
region = ""
pool = "public"
}
```
@ -56,3 +55,11 @@ The following attributes are exported:
* `port_id` - ID of associated port.
* `tenant_id` - the ID of the tenant in which to create the floating IP.
* `fixed_ip` - The fixed IP which the floating IP maps to.
## Import
Floating IPs can be imported using the `id`, e.g.
```
terraform import openstack_networking_floatingip_v2.floatip_1 2c7f39f3-702b-48d1-940c-b50384177ee1
```

View File

@ -91,3 +91,11 @@ The following attributes are exported:
* `shared` - See Argument Reference above.
* `tenant_id` - See Argument Reference above.
* `admin_state_up` - See Argument Reference above.
## Import
Networks can be imported using the `id`, e.g.
```
terraform import openstack_networking_network_v2.network_1 d90ce693-5ccf-4136-a0ed-152ce412b6b9
```

View File

@ -86,6 +86,14 @@ The following attributes are exported:
* `device_id` - See Argument Reference above.
* `fixed_ip/ip_address` - See Argument Reference above.
## Import
Ports can be imported using the `id`, e.g.
```
terraform import openstack_networking_port_v2.port_1 eae26a3e-1c33-4cc1-9c31-0cd729c438a1
```
## Notes
### Ports and Instances

View File

@ -25,13 +25,11 @@ resource "openstack_networking_subnet_v2" "subnet_1" {
}
resource "openstack_networking_router_v2" "router_1" {
region = ""
name = "my_router"
external_gateway = "f67f0d72-0ddf-11e4-9d95-e1f29f417e2f"
}
resource "openstack_networking_router_interface_v2" "router_interface_1" {
region = ""
router_id = "${openstack_networking_router_v2.router_1.id}"
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
}

View File

@ -14,7 +14,6 @@ Manages a V2 router resource within OpenStack.
```
resource "openstack_networking_router_v2" "router_1" {
region = ""
name = "my_router"
external_gateway = "f67f0d72-0ddf-11e4-9d95-e1f29f417e2f"
}

View File

@ -87,3 +87,11 @@ The following attributes are exported:
* `remote_group_id` - See Argument Reference above.
* `security_group_id` - See Argument Reference above.
* `tenant_id` - See Argument Reference above.
## Import
Security Group Rules can be imported using the `id`, e.g.
```
terraform import openstack_networking_secgroup_rule_v2.secgroup_rule_1 aeb68ee3-6e9d-4256-955c-9584a6212745
```

View File

@ -48,3 +48,11 @@ The following attributes are exported:
* `name` - See Argument Reference above.
* `description` - See Argument Reference above.
* `tenant_id` - See Argument Reference above.
## Import
Security Groups can be imported using the `id`, e.g.
```
terraform import openstack_networking_secgroup_v2.secgroup_1 38809219-5e8a-4852-9139-6f461c90e8bc
```

View File

@ -100,3 +100,11 @@ The following attributes are exported:
* `enable_dhcp` - See Argument Reference above.
* `dns_nameservers` - See Argument Reference above.
* `host_routes` - See Argument Reference above.
## Import
Subnets can be imported using the `id`, e.g.
```
terraform import openstack_networking_subnet_v2.subnet_1 da4faf16-5546-41e4-8330-4d0002b74048
```