tall-beard-99429
05/24/2021, 3:31 PMconst proj = new gitlab.Project(...)
and I want to get proj.id
to use in a string literal (typescript). The documentation seems to be indicating that I can do this: `console.log(proj.id.apply(v => ${v}
));` however it doesn't like itbored-oyster-3147
05/24/2021, 3:41 PMOutput<string>.apply(v => "${v}");
would return Output<string>
The same way that:
Promise<string>.then(v => $"{v}");
returns Promise<string>
If you need to interpolate it into a string literal, then your literal needs to be part of the promise:
var result = proj.id.apply(id => "My project ID is ${id}");
now result
is Output<string>
and your proj.id
has been interpolated and can be passed to an Input<string>
tall-beard-99429
05/24/2021, 3:44 PMnew gitlab.BranchProtection(`BranchProtection(${proj.id}:${project.defaultBranch})`, {...})
Input<string>
bored-oyster-3147
05/24/2021, 3:47 PMtall-beard-99429
05/24/2021, 3:48 PMbored-oyster-3147
05/24/2021, 3:50 PMgitlab.Project
, so why not {projectName}-branchprotection-{branchName}
tall-beard-99429
05/24/2021, 3:51 PMnew gitlab.Project()
bored-oyster-3147
05/24/2021, 3:52 PMnew gitlab.Project(name, ...)
not be unique?tall-beard-99429
05/24/2021, 3:52 PMbored-oyster-3147
05/24/2021, 3:52 PMtall-beard-99429
05/24/2021, 3:56 PMdelete
or to at least run them first?bored-oyster-3147
05/24/2021, 3:59 PMreplace
action pulumi does create new, delete old
but for some types of resources that have unique constraints that default behavior doesn't work so you set deleteBeforeReplace: true
in the resource options which makes a replace
action do delete current, create new
destroy
first though since you are actually changing the pulumi names of theses resources so pulumi no longer sees them as the same entity and thus is doing the create and destroy separatelypulumi up
so that it deletes them first since they are no longer declared - then uncomment them with the new namestall-beard-99429
05/24/2021, 4:18 PMbored-oyster-3147
05/24/2021, 4:20 PM