diff --git a/tests/cloudformation/resources/ebs/ebs.json b/tests/cloudformation/resources/ebs/ebs.json index 37e03b273..ecf5cc6e7 100644 --- a/tests/cloudformation/resources/ebs/ebs.json +++ b/tests/cloudformation/resources/ebs/ebs.json @@ -17,6 +17,10 @@ "Value": { "Ref": "AWS::Region" } + }, + { + "Key": "yor_trace", + "Value": "5a5d5a3d-70ed-4771-a32f-e7f4cfaf5ba1" } ], "AvailabilityZone": "us-west-2a" diff --git a/tests/cloudformation/resources/ebs/ebs.yaml b/tests/cloudformation/resources/ebs/ebs.yaml index f2b12c348..8e4f6691c 100644 --- a/tests/cloudformation/resources/ebs/ebs.yaml +++ b/tests/cloudformation/resources/ebs/ebs.yaml @@ -12,6 +12,8 @@ Resources: Value: TagValue - Key: Name Value: !Ref EnvironmentName + - Key: yor_trace + Value: 94c2c7b0-a31c-413d-8772-57b18f59bd1b AvailabilityZone: us-west-2a DeletionPolicy: Snapshot diff --git a/tests/cloudformation/resources/ebs/ebs_tagged.json b/tests/cloudformation/resources/ebs/ebs_tagged.json index 0e959fc1c..dc0e22b00 100644 --- a/tests/cloudformation/resources/ebs/ebs_tagged.json +++ b/tests/cloudformation/resources/ebs/ebs_tagged.json @@ -21,6 +21,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "47604885-8695-41e9-9985-82a9380a5647" } ], "AvailabilityZone": "us-west-2a" diff --git a/tests/cloudformation/resources/ebs/ebs_tagged.yaml b/tests/cloudformation/resources/ebs/ebs_tagged.yaml index b41198e93..fbc28d748 100644 --- a/tests/cloudformation/resources/ebs/ebs_tagged.yaml +++ b/tests/cloudformation/resources/ebs/ebs_tagged.yaml @@ -14,6 +14,8 @@ Resources: Value: !Ref EnvironmentName - Key: new_tag Value: new_value + - Key: yor_trace + Value: 821bf6c4-07f9-410f-b114-d9415573e2ec AvailabilityZone: us-west-2a DeletionPolicy: Snapshot diff --git a/tests/cloudformation/resources/ec2_untagged/ec2_untagged.json b/tests/cloudformation/resources/ec2_untagged/ec2_untagged.json index ae64e9fd7..9bdd12cb4 100644 --- a/tests/cloudformation/resources/ec2_untagged/ec2_untagged.json +++ b/tests/cloudformation/resources/ec2_untagged/ec2_untagged.json @@ -4,12 +4,24 @@ "EC2InstanceResource0": { "Type": "AWS::EC2::Instance", "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "59582b3f-710d-4667-98ea-3d50afe1e896" + } + ], "ImageId": "ami-04169656fea786776" } }, "EC2InstanceResource1": { "Type": "AWS::EC2::Instance", "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "01697564-736e-4451-b887-b06b5b8c6925" + } + ], "ImageId": "ami-04169656fea786776", "NetworkInterfaces": [ { diff --git a/tests/cloudformation/resources/ec2_untagged/ec2_untagged.yaml b/tests/cloudformation/resources/ec2_untagged/ec2_untagged.yaml index 7f589cdcd..e1a0cb3e5 100644 --- a/tests/cloudformation/resources/ec2_untagged/ec2_untagged.yaml +++ b/tests/cloudformation/resources/ec2_untagged/ec2_untagged.yaml @@ -4,7 +4,9 @@ Resources: Type: AWS::EC2::Instance Properties: ImageId: ami-04169656fea786776 - + Tags: + - Key: yor_trace + Value: 6f6a600b-c22a-447e-931a-0e1527154f60 EC2InstanceResource1: Type: AWS::EC2::Instance Properties: @@ -15,6 +17,9 @@ Resources: GroupSet: - "myVPCEC2SecurityGroup" SubnetId: "PublicSubnet" + Tags: + - Key: yor_trace + Value: 3f393509-7141-493e-a521-246abb9d82b0 # Some unindented comment EC2LaunchTemplateResource0: Type: AWS::EC2::LaunchTemplate diff --git a/tests/cloudformation/resources/ec2_untagged/ec2_untagged_tagged.json b/tests/cloudformation/resources/ec2_untagged/ec2_untagged_tagged.json index 59ec45c26..160ae447f 100644 --- a/tests/cloudformation/resources/ec2_untagged/ec2_untagged_tagged.json +++ b/tests/cloudformation/resources/ec2_untagged/ec2_untagged_tagged.json @@ -8,6 +8,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "f737343e-a1bb-4fa6-8753-98d2468fa8d2" } ], "ImageId": "ami-04169656fea786776" @@ -20,6 +24,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "973493ed-c66e-4bae-bd78-d3193440b579" } ], "ImageId": "ami-04169656fea786776", diff --git a/tests/cloudformation/resources/extensions/ebs.template b/tests/cloudformation/resources/extensions/ebs.template index e59c5b79f..972129490 100644 --- a/tests/cloudformation/resources/extensions/ebs.template +++ b/tests/cloudformation/resources/extensions/ebs.template @@ -11,4 +11,6 @@ Resources: Tags: - Key: MyTag Value: TagValue + - Key: yor_trace + Value: 3e607267-06e6-4811-9426-268aebf42976 DeletionPolicy: Snapshot diff --git a/tests/cloudformation/resources/extensions/ebs2.template b/tests/cloudformation/resources/extensions/ebs2.template index 397c9559c..f76933629 100644 --- a/tests/cloudformation/resources/extensions/ebs2.template +++ b/tests/cloudformation/resources/extensions/ebs2.template @@ -12,6 +12,10 @@ { "Key": "MyTag", "Value": "TagValue" + }, + { + "Key": "yor_trace", + "Value": "2dd4b5fc-2e75-4863-b6e3-a1f8492a6e52" } ] }, diff --git a/tests/cloudformation/resources/issue114/template.yaml b/tests/cloudformation/resources/issue114/template.yaml index af91413d6..af11538ca 100644 --- a/tests/cloudformation/resources/issue114/template.yaml +++ b/tests/cloudformation/resources/issue114/template.yaml @@ -25,9 +25,13 @@ Resources: Tags: - Key: Name Value: !Ref EnvironmentName + - Key: yor_trace + Value: 00df030f-801c-4bf1-8d84-125cbf108a90 InternetGateway: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: Name - Value: !Ref EnvironmentName \ No newline at end of file + Value: !Ref EnvironmentName + - Key: yor_trace + Value: 3c4f22c7-83be-4bc1-964f-b9d99f04212c \ No newline at end of file diff --git a/tests/cloudformation/resources/issue114/template_tagged.yaml b/tests/cloudformation/resources/issue114/template_tagged.yaml index 89dfb17c3..3b148c59d 100644 --- a/tests/cloudformation/resources/issue114/template_tagged.yaml +++ b/tests/cloudformation/resources/issue114/template_tagged.yaml @@ -27,6 +27,8 @@ Resources: Value: !Ref EnvironmentName - Key: new_tag Value: new_value + - Key: yor_trace + Value: 9bdd3ec5-335e-4a09-98f8-b4770da7d339 InternetGateway: Type: AWS::EC2::InternetGateway Properties: @@ -34,4 +36,6 @@ Resources: - Key: Name Value: !Ref EnvironmentName - Key: new_tag - Value: new_value \ No newline at end of file + Value: new_value + - Key: yor_trace + Value: ab3c400b-3e4e-4082-99de-413665e8ac57 \ No newline at end of file diff --git a/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs.json b/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs.json index dcae72d91..a6dffa0a2 100644 --- a/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs.json +++ b/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs.json @@ -12,12 +12,24 @@ "EIP1": { "Type": "AWS::EC2::EIP", "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "b158b763-d5e8-43c5-8e19-7466ebb92c35" + } + ], "Domain": "VPC" } }, "EIP2": { "Type": "AWS::EC2::EIP", "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "1671c9f6-a550-421a-9911-235a7cd07480" + } + ], "Domain": "VPC" } }, @@ -45,6 +57,12 @@ { "Type" : "AWS::EC2::NetworkInterface", "Properties" : { + "Tags": [ + { + "Key": "yor_trace", + "Value": "81928d4b-6096-41d8-915e-86d01e1197f1" + } + ], "SecondaryPrivateIpAddressCount" : 2, "SourceDestCheck" : true, "SubnetId" : { "Fn::Select" : [ "0", {"Ref" : "Subnet"} ] } diff --git a/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs_tagged.json b/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs_tagged.json index 4bb306dd0..e8a543323 100644 --- a/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs_tagged.json +++ b/tests/cloudformation/resources/json/SingleENIwithMultipleEIPs_tagged.json @@ -16,6 +16,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "132afdd6-e1dd-4565-9aef-fe6cf63cd1a8" } ], "Domain": "VPC" @@ -28,6 +32,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "bb39e03f-1e1a-46dd-b406-0d5b12c054bd" } ], "Domain": "VPC" @@ -61,6 +69,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "5edddaa9-0952-4591-bc0b-88150a57a181" } ], "SecondaryPrivateIpAddressCount" : 2, diff --git a/tests/cloudformation/resources/json/base.json b/tests/cloudformation/resources/json/base.json index 2157a07cc..daa9f4649 100644 --- a/tests/cloudformation/resources/json/base.json +++ b/tests/cloudformation/resources/json/base.json @@ -13,6 +13,10 @@ { "Key": "old_tag", "Value": "old_value" + }, + { + "Key": "yor_trace", + "Value": "c67fcc99-b6c7-43e5-8613-675b9716d94d" } ] }, diff --git a/tests/cloudformation/resources/json/base_expected.json b/tests/cloudformation/resources/json/base_expected.json index fff7881ca..425c08716 100644 --- a/tests/cloudformation/resources/json/base_expected.json +++ b/tests/cloudformation/resources/json/base_expected.json @@ -21,6 +21,10 @@ { "Key": "another_tag", "Value": "another_val" + }, + { + "Key": "yor_trace", + "Value": "4cc1ad76-71a3-44c1-b898-ee15bf8fe71f" } ] }, diff --git a/tests/cloudformation/resources/no_tags/base.json b/tests/cloudformation/resources/no_tags/base.json index 6e926789a..0def9a864 100644 --- a/tests/cloudformation/resources/no_tags/base.json +++ b/tests/cloudformation/resources/no_tags/base.json @@ -4,6 +4,12 @@ "S3Bucket": { "Type": "AWS::S3::Bucket", "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "09348f8d-34ba-4392-a459-d38245588f4c" + } + ], "AccessControl": "PublicRead", "WebsiteConfiguration": { "IndexDocument": "index.html", diff --git a/tests/cloudformation/resources/no_tags/base.template b/tests/cloudformation/resources/no_tags/base.template index 7ee64189f..4e37227c5 100644 --- a/tests/cloudformation/resources/no_tags/base.template +++ b/tests/cloudformation/resources/no_tags/base.template @@ -7,4 +7,7 @@ Resources: WebsiteConfiguration: IndexDocument: index.html ErrorDocument: error.html + Tags: + - Key: yor_trace + Value: e892cc08-054f-4960-9f9b-7ada7495af5d DeletionPolicy: Retain \ No newline at end of file diff --git a/tests/cloudformation/resources/no_tags/base_expected.json b/tests/cloudformation/resources/no_tags/base_expected.json index b7a383b91..b9def11d4 100644 --- a/tests/cloudformation/resources/no_tags/base_expected.json +++ b/tests/cloudformation/resources/no_tags/base_expected.json @@ -12,6 +12,10 @@ { "Key": "another_tag", "Value": "another_val" + }, + { + "Key": "yor_trace", + "Value": "95e4b8c0-ba12-4bb4-a288-2220176ddabf" } ], "AccessControl": "PublicRead", diff --git a/tests/cloudformation/resources/onlyType/ecs.json b/tests/cloudformation/resources/onlyType/ecs.json index 0fe6e49f8..9c0406ea9 100644 --- a/tests/cloudformation/resources/onlyType/ecs.json +++ b/tests/cloudformation/resources/onlyType/ecs.json @@ -5,11 +5,25 @@ "NewVolume": { "Type": "AWS::EC2::Volume", "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "98b49581-d8b4-4751-8cef-e35650f2e871" + } + ], "Encrypted": true, "AvailabilityZone": "us-west-2a" } }, "ECSCluster": { + "Properties": { + "Tags": [ + { + "Key": "yor_trace", + "Value": "77aa9d2e-9de4-419e-99f3-0591d9c87088" + } + ] + }, "Type": "AWS::ECS::Cluster" } } diff --git a/tests/cloudformation/resources/onlyType/ecs_tagged.json b/tests/cloudformation/resources/onlyType/ecs_tagged.json index 2ed5ace7d..f35cfa633 100644 --- a/tests/cloudformation/resources/onlyType/ecs_tagged.json +++ b/tests/cloudformation/resources/onlyType/ecs_tagged.json @@ -9,6 +9,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "40d96e9e-16a6-420c-b3e0-86ab74facd2e" } ], "Encrypted": true, @@ -21,6 +25,10 @@ { "Key": "new_tag", "Value": "new_value" + }, + { + "Key": "yor_trace", + "Value": "37f54ce6-29ab-42b7-9224-d1c028a5a769" } ] }, diff --git a/tests/cloudformation/resources/parsing_spacial_cases/cfn.yaml b/tests/cloudformation/resources/parsing_spacial_cases/cfn.yaml index fd1144a19..b28835b50 100644 --- a/tests/cloudformation/resources/parsing_spacial_cases/cfn.yaml +++ b/tests/cloudformation/resources/parsing_spacial_cases/cfn.yaml @@ -11,6 +11,9 @@ Resources: Environment: Variables: BROKEN_FIND_IN_MAP: !FindInMap [ Mappings, MyMap, Key ] + Tags: + - Key: yor_trace + Value: db768199-93f6-4980-8f3c-2c067166ea0b ExampleInt: Type: AWS::Lambda::Function Properties: @@ -18,10 +21,16 @@ Resources: Environment: Variables: BROKEN_INT: 10 + Tags: + - Key: yor_trace + Value: 289c9956-7519-4182-a4bd-3b9e417de7ec ExampleJoin: Type: AWS::Lambda::Function Properties: Description: An example template Environment: Variables: - BROKEN_JOIN: !Join [ '-', [ 'a', 'b', 'c' ] ] \ No newline at end of file + BROKEN_JOIN: !Join [ '-', [ 'a', 'b', 'c' ] ] + Tags: + - Key: yor_trace + Value: 3389c236-2a3c-4ff1-90f3-43005457b14d \ No newline at end of file diff --git a/tests/cloudformation/resources/single_line/cfn.json b/tests/cloudformation/resources/single_line/cfn.json index e04969423..0dbb45435 100644 --- a/tests/cloudformation/resources/single_line/cfn.json +++ b/tests/cloudformation/resources/single_line/cfn.json @@ -25,7 +25,11 @@ }, "Tags": [ { "Key": "old_tag1", "Value": "old_val1" }, - { "Key": "old_tag2", "Value": "old_val2" } + { "Key": "old_tag2", "Value": "old_val2" }, + { + "Key": "yor_trace", + "Value": "0238c321-ed7c-43e4-8e90-873dac3eaa96" + } ] } } diff --git a/tests/cloudformation/resources/single_line/cfn_expected.json b/tests/cloudformation/resources/single_line/cfn_expected.json index 02d2438a5..dcded65ae 100644 --- a/tests/cloudformation/resources/single_line/cfn_expected.json +++ b/tests/cloudformation/resources/single_line/cfn_expected.json @@ -33,6 +33,10 @@ { "Key": "another_tag", "Value": "another_val" + }, + { + "Key": "yor_trace", + "Value": "e31ff48d-8c23-462a-893a-fd26a78d55df" } ] } diff --git a/tests/cloudformation/resources/special_tags/cfn.yaml b/tests/cloudformation/resources/special_tags/cfn.yaml index 426bc1685..2dabf3bd9 100644 --- a/tests/cloudformation/resources/special_tags/cfn.yaml +++ b/tests/cloudformation/resources/special_tags/cfn.yaml @@ -8,4 +8,6 @@ Resources: Tags: - Key: "isSpecial" Value: "true" + - Key: yor_trace + Value: 6dc518a5-79b3-41c8-b879-7b33e6163e26 ResourceType: AWS::ElasticLoadBalancingV2::LoadBalancer diff --git a/tests/cloudformation/resources/special_tags/cfn_tagged.yaml b/tests/cloudformation/resources/special_tags/cfn_tagged.yaml index 82738b5e6..051f9f797 100644 --- a/tests/cloudformation/resources/special_tags/cfn_tagged.yaml +++ b/tests/cloudformation/resources/special_tags/cfn_tagged.yaml @@ -10,4 +10,6 @@ Resources: Value: "true" - Key: new_tag Value: new_value + - Key: yor_trace + Value: 20ca51e9-1bec-418c-ac3f-476bf1b1209a ResourceType: AWS::ElasticLoadBalancingV2::LoadBalancer diff --git a/tests/integration/resources/commits_file_1.tf b/tests/integration/resources/commits_file_1.tf index f492e4f8e..7b497b351 100644 --- a/tests/integration/resources/commits_file_1.tf +++ b/tests/integration/resources/commits_file_1.tf @@ -6,8 +6,11 @@ resource "aws_s3_bucket" "financials" { # bucket is not encrypted # bucket does not have access logs # bucket does not have versioning - bucket = "yor-test-1" - acl = "private" + bucket = "yor-test-1" + acl = "private" force_destroy = true + tags = { + yor_trace = "06af8047-a314-4d9e-85e4-10b52c4aeef8" + } } \ No newline at end of file diff --git a/tests/integration/resources/commits_file_2.tf b/tests/integration/resources/commits_file_2.tf index 2e21a8a88..d9cbfbe54 100644 --- a/tests/integration/resources/commits_file_2.tf +++ b/tests/integration/resources/commits_file_2.tf @@ -5,8 +5,11 @@ resource "aws_s3_bucket" "f2" { # bucket is not encrypted # bucket does not have access logs # bucket does not have versioning - bucket = "yor-test-2" - acl = "private" + bucket = "yor-test-2" + acl = "private" force_destroy = true + tags = { + yor_trace = "ba08bdc4-fff0-4c71-85f3-c25c994dce86" + } } \ No newline at end of file diff --git a/tests/serverless/resources/no_tags/serverless.yml b/tests/serverless/resources/no_tags/serverless.yml index bc688dbf8..1880253d2 100644 --- a/tests/serverless/resources/no_tags/serverless.yml +++ b/tests/serverless/resources/no_tags/serverless.yml @@ -14,9 +14,13 @@ functions: myFunction: handler: myFunction.handler name: myFunction + tags: + yor_trace: bc2b0ea8-13ca-439d-b2de-fdc7b1784caa myFunction2: name: myFunction2 handler: myFunction2.handler + tags: + yor_trace: ff9199ac-5d55-4aae-95a5-5f1bf74090f0 resources: # CloudFormation template syntax Resources: diff --git a/tests/serverless/resources/tags_exist/serverless.yml b/tests/serverless/resources/tags_exist/serverless.yml index 732bc73c7..112027cf7 100644 --- a/tests/serverless/resources/tags_exist/serverless.yml +++ b/tests/serverless/resources/tags_exist/serverless.yml @@ -16,6 +16,7 @@ functions: tags: TAG1_FUNC: Func1 Tag Value TAG2_FUNC: Func1 Tag2 Value + yor_trace: 65d5991d-5fb0-4cdd-9962-6261ed104159 name: myFunction myFunction2: name: myFunction2 @@ -23,6 +24,7 @@ functions: tags: TAG1_FUNC: Func2 Tag Value TAG2_FUNC: Func2 Tag2 Value + yor_trace: f5a5497b-e1a5-4ba9-ae34-f29b08b27cad resources: # CloudFormation template syntax Resources: diff --git a/tests/terraform/mixed/mixed.tf b/tests/terraform/mixed/mixed.tf index 5e2b21495..9d7b11879 100644 --- a/tests/terraform/mixed/mixed.tf +++ b/tests/terraform/mixed/mixed.tf @@ -1,5 +1,8 @@ resource aws_s3_bucket "test-bucket" { name = "test-bucket" + tags = { + yor_trace = "e49a9e52-99d1-44d6-a6dc-062b8a1d986b" + } } resource tls_private_key "pem" { diff --git a/tests/terraform/module/module_with_tags/main.tf b/tests/terraform/module/module_with_tags/main.tf index 227279144..b9f1812ad 100644 --- a/tests/terraform/module/module_with_tags/main.tf +++ b/tests/terraform/module/module_with_tags/main.tf @@ -7,6 +7,7 @@ module "complete_sg" { ingress_rules = ["https-443-tcp"] tags = { - Name = "test-sg" + Name = "test-sg" + yor_trace = "dc38918c-f072-4013-9ff2-f7699c98111f" } } \ No newline at end of file diff --git a/tests/terraform/module/provider_modules/main.tf b/tests/terraform/module/provider_modules/main.tf index 9e2763b9c..82553f96f 100644 --- a/tests/terraform/module/provider_modules/main.tf +++ b/tests/terraform/module/provider_modules/main.tf @@ -1,51 +1,58 @@ module "project-factory" { source = "terraform-google-modules/project-factory/google" version = "11.0.0" - labels = { - test = "true" + labels = { + test = "true" + yor_trace = "cc2722c7-8a82-4b37-b018-f848a0fd597a" } } module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "3.2.0" - tags = { - test = "true" + tags = { + test = "true" + yor_trace = "78958a03-1a19-498c-b97f-f0f5d563a141" } } module "project-factory_github" { source = "github.com/terraform-google-modules/terraform-google-project-factory" labels = { - test = "true" + test = "true" + yor_trace = "81e74f86-647c-4975-97c1-29b75dbc6179" } } module "project-factory_git" { source = "git@github.com:terraform-google-modules/terraform-google-project-factory.git" labels = { - test = "true" + test = "true" + yor_trace = "e8c2654b-2ecf-44c8-b3be-6243c6fd86aa" } } module "caf" { source = "aztfmod/caf/azurerm" - tags = { - test = "true" + tags = { + test = "true" + yor_trace = "74e444a2-e869-44d1-8000-39a8d8415867" } } module "caf" { source = "git@github.com:aztfmod/terraform-azurerm-caf.git" - tags = { - test = "true" + tags = { + test = "true" + yor_trace = "74e444a2-e869-44d1-8000-39a8d8415867" } } module "bastion" { - source = "oracle-terraform-modules/bastion/oci" + source = "oracle-terraform-modules/bastion/oci" freeform_tags = { - test = "true" + test = "true" + yor_trace = "0a1f1b2c-d289-4df8-a161-b1bad638401f" } } @@ -54,6 +61,7 @@ module "run-common_logs" { source = "claranet/run-common/azurerm//modules/logs" version = "3.0.0" extra_tags = { - test = "true" + test = "true" + yor_trace = "f38ea78c-4e82-4718-be26-a07bbc3676ac" } } \ No newline at end of file diff --git a/tests/terraform/module/tfe_module/main.tf b/tests/terraform/module/tfe_module/main.tf index cc142f187..d5de2dd87 100644 --- a/tests/terraform/module/tfe_module/main.tf +++ b/tests/terraform/module/tfe_module/main.tf @@ -1,7 +1,8 @@ module "tfe_module" { - source = "app.terraform.io/path/to/module/aws" + source = "app.terraform.io/path/to/module/aws" tags = { Application = "application" Env = var.env + yor_trace = "c291deb7-555d-4c4c-87d1-d33af6a2d54a" } } \ No newline at end of file diff --git a/tests/terraform/resources/attributescenarios/main.tf b/tests/terraform/resources/attributescenarios/main.tf index cee66b29e..800d35765 100644 --- a/tests/terraform/resources/attributescenarios/main.tf +++ b/tests/terraform/resources/attributescenarios/main.tf @@ -3,21 +3,28 @@ resource "aws_security_group" "cluster" { description = "EKS cluster security group" vpc_id = "vpc-123456" tags = merge( - var.tags, - { - "Name" = "${var.env}-eks_cluster_sg" - }, - ) + var.tags, + { + "Name" = "${var.env}-eks_cluster_sg" + }, + { + yor_trace = "70d5a591-3a12-4642-b1af-431203d9bd75" + }) } resource "aws_vpc" "vpc_tags_one_line" { cidr_block = "" - tags = { "Name" = "tag-for-s3", "Environment" = "prod" } + tags = { "Name" = "tag-for-s3", "Environment" = "prod" + yor_trace = "4b5ad578-6989-4fe5-a9fc-013e078d6490" + } } resource "aws_instance" "no_tags" { ami = "some-ami" instance_type = "t3.micro" + tags = { + yor_trace = "a73e5af1-3b9c-441b-b537-874e28a4e481" + } } resource "aws_instance" "simple_tags" { @@ -25,7 +32,8 @@ resource "aws_instance" "simple_tags" { instance_type = "t3.micro" tags = { - Name = "my-instance" + Name = "my-instance" + yor_trace = "416a006f-1aae-480e-9b35-c40e16a0a006" } } @@ -33,7 +41,9 @@ resource "aws_instance" "rendered_tags" { ami = "some-ami" instance_type = "t3.micro" - tags = var.tags + tags = merge(var.tags, { + yor_trace = "bddd25c7-d306-4447-89f6-cb8a3b2a7073" + }) } resource "aws_instance" "merge_tags" { @@ -41,18 +51,20 @@ resource "aws_instance" "merge_tags" { instance_type = "t3.micro" tags = merge(var.tags, - { - Name = "merged-tags-instance", - Env = var.env + { + Name = "merged-tags-instance", + Env = var.env + }, { + yor_trace = "45e95d5f-9bc4-4138-b672-81d0f11b1dee" }) } variable "tags" { default = {} - type = map(string) + type = map(string) } variable "env" { default = "dev" - type = string + type = string } \ No newline at end of file diff --git a/tests/terraform/resources/complex_tags.tf b/tests/terraform/resources/complex_tags.tf index 0244d9224..400079241 100644 --- a/tests/terraform/resources/complex_tags.tf +++ b/tests/terraform/resources/complex_tags.tf @@ -1,41 +1,45 @@ resource "aws_instance" "many_instance_tags" { - ami = "" + ami = "" instance_type = "" - tags = merge({"Name" = "tag-for-instance", "Environment" = "prod"}, - {"Owner" = "bridgecrew" - }, - {"yor_trace" = "4329587194", - "git_org" = "bana"}) + tags = merge({ "Name" = "tag-for-instance", "Environment" = "prod" }, + { "Owner" = "bridgecrew" + }, + { "yor_trace" = "4329587194", + "git_org" = "bana" }) } resource "aws_alb" "alb_with_merged_tags" { - tags = merge({"Name" = "tag-for-alb", "Environment" = "prod"}, - {"yor_trace" = "4329587194", - "git_org" = "bana"}) + tags = merge({ "Name" = "tag-for-alb", "Environment" = "prod" }, + { "yor_trace" = "4329587194", + "git_org" = "bana" }) } resource "aws_vpc" "vpc_tags_one_line" { cidr_block = "" - tags = {"Name" = "tag-for-s3", "Environment" = "prod"} + tags = { "Name" = "tag-for-s3", "Environment" = "prod" + yor_trace = "d47c9f33-67b7-4fc3-9791-eaec821952e8" + } } resource "aws_s3_bucket" "bucket_var_tags" { - tags = var.tags + tags = merge(var.tags, { + yor_trace = "114cd9f8-72de-4f7b-af56-deae8161baef" + }) } variable "tags" { default = { - "Name" = "tag-for-s3" - "Environment" ="prod" + "Name" = "tag-for-s3" + "Environment" = "prod" } } resource "aws_instance" "instance_merged_var" { - ami = "" + ami = "" instance_type = "" - tags = merge(var.tags, - {"yor_trace" = "4329587194", - "git_org" = "bana"}) + tags = merge(var.tags, + { "yor_trace" = "4329587194", + "git_org" = "bana" }) } variable "new_env_tag" { @@ -45,34 +49,43 @@ variable "new_env_tag" { } resource "aws_instance" "instance_merged_override" { - ami = "" + ami = "" instance_type = "" - tags = merge(var.new_env_tag, {"Environment" = "new_env"}) + tags = merge(var.new_env_tag, { "Environment" = "new_env" }, { + yor_trace = "ef6eb7a9-884a-4c38-a6ab-18bdc7017a47" + }) } resource "aws_instance" "instance_empty_tag" { - ami = "" + ami = "" instance_type = "" - tags = {} + tags = { + yor_trace = "5141ec67-aad6-4f87-bedf-a5201001e5fa" + } } resource "aws_instance" "instance_no_tags" { - ami = "" + ami = "" instance_type = "" + tags = { + yor_trace = "f0c197a4-74ea-40c4-b48d-2537f3d8d325" + } } resource "aws_instance" "instance_null_tags" { - ami = "" + ami = "" instance_type = "" - tags = null + tags = { + yor_trace = "4a84b590-c1f2-4b78-b7ae-3b1e1ec88d2f" + } } resource "aws_autoscaling_group" "autoscaling_group_tagged" { // This resource should not be tagged tag { - key = "Name" + key = "Name" propagate_at_launch = false - value = "Mine" + value = "Mine" } max_size = 0 min_size = 0 diff --git a/tests/terraform/resources/eks.tf b/tests/terraform/resources/eks.tf index 34cdc40e6..54739ce9b 100644 --- a/tests/terraform/resources/eks.tf +++ b/tests/terraform/resources/eks.tf @@ -21,6 +21,9 @@ data aws_iam_policy_document "iam_policy_eks" { resource aws_iam_role "iam_for_eks" { name = "${local.resource_prefix.value}-iam-for-eks" assume_role_policy = data.aws_iam_policy_document.iam_policy_eks.json + tags = { + yor_trace = "0792bbd7-cb37-4076-b577-1785aa85fafe" + } } resource aws_iam_role_policy_attachment "policy_attachment-AmazonEKSClusterPolicy" { @@ -38,7 +41,8 @@ resource aws_vpc "eks_vpc" { enable_dns_hostnames = true enable_dns_support = true tags = { - Name = "${local.resource_prefix.value}-eks-vpc" + Name = "${local.resource_prefix.value}-eks-vpc" + yor_trace = "da6c673d-f214-461d-a88d-4711f64a1598" } } @@ -49,6 +53,7 @@ resource aws_subnet "eks_subnet1" { tags = { Name = "${local.resource_prefix.value}-eks-subnet" "kubernetes.io/cluster/${local.eks_name.value}" = "shared" + yor_trace = "b0ba2051-b36e-4aa7-bc94-43734ab23d04" } } @@ -59,6 +64,7 @@ resource aws_subnet "eks_subnet2" { tags = { Name = "${local.resource_prefix.value}-eks-subnet2" "kubernetes.io/cluster/${local.eks_name.value}" = "shared" + yor_trace = "91cf6be8-2600-4f35-ba7b-3e2df8d87b9a" } } @@ -75,6 +81,9 @@ resource aws_eks_cluster "eks_cluster" { "aws_iam_role_policy_attachment.policy_attachment-AmazonEKSClusterPolicy", "aws_iam_role_policy_attachment.policy_attachment-AmazonEKSServicePolicy", ] + tags = { + yor_trace = "a7aa53dd-8324-4b7b-9496-8c7e333f0371" + } } output "endpoint" { diff --git a/tests/terraform/resources/external_tagged/main.tf b/tests/terraform/resources/external_tagged/main.tf index a16bedcf9..94e631363 100644 --- a/tests/terraform/resources/external_tagged/main.tf +++ b/tests/terraform/resources/external_tagged/main.tf @@ -1,39 +1,42 @@ resource "aws_s3_bucket" "a" { bucket = "my-tf-test-bucket" - acl = "private" + acl = "private" tags = { - Name = "My bucket" - env = "dev" - git_commit = "00193660c248483862c06e2ae96111adfcb683af" - git_file = "tests/terraform/resources/external_tagged/main.tf" + Name = "My bucket" + env = "dev" + git_commit = "00193660c248483862c06e2ae96111adfcb683af" + git_file = "tests/terraform/resources/external_tagged/main.tf" git_last_modified_at = "2021-06-01 07:58:29" git_last_modified_by = "tron47@gmail.com" - git_modifiers = "tron47" - git_org = "bridgecrewio" - git_repo = "yor" - team = "seceng" - yor_trace = "fcf8717c-372b-4d9b-9dab-78f5af48fc56" + git_modifiers = "tron47" + git_org = "bridgecrewio" + git_repo = "yor" + team = "seceng" + yor_trace = "fcf8717c-372b-4d9b-9dab-78f5af48fc56" } } resource "aws_s3_bucket" "c" { bucket = "my-tf-test-bucket" - acl = "private" + acl = "private" + tags = { + yor_trace = "7c23a033-6353-48a8-b946-fed3ac6da368" + } } resource "aws_vpc" "d" { cidr_block = "" tags = { - git_commit = "00193660c248483862c06e2ae96111adfcb683af" - git_file = "tests/terraform/resources/external_tagged/main.tf" + git_commit = "00193660c248483862c06e2ae96111adfcb683af" + git_file = "tests/terraform/resources/external_tagged/main.tf" git_last_modified_at = "2021-06-01 07:58:29" git_last_modified_by = "tron47@gmail.com" - git_modifiers = "tron47" - git_org = "bridgecrewio" - git_repo = "yor" - team = "seceng" - yor_trace = "181119e5-c2ff-4ba1-a35e-78d2c0793297" + git_modifiers = "tron47" + git_org = "bridgecrewio" + git_repo = "yor" + team = "seceng" + yor_trace = "181119e5-c2ff-4ba1-a35e-78d2c0793297" } } diff --git a/tests/terraform/resources/k8s_tf/main.tf b/tests/terraform/resources/k8s_tf/main.tf index 0fe074288..a169a10b6 100644 --- a/tests/terraform/resources/k8s_tf/main.tf +++ b/tests/terraform/resources/k8s_tf/main.tf @@ -6,5 +6,6 @@ resource "aws_subnet" "eks_subnet" { tags = { Name = "${local.prefix}-eks-subnet-1" "kubernetes.io/cluster/${local.prefix}" = "shared" + yor_trace = "bcda90db-1625-4f54-bd40-d0c63ae1d8d4" } } \ No newline at end of file diff --git a/tests/terraform/resources/module1/main.tf b/tests/terraform/resources/module1/main.tf index e49f54b77..52076b336 100644 --- a/tests/terraform/resources/module1/main.tf +++ b/tests/terraform/resources/module1/main.tf @@ -1,9 +1,12 @@ resource "aws_s3_bucket" "bucket_module1" { bucket = "tf-test-bucket-destination-12345" - acl = "private" + acl = "private" versioning { enabled = false } + tags = { + yor_trace = "f644e912-7ef9-448b-b022-919da184de5f" + } } module "moduleRef" { diff --git a/tests/terraform/resources/module2/main.tf b/tests/terraform/resources/module2/main.tf index 0da43fbaa..8876e181d 100644 --- a/tests/terraform/resources/module2/main.tf +++ b/tests/terraform/resources/module2/main.tf @@ -1,12 +1,13 @@ resource "aws_s3_bucket" "bucket_module2" { bucket = "tf-test-bucket2" - acl = "public_read" + acl = "public_read" versioning { enabled = false } tags = { - "Name" = "bucket2" + "Name" = "bucket2" + yor_trace = "24e3d6b4-bd52-4a5a-993c-8e1f139c297b" } } diff --git a/tests/terraform/resources/module3/main.tf b/tests/terraform/resources/module3/main.tf index bad6cfe4e..b6ce3f49b 100644 --- a/tests/terraform/resources/module3/main.tf +++ b/tests/terraform/resources/module3/main.tf @@ -1,11 +1,12 @@ resource "aws_s3_bucket" "bucket_module3" { bucket = "tf-test-bucket3" - acl = "public_read" + acl = "public_read" versioning { enabled = false } tags = { - "Name" = "bucket3" + "Name" = "bucket3" + yor_trace = "b6dbe177-599a-4506-aba5-018895897e9f" } } diff --git a/tests/terraform/resources/taggedkms/deleted_kms.tf b/tests/terraform/resources/taggedkms/deleted_kms.tf index 39211ca42..518b5048d 100644 --- a/tests/terraform/resources/taggedkms/deleted_kms.tf +++ b/tests/terraform/resources/taggedkms/deleted_kms.tf @@ -2,6 +2,9 @@ resource "aws_kms_key" "logs_key" { # key does not have rotation enabled description = "${local.resource_prefix.value}-logs bucket key" + tags = { + yor_trace = "fc59c711-22c4-48d2-b25d-b0184cdcb7aa" + } } resource "aws_kms_alias" "logs_key_alias" { diff --git a/tests/terraform/resources/taggedkms/modified/modified_kms.tf b/tests/terraform/resources/taggedkms/modified/modified_kms.tf index 190eef933..008e42ca6 100644 --- a/tests/terraform/resources/taggedkms/modified/modified_kms.tf +++ b/tests/terraform/resources/taggedkms/modified/modified_kms.tf @@ -3,6 +3,9 @@ resource "aws_kms_key" "logs_key" { description = "modified_description" deletion_window_in_days = 7 + tags = { + yor_trace = "f3ba098b-a322-4287-9178-18528f4f81cf" + } } resource "aws_kms_alias" "logs_key_alias" { diff --git a/tests/terraform/resources/taggedkms/origin_kms.tf b/tests/terraform/resources/taggedkms/origin_kms.tf index e2bf86274..509cb8935 100644 --- a/tests/terraform/resources/taggedkms/origin_kms.tf +++ b/tests/terraform/resources/taggedkms/origin_kms.tf @@ -3,6 +3,9 @@ resource "aws_kms_key" "logs_key" { description = "${local.resource_prefix.value}-logs bucket key" deletion_window_in_days = 7 + tags = { + yor_trace = "c90a4a53-e484-4553-a457-5758bd11e7b1" + } } resource "aws_kms_alias" "logs_key_alias" { diff --git a/tests/terraform/resources/tomap/expected.tf b/tests/terraform/resources/tomap/expected.tf index 28956e62c..42285dae2 100644 --- a/tests/terraform/resources/tomap/expected.tf +++ b/tests/terraform/resources/tomap/expected.tf @@ -3,5 +3,7 @@ resource "aws_security_group" "sample" { tags = merge(var.tags, tomap({ "Name" = format("%s-sample", var.this) }), { test_tag = "test_value" + }, { + yor_trace = "5358a3ce-47d7-4023-9e7f-2a8ab4c041d4" }) } \ No newline at end of file diff --git a/tests/terraform/resources/tomap/tomap.tf b/tests/terraform/resources/tomap/tomap.tf index 740589f75..9ade16a22 100644 --- a/tests/terraform/resources/tomap/tomap.tf +++ b/tests/terraform/resources/tomap/tomap.tf @@ -1,5 +1,7 @@ resource "aws_security_group" "sample" { name = "${var.this}-sample" - tags = merge(var.tags, tomap({ "Name" = format("%s-sample", var.this) })) + tags = merge(var.tags, tomap({ "Name" = format("%s-sample", var.this) }), { + yor_trace = "abff79a3-9880-402b-81d4-6ad361a7556c" + }) } \ No newline at end of file diff --git a/tests/terraform/resources/var_tags/main.tf b/tests/terraform/resources/var_tags/main.tf index 2d68a9746..dc4446efb 100644 --- a/tests/terraform/resources/var_tags/main.tf +++ b/tests/terraform/resources/var_tags/main.tf @@ -1,15 +1,17 @@ provider "aws" { - region = "us-east-1" + region = "us-east-1" profile = "dev2" version = "3.27" } resource "aws_s3_bucket" "bucket_with_var" { bucket = "tf-test-bucket-destination-12345" - acl = "private" + acl = "private" versioning { enabled = false } - tags = var.bucket_tags + tags = merge(var.bucket_tags, { + yor_trace = "04aee5e3-b6c8-4da0-8ef8-bdd4287be856" + }) }