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

chore(project): deprecate obsolete fields #1353

Merged
merged 1 commit into from
Sep 12, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ nav_order: 1
- Fix improper omitting in `ToAPI`
- Fix Kafka Topic perfomance
- Add OpenSearch Security Plugin support (`aiven_opensearch_security_plugin_config` resource)
- Deprecate `add_account_owners_admin_access` and `use_source_project_billing_group` fields in `aiven_project` resource

## [4.8.1] - 2023-08-23

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ resource "aiven_project" "myproject" {
### Optional

- `account_id` (String, Deprecated) An optional property to link a project to an already existing account by using account ID. To set up proper dependencies please refer to this variable as a reference.
- `add_account_owners_admin_access` (Boolean) If parent_id is set, grant account owner team admin access to the new project. The default value is `true`.
- `add_account_owners_admin_access` (Boolean, Deprecated) If parent_id is set, grant account owner team admin access to the new project. The default value is `true`.
- `billing_group` (String) The id of the billing group that is linked to this project. To set up proper dependencies please refer to this variable as a reference.
- `copy_from_project` (String) is the name of another project used to copy billing information and some other project attributes like technical contacts from. This is mostly relevant when an existing project has billing type set to invoice and that needs to be copied over to a new project. (Setting billing is otherwise not allowed over the API.) This only has effect when the project is created. To set up proper dependencies please refer to this variable as a reference.
- `default_cloud` (String) Defines the default cloud provider and region where services are hosted. This can be changed freely after the project is created. This will not affect existing services.
- `parent_id` (String) An optional property to link a project to an already existing organization or account by using its ID. To set up proper dependencies please refer to this variable as a reference.
- `tag` (Block Set) Tags are key-value pairs that allow you to categorize projects. (see [below for nested schema](#nestedblock--tag))
- `technical_emails` (Set of String) Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service instability. It is good practice to keep this up-to-date to be aware of any potential issues with your project.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `use_source_project_billing_group` (Boolean) Use the same billing group that is used in source project.
- `use_source_project_billing_group` (Boolean, Deprecated) Use the same billing group that is used in source project.

### Read-Only

Expand Down
6 changes: 6 additions & 0 deletions internal/sdkprovider/service/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ var aivenProjectSchema = map[string]*schema.Schema{
Optional: true,
DiffSuppressFunc: schemautil.CreateOnlyDiffSuppressFunc,
Description: "Use the same billing group that is used in source project.",
Deprecated: "This field is deprecated and will be removed in the next major release.",
},
"add_account_owners_admin_access": {
Type: schema.TypeBool,
Optional: true,
Description: userconfig.Desc("If parent_id is set, grant account owner team admin access to the new project.").DefaultValue(true).Build(),
Deprecated: "This field is deprecated and will be removed in the next major release. " +
"Currently, it will always be set to true, regardless of the value set in the manifest.",
DiffSuppressFunc: func(_ string, _ string, _ string, _ *schema.ResourceData) bool {
return true
},
},
"project": {
Type: schema.TypeString,
Expand Down
16 changes: 6 additions & 10 deletions internal/sdkprovider/service/project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func TestAccAivenProject_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "project", fmt.Sprintf("test-acc-pr-%s", rName)),
resource.TestCheckResourceAttrSet(resourceName, "default_cloud"),
resource.TestCheckResourceAttrSet(resourceName, "ca_cert"),
resource.TestCheckResourceAttr(resourceName, "add_account_owners_admin_access", "true"),
),
},
{
Expand All @@ -42,7 +41,6 @@ func TestAccAivenProject_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "default_cloud"),
resource.TestCheckResourceAttrSet(resourceName, "ca_cert"),
resource.TestCheckResourceAttrSet(resourceName, "billing_group"),
resource.TestCheckResourceAttr(resourceName, "add_account_owners_admin_access", "false"),
),
},
{
Expand Down Expand Up @@ -169,10 +167,9 @@ resource "aiven_account" "bar" {
}

resource "aiven_project" "foo" {
project = "test-acc-pr-%[1]s"
account_id = aiven_account.bar.account_id
default_cloud = "aws-eu-west-2"
add_account_owners_admin_access = true
project = "test-acc-pr-%[1]s"
account_id = aiven_account.bar.account_id
default_cloud = "aws-eu-west-2"
tag {
key = "test"
value = "val"
Expand Down Expand Up @@ -208,10 +205,9 @@ resource "aiven_project" "source" {
}

resource "aiven_project" "foo" {
project = "test-acc-pr-%[1]s"
account_id = aiven_account.bar.account_id
copy_from_project = aiven_project.source.project
use_source_project_billing_group = false
project = "test-acc-pr-%[1]s"
account_id = aiven_account.bar.account_id
copy_from_project = aiven_project.source.project
}

data "aiven_project" "project" {
Expand Down