Page MenuHomePhabricator

D8715.diff
No OneTemporary

D8715.diff

diff --git a/services/terraform/modules/shared/outputs.tf b/services/terraform/modules/shared/outputs.tf
new file mode 100644
--- /dev/null
+++ b/services/terraform/modules/shared/outputs.tf
@@ -0,0 +1,13 @@
+locals {
+ exported_dynamodb_tables = [
+ aws_dynamodb_table.feature-flags
+ ]
+}
+
+# map table names to their resources
+output "dynamodb_tables" {
+ value = {
+ for table in local.exported_dynamodb_tables :
+ table.name => table
+ }
+}
diff --git a/services/terraform/remote/aws_iam.tf b/services/terraform/remote/aws_iam.tf
--- a/services/terraform/remote/aws_iam.tf
+++ b/services/terraform/remote/aws_iam.tf
@@ -108,9 +108,6 @@
}
# Feature Flags IAM
-data "aws_dynamodb_table" "feature_flags" {
- name = "feature-flags"
-}
data "aws_iam_policy_document" "read_feature_flags" {
statement {
sid = "FeatureFlagsDDBReadAccess"
@@ -122,7 +119,7 @@
"dynamodb:Scan",
]
resources = [
- data.aws_dynamodb_table.feature_flags.arn,
+ module.shared.dynamodb_tables["feature-flags"].arn
]
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 3:40 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597403
Default Alt Text
D8715.diff (1 KB)

Event Timeline