lifecycled icon indicating copy to clipboard operation
lifecycled copied to clipboard

Refactor queue creation and attribute handling

Open ashkankamyab opened this issue 1 year ago • 3 comments

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 variable KMS_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.

ashkankamyab avatar May 11 '23 17:05 ashkankamyab

Sorry I pushed the wrong commit

ashkankamyab avatar May 11 '23 17:05 ashkankamyab

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!

DrJosh9000 avatar Jun 21 '23 02:06 DrJosh9000

Hi Sorry for delay. I was stucked in my daily tasks. I will fix it asap :-)

ashkankamyab avatar Aug 08 '23 02:08 ashkankamyab