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

feat: support terraform nested directories project structure #5745

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

moelasmar
Copy link
Contributor

Which issue(s) does this change fix?

#4724

Why is this change necessary?

Currently, customers could not use sam build command on Terraform projects that has a nested directories structure.

How does it address the issue?

Customers can pass a new parameter --terraform-project-root-path and pass the project root directory path that contains all the nested structures.
for example for this scenario:

/project
  /infrastructure
    envrionment/
        dev/
            dev.tfvars
        test/
            test.tfvars
    main.tf
    providers.tf
  /src
    ... (lambda code) ...
  /tests
    ... (lambda tests) ...

customers can execute sam build command from this path /project/infrastructure where the Terraform root module configuration files exist, and pass the value of the new parameter --terraform-project-root-path as ./.. or /project.

SAM CLI will use the value passed in the new parameter to set the ProjectRootDirectory property in all the lambda functions/layers metadata properties, and so Lambda Builders will be able to determine which directory that will be copied to the Temporary directory, and then run the building logic.

What side effects does this change have?

N/A

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@moelasmar moelasmar requested a review from a team as a code owner August 10, 2023 09:59
@moelasmar moelasmar requested review from lucashuy and jfuss August 10, 2023 09:59
@github-actions github-actions bot added area/build sam build command area/schema JSON schema file pr/internal labels Aug 10, 2023
@moelasmar moelasmar enabled auto-merge August 10, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build sam build command area/schema JSON schema file pr/internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants