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)
257
+
}
258
+
default:
259
+
// Assume it's already a valid ARN or queue identifier
260
+
scwARN=queueID
261
+
}
262
+
263
+
// Create RedrivePolicy JSON
264
+
redrivePolicy:=map[string]interface{}{
265
+
"deadLetterTargetArn": scwARN,
266
+
"maxReceiveCount": maxReceiveCount,
267
+
}
268
+
269
+
jsonData, err:=json.Marshal(redrivePolicy)
270
+
iferr!=nil {
271
+
returnfmt.Errorf("failed to marshal redrive policy: %w", err)
272
+
}
273
+
274
+
s=string(jsonData)
275
+
}
276
+
} else {
277
+
returnfmt.Errorf("unsupported list type for %s", resourcePath)
278
+
}
227
279
default:
228
280
returnfmt.Errorf("unsupported type %s for %s", resourceSchema.Type, resourcePath)
229
281
}
@@ -265,14 +317,47 @@ func awsAttributeToResourceData(values map[string]any, value string, resourcePat
265
317
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