Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3389532
D8567.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D8567.diff
View Options
diff --git a/services/scripts/init_local_cloud.sh b/services/scripts/init_local_cloud.sh
--- a/services/scripts/init_local_cloud.sh
+++ b/services/scripts/init_local_cloud.sh
@@ -6,7 +6,7 @@
# docker-compose up -d --force-recreate localstack
docker-compose up -d localstack
-pushd terraform
+pushd terraform/dev
./run.sh
diff --git a/services/terraform/.terraform.lock.hcl b/services/terraform/.terraform.lock.hcl
deleted file mode 100644
--- a/services/terraform/.terraform.lock.hcl
+++ /dev/null
@@ -1,23 +0,0 @@
-# This file is maintained automatically by "terraform init".
-# Manual edits may be lost in future updates.
-
-provider "registry.terraform.io/hashicorp/aws" {
- version = "4.9.0"
- constraints = "~> 4.9.0"
- hashes = [
- "h1:OWIIlbMZl/iQ8qR1U7Co3sGjNHL1HJtgNRnnV1kXNuI=",
- "h1:gx4ni9ZxacUusjZdfLmRVgoMVn1o3CVo0xklOQA2zA8=",
- "zh:084b83aef3335ad4f5e4b8323c6fe43c1ff55e17a7647c6a5cad6af519f72b42",
- "zh:132e47ce69f14de4523b84b213cedf7173398acda14245b1ffe7747aac50f050",
- "zh:2068baef7dfce3613f3b4f27314175e971f8db68d9cde9ec30b5659f80c68c6c",
- "zh:63c6f489683d5f1ac55e82a0df387143ed22701d5f22c109a4d5c9924dd4e437",
- "zh:8115fd21965954fa4568c09331e05bb29da967fab8d077419aed09954378e216",
- "zh:8efdc95fde108f777ed9c79ae25dc17aea9771903250f5c5c8a4c726b90a345f",
- "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
- "zh:9d42a7bc34d84b70c1d1bcc215cabd63abbcbd0352b70bd84da6c3916634932f",
- "zh:aacbcceb241aa475888c0869e87593182edeced3170c76a0c960dd9c905df449",
- "zh:c7fe7904511052e4102870256819a1917177572cf684f0611ebf767f9c1fbaa8",
- "zh:c8e07c3424663d1d0e7e32f4ade8099c19f6326d37c6da98104d90c986ff66fc",
- "zh:e47cafbd38b56ef14fd8d727b4ffea847c166b1c684f585ee5fb78983b537248",
- ]
-}
diff --git a/services/terraform/.gitignore b/services/terraform/dev/.gitignore
rename from services/terraform/.gitignore
rename to services/terraform/dev/.gitignore
diff --git a/services/terraform/dev/.terraform.lock.hcl b/services/terraform/dev/.terraform.lock.hcl
new file mode 100644
--- /dev/null
+++ b/services/terraform/dev/.terraform.lock.hcl
@@ -0,0 +1,25 @@
+# This file is maintained automatically by "terraform init".
+# Manual edits may be lost in future updates.
+
+provider "registry.terraform.io/hashicorp/aws" {
+ version = "5.7.0"
+ constraints = "~> 5.7.0"
+ hashes = [
+ "h1:gCmR7VjmH1RSMC6eaZRr37iGRDGBgzCPWomHHpeMEgA=",
+ "zh:03240d7fc041d5331db7fd5f2ca4fe031321d07d2a6ca27085c5020dae13f211",
+ "zh:0b5252b14c354636fe0348823195dd901b457de1a033015f4a7d11cfe998c766",
+ "zh:2bfb62325b0487be8d1850a964f09cca0d45148faec577459c2a24334ec9977b",
+ "zh:2f9e317ffc57d2b5117cfe8dc266f88aa139b760bc93d8adeed7ad533a78b5a3",
+ "zh:36512725c9d7c559927b98fead04be58494a3a997e5270b905a75a468e307427",
+ "zh:5483e696d3ea764f746d3fe439f7dcc49001c3c774122d7baa51ce01011f0075",
+ "zh:5967635cc14f969ea26622863a2e3f9d6a7ddd3e7d35a29a7275c5e10579ac8c",
+ "zh:7e63c94a64af5b7aeb36ea6e3719962f65a7c28074532c02549a67212d410bb8",
+ "zh:8a7d5f33b11a3f5c7281413b431fa85de149ed8493ec1eea73d50d2d80a475e6",
+ "zh:8e2ed2d986aaf590975a79a2f6b5e60e0dc7d804ab01a8c03ab181e41cfe9b0f",
+ "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
+ "zh:9c7b8ca1b17489f16a6d0f1fc2aa9c130978ea74c9c861d8435410567a0a888f",
+ "zh:a54385896a70524063f0c5420be26ff6f88909bd8e6902dd3e922577b21fd546",
+ "zh:aecd3a8fb70b938b58d93459bfb311540fd6aaf981924bf34abd48f953b4be0d",
+ "zh:f3de076fa3402768d27af0187c6a677777b47691d1f0f84c9b259ff66e65953e",
+ ]
+}
diff --git a/services/terraform/dev/main.tf b/services/terraform/dev/main.tf
new file mode 100644
--- /dev/null
+++ b/services/terraform/dev/main.tf
@@ -0,0 +1,39 @@
+locals {
+ aws_settings = ({
+ region = "us-east-2"
+ access_key = "fake"
+ secret_key = "fake"
+
+ skip_credentials_validation = true
+ skip_metadata_api_check = true
+ skip_requesting_account_id = true
+ s3_use_path_style = true
+
+ override_endpoint = "http://localhost:4566"
+ })
+}
+
+provider "aws" {
+ region = local.aws_settings.region
+ access_key = local.aws_settings.access_key
+ secret_key = local.aws_settings.secret_key
+
+ skip_credentials_validation = local.aws_settings.skip_credentials_validation
+ skip_metadata_api_check = local.aws_settings.skip_metadata_api_check
+ skip_requesting_account_id = local.aws_settings.skip_requesting_account_id
+ s3_use_path_style = local.aws_settings.s3_use_path_style
+
+ dynamic "endpoints" {
+ for_each = local.aws_settings.override_endpoint[*]
+ content {
+ dynamodb = endpoints.value
+ s3 = endpoints.value
+ }
+ }
+}
+
+# Shared resources between local dev environment and remote AWS
+module "shared" {
+ source = "../modules/shared"
+}
+
diff --git a/services/terraform/providers.tf b/services/terraform/dev/providers.tf
rename from services/terraform/providers.tf
rename to services/terraform/dev/providers.tf
--- a/services/terraform/providers.tf
+++ b/services/terraform/dev/providers.tf
@@ -2,7 +2,7 @@
required_providers {
aws = {
source = "hashicorp/aws"
- version = "~> 4.9.0"
+ version = "~> 5.7.0"
}
}
}
diff --git a/services/terraform/run.sh b/services/terraform/dev/run.sh
rename from services/terraform/run.sh
rename to services/terraform/dev/run.sh
diff --git a/services/terraform/main.tf b/services/terraform/main.tf
deleted file mode 100644
--- a/services/terraform/main.tf
+++ /dev/null
@@ -1,51 +0,0 @@
-locals {
- use_localstack = (terraform.workspace == "default")
-
- aws_settings = (
- local.use_localstack ?
- {
- region = "us-east-2"
- access_key = "fake"
- secret_key = "fake"
-
- skip_credentials_validation = true
- skip_metadata_api_check = true
- skip_requesting_account_id = true
- s3_use_path_style = true
-
- override_endpoint = "http://localhost:4566"
- } :
- {
- region = null
- access_key = null
- secret_key = null
-
- skip_credentials_validation = null
- skip_metadata_api_check = null
- skip_requesting_account_id = null
- s3_use_path_style = null
-
- override_endpoint = null
- }
- )
-}
-
-provider "aws" {
- region = local.aws_settings.region
- access_key = local.aws_settings.access_key
- secret_key = local.aws_settings.secret_key
-
- skip_credentials_validation = local.aws_settings.skip_credentials_validation
- skip_metadata_api_check = local.aws_settings.skip_metadata_api_check
- skip_requesting_account_id = local.aws_settings.skip_requesting_account_id
- s3_use_path_style = local.aws_settings.s3_use_path_style
-
-
- dynamic "endpoints" {
- for_each = local.aws_settings.override_endpoint[*]
- content {
- dynamodb = endpoints.value
- s3 = endpoints.value
- }
- }
-}
diff --git a/services/terraform/dynamodb.tf b/services/terraform/modules/shared/dynamodb.tf
rename from services/terraform/dynamodb.tf
rename to services/terraform/modules/shared/dynamodb.tf
diff --git a/services/terraform/providers.tf b/services/terraform/modules/shared/providers.tf
rename from services/terraform/providers.tf
rename to services/terraform/modules/shared/providers.tf
--- a/services/terraform/providers.tf
+++ b/services/terraform/modules/shared/providers.tf
@@ -2,7 +2,7 @@
required_providers {
aws = {
source = "hashicorp/aws"
- version = "~> 4.9.0"
+ version = "~> 5.7.0"
}
}
}
diff --git a/services/terraform/s3.tf b/services/terraform/modules/shared/s3.tf
rename from services/terraform/s3.tf
rename to services/terraform/modules/shared/s3.tf
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 7:30 PM (22 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2602128
Default Alt Text
D8567.diff (7 KB)
Attached To
Mode
D8567: [services][terraform] Move current config to dev/
Attached
Detach File
Event Timeline
Log In to Comment