Skip to content
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_application - support the description property #977

Merged
merged 3 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/hashicorp/terraform-provider-azuread
require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
github.com/manicminer/hamilton v0.52.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0
github.com/manicminer/hamilton v0.54.0
golang.org/x/text v0.3.7
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H
github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ=
github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs=
github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
Expand Down Expand Up @@ -224,8 +224,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/manicminer/hamilton v0.52.0 h1:z+K/fxTpCtWi/XMB4L9QgqPo2B+eoYozNeh8YvplJ3I=
github.com/manicminer/hamilton v0.52.0/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk=
github.com/manicminer/hamilton v0.54.0 h1:vnjgE7Eer9dnrAd78qZHPK6CTNCwwFmuVtvBjjl4OtY=
github.com/manicminer/hamilton v0.54.0/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
Expand Down
10 changes: 10 additions & 0 deletions internal/services/applications/application_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ func applicationResource() *schema.Resource {
},
},

"description": {
Description: "Description of the application as shown to end users",
Type: schema.TypeString,
Optional: true,
ValidateDiagFunc: validate.ValidateDiag(validation.StringLenBetween(0, 1024)),
},

"device_only_auth_enabled": {
Description: "Specifies whether this application supports device authentication without a user.",
Type: schema.TypeBool,
Expand Down Expand Up @@ -951,6 +958,7 @@ func applicationResourceCreate(ctx context.Context, d *schema.ResourceData, meta
properties := msgraph.Application{
Api: expandApplicationApi(d.Get("api").([]interface{})),
AppRoles: expandApplicationAppRoles(d.Get("app_role").(*schema.Set).List()),
Description: utils.NullableString(d.Get("description").(string)),
DisplayName: utils.String(tempDisplayName),
GroupMembershipClaims: expandApplicationGroupMembershipClaims(d.Get("group_membership_claims").(*schema.Set).List()),
IdentifierUris: tf.ExpandStringSlicePtr(d.Get("identifier_uris").(*schema.Set).List()),
Expand Down Expand Up @@ -1121,6 +1129,7 @@ func applicationResourceUpdate(ctx context.Context, d *schema.ResourceData, meta
},
Api: expandApplicationApi(d.Get("api").([]interface{})),
AppRoles: expandApplicationAppRoles(d.Get("app_role").(*schema.Set).List()),
Description: utils.NullableString(d.Get("description").(string)),
DisplayName: utils.String(displayName),
GroupMembershipClaims: expandApplicationGroupMembershipClaims(d.Get("group_membership_claims").(*schema.Set).List()),
IdentifierUris: tf.ExpandStringSlicePtr(d.Get("identifier_uris").(*schema.Set).List()),
Expand Down Expand Up @@ -1217,6 +1226,7 @@ func applicationResourceRead(ctx context.Context, d *schema.ResourceData, meta i
tf.Set(d, "app_role", flattenApplicationAppRoles(app.AppRoles))
tf.Set(d, "app_role_ids", flattenApplicationAppRoleIDs(app.AppRoles))
tf.Set(d, "application_id", app.AppId)
tf.Set(d, "description", app.Description)
tf.Set(d, "device_only_auth_enabled", app.IsDeviceOnlyAuthSupported)
tf.Set(d, "disabled_by_microsoft", fmt.Sprintf("%v", app.DisabledByMicrosoftStatus))
tf.Set(d, "display_name", app.DisplayName)
Expand Down
2 changes: 2 additions & 0 deletions internal/services/applications/application_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ resource "azuread_application" "test" {
fallback_public_client_enabled = true
oauth2_post_response_required = true

description = "Acceptance testing application"
marketing_url = "https://hashitown-%[1]d.com/"
privacy_statement_url = "https://hashitown-%[1]d.com/privacy"
support_url = "https://support.hashitown-%[1]d.com/"
Expand Down Expand Up @@ -850,6 +851,7 @@ resource "azuread_application" "test" {
fallback_public_client_enabled = true
oauth2_post_response_required = true

description = "Acceptance testing application"
marketing_url = "https://templatetown-%[1]d.com/"
privacy_statement_url = "https://templatetown-%[1]d.com/privacy"
support_url = "https://support.templatetown-%[1]d.com/"
Expand Down

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

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

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

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

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

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

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

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

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

Loading