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

CDKTF userdata path: examples does not work in aws launch template #3764

Open
1 task
rpatidar opened this issue Nov 5, 2024 · 0 comments
Open
1 task

CDKTF userdata path: examples does not work in aws launch template #3764

rpatidar opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working new Un-triaged issue

Comments

@rpatidar
Copy link

rpatidar commented Nov 5, 2024

Expected Behavior

cdk synth should work and should not fail.

Actual Behavior

i have tried various options placing the file at differrent folders it always return

Failure1

                       │ Error: Invalid function argument
                       │
                       │   on cdk.tf.json line 94, in resource.aws_launch_template.MyService-LTConstruct-test (MyService-LTConstruct-test):
                       │   94:         "user_data": "${filebase64(\"scripts/myscript.sh\")}",
                       │     ├────────────────
                       │     │ while calling filebase64(path)

Failue2:

                       │ Error: Invalid function argument
                       │
                       │   on cdk.tf.json line 94, in resource.aws_launch_template.ResumeParsingService-LTConstruct-test (ResumeParsingService-LTConstruct-test):
                       │   94:         "user_data": "${filebase64(\"$${path.module}/resumeparsingservice.sh\")}",
                       │     ├────────────────
                       │     │ while calling filebase64(path)
                       │
                       │ Invalid value for "path" parameter: no file exists at
                       │ "${path.module}/resumeparsingservice.sh"; this function works only with files
                       │ that are distributed as part of the configuration source code, so if this
                       │ file will be created by a resource in this configuration you must instead
                       │ obtain this result from an attribute of that resource.

Steps to Reproduce

create cloudformation following the terraform from https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template ( typescript version)

the example have userData: Token.asString(Fn.filebase64("${path.module}/example.sh")), which didn't worked. i simplified and moved all the content to root directory and still it was not finding the scripts.

Versions

language : typescript

cdktf --version
0.20.9

node --version
v20.16.0

Providers

No response

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@rpatidar rpatidar added bug Something isn't working new Un-triaged issue labels Nov 5, 2024
@rpatidar rpatidar changed the title COMPONENT: user data path examples does not work in aws launch template CDKTF userdata path: examples does not work in aws launch template Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant