Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Move IaC files to a specified folder #144

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion .github/workflows/dev-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}

- name: Initialize Terraform
run: terraform init
run: |
cd iac
Copy link
Contributor Author

@eranelbaz eranelbaz Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that the right way to do it?
if so I'll split it to another step

Copy link

@cparedes cparedes Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW it might actually be better to use a working-directory parameter, like so:

Suggested change
cd iac
run: terraform init
working-directory: "./iac"

terraform init

- name: Select Terraform Workspace
run: terraform workspace select dev
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/prod-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}

- name: Initialize Terraform
run: terraform init
run: |
cd iac
terraform init

- name: Select Terraform Workspace
run: terraform workspace select prod
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions .terraform.lock.hcl → iac/.terraform.lock.hcl

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions lambda.tf → iac/lambda.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "null_resource" "api_function_binary" {
provisioner "local-exec" {
command = "GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOFLAGS=-trimpath go build -mod=readonly -tags lambda.norpc -ldflags='-s -w' -o ../api_function_bootstrap/bootstrap ./lambda/api"
working_dir = "./src"
working_dir = "../src"
}

triggers = {
Expand All @@ -12,7 +12,7 @@ resource "null_resource" "api_function_binary" {
resource "null_resource" "populate_provider_versions_binary" {
provisioner "local-exec" {
command = "GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOFLAGS=-trimpath go build -mod=readonly -tags lambda.norpc -ldflags='-s -w' -o ../populate_provider_versions_bootstrap/bootstrap ./lambda/populate_provider_versions"
working_dir = "./src"
working_dir = "../src"
}

triggers = {
Expand All @@ -24,15 +24,15 @@ data "archive_file" "api_function_archive" {
depends_on = [null_resource.api_function_binary]

type = "zip"
source_file = "./api_function_bootstrap/bootstrap"
source_file = "../api_function_bootstrap/bootstrap"
output_path = "api_bootstrap.zip"
}

data "archive_file" "populate_provider_versions_archive" {
depends_on = [null_resource.populate_provider_versions_binary]

type = "zip"
source_file = "./populate_provider_versions_bootstrap/bootstrap"
source_file = "../populate_provider_versions_bootstrap/bootstrap"
output_path = "populate_provider_versions_bootstrap.zip"
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading