Skip to content

Commit

Permalink
chore(serverless): bump sdk go + deprecate MnqNamespaceID on trigger …
Browse files Browse the repository at this point in the history
…sqs (#2474)

* bump sdk go

* feat(serverless): deprecate MnqNamespaceID on trigger sqs

* go mod tidy

* update secret cassettes

* delete documentdb docs deak links
  • Loading branch information
yfodil committed Mar 26, 2024
1 parent df9ee23 commit f629237
Show file tree
Hide file tree
Showing 19 changed files with 581 additions and 601 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/documentdb_database.md
Expand Up @@ -5,7 +5,7 @@ page_title: "Scaleway: scaleway_documentdb_database"

# scaleway_documentdb_database

Gets information about DocumentDB database. More on our official [site](https://www.scaleway.com/en/developers/api/document_db/)
Gets information about DocumentDB database.

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/documentdb_instance.md
Expand Up @@ -5,7 +5,7 @@ page_title: "Scaleway: scaleway_documentdb_instance"

# scaleway_documentdb_instance

Gets information about an DocumentDB instance. For further information see our [developers website](https://www.scaleway.com/en/developers/api/document_db/)
Gets information about an DocumentDB instance.

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/container_trigger.md
Expand Up @@ -51,7 +51,7 @@ The following arguments are supported:
- `description` (Optional) The description of the trigger.

- `sqs` The configuration of the Scaleway's SQS used by the trigger
- `namespace_id` (Optional) ID of the mnq namespace. Deprecated.
- `namespace_id` (Deprecated) ID of the mnq namespace. Deprecated.
- `queue` (Required) Name of the queue
- `project_id` (Optional) ID of the project where sqs is enabled, defaults to provider's project
- `region` (Optional) Region where sqs is enabled, defaults to provider's region
Expand Down
1 change: 0 additions & 1 deletion docs/resources/documentdb_database.md
Expand Up @@ -6,7 +6,6 @@ page_title: "Scaleway: scaleway_documentdb_database"
# Resource: scaleway_documentdb_database

Creates and manages Scaleway DocumentDB database.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db).

## Example Usage

Expand Down
1 change: 0 additions & 1 deletion docs/resources/documentdb_instance.md
Expand Up @@ -6,7 +6,6 @@ page_title: "Scaleway: scaleway_documentdb_instance"
# Resource: scaleway_documentdb_instance

Creates and manages Scaleway Database Instances.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Example Usage

Expand Down
1 change: 0 additions & 1 deletion docs/resources/documentdb_private_network_endpoint.md
Expand Up @@ -6,7 +6,6 @@ page_title: "Scaleway: scaleway_documentdb_private_network_endpoint"
# Resource: scaleway_documentdb_private_network_endpoint

Creates and manages Scaleway Database Private Network Endpoint.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Example Usage

Expand Down
1 change: 0 additions & 1 deletion docs/resources/documentdb_privilege.md
Expand Up @@ -6,7 +6,6 @@ page_title: "Scaleway: scaleway_documentdb_privilege"
# Resource: scaleway_documentdb_privilege

Create and manage Scaleway DocumentDB database privilege.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Example Usage

Expand Down
1 change: 0 additions & 1 deletion docs/resources/documentdb_read_replica.md
Expand Up @@ -6,7 +6,6 @@ page_title: "Scaleway: scaleway_documentdb_read_replica"
# Resource: scaleway_documentdb_read_replica

Creates and manages Scaleway DocumentDB Database read replicas.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Example Usage

Expand Down
1 change: 0 additions & 1 deletion docs/resources/documentdb_user.md
Expand Up @@ -6,7 +6,6 @@ page_title: "Scaleway: scaleway_documentdb_user"
# Resource: scaleway_documentdb_user

Creates and manages Scaleway Database DocumentDB Users.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/function_trigger.md
Expand Up @@ -51,7 +51,7 @@ The following arguments are supported:
- `description` (Optional) The description of the trigger.

- `sqs` The configuration of the Scaleway's SQS used by the trigger
- `namespace_id` (Optional) ID of the mnq namespace. Deprecated.
- `namespace_id` (Deprecated) ID of the mnq namespace. Deprecated.
- `queue` (Required) Name of the queue
- `project_id` (Optional) ID of the project that contain the mnq namespace, defaults to provider's project
- `region` (Optional) Region where the mnq namespace is, defaults to provider's region
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -16,7 +16,7 @@ require (
github.com/nats-io/jwt/v2 v2.5.5
github.com/nats-io/nats.go v1.32.0
github.com/robfig/cron/v3 v3.0.1
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240228092808-aefd8976c68f
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240325161646-a49fad6abe89
github.com/stretchr/testify v1.9.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -201,8 +201,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240228092808-aefd8976c68f h1:63HwkTU9bAHDsHhdB9NU7XLM846tBxbQ3nGLBwlSO+E=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240228092808-aefd8976c68f/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240325161646-a49fad6abe89 h1:q9KYEP2h9ZbeI9k5y0n4SRYmzCQjccnlLfZ0IXVPIRs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240325161646-a49fad6abe89/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
Expand Down
7 changes: 0 additions & 7 deletions scaleway/helpers_container_triggers.go
Expand Up @@ -30,19 +30,12 @@ func waitForContainerTrigger(ctx context.Context, containerAPI *container.API, r

func expandContainerTriggerMnqSqsCreationConfig(i interface{}) *container.CreateTriggerRequestMnqSqsClientConfig {
m := i.(map[string]interface{})

mnqNamespaceID := locality.ExpandID(m["namespace_id"].(string))

req := &container.CreateTriggerRequestMnqSqsClientConfig{
Queue: m["queue"].(string),
MnqProjectID: m["project_id"].(string),
MnqRegion: m["region"].(string),
}

if mnqNamespaceID != "" {
req.MnqNamespaceID = &mnqNamespaceID
}

return req
}

Expand Down
7 changes: 0 additions & 7 deletions scaleway/helpers_function_triggers.go
Expand Up @@ -10,19 +10,12 @@ import (

func expandFunctionTriggerMnqSqsCreationConfig(i interface{}) *function.CreateTriggerRequestMnqSqsClientConfig {
m := i.(map[string]interface{})

mnqNamespaceID := locality.ExpandID(m["namespace_id"].(string))

req := &function.CreateTriggerRequestMnqSqsClientConfig{
Queue: m["queue"].(string),
MnqProjectID: m["project_id"].(string),
MnqRegion: m["region"].(string),
}

if mnqNamespaceID != "" {
req.MnqNamespaceID = &mnqNamespaceID
}

return req
}

Expand Down
2 changes: 1 addition & 1 deletion scaleway/resource_container_trigger.go
Expand Up @@ -61,10 +61,10 @@ func ResourceScalewayContainerTrigger() *schema.Resource {
Schema: map[string]*schema.Schema{
"namespace_id": {
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Description: "ID of the mnq namespace",
DiffSuppressFunc: diffSuppressFuncLocality,
Deprecated: "The 'namespace_id' field is deprecated and will be removed in the next major version. It is no longer necessary to specify it",
},
"queue": {
Required: true,
Expand Down
2 changes: 1 addition & 1 deletion scaleway/resource_function_trigger.go
Expand Up @@ -61,10 +61,10 @@ func ResourceScalewayFunctionTrigger() *schema.Resource {
Schema: map[string]*schema.Schema{
"namespace_id": {
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Description: "ID of the mnq namespace",
DiffSuppressFunc: diffSuppressFuncLocality,
Deprecated: "The 'namespace_id' field is deprecated and will be removed in the next major version. It is no longer necessary to specify it",
},
"queue": {
Required: true,
Expand Down

0 comments on commit f629237

Please sign in to comment.