diff --git a/sentry/resource_sentry_project.go b/sentry/resource_sentry_project.go index 9f18bf97b..462bdf6fe 100644 --- a/sentry/resource_sentry_project.go +++ b/sentry/resource_sentry_project.go @@ -238,6 +238,7 @@ func resourceSentryProjectRead(ctx context.Context, d *schema.ResourceData, meta d.Set("status", proj.Status), d.Set("digests_min_delay", proj.DigestsMinDelay), d.Set("digests_max_delay", proj.DigestsMaxDelay), + d.Set("allowed_domains", proj.AllowedDomains), d.Set("resolve_age", proj.ResolveAge), d.Set("project_id", proj.ID), // Deprecated ) @@ -274,6 +275,15 @@ func resourceSentryProjectUpdate(ctx context.Context, d *schema.ResourceData, me params.ResolveAge = sentry.Int(v.(int)) } + if v, ok := d.GetOk("allowed_domains"); ok { + allowedDomainsSet := v.(*schema.Set) + allowedDomains := make([]string, allowedDomainsSet.Len()) + for i, domain := range allowedDomainsSet.List() { + allowedDomains[i] = domain.(string) + } + params.AllowedDomains = allowedDomains + } + tflog.Debug(ctx, "Updating project", map[string]interface{}{ "org": org, "project": project, diff --git a/sentry/resource_sentry_project_test.go b/sentry/resource_sentry_project_test.go index 1d8b0175c..40841c931 100644 --- a/sentry/resource_sentry_project_test.go +++ b/sentry/resource_sentry_project_test.go @@ -54,7 +54,7 @@ func TestAccSentryProject_basic(t *testing.T) { ImportStateVerify: true, // TODO: Until we update go-sentry to include these attributes in its project.Get function, // we will ignore them for now. - ImportStateVerifyIgnore: []string{"allowed_domains", "remove_default_key", "remove_default_rule"}, + ImportStateVerifyIgnore: []string{"remove_default_key", "remove_default_rule"}, }, }, }) @@ -154,7 +154,7 @@ func TestAccSentryProject_teams(t *testing.T) { ImportStateVerify: true, // TODO: Until we update go-sentry to include these attributes in its project.Get function, // we will ignore them for now. - ImportStateVerifyIgnore: []string{"allowed_domains", "remove_default_key", "remove_default_rule"}, + ImportStateVerifyIgnore: []string{"remove_default_key", "remove_default_rule"}, }, }, })