Skip to content

Commit

Permalink
chore(release): v4.31.0 (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov authored Dec 18, 2024
1 parent 65f0e8f commit 9d58d73
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nav_order: 1
<!-- Always keep the following header in place: -->
<!--## [MAJOR.MINOR.PATCH] - YYYY-MM-DD -->

## [MAJOR.MINOR.PATCH] - YYYY-MM-DD
## [4.31.0] - 2024-12-18

- Add `alloydbomni` BETA resource and datasource
- Add `aiven_alloydbomni_user` BETA resource and datasource
Expand Down
38 changes: 37 additions & 1 deletion docs/resources/alloydbomni.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,35 @@ Creates and manages an Aiven for AlloyDB Omni service.
**This resource is in the beta stage and may change without notice.** Set
the `PROVIDER_AIVEN_ENABLE_BETA` environment variable to use the resource.


## Example Usage

```terraform
resource "aiven_alloydbomni" "example_alloydbomni" {
project = data.aiven_project.example_project.project
cloud_name = "google-europe-west1"
plan = "startup-4"
service_name = "example-alloydbomni-service"
maintenance_window_dow = "monday"
maintenance_window_time = "10:00:00"
tag {
key = "test"
value = "val"
}
alloydbomni_user_config {
public_access {
pg = true
prometheus = false
}
pg {
idle_in_transaction_session_timeout = 900
log_min_duration_statement = -1
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -307,3 +335,11 @@ Read-Only:
- `route` (String)
- `ssl` (Boolean)
- `usage` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import aiven_alloydbomni.example_alloydbomni PROJECT/SERVICE_NAME
```
1 change: 1 addition & 0 deletions examples/resources/aiven_alloydbomni/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import aiven_alloydbomni.example_alloydbomni PROJECT/SERVICE_NAME
25 changes: 25 additions & 0 deletions examples/resources/aiven_alloydbomni/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "aiven_alloydbomni" "example_alloydbomni" {
project = data.aiven_project.example_project.project
cloud_name = "google-europe-west1"
plan = "startup-4"
service_name = "example-alloydbomni-service"
maintenance_window_dow = "monday"
maintenance_window_time = "10:00:00"

tag {
key = "test"
value = "val"
}

alloydbomni_user_config {
public_access {
pg = true
prometheus = false
}

pg {
idle_in_transaction_session_timeout = 900
log_min_duration_statement = -1
}
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23

require (
github.com/aiven/aiven-go-client/v2 v2.33.0
github.com/aiven/go-client-codegen v0.70.0
github.com/aiven/go-client-codegen v0.71.0
github.com/avast/retry-go v3.0.0+incompatible
github.com/dave/jennifer v1.7.1
github.com/docker/go-units v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/aiven/aiven-go-client/v2 v2.33.0 h1:7hsM3/2lVog/P9ls/gLeba5feNVQjK8rI
github.com/aiven/aiven-go-client/v2 v2.33.0/go.mod h1:qXBgER0dtjJa1V3l7kzpizuAGjFCkgahhHL5OpoM2ZM=
github.com/aiven/go-api-schemas v1.106.0 h1:qncRsbiaGnU9JE9fmTFHclTCBem+t+6EPMXGXM35w2c=
github.com/aiven/go-api-schemas v1.106.0/go.mod h1:z7dGvufm6If4gOdVr7dWTuFZmll9FOZr5Z5CSxGpebA=
github.com/aiven/go-client-codegen v0.70.0 h1:i8DIbTxx4sZ7dUc4g2ILsJ7phvl1IEi8PfzblTDlWVA=
github.com/aiven/go-client-codegen v0.70.0/go.mod h1:QKN/GgLMGWd6+gPEucXlZPi5vC3C6RpD3UeBRQOLI1Y=
github.com/aiven/go-client-codegen v0.71.0 h1:SGiHrfbU8RiqVegQGV3BStnbIdFke+15lxadlPORqfI=
github.com/aiven/go-client-codegen v0.71.0/go.mod h1:QKN/GgLMGWd6+gPEucXlZPi5vC3C6RpD3UeBRQOLI1Y=
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/samber/lo"

"github.com/aiven/terraform-provider-aiven/internal/common"
"github.com/aiven/terraform-provider-aiven/internal/schemautil"
Expand All @@ -23,6 +24,13 @@ import (

const serviceIntegrationEndpointRegExp = "^[a-zA-Z0-9_-]*\\/{1}[a-zA-Z0-9_-]*$"

func serviceIntegrationTypeChoices() []string {
// application_service_credential is not ready for use
return lo.Filter(service.IntegrationTypeChoices(), func(s string, _ int) bool {
return s != "application_service_credential"
})
}

func aivenServiceIntegrationSchema() map[string]*schema.Schema {
s := map[string]*schema.Schema{
"integration_id": {
Expand Down Expand Up @@ -52,11 +60,11 @@ func aivenServiceIntegrationSchema() map[string]*schema.Schema {
Type: schema.TypeString,
},
"integration_type": {
Description: userconfig.Desc("Type of the service integration").PossibleValuesString(service.IntegrationTypeChoices()...).Build(),
Description: userconfig.Desc("Type of the service integration").PossibleValuesString(serviceIntegrationTypeChoices()...).Build(),
ForceNew: true,
Required: true,
Type: schema.TypeString,
ValidateFunc: validation.StringInSlice(service.IntegrationTypeChoices(), false),
ValidateFunc: validation.StringInSlice(serviceIntegrationTypeChoices(), false),
},
"project": {
Description: "Project the integration belongs to.",
Expand Down

0 comments on commit 9d58d73

Please sign in to comment.