Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSRule Terraform Support? #907

Closed
jbla9028 opened this issue Jan 8, 2022 · 4 comments
Closed

PSRule Terraform Support? #907

jbla9028 opened this issue Jan 8, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@jbla9028
Copy link

jbla9028 commented Jan 8, 2022

Is your feature request related to a problem? Please describe.
It appears that psrule can review a ARM or bicep template from the documentation. It seems like the only open to review terraform is to review the resources after the terraform code has applied the infrastructure. Can we get native terraform support?

Passing a target folder, along with variables, can psrule review a user's terraform code for compliance?

Describe the solution you'd like

Describe alternatives you've considered
There are other solutions that will do this but psRule's syntax seems very easy to use, it would be great to leverage it with terraform.

Additional context

@jbla9028 jbla9028 added the enhancement New feature or request label Jan 8, 2022
@BernieWhite
Copy link
Member

BernieWhite commented Jan 10, 2022

@jbla9028 Thanks for the request.

PSRule can process terraform HCL when outputted as JSON. https://www.terraform.io/internals/json-format

However I think by this request you are more talking about support for testing Azure resources from HCL code with PSRule for Azure.

Is that correct?

@jbla9028
Copy link
Author

@BernieWhite Thank you for the reply. Yes I am using PSRule for Azure. Would I am trying to conceptualize if I was to run these two commands (terraform plan against infrastructure that has NOT been provisioned) would I get the same checks with psrule?

Get-AzResource -ExpandProperties -ResourceGroupName $ResourceGroupName

terraform plan out-tfplan.json

@BernieWhite
Copy link
Member

BernieWhite commented Jan 10, 2022

@jbla9028 OK thanks. No, terraform plan produces an output that is custom and different from the native Azure structure.

@BernieWhite
Copy link
Member

@jbla9028 I don't think this is going to be a quick implementation. In theory it would be awesome, but I can imagine there may be issues mapping the terraform providers.

I'm going to transfer this issue over to PSRule for Azure, for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants