Is there any way to have access to AWS cli within railway?
We have some self hosted Python packages in AWS and part of the build process is to retrieve a token from AWS, which will then be used to install our private packages. We use the AWS cli for this - is there any way in which we can access the AWS cli within railway?
6 Replies
Project ID:
N/A
I like to think I know railway quite well, but I don't know about this aws cli, so please tell me more about the aws cli so I can try to help you integrate it into the build process.
how would you authentication the aws cli normally?
Sorry, I mis-worded that. I actually don't know if the AWS cli is installed on railway the same way something like Python may be. You typically won't have AWS cli installed on your local machine and you'd need to download it like this. Then, you'd have to authenticate with the AWS cli using the
aws configure
command and then pass it your aws access key id and aws secret key id.oh yeah I'm not worried about being able to install the aws cli onto a railway deployment, I'm looking to find out from you if the cli offers a headless authentication method
headless meaning, you could pass in maybe a key and secret into the cli via arguments
What I ended up doing was configuring a custom
railway.toml
for the build. For the build command I had it run a custom shell script called railway_setup.sh
. This shell script included the running of a python script using the aws boto3
client to retrieve the credentials.
railway.toml
boto3
can automatically make use of AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
env to authenticate, so there is no need to use the aws client
railway_setup.sh
export_code_artifact.pyHowever, I am now getting the following error:
what do you have in your deployment logs?