boltops-tools / terraspace-docs Goto Github PK
View Code? Open in Web Editor NEWTerraspace Docs
License: Apache License 2.0
Terraspace Docs
License: Apache License 2.0
Hello,
in the documentation of terrafile usage, there is example about using the provided example, but not how to use it from the module.
So is this proper usage?
Terrafile
mod "foo", source: "[email protected]:bar/baz.git"
module "stuff" {
source = "vendor/modules/foo"
}
If yes, add this example could be a nice usage.
Hello,
I don't really know where to put an example about gitlab, but this is how I do it
See https://docs.gitlab.com/ee/user/infrastructure/terraform_state.html for more information
To use inside gitlab-ci and locally, I have done his configuration
config/boot.rb
:
ENV['CI_PROJECT_ID'] ||= '<your project id>'
ENV['CI_API_V4_URL'] ||= 'https://gitlab.com/api/v4'
ENV['CI_JOB_USERNAME'] ||= 'gitlab-ci-token'
ENV['CI_JOB_TOKEN'] ||= 'you-must-defined-a-gitlab-PAT'
ENV['TF_URL'] = "#{ENV['CI_API_V4_URL']}/projects/#{ENV['CI_PROJECT_ID']}/terraform/state"
test/config/terraform/backend.tf
:
terraform {
backend "http" {
address = "<%= ENV['TF_URL'] %>/<%= expansion(':ACCOUNT-:REGION-:ENV-:TYPE_DIR-:MOD_NAME') %>"
lock_address = "<%= ENV['TF_URL'] %>/<%= expansion(':ACCOUNT-:REGION-:ENV-:TYPE_DIR-:MOD_NAME') %>/lock"
unlock_address = "<%= ENV['TF_URL'] %>/<%= expansion(':ACCOUNT-:REGION-:ENV-:TYPE_DIR-:MOD_NAME') %>/lock"
username = "<%= ENV['CI_JOB_USERNAME'] %>"
password = "<%= ENV['CI_JOB_TOKEN'] %>"
lock_method = "POST"
unlock_method = "DELETE"
retry_wait_min = 5
}
}
Note:
CI_PROJECT_ID
, CI_API_V4_URL
and CI_JOB_TOKEN
is defined by gitlab automatically in the gitlab-ci, it's only for local usage that I define it ;)The docs indicate the ability to layer tfvars
using env based folders here and here. The first section (full-layering) seems to indicate this is "simple layering" but mentions the TS_ENV
var without much explanation. The second section (extra) indicates the use of TS_ENV
to organize based on env folders but doesn't explain.
Through trial and error I've learned that I need set both TS_ENV
and TS_EXTRA
like so: TS_ENV=$TS_ENV; TS_EXTRA=$TS_ENV/base
. I think the Docs could use some added context here. Ideally, this should be supported out-of-the-box IMHO.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.