-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azuread_service_principal - support for the AppRoleAssignmentRequired property #127
Changes from 1 commit
5223b12
fdbd386
a0ec47c
8717b05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ func TestAccAzureADServicePrincipal_basic(t *testing.T) { | |
resource.TestCheckResourceAttrSet(resourceName, "display_name"), | ||
resource.TestCheckResourceAttrSet(resourceName, "application_id"), | ||
resource.TestCheckResourceAttr(resourceName, "oauth2_permissions.#", "1"), | ||
resource.TestCheckResourceAttr(resourceName, "app_role_assignment_required", "false"), | ||
resource.TestCheckResourceAttr(resourceName, "oauth2_permissions.0.admin_consent_description", fmt.Sprintf("Allow the application to access %s on behalf of the signed-in user.", fmt.Sprintf("acctestApp-%s", id))), | ||
resource.TestCheckResourceAttrSet(resourceName, "object_id"), | ||
), | ||
|
@@ -53,6 +54,7 @@ func TestAccAzureADServicePrincipal_complete(t *testing.T) { | |
Config: testAccADServicePrincipal_complete(id), | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckADServicePrincipalExists(resourceName), | ||
resource.TestCheckResourceAttr(resourceName, "app_role_assignment_required", "true"), | ||
resource.TestCheckResourceAttr(resourceName, "tags.#", "3"), | ||
resource.TestCheckResourceAttrSet(resourceName, "object_id"), | ||
), | ||
|
@@ -131,7 +133,8 @@ resource "azuread_application" "test" { | |
} | ||
|
||
resource "azuread_service_principal" "test" { | ||
application_id = "${azuread_application.test.application_id}" | ||
application_id = "${azuread_application.test.application_id}" | ||
app_role_assignment_required = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. COuld we align these assingments here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
tags = ["test", "multiple", "CapitalS"] | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ resource "azuread_application" "example" { | |
|
||
resource "azuread_service_principal" "example" { | ||
application_id = "${azuread_application.example.application_id}" | ||
app_role_assignment_required = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we aling these assingments here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
tags = ["example", "tags", "here"] | ||
} | ||
|
@@ -38,6 +39,8 @@ The following arguments are supported: | |
|
||
* `application_id` - (Required) The ID of the Azure AD Application for which to create a Service Principal. | ||
|
||
* `app_role_assignment_required` - (Optional) Does this Service Principal require an AppRoleAssignment to a user or group before Azure AD will issue a user or access token to the application? Defaults to `false`. | ||
|
||
* `tags` - (Optional) A list of tags to apply to the Service Principal. | ||
|
||
## Attributes Reference | ||
|
@@ -52,6 +55,8 @@ The following attributes are exported: | |
|
||
* `display_name` - The Display Name of the Azure Active Directory Application associated with this Service Principal. | ||
|
||
* `app_role_assignment_required` - Whether this Service Principal requires an AppRoleAssignment to a user or group before Azure AD will issue a user or access token to the application. | ||
|
||
* `oauth2_permissions` - A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a `oauth2_permission` block as documented below. | ||
|
||
--- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this above the computed properties?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. What about the
oauth2_permissions
andtags
, would you like me to move those above the computed properties as well, for consistency's sake?