Page MenuHomePhabricator

[services][terraform] Import shared resources
ClosedPublic

Authored by bartek on Jul 19 2023, 9:30 AM.
Tags
None
Referenced Files
F3181821: D8570.id29242.diff
Fri, Nov 8, 7:00 AM
F3181810: D8570.id28846.diff
Fri, Nov 8, 6:58 AM
F3181212: D8570.id28878.diff
Fri, Nov 8, 5:48 AM
F3179937: D8570.diff
Fri, Nov 8, 3:52 AM
Unknown Object (File)
Tue, Nov 5, 7:31 AM
Unknown Object (File)
Tue, Nov 5, 7:31 AM
Unknown Object (File)
Tue, Nov 5, 7:31 AM
Unknown Object (File)
Tue, Nov 5, 7:31 AM

Details

Summary

When trying to sync remote state with local terraform, I discovered several inconsistencies bethween them.
I needed to make adjustments in the terraform to match local state.
Introduced a is_dev variable to switch betweeen these two.

I don't know which resources are "correct" so I kept the remote state untouched.
Cc @jon, @varun

Depends on D8568

Test Plan

terraform plan in both dev/ and remote/ gives no changes after importing resources.

Used this imports file: imports.tf

note that I use import blocks which require Terraform 1.5 (the Nix one is 1.3)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jul 19 2023, 10:37 AM

The purpose of this diff is to decide which DDB tables are actually used and what their config should be. Then I'll apply these changes.

jon added inline comments.
services/terraform/modules/shared/dynamodb.tf
5–6

potentially dumb question. Does capacity do anything?

IIRC, the default billing_mode for a table is pay-per-request, which doesn't use these values.

From https://docs.aws.amazon.com/wellarchitected/latest/serverless-applications-lens/capacity.html

With on-demand capacity mode, DynamoDB charges you for the data reads and writes your application performs on your tables. You do not need to specify how much read and write throughput you expect your application to perform because DynamoDB instantly accommodates your workloads as they ramp up or down.

This revision now requires changes to proceed.Jul 19 2023, 11:39 AM
services/terraform/modules/shared/dynamodb.tf
5–6

Yeah, we can simply use PROVISIONED capacity mode and don't care about these values
feature-flags table does it IIRC

Changed billing model to PAY_PER_REQUEST

This revision is now accepted and ready to land.Jul 23 2023, 7:33 AM