lifecycled
lifecycled copied to clipboard
Refactor queue creation and attribute handling
This commit introduces changes to the Create
method of the Queue
struct, improving the flexibility and configurability of queue attributes. The following updates were made:
- The
queuePolicy
now supports customization through a configuration file located at/etc/lifecycled/queue_policy.json
. If the file is not found or cannot be read, a default policy is used. - The
Create
method now checks for the presence of environment variableKMS_MASTER_KEY_ID
. If available, it sets the corresponding attribute in the SQS queue creation request. - The error handling in attribute assignment has been enhanced, ensuring proper handling of errors related to environment variable parsing and conversion.
These changes improve the modularity and adaptability of the code, allowing for easier customization of queue policies and attribute configurations. They provide a more seamless integration with environment variables, offering greater flexibility in different deployment scenarios.
These modifications enhance the maintainability and configurability of the codebase, ensuring a more robust and adaptable queue management solution.
Sorry I pushed the wrong commit
Hi @ashkankamyab, sorry for the slow response.
We had a look and have two main suggestions:
- KMS_MASTER_KEY_ID would probably be better if it could be set with a CLI flag
- The path to the policy file should also be a flag, rather than a hard-coded path
Please let us know how much of a blocker this is for you, so we can give the right amount of help to get this merged!
Hi Sorry for delay. I was stucked in my daily tasks. I will fix it asap :-)