generated from sfeir-open-source/sfeir-school-template
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
164 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "5.77.0" | ||
} | ||
} | ||
} | ||
|
||
module my-app-instance { | ||
source = "./modules/myschoolapp-module" | ||
my_app_env = "development" | ||
ec2_instance_count = 2 | ||
rds_instance_size = 20 | ||
rds_instance_id = "<yourinstanceid>" | ||
rds_instance_user = "<yourdbuser>" | ||
rds_instance_password = "<yourdbsecretpassword>" | ||
} |
12 changes: 12 additions & 0 deletions
12
steps/aws/06-team-working/modules/my-app-module/datasources.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Get the default VPC ID | ||
data "aws_vpc" "default" { | ||
default = true | ||
} | ||
|
||
# Get the default subnet IDs in the default VPC | ||
data "aws_subnets" "default" { | ||
filter { | ||
name = "vpc-id" | ||
values = [data.aws_vpc.default.id] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Define the AWS RDS instance resource | ||
# resource "aws_db_instance" "default" { | ||
# resource "aws_db_instance" "myschoolapp_db" { | ||
# } | ||
|
||
# Define the EC2 instance resources | ||
# resource "aws_instance" "default" { | ||
# resource "aws_instance" "myschoolapp_compute" { | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "5.77.0" | ||
} | ||
} | ||
} | ||
|
||
module my-app-instance { | ||
source = "./modules/myschoolapp-module" | ||
my_app_env = "development" | ||
ec2_instance_count = 2 | ||
rds_instance_size = 20 | ||
rds_instance_id = "cdarcymysqldb" | ||
rds_instance_user = "cdarcy" | ||
rds_instance_password = "cdarcy_mysqldb_61672" | ||
} | ||
rds_instance_id = "mysqldb" | ||
rds_instance_user = var.rds_dbuser | ||
rds_instance_password = var.rds_dbpassword | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
variable "rds_dbuser" { | ||
# configure eternally through a secret or an environment variable, eg. | ||
# export TF_rds_dbuser="youruser" | ||
sensitive = true | ||
} | ||
|
||
variable "rds_dbpassword" { | ||
# configure eternally through a secret or an environment variable, eg. | ||
# export TF_rds_dbpassword="yourpassword" | ||
sensitive = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
variable "rds_dbuser" { | ||
# configure eternally through a secret or an environment variable, eg. | ||
# export TF_rds_dbuser="youruser" | ||
sensitive = true | ||
} | ||
|
||
variable "rds_dbpassword" { | ||
# configure eternally through a secret or an environment variable, eg. | ||
# export TF_rds_dbpassword="yourpassword" | ||
sensitive = true | ||
} |