Skip to content

Commit

Permalink
feat: update terraform providers and limit file writes on renames
Browse files Browse the repository at this point in the history
  • Loading branch information
darraghoriordan committed Dec 31, 2023
1 parent 8731728 commit 6cf598d
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 47 deletions.
57 changes: 30 additions & 27 deletions infrastructure/local-dev/auth0-dev/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions infrastructure/local-dev/auth0-dev/auth0-resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ resource "auth0_resource_server" "backend_api_app" {
resource "auth0_resource_server_scopes" "backend_api_app_scopes" {
resource_server_identifier = auth0_resource_server.backend_api_app.identifier


scopes {
name = "read:own"
description = "Read own records"
Expand Down Expand Up @@ -86,8 +85,6 @@ resource "auth0_resource_server_scopes" "backend_api_app_scopes" {
resource "auth0_role" "super_user_role" {
name = "SuperUserDeveloper"
description = "This role is able to do everything"


}

resource "auth0_role_permissions" "backend_api_app_role_permissions" {
Expand Down Expand Up @@ -131,6 +128,7 @@ resource "auth0_user" "dev_test_basic_user" {
email_verified = true
given_name = "Basic"
family_name = "User"

}

resource "auth0_user" "dev_test_no_email_verified_user" {
Expand All @@ -141,6 +139,7 @@ resource "auth0_user" "dev_test_no_email_verified_user" {
email_verified = false
given_name = "NoEmail"
family_name = "Verified"

}

resource "auth0_user" "dev_test_user" {
Expand Down Expand Up @@ -185,7 +184,7 @@ output "app_auth0_dev_management_client_secret" {
sensitive = true
}
output "auth0_client_secret" {
value = auth0_client.frontend_spa_app.client_secret
value = auth0_client_credentials.fe_spa_client_credentials.client_secret
sensitive = true
}
output "test_user_username" {
Expand Down
31 changes: 16 additions & 15 deletions infrastructure/production/auth0-prod/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion infrastructure/production/auth0-prod/auth0-resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ output "app_auth0_prod_management_client_secret" {
sensitive = true
}
output "auth0_client_secret" {
value = auth0_client.frontend_spa_app.client_secret
value = auth0_client_credentials.fe_spa_client_credentials.client_secret
sensitive = true
}
10 changes: 10 additions & 0 deletions libs/project-setup/setup-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ const searchFilesForTextAndReplace = async (
dot: true,
gitignore: true,
ignore: [
"*.png",
"*.jpg",
"*.jpeg",
"*.gif",
"*.svg",
"*.ico",
".git/**/*",
"node_modules/**/*",
"dist/**/*",
Expand All @@ -91,7 +97,11 @@ const searchFilesForTextAndReplace = async (
const fileContents = fs.readFileSync(file, "utf8");
for (const { search, replace } of replacePatterns) {
const regex = new RegExp(search, "g");
if (!regex.test(fileContents)) {
continue;
}
const newFileContents = fileContents.replace(regex, replace);
console.log(`replacing ${search} with ${replace} in ${file}`);
fs.writeFileSync(file, newFileContents);
}
});
Expand Down

0 comments on commit 6cf598d

Please sign in to comment.