A custom provider for terraform.
- Download the latest release for your platform
- rename the file to
terraform-provider-quantum
- Copy the file to the same directory as terraform
dirname $(which terraform)
is installed
Returns a list of files from a directory
data "quantum_list_files" "data_files" {
folders = ["./data"]
patterns = ["*.txt", "*.doc*"]
recursive = true
}
The output will look like this:
data.quantum_list_files.data_files.files = ["./data/file1.txt", "./data/file2.docx"]
folders
- (Optional) - The source list for folderspatterns
- (Optional) - The patterns to match files, uses golang's filepath.Matchrecursive
- (Optional) - Defaultfalse
, walk directory recursivelyinclude_folder
- (Optional) - Defaulttrue
, include the parent folder in the results
files
- The list of matched files
Queries a json string using GJSON (https://github.com/tidwall/gjson)
data "quantum_query_json" "instance_pricing" {
json = "${data.aws_pricing_product.instance.result}"
query = "terms.OnDemand.*.priceDimensions.*.pricePerUnit.USD"
}
The output will look like this:
data.quantum_query_json.result = 0.60435
json
- The JSON to queryquery
- The query string (with this syntax: https://github.com/tidwall/gjson#path-syntax)
result
- The query result. Depending on the json and query, this could be json, float, string, etc.
This resource will generate a password with lowercase, uppercase, numbers and special characters matching the specified length
. It will also rotate the password every 'n'
days based on the rotation
attribute.
Generates a random password to be used by other resources
resource "quantum_password" "rds_backup_db_password" {
length = 10
rotation = 90
}
length
- (Optional) - Password length [default20
]rotation
- (Optional) - Number of days before a new password gets generated. [default0
= no rotation]special_chars
- (Optional) - Override the special characters set [default!"#$%&'()*+,-./
]
A
rotation
set to negative number means the password expires on each run
password
- Attribute to use in your other resources to set the passwordlast_update
- Last generation date of the password
Note that on quantum_password attribute change, you need to run
apply
twice to get the new password propagated to dependant resources. (Comment on this behavior)
go get github.com/coveo/terraform-provider-quantum
cd $GOPATH/src/github.com/coveo/terraform-provider-quantum
go get ./...
$EDITOR .