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

Feature request: SAM CLI -Include-dir (Terraform) (Build) #5339

Closed
SuperP4rks opened this issue Jun 12, 2023 · 5 comments
Closed

Feature request: SAM CLI -Include-dir (Terraform) (Build) #5339

SuperP4rks opened this issue Jun 12, 2023 · 5 comments
Labels
area/build sam build command area/terraform terraform support issue type/feature Feature request

Comments

@SuperP4rks
Copy link

Hi Team,

I think this has been discussed in other threads, but it would be really helpful if we can help with more structured repositories in a terraform work flow like the below:

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

I prepose a couple of solutions:

    1. add a cli command to include-dir e.g. --include-dir "../src/*"
    • this could then be added to the samconfig.toml
version = 0.1
[default]
[default.build.parameters]
hook_name = "terraform"
beta_features = true
include-dir = ../src/*
    1. Pull through the code declared in the sam_metadata resource `
resource "null_resource" "sam_metadata_..." {
  triggers = {
    original_source_code = "../src
  }
}

I have tried playing with the --base-dir and --manifest flags however when the file is located above the root it cannot identify the ../src folder with the lambda code.

It would be amazing to see if we can help with more flexible terraform builds to suit the structured folders, instead of putting the python structure under the terraform folder.

@SuperP4rks SuperP4rks added stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. type/feature Feature request labels Jun 12, 2023
@GantZA
Copy link

GantZA commented Jun 12, 2023

I would like this feature too, currently trying to help setup SAM and Terraform at a client where lambda function projects are structure similar to the above. local debugging and testing isn't great at the moment but SAM working with Terraform would solve this massively

@mildaniel mildaniel removed the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jun 12, 2023
@mildaniel
Copy link
Contributor

Thanks for the feature request. We understand this to be a limitation currently impacting customers and are looking at a few different ways to address this issue!

@SuperP4rks
Copy link
Author

Hi @mildaniel ,

Do we have an ETA or a view on when this is in the roadmap.

Also do we need to update the tags to add area/build, area/terraform?

@moelasmar moelasmar added area/build sam build command area/terraform terraform support issue labels Jun 19, 2023
@moelasmar
Copy link
Contributor

Hi @jordancparker,
Thanks for raising this request. This request is a duplicate of this issue. I am going to close your request, and you can follow up on the other issue to get updates on this feature.

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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/terraform terraform support issue type/feature Feature request
Projects
None yet
Development

No branches or pull requests

4 participants