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

Do not trim resource id from tfplan json #825

Merged

Conversation

kanchwala-yusuf
Copy link
Contributor

@kanchwala-yusuf kanchwala-yusuf commented May 31, 2021

fixes #702
Resource ID in the tfplan json is of the format: module.acqa-test-cbmodule1.aws_codebuild_project.cb_project, but in terrascan we trim it to aws_codebuild_project.cb_project.

As a result, it becomes difficult to identify module in which the resource has been created.

This PR fixes this problem

@codecov
Copy link

codecov bot commented May 31, 2021

Codecov Report

Merging #825 (d5c16ff) into master (fafdda4) will increase coverage by 2.91%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #825      +/-   ##
==========================================
+ Coverage   75.20%   78.12%   +2.91%     
==========================================
  Files         112      162      +50     
  Lines        3453     4333     +880     
==========================================
+ Hits         2597     3385     +788     
- Misses        665      734      +69     
- Partials      191      214      +23     
Impacted Files Coverage Δ
pkg/iac-providers/kubernetes/v1/normalize.go 88.57% <ø> (-1.91%) ⬇️
pkg/iac-providers/tfplan/v1/load-file.go 74.19% <ø> (-3.59%) ⬇️
pkg/iac-providers/output/types.go 100.00% <100.00%> (ø)
pkg/iac-providers/terraform/commons/resource.go 66.66% <0.00%> (-4.17%) ⬇️
pkg/http-server/start.go 0.00% <0.00%> (ø)
...g/mapper/iac-providers/cft/config/docdb-cluster.go 100.00% <0.00%> (ø)
.../iac-providers/cft/config/secretsmanager-secret.go 100.00% <0.00%> (ø)
...r/iac-providers/cft/config/cloudformation-stack.go 81.81% <0.00%> (ø)
pkg/iac-providers/cft/v1/load-file.go 56.14% <0.00%> (ø)
... and 47 more

@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@patilpankaj212 patilpankaj212 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!
The resourceID change for k8 seems harmless as it is internal to terrascan.

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

Successfully merging this pull request may close these issues.

tfplan should use resource address for id field
2 participants