You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- README: added Remote State Setup and Module Structure sections
- GAP_ANALYSIS: updated to reflect completed modules and backend
- CHANGELOG: added to document all refactoring changes
- DynamoDB table: `terraform-locks` (for state locking)
165
+
166
+
2.**Note the Output**
167
+
168
+
After applying, note the `backend_config` output which shows the exact configuration to use.
169
+
170
+
3.**Enable Remote State**
171
+
172
+
Edit `provider.tf` and uncomment the backend block:
173
+
174
+
```hcl
175
+
terraform {
176
+
# ... required_providers ...
177
+
178
+
backend "s3" {
179
+
bucket = "terraform-state-<ACCOUNT_ID>"
180
+
key = "ai-chatbot/terraform.tfstate"
181
+
region = "us-east-1"
182
+
encrypt = true
183
+
dynamodb_table = "terraform-locks"
184
+
}
185
+
}
186
+
```
187
+
188
+
4.**Migrate State**
189
+
190
+
```bash
191
+
cd .. # Return to project root
192
+
terraform init -migrate-state
193
+
```
194
+
195
+
Terraform will ask to copy your existing local state to the new S3 backend.
196
+
197
+
### AWS Academy Note
198
+
199
+
In AWS Academy environments, the backend S3 bucket and DynamoDB table may need to be recreated each session since resources are deleted when labs end. For persistent setups, consider using a personal AWS account.
200
+
201
+
---
202
+
144
203
## Deployment
145
204
146
205
### 1. Clone and Configure
@@ -268,11 +327,18 @@ If the bot stops responding after redeployment:
0 commit comments