diff --git a/internal/provider/resource_tfe_admin_organization_settings.go b/internal/provider/resource_tfe_admin_organization_settings.go index 43c799908..f2020f2b7 100644 --- a/internal/provider/resource_tfe_admin_organization_settings.go +++ b/internal/provider/resource_tfe_admin_organization_settings.go @@ -41,6 +41,10 @@ func resourceTFEAdminOrganizationSettings() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "global_provider_sharing": { + Type: schema.TypeBool, + Optional: true, + }, "sso_enabled": { Computed: true, Type: schema.TypeBool, @@ -87,6 +91,7 @@ func resourceTFEAdminOrganizationSettingsRead(d *schema.ResourceData, meta inter d.Set("organization", org.Name) d.Set("access_beta_tools", org.AccessBetaTools) d.Set("global_module_sharing", org.GlobalModuleSharing) + d.Set("global_provider_sharing", org.GlobalProviderSharing) d.Set("sso_enabled", org.SsoEnabled) d.Set("workspace_limit", org.WorkspaceLimit) d.SetId(org.Name) @@ -140,11 +145,13 @@ func resourceTFEAdminOrganizationSettingsUpdate(d *schema.ResourceData, meta int return err } globalModuleSharing := d.Get("global_module_sharing").(bool) + globalProviderSharing := d.Get("global_provider_sharing").(bool) _, err = config.Client.Admin.Organizations.Update(ctx, name, tfe.AdminOrganizationUpdateOptions{ - AccessBetaTools: tfe.Bool(d.Get("access_beta_tools").(bool)), - GlobalModuleSharing: tfe.Bool(globalModuleSharing), - WorkspaceLimit: tfe.Int(d.Get("workspace_limit").(int)), + AccessBetaTools: tfe.Bool(d.Get("access_beta_tools").(bool)), + GlobalModuleSharing: tfe.Bool(globalModuleSharing), + GlobalProviderSharing: tfe.Bool(globalProviderSharing), + WorkspaceLimit: tfe.Int(d.Get("workspace_limit").(int)), }) if err != nil { diff --git a/internal/provider/resource_tfe_admin_organization_settings_test.go b/internal/provider/resource_tfe_admin_organization_settings_test.go index 2a744f55d..690b8ab17 100644 --- a/internal/provider/resource_tfe_admin_organization_settings_test.go +++ b/internal/provider/resource_tfe_admin_organization_settings_test.go @@ -33,6 +33,8 @@ func TestAccTFEAdminOrganizationSettings_basic(t *testing.T) { "tfe_admin_organization_settings.settings", "organization", fmt.Sprintf("tst-terraform-%d", rInt1)), resource.TestCheckResourceAttr( "tfe_admin_organization_settings.settings", "global_module_sharing", "false"), + resource.TestCheckResourceAttr( + "tfe_admin_organization_settings.settings", "global_provider_sharing", "false"), resource.TestCheckResourceAttr( "tfe_admin_organization_settings.settings", "access_beta_tools", "true"), @@ -58,6 +60,8 @@ func TestAccTFEAdminOrganizationSettings_basic(t *testing.T) { "tfe_admin_organization_settings.settings", "organization", fmt.Sprintf("tst-terraform-%d", rInt1)), resource.TestCheckResourceAttr( "tfe_admin_organization_settings.settings", "global_module_sharing", "false"), + resource.TestCheckResourceAttr( + "tfe_admin_organization_settings.settings", "global_provider_sharing", "false"), resource.TestCheckResourceAttr( "tfe_admin_organization_settings.settings", "access_beta_tools", "true"), @@ -94,6 +98,7 @@ resource "tfe_organization" "bar" { resource "tfe_admin_organization_settings" "settings" { organization = tfe_organization.foobar.id global_module_sharing = false + global_provider_sharing = false access_beta_tools = true module_sharing_consumer_organizations = [tfe_organization.foo.id, tfe_organization.bar.id] diff --git a/website/docs/r/admin_organization_settings.markdown b/website/docs/r/admin_organization_settings.markdown index f6c68e30f..d701eaea4 100644 --- a/website/docs/r/admin_organization_settings.markdown +++ b/website/docs/r/admin_organization_settings.markdown @@ -44,6 +44,7 @@ resource "tfe_admin_organization_settings" "test-settings" { workspace_limit = 15 access_beta_tools = false global_module_sharing = false + global_provider_sharing = false module_sharing_consumer_organizations = [ tfe_organization.a-module-consumer.name ] @@ -58,6 +59,7 @@ The following arguments are supported: * `access_beta_tools` - (Optional) True if the organization has access to beta tool versions. * `workspace_limit` - (Optional) Maximum number of workspaces for this organization. If this number is set to a value lower than the number of workspaces the organization has, it will prevent additional workspaces from being created, but existing workspaces will not be affected. If set to 0, this limit will have no effect. * `global_module_sharing` - (Optional) If true, modules in the organization's private module repository will be available to all other organizations. Enabling this will disable any previously configured module_sharing_consumer_organizations. Cannot be true if module_sharing_consumer_organizations is set. +* `global_provider_sharing` - (Optional) If true, provider in the organization's private provider registry will be available to all other organizations. * `module_sharing_consumer_organizations` - (Optional) A list of organization names to share modules in the organization's private module repository with. Cannot be set if global_module_sharing is true. ## Attributes Reference