Skip to content

Commit

Permalink
Switch to an improved example conversion method (#484)
Browse files Browse the repository at this point in the history
# 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
t0yv0 authored Feb 27, 2024
1 parent 8ea39d6 commit 4fe354a
Show file tree
Hide file tree
Showing 226 changed files with 3,386 additions and 2,829 deletions.
6 changes: 6 additions & 0 deletions .ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ plugins:
version: "5.52.0"
- name: random
version: "4.14.0"
- name: terraform
version: "1.0.15"
kind: converter
license:
ignore:
- github.com/hashicorp/terraform-provider-azuread/shim

# Use `pulumi convert` for translating examples from TF to Pulumi.
pulumiConvert: 1
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VERSION := $(shell pulumictl get version)
JAVA_GEN := pulumi-java-gen
TESTPARALLELISM := 10
WORKING_DIR := $(shell pwd)
PULUMI_CONVERT := 0
PULUMI_CONVERT := 1

development: install_plugins provider build_sdks install_sdks

Expand Down Expand Up @@ -40,7 +40,7 @@ build_dotnet: upstream

build_go: upstream
PULUMI_CONVERT=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs go build
cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}'

build_java: PACKAGE_VERSION := $(shell pulumictl get version --language generic)
build_java: bin/pulumi-java-gen upstream
Expand Down Expand Up @@ -98,6 +98,7 @@ install_plugins: .pulumi/bin/pulumi
.pulumi/bin/pulumi plugin install resource std 1.4.0
.pulumi/bin/pulumi plugin install resource azure 5.52.0
.pulumi/bin/pulumi plugin install resource random 4.14.0
.pulumi/bin/pulumi plugin install converter terraform 1.0.15

lint_provider: provider
cd provider && golangci-lint run -c ../.golangci.yml
Expand Down
968 changes: 484 additions & 484 deletions provider/cmd/pulumi-resource-azuread/schema.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sdk/dotnet/AccessPackage.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sdk/dotnet/AccessPackageAssignmentPolicy.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/dotnet/AccessPackageCatalog.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions sdk/dotnet/AccessPackageCatalogRoleAssignment.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sdk/dotnet/AccessPackageResourceCatalogAssociation.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions sdk/dotnet/AccessPackageResourcePackageAssociation.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/dotnet/AdministrativeUnit.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions sdk/dotnet/AdministrativeUnitMember.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sdk/dotnet/AdministrativeUnitRoleMember.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4fe354a

Please sign in to comment.