diff --git a/pkg/iac/terraform/state/test/aws_ec2_instance/results.golden.json b/pkg/iac/terraform/state/test/aws_ec2_instance/results.golden.json index 194acc9c0..87252c245 100755 --- a/pkg/iac/terraform/state/test/aws_ec2_instance/results.golden.json +++ b/pkg/iac/terraform/state/test/aws_ec2_instance/results.golden.json @@ -4,7 +4,6 @@ "Type": "aws_instance", "Attrs": { "ami": "ami-0697b068b80d79421", - "arn": "arn:aws:ec2:eu-west-3:047081014315:instance/i-0d3650a23f4e45dc0", "associate_public_ip_address": true, "availability_zone": "eu-west-3b", "cpu_core_count": 1, diff --git a/pkg/iac/terraform/state/test/aws_internet_gateway/results.golden.json b/pkg/iac/terraform/state/test/aws_internet_gateway/results.golden.json index 616ceb483..7b76ae242 100755 --- a/pkg/iac/terraform/state/test/aws_internet_gateway/results.golden.json +++ b/pkg/iac/terraform/state/test/aws_internet_gateway/results.golden.json @@ -3,7 +3,6 @@ "Id": "igw-0184eb41aadc62d1c", "Type": "aws_internet_gateway", "Attrs": { - "arn": "arn:aws:ec2:eu-west-3:047081014315:internet-gateway/igw-0184eb41aadc62d1c", "id": "igw-0184eb41aadc62d1c", "owner_id": "047081014315", "tags": { diff --git a/pkg/iac/terraform/state/test/aws_launch_template/results.golden.json b/pkg/iac/terraform/state/test/aws_launch_template/results.golden.json index d7ad8a2fa..b895853b1 100755 --- a/pkg/iac/terraform/state/test/aws_launch_template/results.golden.json +++ b/pkg/iac/terraform/state/test/aws_launch_template/results.golden.json @@ -3,7 +3,6 @@ "Id": "lt-0ed993d09ce6afc67", "Type": "aws_launch_template", "Attrs": { - "arn": "arn:aws:ec2:us-east-1:533948124879:launch-template/lt-0ed993d09ce6afc67", "block_device_mappings": [ { "device_name": "/dev/sda1", diff --git a/pkg/iac/terraform/state/test/aws_lb_listener/results.golden.json b/pkg/iac/terraform/state/test/aws_lb_listener/results.golden.json index 03fe964c1..079d3bbd2 100755 --- a/pkg/iac/terraform/state/test/aws_lb_listener/results.golden.json +++ b/pkg/iac/terraform/state/test/aws_lb_listener/results.golden.json @@ -53,7 +53,6 @@ "Id": "igw-00e1a78d127606c92", "Type": "aws_internet_gateway", "Attrs": { - "arn": "arn:aws:ec2:us-east-1:533948124879:internet-gateway/igw-00e1a78d127606c92", "id": "igw-00e1a78d127606c92", "owner_id": "533948124879", "vpc_id": "vpc-069eb1208f4f62f3c" diff --git a/pkg/iac/terraform/state/test/aws_vpc/results.golden.json b/pkg/iac/terraform/state/test/aws_vpc/results.golden.json index c176d6fbd..8ed19ae8c 100755 --- a/pkg/iac/terraform/state/test/aws_vpc/results.golden.json +++ b/pkg/iac/terraform/state/test/aws_vpc/results.golden.json @@ -26,7 +26,6 @@ "Id": "vpc-0a5666c0cfc366714", "Type": "aws_vpc", "Attrs": { - "arn": "arn:aws:ec2:us-east-1:929327065333:vpc/vpc-0a5666c0cfc366714", "assign_generated_ipv6_cidr_block": false, "cidr_block": "10.0.0.0/16", "default_network_acl_id": "acl-081a06acb9d092caf", diff --git a/pkg/iac/terraform/state/test/unsupported_attribute/results.golden.json b/pkg/iac/terraform/state/test/unsupported_attribute/results.golden.json index 6fbff9792..a3e597ff5 100755 --- a/pkg/iac/terraform/state/test/unsupported_attribute/results.golden.json +++ b/pkg/iac/terraform/state/test/unsupported_attribute/results.golden.json @@ -4,7 +4,6 @@ "Type": "aws_instance", "Attrs": { "ami": "ami-0f8e5edde3a79f541", - "arn": "arn:aws:ec2:eu-west-3:929327065333:instance/i-002c7d44410fee60e", "associate_public_ip_address": true, "availability_zone": "eu-west-3a", "cpu_core_count": 1, diff --git a/pkg/resource/aws/aws_instance.go b/pkg/resource/aws/aws_instance.go index d31417bea..e9843850d 100644 --- a/pkg/resource/aws/aws_instance.go +++ b/pkg/resource/aws/aws_instance.go @@ -12,6 +12,7 @@ func initAwsInstanceMetaData(resourceSchemaRepository dctlresource.SchemaReposit resourceSchemaRepository.SetNormalizeFunc(AwsInstanceResourceType, func(res *resource.Resource) { val := res.Attrs val.SafeDelete([]string{"timeouts"}) + val.SafeDelete([]string{"arn"}) if v, _ := version.NewVersion("3.38.0"); res.Schema().ProviderVersion.LessThan(v) { val.SafeDelete([]string{"instance_initiated_shutdown_behavior"}) diff --git a/pkg/resource/aws/aws_internet_gateway.go b/pkg/resource/aws/aws_internet_gateway.go index 700ce031d..ee6b1ba53 100644 --- a/pkg/resource/aws/aws_internet_gateway.go +++ b/pkg/resource/aws/aws_internet_gateway.go @@ -8,5 +8,8 @@ import ( const AwsInternetGatewayResourceType = "aws_internet_gateway" func initAwsInternetGatewayMetaData(resourceSchemaRepository dctlresource.SchemaRepositoryInterface) { + resourceSchemaRepository.SetNormalizeFunc(AwsInternetGatewayResourceType, func(res *resource.Resource) { + res.Attributes().SafeDelete([]string{"arn"}) + }) resourceSchemaRepository.SetFlags(AwsInternetGatewayResourceType, resource.FlagDeepMode) } diff --git a/pkg/resource/aws/aws_launch_template.go b/pkg/resource/aws/aws_launch_template.go index f944f202d..6b5b25f68 100644 --- a/pkg/resource/aws/aws_launch_template.go +++ b/pkg/resource/aws/aws_launch_template.go @@ -8,5 +8,8 @@ import ( const AwsLaunchTemplateResourceType = "aws_launch_template" func initAwsLaunchTemplateMetaData(resourceSchemaRepository dctlresource.SchemaRepositoryInterface) { + resourceSchemaRepository.SetNormalizeFunc(AwsLaunchTemplateResourceType, func(res *resource.Resource) { + res.Attributes().SafeDelete([]string{"arn"}) + }) resourceSchemaRepository.SetFlags(AwsLaunchTemplateResourceType, resource.FlagDeepMode) } diff --git a/pkg/resource/aws/aws_vpc.go b/pkg/resource/aws/aws_vpc.go index 5f991400c..dfb79620d 100644 --- a/pkg/resource/aws/aws_vpc.go +++ b/pkg/resource/aws/aws_vpc.go @@ -8,5 +8,8 @@ import ( const AwsVpcResourceType = "aws_vpc" func initAwsVpcMetaData(resourceSchemaRepository dctlresource.SchemaRepositoryInterface) { + resourceSchemaRepository.SetNormalizeFunc(AwsVpcResourceType, func(res *resource.Resource) { + res.Attributes().SafeDelete([]string{"arn"}) + }) resourceSchemaRepository.SetFlags(AwsVpcResourceType, resource.FlagDeepMode) } diff --git a/pkg/test/aws/3.19.0/aws_internet_gateway/expected.json b/pkg/test/aws/3.19.0/aws_internet_gateway/expected.json index 616ceb483..7b76ae242 100755 --- a/pkg/test/aws/3.19.0/aws_internet_gateway/expected.json +++ b/pkg/test/aws/3.19.0/aws_internet_gateway/expected.json @@ -3,7 +3,6 @@ "Id": "igw-0184eb41aadc62d1c", "Type": "aws_internet_gateway", "Attrs": { - "arn": "arn:aws:ec2:eu-west-3:047081014315:internet-gateway/igw-0184eb41aadc62d1c", "id": "igw-0184eb41aadc62d1c", "owner_id": "047081014315", "tags": { diff --git a/pkg/test/aws/3.19.0/aws_launch_template/expected.json b/pkg/test/aws/3.19.0/aws_launch_template/expected.json index e06d46452..ea24842fd 100755 --- a/pkg/test/aws/3.19.0/aws_launch_template/expected.json +++ b/pkg/test/aws/3.19.0/aws_launch_template/expected.json @@ -3,7 +3,6 @@ "Id": "lt-00b2d18c6cee7fe23", "Type": "aws_launch_template", "Attrs": { - "arn": "arn:aws:ec2:us-east-1:533948124879:launch-template/lt-00b2d18c6cee7fe23", "default_version": 1, "description": "", "disable_api_termination": false, @@ -24,7 +23,6 @@ "Id": "lt-0ed993d09ce6afc67", "Type": "aws_launch_template", "Attrs": { - "arn": "arn:aws:ec2:us-east-1:533948124879:launch-template/lt-0ed993d09ce6afc67", "block_device_mappings": [ { "device_name": "/dev/sda1", diff --git a/pkg/test/aws/3.19.0/aws_vpc/expected.json b/pkg/test/aws/3.19.0/aws_vpc/expected.json index 14efc77c2..d878d4625 100755 --- a/pkg/test/aws/3.19.0/aws_vpc/expected.json +++ b/pkg/test/aws/3.19.0/aws_vpc/expected.json @@ -3,7 +3,6 @@ "Id": "vpc-02c50896b59598761", "Type": "aws_vpc", "Attrs": { - "arn": "arn:aws:ec2:eu-west-3:929327065333:vpc/vpc-02c50896b59598761", "assign_generated_ipv6_cidr_block": false, "cidr_block": "10.0.0.0/16", "default_network_acl_id": "acl-0acd66b145f6f2102", @@ -24,7 +23,6 @@ "Id": "vpc-0768e1fd0029e3fc3", "Type": "aws_vpc", "Attrs": { - "arn": "arn:aws:ec2:eu-west-3:929327065333:vpc/vpc-0768e1fd0029e3fc3", "assign_generated_ipv6_cidr_block": false, "cidr_block": "10.1.0.0/16", "default_network_acl_id": "acl-0d17964d633baf4b3", @@ -45,7 +43,6 @@ "Id": "vpc-020b072316a95b97f", "Type": "aws_vpc", "Attrs": { - "arn": "arn:aws:ec2:eu-west-3:929327065333:vpc/vpc-020b072316a95b97f", "assign_generated_ipv6_cidr_block": false, "cidr_block": "10.2.0.0/16", "default_network_acl_id": "acl-0ff5d175a1aa8f51a",