Skip to content

Commit

Permalink
add experimental comment section
Browse files Browse the repository at this point in the history
  • Loading branch information
weilueluo committed Aug 7, 2024
1 parent 05e931a commit fbed395
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 5 deletions.
4 changes: 4 additions & 0 deletions infra/TERRAFORM_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_cognito"></a> [cognito](#module\_cognito) | ./modules/cognito | n/a |
| <a name="module_db"></a> [db](#module\_db) | ./modules/dynamo | n/a |
| <a name="module_luoweilue_com_redirect"></a> [luoweilue\_com\_redirect](#module\_luoweilue\_com\_redirect) | ./redirect | n/a |
| <a name="module_v1"></a> [v1](#module\_v1) | ./site_static | n/a |
| <a name="module_v2"></a> [v2](#module\_v2) | ./site_static | n/a |
Expand All @@ -33,6 +35,8 @@ No resources.

| Name | Description |
|------|-------------|
| <a name="output_cognito"></a> [cognito](#output\_cognito) | n/a |
| <a name="output_db"></a> [db](#output\_db) | n/a |
| <a name="output_redirect"></a> [redirect](#output\_redirect) | n/a |
| <a name="output_v1"></a> [v1](#output\_v1) | n/a |
| <a name="output_v2"></a> [v2](#output\_v2) | n/a |
Expand Down
21 changes: 21 additions & 0 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ module "v2" {
# # lb_account_id = "652711504416" # for "eu-west-2" region, check https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html
# }

module "db" {
source = "./modules/dynamo"

resource_prefix = "v3"
partition_key = {
name = "name"
type = "S"
}
sort_key = {
name = "time"
type = "N"
}
}

# requires updating the .env.local file for the cognito pool id
module "cognito" {
source = "./modules/cognito"
resource_prefix = "v3"
dynamodb_arn = module.db.arn
}

module "v3" {
source = "./site_dynamic/v3"
resource_prefix = "v3"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions infra/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ output "redirect" {
"weilueluo.com" : module.weilueluo_com_redirect,
})
}

output "db" {
value = module.db
}

output "cognito" {
value = module.cognito
}
9 changes: 5 additions & 4 deletions infra/site_dynamic/v3/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ data "template_file" "user_data" {

# instance
resource "aws_instance" "instance" {
ami = data.aws_ami.ami.id
instance_type = var.instance_type
subnet_id = aws_subnet.subnet.id
security_groups = [aws_security_group.security_group.id]
ami = data.aws_ami.ami.id
instance_type = var.instance_type
subnet_id = aws_subnet.subnet.id
vpc_security_group_ids = [aws_security_group.security_group.id]

associate_public_ip_address = true
key_name = aws_key_pair.key_pair.key_name
user_data = data.template_file.user_data.rendered
user_data_replace_on_change = true

tags = {
Name = var.resource_prefix
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/V3_NEXT_TAG.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
89
92

0 comments on commit fbed395

Please sign in to comment.