Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. data "i3_definitions" "all" {
  2. infrastructure = "dynamodb"
  3. component = "wbs"
  4. }
  5. locals {
  6. defns = data.i3_definitions.all.definitions
  7. }
  8.  
  9. resource "i3_common" "common" {
  10. key = data.repliconi3_definitions.all.key
  11. }
  12.  
  13. data "i3_config" "key_arn_config" {
  14. for_each = local.defns
  15. definition_key = each.key
  16. common_id = i3_common.common.id
  17. config_key = "kmsKeyArn"
  18. default_value = "arn:aws:kms"
  19. }
  20.  
  21. resource "local_file" "my_table" {
  22. for_each = local.defns
  23. filename = "./MyTable-${each.value}"
  24. content = data.i3_config.key_arn_config[each.key].value
  25. }
  26.  
  27. resource "i3_setting" "test_setting" {
  28. for_each = local.defns
  29. definition_key = each.key
  30. common_id = i3_common.common.id
  31. setting_key = "MyDynamoTableName"
  32. setting_value = local_file.my_table[each.key].filename
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement