diff --git a/pkg/iac/terraform/state/terraform_state_reader_test.go b/pkg/iac/terraform/state/terraform_state_reader_test.go index 9fd382b5..73a92226 100644 --- a/pkg/iac/terraform/state/terraform_state_reader_test.go +++ b/pkg/iac/terraform/state/terraform_state_reader_test.go @@ -445,6 +445,7 @@ func TestTerraformStateReader_Azure_Resources(t *testing.T) { {name: "private dns zone", dirName: "azurerm_private_dns_zone", wantErr: false}, {name: "private dns a record", dirName: "azurerm_private_dns_a_record", wantErr: false}, {name: "private dns aaaa record", dirName: "azurerm_private_dns_aaaa_record", wantErr: false}, + {name: "private dns cname record", dirName: "azurerm_private_dns_cname_record", wantErr: false}, {name: "images", dirName: "azurerm_image", wantErr: false}, {name: "ssh public key", dirName: "azurerm_ssh_public_key", wantErr: false}, } diff --git a/pkg/iac/terraform/state/test/azurerm_private_dns_cname_record/results.golden.json b/pkg/iac/terraform/state/test/azurerm_private_dns_cname_record/results.golden.json new file mode 100755 index 00000000..6f48ae17 --- /dev/null +++ b/pkg/iac/terraform/state/test/azurerm_private_dns_cname_record/results.golden.json @@ -0,0 +1,28 @@ +[ + { + "Id": "/subscriptions/7bfb2c5c-7308-46ed-8ae4-fffa356eb406/resourceGroups/martin-dev/providers/Microsoft.Network/privateDnsZones/thisisatestusingtf.com/CNAME/othertest", + "Type": "azurerm_private_dns_cname_record", + "Attrs": { + "fqdn": "othertest.thisisatestusingtf.com.", + "id": "/subscriptions/7bfb2c5c-7308-46ed-8ae4-fffa356eb406/resourceGroups/martin-dev/providers/Microsoft.Network/privateDnsZones/thisisatestusingtf.com/CNAME/othertest", + "name": "othertest", + "record": "othertest.com", + "resource_group_name": "martin-dev", + "ttl": 300, + "zone_name": "thisisatestusingtf.com" + } + }, + { + "Id": "/subscriptions/7bfb2c5c-7308-46ed-8ae4-fffa356eb406/resourceGroups/martin-dev/providers/Microsoft.Network/privateDnsZones/thisisatestusingtf.com/CNAME/test", + "Type": "azurerm_private_dns_cname_record", + "Attrs": { + "fqdn": "test.thisisatestusingtf.com.", + "id": "/subscriptions/7bfb2c5c-7308-46ed-8ae4-fffa356eb406/resourceGroups/martin-dev/providers/Microsoft.Network/privateDnsZones/thisisatestusingtf.com/CNAME/test", + "name": "test", + "record": "test.com", + "resource_group_name": "martin-dev", + "ttl": 300, + "zone_name": "thisisatestusingtf.com" + } + } +] \ No newline at end of file diff --git a/pkg/iac/terraform/state/test/azurerm_private_dns_cname_record/terraform.tfstate b/pkg/iac/terraform/state/test/azurerm_private_dns_cname_record/terraform.tfstate new file mode 100644 index 00000000..52176f88 --- /dev/null +++ b/pkg/iac/terraform/state/test/azurerm_private_dns_cname_record/terraform.tfstate @@ -0,0 +1,65 @@ +{ + "version": 4, + "terraform_version": "0.14.5", + "serial": 19, + "lineage": "7f22faf7-4655-0f68-3b00-9099a46450a7", + "outputs": {}, + "resources": [ +{ + "mode": "managed", + "type": "azurerm_private_dns_cname_record", + "name": "othertestcname", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "fqdn": "othertest.thisisatestusingtf.com.", + "id": "/subscriptions/7bfb2c5c-7308-46ed-8ae4-fffa356eb406/resourceGroups/martin-dev/providers/Microsoft.Network/privateDnsZones/thisisatestusingtf.com/CNAME/othertest", + "name": "othertest", + "record": "othertest.com", + "resource_group_name": "martin-dev", + "tags": null, + "timeouts": null, + "ttl": 300, + "zone_name": "thisisatestusingtf.com" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "azurerm_private_dns_zone.testzone", + "data.azurerm_resource_group.martin" + ] + } + ] + }, + { + "mode": "managed", + "type": "azurerm_private_dns_cname_record", + "name": "testcname", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "fqdn": "test.thisisatestusingtf.com.", + "id": "/subscriptions/7bfb2c5c-7308-46ed-8ae4-fffa356eb406/resourceGroups/martin-dev/providers/Microsoft.Network/privateDnsZones/thisisatestusingtf.com/CNAME/test", + "name": "test", + "record": "test.com", + "resource_group_name": "martin-dev", + "tags": null, + "timeouts": null, + "ttl": 300, + "zone_name": "thisisatestusingtf.com" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "azurerm_private_dns_zone.testzone", + "data.azurerm_resource_group.martin" + ] + } + ] + } + ] +}