generated from scaleway-terraform-modules/module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccess_admin.tf
23 lines (19 loc) · 864 Bytes
/
access_admin.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data "scaleway_account_project" "current" {}
resource "scaleway_iam_application" "admin" {
name = format("SDB - %s - Admin", var.name)
description = format("Full access to Serverless SQL Database %s", var.name)
}
resource "scaleway_iam_policy" "admin" {
name = format("SDB - %s - Admin", var.name)
description = format("Full access to Serverless SQL Database %s", var.name)
application_id = scaleway_iam_application.admin.id
rule {
project_ids = [data.scaleway_account_project.current.id]
permission_set_names = ["ServerlessSQLDatabaseFullAccess"]
}
}
resource "scaleway_iam_api_key" "admin" {
application_id = scaleway_iam_application.admin.id
default_project_id = data.scaleway_account_project.current.id
expires_at = var.keys_ttl > 0 ? time_rotating.keys_ttl[0].rotation_rfc3339 : null
}