Skip to content

Commit 17627da

Browse files
authored
CM-39486 - Change unique resource ID in tfplan scan (#247)
1 parent 0bfb8d4 commit 17627da

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cycode/cli/files_collector/iac/tf_content_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _get_resource_name(resource_change: ResourceChange) -> str:
5959

6060
valid_parts = [part for part in parts if part]
6161

62-
return '-'.join(valid_parts).replace('.', '-')
62+
return '.'.join(valid_parts)
6363

6464

6565
def _extract_resources(tfplan: str, filename: str) -> List[ResourceChange]:

tests/test_files/tf_content_generator_files/tfplan-create-example/tf_content.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ resource "aws_sfn_state_machine" "terra_ci_runner" {
7979
type = "STANDARD"
8080
}
8181

82-
resource "aws_route" "private-1" {
82+
resource "aws_route" "private.1" {
8383
carrier_gateway_id = null
8484
destination_cidr_block = "172.25.16.0/20"
8585
destination_ipv6_cidr_block = null
@@ -95,7 +95,7 @@ resource "aws_route" "private-1" {
9595
vpc_peering_connection_id = null
9696
}
9797

98-
resource "aws_route" "private-rtb-00cf8381520103cfb" {
98+
resource "aws_route" "private.rtb-00cf8381520103cfb" {
9999
carrier_gateway_id = null
100100
destination_cidr_block = "172.25.16.0/20"
101101
destination_ipv6_cidr_block = null

0 commit comments

Comments
 (0)