Closed josephlim75 closed 3 years ago
Was having the same issue for the aws plugin too cannot load such file -- ~/home/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/terraspace_plugin_aws-0.2.2/lib/terraspace_plugin_aws/interfaces
I was getting a similar error when running on macOS (10.15.7). For me, works only when running 'bundle exec' in front of the command. for example => bundle exec terraspace all up
So, I have this sh to simplify my run, where I also added a few more variables like env and region
#!/bin/bash
if [ $# -le "3" ]
then
tput setaf 1; echo "No all arguments supplied, Please supply command (e.g. plan), scope (e.g. demo), enviroment (e.g. dev), region (e.g. eu-west-1)"
tput setaf 1; echo "for example => ./run.sh plan demo dev eu-west-1"
else
command=$1
scope=$2
env=$3
region=$4
export TS_ENV=$3
export AWS_REGION=$4
tput setaf 2; echo "Set Enviroment => $env; Running Terraspace $command for $scope stack(s)"
fi
if [ "$scope" = "all" ];
then
bundle exec terraspace all $command
else
bundle exec terraspace $command $scope
fi
@eugeneromancenko Thanks for the script. Wondering which version terraspace you're using. In v0.5.x terraspace loads bundler/setup internally earlier and believe that should get rid of the need to call bundle exec
. Thanks!
Managed to get it work inside an alpine container: Building 86.3s
FROM ruby:2.7.2-alpine3.12
RUN apk add ruby-unf_ext cmake build-base git terraform aws-cli
RUN gem install terraspace
env
/ # env
RUBY_MAJOR=2.7
HOSTNAME=34aca7e1e102
SHLVL=1
HOME=/root
BUNDLE_APP_CONFIG=/usr/local/bundle
RUBY_VERSION=2.7.2
TERM=xterm
PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=C.UTF-8
GEM_HOME=/usr/local/bundle
RUBY_DOWNLOAD_SHA256=1b95ab193cc8f5b5e59d2686cb3d5dcf1ddf2a86cb6950e0b4bdaae5040ec0d6
PWD=/
BUNDLE_SILENCE_ROOT_WARNING=1
After configuring the aws cli I was able to create the demo stack. Regarding the aws credentials those could be mounted or used from the env file.. or other options
terraspace up demo
Building .terraspace-cache/us-east-1/dev/stacks/demo
Creating bucket: terraform-state-<aws_account_id>-us-east-1-dev
Creating dynamodb table: terraform_locks
Waiting for dynamodb table to finish creating...
Built in .terraspace-cache/us-east-1/dev/stacks/demo
Current directory: .terraspace-cache/us-east-1/dev/stacks/demo
=> terraform init -get -input=false >> /tmp/terraspace/log/init/demo.log
=> terraform apply -input=false
Acquiring state lock. This may take a few moments...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# random_pet.this will be created
+ resource "random_pet" "this" {
+ id = (known after apply)
+ length = 2
+ separator = "-"
}......
@l1ahim Thanks for the help with the alpine dockerfile 👍
Docker images with terraspace are now on Dockerhub: https://hub.docker.com/r/boltops/terraspace 🎉 They are built and published on a daily basis. Here are docs: Terraspace with Docker
docker run -ti boltops/terraspace:alpine
docker run -ti boltops/terraspace:amzn2
docker run -ti boltops/terraspace:ubuntu
In addition to the Docker images, there is now a standalone package installer. Also built daily.
Hi,
I'm trying to test out terraspace inside an alpine 3.12 docker container with ruby runtime installed. I'm able to install terraspace and validate the installation and everything seems to be fine. When I try to execute
terraspace build demo
orterraspace up demo
I got the following error. I'm not familiar with ruby, I'm not sure if this is even possible to run in alpine docker. I've also tried in a Debian container and I get the same error. Containers were downloaded fromhttps://hub.docker.com/_/ruby
Is good if you can include some documentation on how to install and execute inside a docker container, I believe this will help a lot of people who want to try out this awesome tool without having the need to install Ruby runtime components into their current workspace.
Error
Environment