https://pulumi.com logo
#python
Title
# python
s

sparse-intern-71089

01/03/2021, 6:23 PM
This message was deleted.
g

green-school-95910

01/03/2021, 6:25 PM
Secret values are `Output`s in runtime while building the resource graph, since they have to carry their "secrecy" to every value derived from them.
Copy code
# Start up script
r_server_startup = GITHUB_PASSWORD.apply(lambda password: f"""
#!/bin/bash
cd ~ ;
sudo apt update;
sudo apt install -y git;
sudo git clone -b {BRANCH} https://{GITHUB_USERNAME}:{password}@github.com/orgacuity/orgacuity.git;
""")
The
r_server_startup
will be a new
Output
that holds the script and is also secret, since it is derived from a secret
Output
f

full-account-26076

01/03/2021, 6:32 PM
Ah, thanks, @green-school-95910. I had something similar with
apply
before but just not in this fashion. I'll give it a run.
The good part is that the
apply
method is rendering because installs occur. Bad part is that the password isn't materializing in
r_startup_script
and the clone doesn't occur.
g

gentle-diamond-70147

01/05/2021, 12:14 AM
@full-account-26076 can you share more detail about what you're getting in the startup script? If I try the attached code (with Luiz's
.apply()
example), I see my secret in the stack output with
pulumi stack output --show-secrets
.
f

full-account-26076

01/05/2021, 12:49 AM
@gentle-diamond-70147 - Sorry, I got this working and it wasn't a Pulumi problem (the problem was me). Bad GitHub URL 🙄 . Thanks!
g

gentle-diamond-70147

01/05/2021, 12:49 AM
Glad you got it working!
💯 1
f

full-account-26076

01/05/2021, 12:52 AM
Honestly, smooth as butter.