Skip to content

Commit 847c821

Browse files
chore: add demo .tfvars files and update README (#2)
1 parent bf28d7f commit 847c821

File tree

6 files changed

+43
-15
lines changed

6 files changed

+43
-15
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ crash.*.log
1313
# password, private keys, and other secrets. These should not be part of version
1414
# control as they are data points which are potentially sensitive and subject
1515
# to change depending on the environment.
16-
*.tfvars
17-
*.tfvars.json
16+
# *.tfvars
17+
# *.tfvars.json
1818

1919
# Ignore override files as they are usually used to override resources locally and so
2020
# are not checked in

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,47 @@ This project provisions the following resources on AWS:
99
- **S3 Bucket**: static website hosting
1010
- **CloudFront Distribution**: global CDN with HTTPS support
1111
- **DynamoDB Table**: to store product data
12-
- **Lambda Function**: `get_products`: read items from DynamoDB
13-
- **Lambda Function**: `post_products`: write items into DynamoDB
12+
- **Lambda Function**: `get_products`: read items from DynamoDB
13+
- **Lambda Function**: `post_products`: write items into DynamoDB
1414

1515
### Architecture Diagram
16+
1617
![Infrastructure Diagram](src/infra/graph.png)
1718

1819
## Project structure:
1920

2021
The project is under the src folder.
2122

22-
- **infra**: contains all Terraform files; run `terraform` commands from here
23-
- **infra-modules**: reusable Terraform modules for resources
24-
- **lambda-function-python**: Python source code for Lambda functions
25-
- **lambda-function-python-zip**: folder used by Terraform to generate Lambda ZIPs
26-
- **web-template**: static web templates to be uploaded to S3
23+
- **infra**: contains all Terraform files; run `terraform` commands from here
24+
- **infra-modules**: reusable Terraform modules for resources
25+
- **lambda-function-python**: Python source code for Lambda functions
26+
- **lambda-function-python-zip**: folder used by Terraform to generate Lambda ZIPs
27+
- **web-template**: static web templates to be uploaded to S3
2728

2829
## 🚀 Commands
2930

3031
Initialize, plan and apply:
3132

3233
```bash
3334
terraform init
34-
terraform plan -var-file=variables/dev.tfvars
35-
terraform apply -var-file=variables/dev.tfvars
35+
terraform plan -var-file='variables/dev.tfvars'
36+
terraform apply -var-file='variables/dev.tfvars'
3637
```
3738

3839
Destroy infrastructure:
3940

4041
```bash
41-
terraform destroy -var-file=variables/dev.tfvars
42+
terraform destroy -var-file='variables/dev.tfvars'
4243
```
4344

44-
## Future Enhancements
45-
Stay tuned! This project will be extended with new features and improvements, making it an even more complete serverless case study. 🚀
45+
## Future Enhancements
46+
47+
Stay tuned! This project will be extended with new features and improvements, making it an even more complete serverless case study. 🚀
4648

4749
## License
50+
4851
This project is licensed under the **MIT License**. Use at your own risk. If something breaks, **it's your problem!** 😆
4952

5053
---
51-
🚀 Happy Coding!
54+
55+
🚀 Happy Coding!

src/infra/.terraform.lock.hcl

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/infra/variables/dev.tfvars

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This .tfvars file is included for demonstration purposes only.
2+
# In real projects, .tfvars files should NOT be committed to version control
3+
# as they often contain sensitive information (e.g., passwords, API keys)
4+
# and environment-specific values that change over time.
5+
6+
aws_region = "eu-central-1"
7+
project_environment = "dev"

src/infra/variables/prod.tfvars

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This .tfvars file is included for demonstration purposes only.
2+
# In real projects, .tfvars files should NOT be committed to version control
3+
# as they often contain sensitive information (e.g., passwords, API keys)
4+
# and environment-specific values that change over time.
5+
6+
aws_region = "eu-central-1"
7+
project_environment = "prod"

src/infra/variables/qa.tfvars

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This .tfvars file is included for demonstration purposes only.
2+
# In real projects, .tfvars files should NOT be committed to version control
3+
# as they often contain sensitive information (e.g., passwords, API keys)
4+
# and environment-specific values that change over time.
5+
6+
aws_region = "eu-central-1"
7+
project_environment = "qa"

0 commit comments

Comments
 (0)