terraform apply registers the integration with Plerion for you. There is no CloudFormation stack in your account, and no role ARN to paste back into the console.
The template registers the integration by calling the Plerion API during
terraform apply, using a short-lived token you generate in the console. Generate the token immediately before you apply.Before you start
- Terraform 1.5.0 or later. The template uses a
checkblock to report a failed registration without blocking the rest of your apply. - Credentials for the target AWS account, with permission to create IAM roles and policies.
- Access to the Plerion console to start onboarding and generate an integration token.
Choose how CWPP scanning runs
Plerion enables Cloud Security Posture Management (CSPM) and Cloud Infrastructure Entitlement Management (CIEM) on every integration. Cloud Workload Protection Platform (CWPP) workload scanning is optional, and the Terraform flow provides two templates. Pick the one that matches the CWPP option you select in the console.- Same account (
aws-integration.tf): Plerion runs the CWPP scanning appliances inside the account you are onboarding. The template provisions the appliance role and instance profile. You set the appliance regions and networking in the console after applying. Choose this to keep scanning inside your own account. - Plerion-managed service account (
aws-integration-plerion-managed.tf): Plerion runs the scanning appliances in its own AWS accounts, so there is no appliance infrastructure or networking to manage in your account. You grant a cross-account role to the Plerion service account. See Plerion-managed scanning for how managed scanning works.
aws-integration.tf) and set capabilities to CSPM. No CWPP resources are provisioned.
Steps to onboard with Terraform
1
Start an AWS account onboarding in Plerion
- Go to
Settings>Integrations. - Next to AWS account, click the
+button and chooseAdd single AWS account. You can also chooseAdd single AWS account with Terraformto go straight to the Terraform strategy.
2
Select your capabilities
- CSPM and CIEM are selected by default.
- To include workload scanning, also select CWPP.
- Click
Next.
3
Select the Terraform deployment strategy
- On the Deployment strategy step, select Terraform.
- If you selected CWPP, choose whether scanning runs in the same account or through a Plerion-managed service account.
- Click
Next.
4
Download the template
On the Grant Plerion access page, download the Terraform template into its own directory. The file is
aws-integration.tf for same-account scanning, or aws-integration-plerion-managed.tf for Plerion-managed scanning.5
Copy the values shown in the console
The page lists the values to pass to the template:
plerion_api_urlplerion_account_idexternal_idservice_account_id(Plerion-managed scanning only)auth_token, the short-lived integration token
6
Apply the template
From the template directory, initialize and apply, passing the values from the console. For Plerion-managed scanning, also pass
terraform apply provisions the role and policies, then registers the integration with Plerion automatically.-var 'service_account_id=<service_account_id>'. To onboard with CSPM and CIEM only, add -var 'capabilities=CSPM'.7
Finish CWPP setup for same-account scanning
If you chose same-account CWPP, the template provisions the appliance role and instance profile, but the appliance regions and networking are specific to your VPC. In the console, open the integration’s Workload tab, enable the appliance regions, and set the subnet and security group for each region. Plerion-managed scanning needs no further setup.
8
Confirm the integration
The account appears in your integrations list and Plerion starts the first scan. Track progress under
Settings > Integrations > Scans, and view results in the Compliance, Well-Architected, and Findings dashboards.Template inputs
Pass these variables at apply time, or set them in a.tfvars file.
Keeping permissions up to date
Plerion extends the AWS permissions policies over time as detection coverage grows. A CloudFormation stack can update itself, but Terraform manages these resources in your own state, so you apply policy updates yourself. When Plerion releases a policy change, download the current template again and runterraform apply. Terraform updates the role and policies in place. Your integration keeps working on the existing permissions until you apply the update.