-
Notifications
You must be signed in to change notification settings - Fork 18
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
[WIP] Add node.js module containing Terraform interpolation functions #268
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On top of the work here - I assume we'll need to also start building and publishing an actual @pulumi/terraform
package out of this repo?
sdk/nodejs/index.ts
Outdated
* @param path the full path | ||
*/ | ||
export function basename(path: string): string { | ||
return Path.win32.basename(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this use win32 basename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that is the behaviour that Terraform uses filepath.basename
instead of path.basename
in order to deal with Windows paths correctly. I added a test for this case to ensure it works with both types.
434b893
to
cf8022a
Compare
cadf732
to
7cdd3ca
Compare
51be5ce
to
314a913
Compare
@ellismg, as discussed, I've tagged you for review to ensure that the build system is correct. I've not yet pulled in the package publishing script, but once the tests are passing in Travis CI, I will do so. |
eeac6d5
to
ae726f5
Compare
This is quite stale now - so I'll close it out for now. If/when we want to come back to it there's some great work in this branch. |
This PR is work in progress to fix #267.
The interpolation functions in Terraform are as follows (checked off when part of this PR, or with notes beside them):
abs
basename
base64decode
base64encode
base64gzip
- implemented butgzip
options appear different so test cases do not pass 1-1base64sha256
base64sha512
bcrypt
ceil
chomp
chunklist
cidrhost
cidrnetmask
cidrsubnet
coalesce
coalescelist
compact
concat
contains
dirname
distinct
element
file
flatten
floor
format
formatlist
indent
index
join
jsonencode
keys
length
list
log
lower
map
max
matchkeys
md5
merge
min
pathexpand
pow
uuid
replace
rsadecrypt
sha1
sha256
sha512
signum
slice
sort
split
substr
timestamp
timeadd
title
transpose
trimspace
upper
values
urlencode
zipmap
There is a minimal set of runtime dependencies (and several more development dependencies).
Still do do: