Repository navigation
feat: convert ngwaf gold-standard-starter to fastly terraform provider - #33
Open
saschanowak wants to merge 1 commit into
Open
saschanowak wants to merge 1 commit into
saschanowak wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the
gold-standard-starterexample from the legacysignalsciences/sigsciprovider to the official
fastly/fastlyTerraform provider (>= 9.3.0), aligning itwith Fastly's unified account model. Corp-scoped resources become account-scoped,
the NGWAF "site" becomes a "workspace," and authentication consolidates onto a single
Fastly API token.
Motivation
The
sigsciprovider predates the unified Fastly account model and is being supersededby first-class NGWAF resources in the
fastly/fastlyprovider. Moving the starter ontothe supported provider keeps the demo current, lets it share one credential and one
control plane with the rest of Fastly, and removes the separate Signal Sciences corp/site/email
auth surface.
Changes
Provider & auth
providers.tf: swapsignalsciences/sigsci(>= 3.3.0) →fastly/fastly(>= 9.3.0).main.tf: provider block no longer takescorp/email/auth_token; thefastlyprovider authenticates via the
FASTLY_API_KEYenvironment variable, reused across allFastly resources.
variables.tf: dropNGWAF_CORP,NGWAF_SITE,NGWAF_EMAIL, and the sensitiveNGWAF_TOKEN; add a singleNGWAF_WORKSPACEvariable.Resource mapping (corp → account, site → workspace)
sigsci_corp_list→fastly_ngwaf_account_listsigsci_corp_signal_tag→fastly_ngwaf_account_signal(nownameinstead ofshort_name, plus requiredapplies_to = ["*"])sigsci_corp_rule→fastly_ngwaf_account_rulesigsci_site_signal_tag→fastly_ngwaf_workspace_signal(now takesworkspace_id)sigsci_site_rule→fastly_ngwaf_workspace_rulefastly_ngwaf_workspaceresource (mode = "log") defines the tenant workspace.Rule schema rewrites
site_short_names/corp_scope/reason/expirationremoved;
description,applies_to, andrequest_logging = "sampled"added.conditions { type = "multival" }/conditions { type = "single" }blocksreplaced with
multival_condition/conditionblocks;actions→action.signalType→signal_id,inList→in_list,addSignal→add_signal,responseCode→response_code,requestHeader→request_header,valueString→value_string,doesNotEqual→does_not_equal,rateLimit→rate_limit,logRequest→log_request..idlookups to namespaced string refs(
"corp.${...name}"for account scope,"site.${...name}"for workspace scope).Threshold model
sigsci_site_alertresources (1m/10m/60m) are replaced by theworkspace's
attack_signal_thresholdsblock (one_minute = 50,ten_minutes = 350,one_hour = 1800,immediate = false).intervalcorrected1→60(seconds) andsignalmoved insidethe
rate_limitblock.Docs & misc
README.md: "Corp configurations" → "Account configurations", "Site configurations" →"Workspace configurations", "Site Alert" → "Workspace Thresholds". Pre-reqs now point to
a Fastly API token with service create/manage permissions and note the unified account
model. Apply example uses
TF_VAR_NGWAF_WORKSPACE.dashboard.signalsciences.net/corps/.../sites/...tomanage.fastly.com/security/ngwaf/workspaces/${...id}/dashboards.Breaking changes / migration notes
terraform init -upgradebefore applying.FASTLY_API_KEYinstead of supplyingNGWAF_CORP/SITE/EMAIL/TOKEN; provide the workspace name viaTF_VAR_NGWAF_WORKSPACE..tfresources only — it does not includeimportblocks or
moved/state-migration steps. Applying against state created by thesigsciprovider will require migrating or recreating resources; a fresh
terraform applyagainstan empty state is the clean path.
Testing
terraform init -upgraderesolvesfastly/fastly >= 9.3.0terraform validatepassesterraform apply -parallelism=1against a test workspace creates expectedlists, signals, account/workspace rules, and thresholds