Check out the Terraform Documentation and their Introduction for more information on terraform
If you are using terraform >0.13.x, our release can be automatically downloaded from their registry using the block described in "Using the provider"
If you are using terraform 0.12.x, you must either build or copy the appropriate executable to your plugin directory. ex terraform.d/plugins/darwin_amd64
You may find prebuilt binaries in our Releases.
If you wish to build from source, first make the correct directory, cd to it, and checkout the repo. Running make build
will then build the provider and output it to terraform-provider-sigsci
mkdir -p $GOPATH/src/github.com/signalsciences/
cd $GOPATH/src/github.com/signalsciences/
git clone git@github.com:signalsciences/terraform-provider-sigsci.git
cd terraform-provider-sigsci
make build
cp terraform-provider-sigsci ~/.terraform.d/plugins
You must provide corp, email, and either form of authentication. This can be added in the provider block or with environment variables (recommended).
# Terraform 0.13.x
terraform {
required_providers {
sigsci = {
source = "signalsciences/sigsci"
}
}
}
# Required configuration block (for all versions of terraform)
provider "sigsci" {
// corp = "" // Required. may also provide via env variable SIGSCI_CORP
// email = "" // Required. may also provide via env variable SIGSCI_EMAIL
// auth_token = "" //may also provide via env variable SIGSCI_TOKEN
// password = "" //may also provide via env variable SIGSCI_PASSWORD
}
More information on each resource and field can be found on the Signal Sciences Api Docs.
All resources are importable. Importing will vary depending on if you are importing a corp level resource, or a site level resource
terraform import resource.name id // General form
terraform import sigsci_site.my-site test_site // Example
terraform import resource.name site_short_name:id //General form
terraform import sigsci_site_list.manual-list test_site:site.manual-list //Example
main.tf has an example of every resource
resource "sigsci_site" "my-site" {
short_name = "manual_test"
display_name = "manual terraform test"
block_duration_seconds = 86400
block_http_code = 406
agent_anon_mode = ""
agent_level = "block"
}
resource "sigsci_site_signal_tag" "test_tag" {
site_short_name = sigsci_site.my-site.short_name
name = "My new signal tag"
description = "description"
}
resource "sigsci_site_alert" "test_site_alert" {
site_short_name = sigsci_site.my-site.short_name
tag_name = sigsci_site_signal_tag.test_tag.id
long_name = "test_alert"
interval = 10
threshold = 12
enabled = true
action = "info"
}
resource "sigsci_site_rule" "test" {
site_short_name = sigsci_site.my-site.short_name
type = "signal"
group_operator = "any"
enabled = true
reason = "Example site rule update"
signal = "SQLI"
expiration = ""
conditions {
type = "single"
field = "ip"
operator = "equals"
value = "1.2.3.4"
}
conditions {
type = "single"
field = "ip"
operator = "equals"
value = "1.2.3.5"
conditions {
type = "multival"
field = "ip"
operator = "equals"
group_operator = "all"
value = "1.2.3.8"
}
}
actions {
type = "excludeSignal"
}
}
resource "sigsci_corp_list" "test_list" {
name = "My corp list"
type = "ip"
description = "Some IPs"
entries = [
"4.5.6.7",
"2.3.4.5",
"1.2.3.4",
]
}