Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to an improved example conversion method (#484)
# Stats Baseline 67 API locations with examples Provider: azuread Success rate: 98.10% (618/630) Converted 98.10% of csharp examples (103/105) Converted 98.10% of go examples (103/105) Converted 99.05% of java examples (104/105) Converted 98.10% of python examples (103/105) Converted 98.10% of typescript examples (103/105) Converted 97.14% of yaml examples (102/105) Experimental 67 API locations with examples Provider: azuread Success rate: 98.30% (635/646) Converted 98.15% of csharp examples (106/108) Converted 98.15% of go examples (106/108) Converted 98.15% of java examples (106/108) Converted 98.15% of python examples (106/108) Converted 98.15% of typescript examples (106/108) Converted 99.06% of yaml examples (105/106) # Newly failing examples Example started failing: #/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2 csharp 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. go 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. java 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. python 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. typescript 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. yaml 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. Example started failing: #/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2 csharp 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. go 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. java 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. python 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. typescript 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. yaml 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. Example started failing: #/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2 go 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. java 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. python 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. typescript 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. yaml 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. csharp 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. Example started failing: #/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2 java 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. python 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. typescript 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. yaml 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. csharp 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. go 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. Example started failing: #/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2 java 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. python 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. typescript 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. yaml 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. csharp 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. go 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. Example started failing: #/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2 java 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. python 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. typescript 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. yaml 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. csharp 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. go 2 Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. # Error 1 6 examples failed with the following error: ``` Duplicate resource "azuread_app_role_assignment" configuration: A azuread_app_role_assignment resource named "example" was already declared at /e69.tf:27,1-49. Resource names must be unique per type in each module. ``` Failures include converting the "#/resources/azuread:index/appRoleAssignment:AppRoleAssignment#2" example with the following HCL to python, typescript, yaml, csharp, go, java: ``` data "azuread_domains" "example" { only_initial = true } resource "azuread_application" "internal" { display_name = "internal" app_role { allowed_member_types = ["Application", "User"] description = "Admins can perform all task actions" display_name = "Admin" enabled = true id = "00000000-0000-0000-0000-222222222222" value = "Admin.All" } } resource "azuread_service_principal" "internal" { application_id = azuread_application.internal.application_id } resource "azuread_group" "example" { display_name = "example" security_enabled = true } resource "azuread_app_role_assignment" "example" { app_role_id = azuread_service_principal.internal.app_role_ids["Admin.All"] principal_object_id = azuread_group.example.object_id resource_object_id = azuread_service_principal.internal.object_id } resource "azuread_user" "example" { display_name = "D. Duck" password = "SecretP@sswd99!" user_principal_name = "d.duck@${data.azuread_domains.example.domains.0.domain_name}" } resource "azuread_app_role_assignment" "example" { app_role_id = azuread_service_principal.internal.app_role_ids["Admin.All"] principal_object_id = azuread_user.example.object_id resource_object_id = azuread_service_principal.internal.object_id } ``` # Error 2 1 examples failed with the following error: ``` unsupported attribute 'owners'; unknown property 'owners' among [otherMails surname ageGroup consentProvidedForMinor division forcePasswordChange managerId password preferredLanguage department mail officeLocation companyName costCenter disablePasswordExpiration jobTitle showInAddressList streetAddress usageLocation userPrincipalName city givenName postalCode accountEnabled displayName employeeType disableStrongPassword employeeId faxNumber mailNickname state businessPhones country mobilePhone onpremisesImmutableId] ``` Failures include converting the "#/resources/azuread:index/group:Group#2" example with the following HCL to csharp: ``` data "azuread_client_config" "current" {} resource "azuread_user" "example" { display_name = "J Doe" owners = [data.azuread_client_config.current.object_id] password = "notSecure123" user_principal_name = "[email protected]" } resource "azuread_group" "example" { display_name = "MyGroup" owners = [data.azuread_client_config.current.object_id] security_enabled = true members = [ azuread_user.example.object_id, /* more users */ ] } ``` # Error 3 1 examples failed with the following error: ``` unsupported attribute 'owners'; unknown property 'owners' among [mailNickname preferredLanguage showInAddressList forcePasswordChange department otherMails surname companyName disablePasswordExpiration employeeType streetAddress city postalCode managerId consentProvidedForMinor mobilePhone ageGroup officeLocation state businessPhones costCenter country division employeeId onpremisesImmutableId password usageLocation accountEnabled userPrincipalName displayName faxNumber givenName jobTitle mail disableStrongPassword] ``` Failures include converting the "#/resources/azuread:index/group:Group#2" example with the following HCL to python: ``` data "azuread_client_config" "current" {} resource "azuread_user" "example" { display_name = "J Doe" owners = [data.azuread_client_config.current.object_id] password = "notSecure123" user_principal_name = "[email protected]" } resource "azuread_group" "example" { display_name = "MyGroup" owners = [data.azuread_client_config.current.object_id] security_enabled = true members = [ azuread_user.example.object_id, /* more users */ ] } ``` # Error 4 1 examples failed with the following error: ``` unsupported attribute 'owners'; unknown property 'owners' among [disablePasswordExpiration displayName faxNumber mailNickname managerId preferredLanguage costCenter division businessPhones department employeeType forcePasswordChange mobilePhone officeLocation onpremisesImmutableId ageGroup streetAddress employeeId jobTitle mail city country otherMails password accountEnabled showInAddressList state usageLocation companyName userPrincipalName postalCode disableStrongPassword givenName surname consentProvidedForMinor] ``` Failures include converting the "#/resources/azuread:index/group:Group#2" example with the following HCL to typescript: ``` data "azuread_client_config" "current" {} resource "azuread_user" "example" { display_name = "J Doe" owners = [data.azuread_client_config.current.object_id] password = "notSecure123" user_principal_name = "[email protected]" } resource "azuread_group" "example" { display_name = "MyGroup" owners = [data.azuread_client_config.current.object_id] security_enabled = true members = [ azuread_user.example.object_id, /* more users */ ] } ``` # Error 5 1 examples failed with the following error: ``` unsupported attribute 'owners'; unknown property 'owners' among [country mobilePhone password accountEnabled city employeeId surname costCenter managerId preferredLanguage showInAddressList streetAddress usageLocation otherMails businessPhones companyName department disablePasswordExpiration displayName employeeType givenName faxNumber postalCode division officeLocation onpremisesImmutableId consentProvidedForMinor forcePasswordChange jobTitle mailNickname ageGroup disableStrongPassword mail state userPrincipalName] ``` Failures include converting the "#/resources/azuread:index/group:Group#2" example with the following HCL to go: ``` data "azuread_client_config" "current" {} resource "azuread_user" "example" { display_name = "J Doe" owners = [data.azuread_client_config.current.object_id] password = "notSecure123" user_principal_name = "[email protected]" } resource "azuread_group" "example" { display_name = "MyGroup" owners = [data.azuread_client_config.current.object_id] security_enabled = true members = [ azuread_user.example.object_id, /* more users */ ] } ``` # Error 6 1 examples failed with the following error: ``` not yet implemented: call notImplemented; Function not yet implemented: Function format not yet implemented ``` Failures include converting the "#/resources/azuread:index/directoryRoleAssignment:DirectoryRoleAssignment#2" example with the following HCL to java: ``` resource "azuread_directory_role" "example" { display_name = "Cloud application administrator" } resource "azuread_application" "example" { display_name = "My Application" } data "azuread_user" "example" { user_principal_name = "[email protected]" } resource "azuread_directory_role_assignment" "example" { role_id = azuread_directory_role.example.template_id principal_object_id = data.azuread_user.example.object_id directory_scope_id = format("/%s", azuread_application.example.object_id) } ```
- Loading branch information