You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfmt.Errorf("invalid queue ID format for dead-letter queue: %s (expected region/project-id/queue-name or arn:scw:sqs:region:project-id:queue-name)", queueID)
258
+
}
259
+
default:
260
+
// Assume it's already a valid ARN or queue identifier
261
+
scwARN=queueID
262
+
}
263
+
264
+
// Create RedrivePolicy JSON
265
+
redrivePolicy:=map[string]any{
266
+
"deadLetterTargetArn": scwARN,
267
+
"maxReceiveCount": maxReceiveCount,
268
+
}
269
+
270
+
jsonData, err:=json.Marshal(redrivePolicy)
271
+
iferr!=nil {
272
+
returnfmt.Errorf("failed to marshal redrive policy: %w", err)
273
+
}
274
+
275
+
s=string(jsonData)
276
+
}
277
+
} else {
278
+
returnfmt.Errorf("unsupported list type for %s", resourcePath)
279
+
}
227
280
default:
228
281
returnfmt.Errorf("unsupported type %s for %s", resourceSchema.Type, resourcePath)
229
282
}
@@ -265,14 +318,47 @@ func awsAttributeToResourceData(values map[string]any, value string, resourcePat
265
318
setResourceValue(values, resourcePath, i, resourceSchemas)
Description: "The maximum size of a message. Should be in bytes.",
108
108
},
109
+
"dead_letter_queue": {
110
+
Type: schema.TypeList,
111
+
Optional: true,
112
+
MaxItems: 1,
113
+
Description: "Configuration for the dead-letter queue",
114
+
Elem: &schema.Resource{
115
+
Schema: map[string]*schema.Schema{
116
+
"id": {
117
+
Type: schema.TypeString,
118
+
Required: true,
119
+
Description: "The ID or ARN of the dead-letter queue where messages are sent after the maximum receive count is exceeded.",
120
+
},
121
+
"max_receive_count": {
122
+
Type: schema.TypeInt,
123
+
Required: true,
124
+
ValidateFunc: validation.IntBetween(1, 1000),
125
+
Description: "The number of times a message is delivered to the source queue before being sent to the dead-letter queue. Must be between 1 and 1,000.",
0 commit comments