Skip to content

Commit

Permalink
Merge branch 'DOC-4424' into 'master'
Browse files Browse the repository at this point in the history
DOC-4424: Terraform release v1.0.0

See merge request documentation/doc-terraform-template!88
  • Loading branch information
aurelienmoreira committed Dec 19, 2024
2 parents 2442434 + 8a3b946 commit 3e4f849
Show file tree
Hide file tree
Showing 35 changed files with 342 additions and 16 deletions.
18 changes: 18 additions & 0 deletions Content/data-sources/access_key-example.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
### Get one of your own access keys (root account or user)

```hcl
data "outscale_access_key" "access_key01" {
filter {
name = "access_key_ids"
values = ["ABCDEFGHIJ0123456789"]
}
}
```

### Get the access key of another user

```hcl
data "outscale_access_key" "access_key01" {
user_name = "user_name"
filter {
name = "access_key_ids"
values = ["XXXXXXXXX"]
}
filter {
name = "states"
values = ["ACTIVE"]
}
}
```
18 changes: 18 additions & 0 deletions Content/data-sources/access_keys-example.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
### Get your own access keys (root account or user)

```hcl
data "outscale_access_keys" "access_keys01" {
filter {
name = "access_key_ids"
values = ["ABCDEFGHIJ0123456789", "0123456789ABCDEFGHIJ"]
}
}
```

### Get the access keys of another user

```hcl
data "outscale_access_keys" "access_keys" {
user_name = "user_name"
filter {
name = "access_key_ids"
values = ["XXXXXXXXX","YYYYYYYYYY"]
}
filter {
name = "states"
values = ["ACTIVE"]
}
}
```
6 changes: 6 additions & 0 deletions Content/data-sources/entities_linked_to_policy-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```hcl
data "outscale_entities_linked_to_policy" "entities_linked_policy01" {
policy_orn = "orn:ows:idauth::012345678910:policy/example/example-policy"
entities_type = ["USER","GROUP","ACCOUNT"]
}
```
16 changes: 16 additions & 0 deletions Content/data-sources/policies-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```hcl
data "outscale_policies" "user_policies" {
filter {
name = "only_linked"
values = [true]
}
filter {
name = "path_prefix"
values = ["/"]
}
filter {
name = "scope"
values = ["LOCAL"]
}
}
```
5 changes: 5 additions & 0 deletions Content/data-sources/policies_linked_to_user-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```hcl
data "outscale_policies_linked_to_user" "linked_policy01" {
user_name = "user_name"
}
```
13 changes: 13 additions & 0 deletions Content/data-sources/policies_linked_to_user_group-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```hcl
data "outscale_policies_linked_to_user_group" "managed_policies_linked_to_user_group" {
user_group_name = "user_group_name"
filter {
name = "user_group_ids"
values = ["XXXXXXX","YYYYYY"]
}
filter {
name = "path_prefix"
values = ["/test/"]
}
}
```
5 changes: 5 additions & 0 deletions Content/data-sources/policy-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```hcl
data "outscale_policy" "user_policy01" {
policy_orn = "orn:ows:idauth::012345678910:policy/example/example-user-policy"
}
```
8 changes: 8 additions & 0 deletions Content/data-sources/user-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```hcl
data "outscale_user" "user01" {
filter {
name = "user_ids"
values = ["XXXXXXXXXXXXXXXX"]
}
}
```
6 changes: 6 additions & 0 deletions Content/data-sources/user_group-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```hcl
data "outscale_user_group" "user_group01" {
user_group_name = "user_group_name"
path = "/"
}
```
12 changes: 12 additions & 0 deletions Content/data-sources/user_groups-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```hcl
data "outscale_user_groups" "usegroups01" {
filter {
name = "user_group_ids"
values = ["XXXXXXXXX","YYYYYYYYYY"]
}
filter {
name = "path_prefix"
values = ["/"]
}
}
```
6 changes: 6 additions & 0 deletions Content/data-sources/user_groups_per_user-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```hcl
data "outscale_user_groups_per_user" "user_groups_per_user01" {
user_name = "user_name"
user_path = "/"
}
```
8 changes: 8 additions & 0 deletions Content/data-sources/users-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```hcl
data "outscale_users" "users-2" {
filter {
name = "user_ids"
values = ["XXXXXXXXXXXXXXXX","YYYYYYYYYY"]
}
}
```
39 changes: 38 additions & 1 deletion Content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,35 @@ $ export OUTSCALE_X509KEY="~/certificate/certificate.key"
$ terraform plan
```

## Configuration

### Set a profile using a configuration file

Use the `profile` or the `OSC_PROFILE` parameter to specify a named profile.

The locations of the shared configuration and credentials files can be configured using either the parameters `config_file` and `OSC_PROFILE`.

Example with the provider:

```hcl
provider "outscale" {
config_file = "./.osc/config.json"
profile = "default"
}
```

Examples with the environment variable export:

```hcl
# For Linux and macOS
export OSC_PROFILE="default"
export OSC_CONFIG_FILE="$HOME/.osc/config.json"
# For Windows
export OSC_CONFIG_FILE="%USERPROFILE%.osc\config.json"
```


## Arguments Reference

In addition to [generic provider arguments](https://www.terraform.io/docs/configuration/providers.html), the following arguments are supported in the OUTSCALE provider block:
Expand All @@ -93,4 +122,12 @@ In addition to [generic provider arguments](https://www.terraform.io/docs/config

* `x509_cert_path` - (Optional) The path to the x509 Client Certificate. It can also be sourced from the `OUTSCALE_X509CERT` [environment variable](#environment-variables). For more information on the use of those certificates, see [About API Access Rules](https://docs.outscale.com/en/userguide/About-API-Access-Rules.html).

* `x509_key_path` - (Optional) The path to the private key of the x509 Client Certificate. It can also be sourced from the `OUTSCALE_X509KEY` [environment variable](#environment-variables). For more information on the use of those certificates, see [About API Access Rules](https://docs.outscale.com/en/userguide/About-API-Access-Rules.html).
* `x509_key_path` - (Optional) The path to the private key of the x509 Client Certificate. It can also be sourced from the `OUTSCALE_X509KEY` [environment variable](#environment-variables). For more information on the use of those certificates, see [About API Access Rules](https://docs.outscale.com/en/userguide/About-API-Access-Rules.html).

* `config_file` - (Optional) The path to the OSC config file.

* `profile` - (Optional) The named profile you want to use.

* `OSC_PROFILE` - (Optional) The OSC profile name as set in the shared configuration and credentials files.

* `OSC_CONFIG_FILE` - (Optional) The path to the OSC config file.
14 changes: 14 additions & 0 deletions Content/resource-correspondence.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
outscale/data_source_outscale_client_gateways.go, ReadClientGateways
outscale/data_source_outscale_dhcp_option.go, ReadDhcpOptions
outscale/data_source_outscale_dhcp_options.go, ReadDhcpOptions
outscale/data_source_outscale_entities_linked_to_policy.go, ReadEntitiesLinkedToPolicy
outscale/data_source_outscale_flexible_gpu.go, ReadFlexibleGpus
outscale/data_source_outscale_flexible_gpus.go, ReadFlexibleGpus
outscale/data_source_outscale_flexible_gpu_catalog.go, ReadFlexibleGpuCatalog
Expand Down Expand Up @@ -39,6 +40,10 @@
outscale/data_source_outscale_nets.go, ReadNets
outscale/data_source_outscale_nic.go, ReadNics
outscale/data_source_outscale_nics.go, ReadNics
outscale/data_source_outscale_policy.go, ReadPolicy
outscale/data_source_outscale_policies_linked_to_user.go, ReadLinkedPolicies
outscale/data_source_outscale_policies_linked_to_user_group.go, ReadManagedPoliciesLinkedToUserGroup
outscale/data_source_outscale_policies.go, ReadPolicies
outscale/data_source_outscale_product_type.go, ReadProductTypes
outscale/data_source_outscale_product_types.go, ReadProductTypes
outscale/data_source_outscale_public_ip.go, ReadPublicIps
Expand All @@ -59,6 +64,11 @@
outscale/data_source_outscale_subnet.go, ReadSubnets
outscale/data_source_outscale_subnets.go, ReadSubnets
outscale/data_source_outscale_subregions.go, ReadSubregions
outscale/data_source_outscale_user.go, ReadUsers
outscale/data_source_outscale_users.go, ReadUsers
outscale/data_source_outscale_user_group.go, ReadUserGroup
outscale/data_source_outscale_user_groups.go, ReadUserGroups
outscale/data_source_outscale_user_groups_per_user.go, ReadUserGroupsPerUser
outscale/data_source_outscale_virtual_gateway.go, ReadVirtualGateways
outscale/data_source_outscale_virtual_gateways.go, ReadVirtualGateways
outscale/data_source_outscale_vm_state.go, ReadVmsState
Expand Down Expand Up @@ -99,6 +109,8 @@
outscale/resource_outscale_nic_link.go, LinkNic
outscale/resource_outscale_nic_private_ip.go, LinkPrivateIps
outscale/resource_outscale_nic.go, CreateNic
outscale/resource_outscale_policy.go, CreatePolicy
outscale/resource_outscale_policy_version.go, CreatePolicyVersion
outscale/resource_outscale_public_ip_link.go, LinkPublicIp
outscale/resource_outscale_public_ip.go, CreatePublicIp
outscale/resource_outscale_route_table_link.go, LinkRouteTable
Expand All @@ -111,6 +123,8 @@
outscale/resource_outscale_snapshot_export_task.go, CreateSnapshotExportTask
outscale/resource_outscale_snapshot.go, CreateSnapshot
outscale/resource_outscale_subnet.go, CreateSubnet
outscale/resource_outscale_user.go, CreateUser
outscale/resource_outscale_user_group.go, CreateUserGroup
outscale/resource_outscale_virtual_gateway_link.go, LinkVirtualGateway
outscale/resource_outscale_virtual_gateway_route_propagation.go, UpdateRoutePropagation
outscale/resource_outscale_virtual_gateway.go, CreateVirtualGateway
Expand Down
4 changes: 1 addition & 3 deletions Content/resources/access_key-addprop.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
argument:
add:
state: (Optional) The state for the access key (`ACTIVE` | `INACTIVE`).
remove:
- user_name # Waiting for Terraform implementation
state: (Optional) The state for the access key (`ACTIVE` | `INACTIVE`).
15 changes: 14 additions & 1 deletion Content/resources/access_key-example.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
### Creating an access key for yourself

```hcl
resource "outscale_access_key" "access_key01" {
state = "ACTIVE"
expiration_date = "2023-01-01"
expiration_date = "2028-01-01"
}
```

### Creating an access key for another user

```hcl
resource "outscale_access_key" "access_key_eim01" {
user_name = outscale_user.user-1.user_name
state = "ACTIVE"
expiration_date = "2028-01-01"
depends_on = [outscale_user.user-1]
}
```
4 changes: 2 additions & 2 deletions Content/resources/flexible_gpu_link-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

```hcl
resource "outscale_vm" "vm01" {
image_id = ami-12345678
vm_type = t2.small
image_id = "ami-12345678"
vm_type = "tinav5.c1r1p2"
keypair_name = var.keypair_name
placement_subregion_name = "eu-west-2a"
}
Expand Down
1 change: 0 additions & 1 deletion Content/resources/load_balancer-addprop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ argument:
tags.value: (Required) The value of the tag, between 0 and 255 characters.
attribute:
remove:
- backend_ips # Waiting for Terraform implementation
- load_balancer_sticky_cookie_policies.cookie_expiration_period # Waiting for Terraform implementation
13 changes: 11 additions & 2 deletions Content/resources/load_balancer_vms-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
```hcl
resource "outscale_vm" "outscale_vm01" {
image_id = "ami-12345678"
vm_type = "t2.small"
vm_type = "tinav5.c1r1p2"
keypair_name = var.keypair_name
}
resource "outscale_vm" "outscale_vm_02" {
resource "outscale_vm" "outscale_vm02" {
image_id = var.image_id
vm_type = var.vm_type
keypair_name = var.keypair_name
Expand Down Expand Up @@ -36,4 +36,13 @@ resource "outscale_load_balancer_vms" "outscale_load_balancer_vms01" {
load_balancer_name = "load-balancer-for-backend-vms"
backend_vm_ids = [outscale_vm.outscale_vm01.vm_id,outscale_vm.outscale_vm_02.vm_id]
}
```

### Register IPs with a load balancer

```hcl
resource "outscale_load_balancer_vms" "outscale_load_balancer_vms01" {
load_balancer_name = "load-balancer-for-backend-vms"
backend_ips = [outscale_vm.outscale_vm01.public_ip, outscale_vm.outscale_vm02.public_ip]
}
```
4 changes: 3 additions & 1 deletion Content/resources/net_peering-addprop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ argument:
add:
tags: (Optional) A tag to add to this resource. You can specify this argument several times.
tags.key: (Required) The key of the tag, with a minimum of 1 character.
tags.value: (Required) The value of the tag, between 0 and 255 characters.
tags.value: (Required) The value of the tag, between 0 and 255 characters.
remove:
- accepter_owner_id
8 changes: 8 additions & 0 deletions Content/resources/policy-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```hcl
resource "outscale_policy" "policy-1" {
policy_name = "terraform-policy-1"
description = "test-terraform"
document = file("policy.json")
path = "/"
}
```
9 changes: 9 additions & 0 deletions Content/resources/policy-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Import

A policy can be imported using its ORN. For example:

```console

$ terraform import outscale_policy.policy1 orn

```
3 changes: 3 additions & 0 deletions Content/resources/policy_version-addprop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
argument:
add:
set_as_default: (Optional) If set to true, the new policy version is set as the default version, meaning it becomes the active one. Otherwise, the new policy version is not actually active until the `default_version_id` is specified in the `outscale_user` or `outscale_user_group` resources.
7 changes: 7 additions & 0 deletions Content/resources/policy_version-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```hcl
resource "outscale_policy_version" "Policy2-version-02" {
policy_orn = outscale_policy.policy-2.orn
document = file("policy.json")
set_as_default = true
}
```
1 change: 1 addition & 0 deletions Content/resources/policy_version-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~> **Note** At creation, the initial version of a policy is set to 'V1' by default.
3 changes: 3 additions & 0 deletions Content/resources/user-addprop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
argument:
add:
default_version_id: The ID of a policy version that you want to make the default one (the active one).
Loading

0 comments on commit 3e4f849

Please sign in to comment.