Skip to content

Commit

Permalink
feat: change user from cs to eleve, add env vars for tp(#7)
Browse files Browse the repository at this point in the history
* feat: change user from cs to eleve

* feat: add env vars for tp

* fix: remove deprecated aws profile

Co-authored-by: Antoine Ansari <[email protected]>
  • Loading branch information
Mohsen51 and Antoine Ansari authored Jan 17, 2023
1 parent d5ba18b commit e64185d
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 14 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*
.terraform.lock.hcl

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To connect to the VM:
- Create a SSH key on your Github account: [Add a ssh key documentation](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
- Share your handle Github with Padok's team member

- Launch a "Remote SSH Session" with VSCode extension via the command `ssh cs@<handleGithub>.cs.padok.school`
- Launch a "Remote SSH Session" with VSCode extension via the command `ssh eleve@<handleGithub>.cs.padok.school`

## Explore the Terraform code

Expand Down
10 changes: 6 additions & 4 deletions iac/dev.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
environment = "dev"
vpc_id = "vpc-0fbfe8a414325b6e6"
private_subnets = ["subnet-0e185b7265256ab22", "subnet-0b4e47a0eb4f52406"]
public_subnets = ["subnet-000da12999c598b26", "subnet-054b28934c16043b5"]

aws_region = "eu-west-3"
environment = "dev"
vpc_id = "vpc-02b1b1107bdb3dad4"
public_subnets = ["subnet-0fd3481b698bd44b7","subnet-0f60f004d87f6e1c5"]
private_subnets = ["subnet-07291e52d7cc7d0aa","subnet-0c1eef5af5c50f14a"]
9 changes: 5 additions & 4 deletions iac/prd.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

environment = "prd"
vpc_id = "vpc-06987f5dade98b59a"
private_subnets = ["subnet-0aaae4f50bfd26d64", "subnet-04659d20c010aac58"]
public_subnets = ["subnet-0b93808f63a1676d4", "subnet-023ee16302deb756c"]
aws_region = "eu-west-3"
environment = "prd"
vpc_id = "vpc-0dd9c0f79c31c777e"
public_subnets = ["subnet-01af9d35b4279a9c2","subnet-0267c286d9c051e9c"]
private_subnets = ["subnet-0438f5549da998fd6","subnet-0ea9360b02a77cc08"]
2 changes: 1 addition & 1 deletion vscode-box/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ resource "aws_route53_record" "vm" {
# Output

output "public_dns" {
value = {for user in local.github_usernames: user => "ssh cs@${user}.cs.padok.school"}
value = {for user in local.github_usernames: user => "ssh eleve@${user}.cs.padok.school"}
}
2 changes: 1 addition & 1 deletion vscode-box/userdata.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
groups:
- docker
users:
- name: cs
- name: eleve
ssh_import_id:
- gh:${github_username}
lock_passwd: true
Expand Down
5 changes: 4 additions & 1 deletion vscode-box/usernames.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
locals {
github_usernames = toset([
"Anne-Flore","oussamaca"
"Anne-Flore",
"oussamaca",
# Antoine Ansari
"Mohsen51"
])
}
4 changes: 2 additions & 2 deletions vscode-box/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ locals {
common_tags = {
source = "Dojo VSCode Box"
}
env_name = "dojocs"
env_name = "dojo"
}

resource "aws_vpc" "vpc" {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tags = merge(local.common_tags,
{ Name = "Dojo CS" })
{ Name = "Dojo" })
}

data "aws_availability_zones" "available" {
Expand Down

0 comments on commit e64185d

Please sign in to comment.