Skip to content

Commit

Permalink
Merge branch 'DOC-4328' into 'master'
Browse files Browse the repository at this point in the history
DOC-4328: Added parameters and examples

See merge request documentation/doc-terraform-template!80
  • Loading branch information
aurelienmoreira committed Jun 18, 2024
2 parents ed65c65 + 404303b commit b59d776
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Content/resource-correspondence.csv
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
outscale/resource_outscale_virtual_gateway_route_propagation.go, UpdateRoutePropagation
outscale/resource_outscale_virtual_gateway.go, CreateVirtualGateway
outscale/resource_outscale_vm.go, CreateVms
outscale/resource_outscale_volumes_link.go, LinkVolume
outscale/resource_outscale_volume_link.go, LinkVolume
outscale/resource_outscale_volume.go, CreateVolume
outscale/resource_outscale_vpn_connection_route.go, CreateVpnConnectionRoute
outscale/resource_outscale_vpn_connection.go, CreateVpnConnection
5 changes: 5 additions & 0 deletions Content/resources/flexible_gpu_link-addprop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
argument:
rename:
flexible_gpu_id:
name: flexible_gpu_ids
description: (Required) The ID of one or more fGPUs you want to attach.
2 changes: 1 addition & 1 deletion Content/resources/flexible_gpu_link-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "outscale_flexible_gpu" "flexible_gpu01" {

```hcl
resource "outscale_flexible_gpu_link" "link_fgpu01" {
flexible_gpu_id = outscale_flexible_gpu.flexible_gpu01.flexible_gpu_id
flexible_gpu_ids = [outscale_flexible_gpu.flexible_gpu01.flexible_gpu_id]
vm_id = outscale_vm.vm01.vm_id
}
```
1 change: 1 addition & 0 deletions Content/resources/nic-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ resource "outscale_security_group" "security_group01" {
```hcl
resource "outscale_nic" "nic01" {
subnet_id = outscale_subnet.subnet01.subnet_id
security_group_ids = [outscale_security_group.security_group01.security_group_id]
}
```
Expand Down
16 changes: 15 additions & 1 deletion Content/resources/vm-addprop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ argument:
- placement
- bsu_optimized
add:
block_device_mappings: |
(Optional) One or more block device mappings.
* `bsu` - Information about the BSU volume to create.
* `delete_on_vm_deletion` - (Optional) By default or if set to true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM.
* `iops` - (Optional) The number of I/O operations per second (IOPS). This parameter must be specified only if you create an `io1` volume. The maximum number of IOPS allowed for `io1` volumes is `13000` with a maximum performance ratio of 300 IOPS per gibibyte.
* `snapshot_id` - (Optional) The ID of the snapshot used to create the volume.
* `volume_size` - (Optional) The size of the volume, in gibibytes (GiB).
* `tags`- One or more tags associated with the VM.
* `key`- The key of the tag with a minimum of 1 character.
* `value` - The value of the tag, between 0 and 255 characters.
get_admin_password: "(Optional) (Windows VM only) If true, waits for the administrator password of the VM to become available in order to retrieve the VM. The password is exported to the `admin_password` attribute."
nics: |
(Optional) One or more NICs. If you specify this parameter, you must not specify the `subnet_id` and `subregion_name` parameters. To define a NIC as the primary network interface of the VM, use the `primary_nic` argument.
Expand Down Expand Up @@ -40,7 +50,11 @@ argument:
rename:
performance:
description: "The performance of the VM (`medium` | `high` | `highest`). Updating this parameter will trigger a stop/start of the VM."
security_groups: security_group_names
security_group_ids:
description: "One or more IDs of security group for the VMs. You must specify at least one of the following parameters: `security_group_ids` or `security_group_names`."
security_groups:
name: security_group_names
description: "One or more names of security groups for the VMs. You must specify at least one of the following parameters: `security_group_ids` or `security_group_names`."
user_data:
description: "Data or script used to add a specific configuration to the VM. It must be Base64-encoded, either directly or using the [base64encode](https://www.terraform.io/docs/configuration/functions/base64encode.html) Terraform function. For multiline strings, use a [heredoc syntax](https://www.terraform.io/docs/configuration/expressions.html#string-literals). Updating this parameter will trigger a stop/start of the VM."
vm_type:
Expand Down
63 changes: 56 additions & 7 deletions Content/resources/vm-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ resource "outscale_keypair" "keypair01" {
### Create a VM in the public Cloud

```hcl
resource "outscale_security_group" "security_group01" {
description = "vm security group"
security_group_name = "vm_security_group1"
}
resource "outscale_vm" "vm01" {
image_id = var.image_id
vm_type = var.vm_type
keypair_name = var.keypair_name
security_group_ids = [var.security_group_id]
security_group_ids = [outscale_security_group.security_group01.security_group_id]
placement_subregion_name = "eu-west-2a"
placement_tenancy = "default"
tags {
Expand All @@ -30,10 +35,16 @@ resource "outscale_vm" "vm01" {
### Create a VM with block device mappings

```hcl
resource "outscale_security_group" "security_group01" {
description = "vm security group"
security_group_name = "vm_security_group1"
}
resource "outscale_vm" "vm02" {
image_id = var.image_id
vm_type = var.vm_type
keypair_name = var.keypair_name
security_group_ids = [outscale_security_group.security_group01.security_group_id]
block_device_mappings {
device_name = "/dev/sda1" # /dev/sda1 corresponds to the root device of the VM
bsu {
Expand All @@ -52,6 +63,32 @@ resource "outscale_vm" "vm02" {
}
}
}
resource "outscale_security_group" "security_group01" {
description = "vm security group"
security_group_name = "vm_security_group1"
}
resource "outscale_vm" "vm02" {
image_id = var.image_id
vm_type = var.vm_type
keypair_name = var.keypair_name
security_group_ids = [outscale_security_group.security_group01.security_group_id]
block_device_mappings {
device_name = "/dev/sdb"
bsu {
volume_size = 30
volume_type = "gp2"
snapshot_id = outscale_snapshot.snapshot.id
delete_on_vm_deletion = false
tags {
key = "Name"
value = "bsu-tags-gp2"
}
}
}
}
```

### Create a VM in a Net with a network
Expand Down Expand Up @@ -122,6 +159,11 @@ resource "outscale_vm" "vm03" {
~> **Note:** If you plan to use the `outscale_nic_link`resource, it is recommended to specify the `primary_nic` argument to define the primary network interface of a VM.

```hcl
resource "outscale_security_group" "security_group01" {
description = "vm security group"
security_group_name = "vm_security_group1"
}
resource "outscale_net" "net02" {
ip_range = "10.0.0.0/16"
tags {
Expand All @@ -144,9 +186,10 @@ resource "outscale_nic" "nic01" {
}
resource "outscale_vm" "vm04" {
image_id = var.image_id
vm_type = "c4.large"
keypair_name = var.keypair_name
image_id = var.image_id
vm_type = "c4.large"
keypair_name = var.keypair_name
security_group_ids = [outscale_security_group.security_group01.security_group_id]
primary_nic {
nic_id = outscale_nic.nic01.nic_id
device_number = "0"
Expand All @@ -157,6 +200,11 @@ resource "outscale_vm" "vm04" {
### Create a VM with secondary NICs

```hcl
resource "outscale_security_group" "security_group01" {
description = "vm security group"
security_group_name = "vm_security_group1"
}
resource "outscale_net" "net02" {
ip_range = "10.0.0.0/16"
tags {
Expand All @@ -179,9 +227,10 @@ resource "outscale_nic" "nic01" {
}
resource "outscale_vm" "vm04" {
image_id = var.image_id
vm_type = "c4.large"
keypair_name = var.keypair_name
image_id = var.image_id
vm_type = "c4.large"
keypair_name = var.keypair_name
security_group_ids = [outscale_security_group.security_group01.security_group_id]
nics {
nic_id = outscale_nic.nic01.nic_id
device_number = "0"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "outscale_vm" "vm01" {
### Link a volume to a VM

```hcl
resource "outscale_volumes_link" "volumes_link01" {
resource "outscale_volume_link" "volumes_link01" {
device_name = "/dev/xvdc"
volume_id = outscale_volume.volume01.id
vm_id = outscale_vm.vm01.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ A volume link can be imported using a volume ID. For example:

```console

$ terraform import outscale_volumes_link.ImportedVolumeLink vol-12345678
$ terraform import outscale_volume_link.ImportedVolumeLink vol-12345678

```
2 changes: 1 addition & 1 deletion Content/variables.csv
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ vm_state,a,VM state,VM states,https://docs.outscale.com/en/userguide/About-Insta
vm_type,a,VM type,VM types,https://docs.outscale.com/en/userguide/Instance-Types.html,https://docs.outscale.com/api#readvmtypes
vm,a,virtual machine (VM),virtual machines (VMs),https://docs.outscale.com/en/userguide/About-Instances.html,https://docs.outscale.com/api#3ds-outscale-api-vm
volume,a,volume,volumes,https://docs.outscale.com/en/userguide/About-Volumes.html,https://docs.outscale.com/api#3ds-outscale-api-volume
volumes_link,a,volume link,volume links,https://docs.outscale.com/en/userguide/About-Volumes.html,https://docs.outscale.com/api#3ds-outscale-api-volume
volume_link,a,volume link,volume links,https://docs.outscale.com/en/userguide/About-Volumes.html,https://docs.outscale.com/api#3ds-outscale-api-volume
vpn_connection_route,a,VPN connection route,VPN connection routes,https://docs.outscale.com/en/userguide/About-Routing-Configuration-for-VPN-Connections.html,https://docs.outscale.com/api#3ds-outscale-api-vpnconnection
vpn_connection,a,VPN connection,VPN connections,https://docs.outscale.com/en/userguide/About-VPN-Connections.html,https://docs.outscale.com/api#3ds-outscale-api-vpnconnection

0 comments on commit b59d776

Please sign in to comment.