Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

general cleanup of pipeline stuff for new auth0 implementation #85

Merged
merged 3 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
awsCredentials:
description: 'AWS Credentials'
required: true
auth0Secret:
description: 'Auth0 Secret'
required: true
auth0Domain:
description: 'Auth0 Domain'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: 'AWS Credentials'
required: true
auth0Domain:
description: 'Auth0 Issuer Base URL'
description: 'Auth0 Domain'
required: true
auth0ClientId:
description: 'Auth0 Client ID'
Expand Down
25 changes: 11 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ data "auth0_client" "unibasement" {
name = auth0_client.unibasement.name
}

output "auth0_client_domain_url" {
value = data.auth0_tenant.unibasement.domain
}


data "auth0_tenant" "unibasement" {}
resource "aws_ecs_task_definition" "unibasement_frontend" {
Expand Down Expand Up @@ -242,7 +238,7 @@ resource "aws_ecs_task_definition" "unibasement_frontend" {
},
{
"name": "AUTH0_SECRET",
"value": "ff7eb6072eb762d21999e7fda733feba681970b781f3ba0d55867b7d0c83ca2a"
"value": "${random_string.auth0_secret.result}"
},
{
"name": "AUTH0_BASE_URL",
Expand All @@ -267,10 +263,12 @@ resource "aws_ecs_task_definition" "unibasement_frontend" {
DEFINITION
}

# the client secret is a session encryption key and therefore the above is not a gross violation of like every security principle ever lmao. we could generate it every now and then but this like way too much effort for an mvp. hi evan!!!

#TODO pass in auth0 variables into the above.

# Generate a random string for the secret
resource "random_string" "auth0_secret" {
length = 64
special = true
}

#TODO need scalability stuff for front, back db ?

Expand Down Expand Up @@ -346,11 +344,6 @@ data "aws_network_interface" "unibasement_backend_ip" {
id = data.aws_network_interfaces.unibasement_backend_ip.ids[0]
}

output "thebackendip" {
value = data.aws_network_interface.unibasement_backend_ip.association[0].public_ip
}


resource "aws_ecs_task_definition" "unibasement_backend" {
family = "unibasement_backend"
network_mode = "awsvpc"
Expand Down Expand Up @@ -520,10 +513,14 @@ resource "aws_lb_listener" "unibasement" {
}

resource "local_file" "url" {
content = "http://${aws_lb.unibasement.dns_name}:3000/" # TODO figure out
content = "http://${aws_lb.unibasement.dns_name}:3000/"
filename = "./unibasement.txt"
}

output "url" {
value = "http://${aws_lb.unibasement.dns_name}:3000/"
}



////////////////////////////// Miscellaneous ///////////////////////////////////
Loading