Prisma Cloud: How To Import Resources Using The Prisma Cloud Terraform Provider
2973
Created On 07/31/23 05:30 AM - Last Modified 08/08/23 18:00 PM
Objective
Be able to import resources from Prisma Cloud into your Terraform state file and edit them.
Environment
- Prisma Cloud
- Terraform
- Visual Studio Code (Integration development environment)
- API
Procedure
- Create an empty resource of your choice in your .tf file
- Run the terraform import command with resource ID of the resource that you want to import.
terraform import prismacloud_policy.example 11111111-2222-3333-4444-5555555555
Note: A resource ID can be found from Prisma Cloud for any resource present there. In this example we're using a custom policy already present in Prisma Cloud with the policy ID 7708abaf-c7d5-49ed-b11d-e3665d2d3b77
- This is what the resource looks like in the state file after being imported
- Modify the resource block from step 1
- Run the terraform apply command after changes to the resource block have been made
Additional Information
Terraform Documentation