|
| 1 | +resource "aws_dynamodb_table" "dynamo" { |
| 2 | + billing_mode = "PAY_PER_REQUEST" |
| 3 | + deletion_protection_enabled = false |
| 4 | + hash_key = "id" |
| 5 | + name = "${var.environment}-identity-vault" |
| 6 | + region = "us-west-2" |
| 7 | + stream_enabled = true |
| 8 | + stream_view_type = "KEYS_ONLY" |
| 9 | + table_class = "STANDARD" |
| 10 | + attribute { |
| 11 | + name = "id" |
| 12 | + type = "S" |
| 13 | + } |
| 14 | + attribute { |
| 15 | + name = "primary_email" |
| 16 | + type = "S" |
| 17 | + } |
| 18 | + attribute { |
| 19 | + name = "primary_username" |
| 20 | + type = "S" |
| 21 | + } |
| 22 | + attribute { |
| 23 | + name = "sequence_number" |
| 24 | + type = "S" |
| 25 | + } |
| 26 | + attribute { |
| 27 | + name = "user_uuid" |
| 28 | + type = "S" |
| 29 | + } |
| 30 | + global_secondary_index { |
| 31 | + hash_key = "primary_email" |
| 32 | + name = "${var.environment}-identity-vault-primary_email" |
| 33 | + non_key_attributes = [] |
| 34 | + projection_type = "ALL" |
| 35 | + range_key = "id" |
| 36 | + } |
| 37 | + global_secondary_index { |
| 38 | + hash_key = "primary_username" |
| 39 | + name = "${var.environment}-identity-vault-primary_username" |
| 40 | + non_key_attributes = [] |
| 41 | + projection_type = "ALL" |
| 42 | + range_key = "id" |
| 43 | + } |
| 44 | + global_secondary_index { |
| 45 | + hash_key = "sequence_number" |
| 46 | + name = "${var.environment}-identity-vault-sequence_number" |
| 47 | + non_key_attributes = [] |
| 48 | + projection_type = "ALL" |
| 49 | + } |
| 50 | + global_secondary_index { |
| 51 | + hash_key = "user_uuid" |
| 52 | + name = "${var.environment}-identity-vault-user_uuid" |
| 53 | + non_key_attributes = [] |
| 54 | + projection_type = "ALL" |
| 55 | + range_key = "id" |
| 56 | + } |
| 57 | + point_in_time_recovery { |
| 58 | + enabled = true |
| 59 | + recovery_period_in_days = 35 |
| 60 | + } |
| 61 | + ttl { |
| 62 | + enabled = false |
| 63 | + } |
| 64 | + tags = { |
| 65 | + application = "identity-vault" |
| 66 | + cis_environment = "production" |
| 67 | + } |
| 68 | +} |
0 commit comments