Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor queue creation and attribute handling #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ashkankamyab
Copy link

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.

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
Copy link
Author

Sorry I pushed the wrong commit

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.
@DrJosh9000
Copy link

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!

@ashkankamyab
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants