Skip to content

Commit

Permalink
add eim tests and update test_provider_oapi
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-mzi authored and outscale-toa committed Dec 19, 2024
1 parent b3c2994 commit 76a7a00
Show file tree
Hide file tree
Showing 55 changed files with 3,498 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,4 @@
}
],
"check_results": "########"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,4 @@
}
],
"check_results": "########"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
{
"schema_version": 0,
"attributes": {
"backend_ips": [],
"backend_ips": null,
"backend_vm_ids": [
"##id-1##"
],
Expand Down Expand Up @@ -373,4 +373,4 @@
}
],
"check_results": "########"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,4 @@
}
],
"check_results": "########"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,4 @@
}
],
"check_results": "########"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,4 @@
}
],
"check_results": "########"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
{
"schema_version": 0,
"attributes": {
"backend_ips": [],
"backend_ips": null,
"backend_vm_ids": [
"##id-1##"
],
Expand Down Expand Up @@ -343,4 +343,4 @@
}
],
"check_results": "########"
}
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Action": [
"api:*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policy11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Action": [
"api:*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policy12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Action": [
"api:Read*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policy2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Action": [
"api:*VM*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policyV1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"api:ReadConsumptionAccount"
],
"Resource": [
"*"
]
}
]
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policyV2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Action": [
"api:Read*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
9 changes: 9 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policyV3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Statement": [
{
"Action": "*",
"Resource": "*",
"Effect": "Allow"
}
]
}
13 changes: 13 additions & 0 deletions tests/qa_provider_oapi/data/policies_files/policy_RO.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Action": [
"api:Read*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"api:ReadConsumptionAccount"
],
"Resource": [
"*"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"version": "########",
"terraform_version": "########",
"serial": "########",
"lineage": "########",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "outscale_access_key",
"name": "access_key_eim01",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"access_key_id": "##id-0##",
"creation_date": "########",
"expiration_date": "2028-01-01T00:00:00.000+0000",
"id": "##id-0##",
"last_modification_date": "########",
"request_id": "########",
"secret_key": "########",
"state": "ACTIVE",
"user_name": "User-terraform-2"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"outscale_user.user-2"
]
}
]
},
{
"mode": "managed",
"type": "outscale_user",
"name": "user-1",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-1##",
"last_modification_date": "########",
"path": "/terraform/",
"policy": [],
"user_email": "[email protected]",
"user_id": "##id-1##",
"user_name": "User-terraform-1"
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "outscale_user",
"name": "user-2",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-2##",
"last_modification_date": "########",
"path": "/",
"policy": [],
"user_email": "[email protected]",
"user_id": "##id-2##",
"user_name": "User-terraform-2"
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
}
],
"check_results": "########"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "outscale_user" "user-1" {
user_name = "User-terraform-1"
user_email = "[email protected]"
path = "/terraform/"
}


resource "outscale_user" "user-2" {
user_name = "User-terraform-2"
}

resource "outscale_access_key" "access_key_eim01" {
user_name = outscale_user.user-2.user_name
state = "ACTIVE"
expiration_date = "2028-01-01"
depends_on=[outscale_user.user-2]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"version": "########",
"terraform_version": "########",
"serial": "########",
"lineage": "########",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "outscale_access_key",
"name": "access_key_eim01",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"access_key_id": "##id-0##",
"creation_date": "########",
"expiration_date": "2028-01-01T00:00:00.000+0000",
"id": "##id-0##",
"last_modification_date": "########",
"request_id": "########",
"secret_key": "########",
"state": "ACTIVE",
"user_name": "User-terraform-2"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"outscale_user.user-2"
]
}
]
},
{
"mode": "managed",
"type": "outscale_user",
"name": "user-1",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-1##",
"last_modification_date": "########",
"path": "/terraform_update/",
"policy": [],
"user_email": "[email protected]",
"user_id": "##id-1##",
"user_name": "User-terraform-11"
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "outscale_user",
"name": "user-2",
"provider": "provider[\"registry.terraform.io/outscale/outscale\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"creation_date": "########",
"id": "##id-2##",
"last_modification_date": "########",
"path": "/",
"policy": [],
"user_email": "[email protected]",
"user_id": "##id-2##",
"user_name": "User-terraform-2"
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
}
],
"check_results": "########"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "outscale_user" "user-1" {
user_name = "User-terraform-11"
user_email = "[email protected]"
path = "/terraform_update/"
}


resource "outscale_user" "user-2" {
user_name = "User-terraform-2"
}

resource "outscale_access_key" "access_key_eim01" {
user_name = outscale_user.user-2.user_name
state = "ACTIVE"
expiration_date = "2028-01-01"
depends_on=[outscale_user.user-2]
}

Loading

0 comments on commit 76a7a00

Please sign in to comment.