Skip to content

Commit

Permalink
Fix: Gcp Tfvars 경로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gytjd committed Nov 20, 2024
1 parent e187165 commit ab3e331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public String addOrUpdateAwsAndGcpKey(String email, String companyName, String a
AiwaKey aiwaKey = findOrCreateAiwaKey(member, companyName);
aiwaKey.setAccessKey(accessKey);
aiwaKey.setSecretKey(secretKey);

// AWS tfvars 파일 생성 및 URL 반환
String awsTfvarsUrl = s3Service.createAwsTfvarsFile(email, accessKey, secretKey);
aiwaKey.setAwsTfvarsUrl(awsTfvarsUrl);
Expand All @@ -84,7 +84,7 @@ public String addOrUpdateAwsAndGcpKey(String email, String companyName, String a
aiwaKey.setGcpKeyPath(gcpKeyPath);

// GCP tfvars 파일 생성 및 URL 반환
String gcpTfvarsUrl = s3Service.createGcpTfvarsFile(email,projectId); // GCP tfvars 생성
String gcpTfvarsUrl = s3Service.createGcpTfvarsFile(email,projectId,gcpKeyPath); // GCP tfvars 생성
aiwaKey.setGcpTfvarsUrl(gcpTfvarsUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ public String createAwsTfvarsFile(String userId, String accessKey, String secret
}

// GCP tfvars 파일 생성
public String createGcpTfvarsFile(String userId, String gcpProjectId) {
public String createGcpTfvarsFile(String userId,String projectId, String gcpKeyPath) {
String userPrefix = "users/" + userId + "/GCP/";
String tfvarsContent = String.format("""
gcp_project_id = "%s"
gcp_credentials = "users/%s/GCP/gcp_credentials.json"
""", gcpProjectId, userId);
gcp_credentials = "%s"
""", projectId, gcpKeyPath);

String tfvarsKey = userPrefix + "gcp_terraform.tfvars";
s3Client.putObject(bucketName, tfvarsKey, tfvarsContent);
Expand Down

0 comments on commit ab3e331

Please sign in to comment.