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

ActiveMQ User Resource is missing #1264

Closed
haarchri opened this issue Apr 15, 2024 · 6 comments
Closed

ActiveMQ User Resource is missing #1264

haarchri opened this issue Apr 15, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@haarchri
Copy link
Member

What problem are you facing?

We want to use ActiveMQ in the official provider (mq.aws.upbound.io/v1beta1). We noticed that the official provider does not have a User API. The inline user configuration will not help because of the following comment MQ does not return broker users preventing this resource from making user updates and drift detection. https://marketplace.upbound.io/providers/upbound/provider-aws-mq/v1.3.1/resources/mq.aws.upbound.io/Broker/v1beta1#doc:spec-forProvider-user

And the Broker is missing a status that returns the log group names.

Both of these features are integrated in the community providers and it would help us a lot if we could have similar features with the official provider.
Is it possible to integrate these features into the official providers?

How could Official AWS Provider help solve your problem?

@haarchri haarchri added the enhancement New feature or request label Apr 15, 2024
@mergenci
Copy link
Collaborator

mergenci commented May 6, 2024

@ulucinar
Copy link
Collaborator

ulucinar commented May 6, 2024

We took an initial look at this:

  • As @haarchri states in the description, the UpdateBroker operation in the Amazon MQ REST API does not allow updating the broker users (please search for the definition of UpdateBrokerInput object in the given link). So while one can provision broker users (with some constraints on RabbitMQ) using the CreateBroker operation, it's not possible to update them via the UpdateBroker operation.
  • So, it's not possible to manage (drift detection/updates) the existing users of a broker via the Broker.mq MR.
  • Amazon MQ REST API has the UpdateUser operation on the User resource that allows updating ActiveMQ users. Currently, a corresponding Terraform resource is missing in the Terraform AWS provider.
  • Regarding the general log group, it's already available in the DescribeBroker output (please see the LogsSummary schema). However, the Terraform AWS provider does not extract that information from the SDK response and the Terraform resource schema does not have a corresponding attribute.

@haarchri
Copy link
Member Author

haarchri commented May 8, 2024

@ulucinar in the community provider-aws we have a ActiveMQ User Resource - so we could implement the resource her too without tf ?

@ulucinar
Copy link
Collaborator

ulucinar commented May 8, 2024

Hi @haarchri,
We are on it. @mergenci has started investigating how to implement the broker user resource.

@mergenci
Copy link
Collaborator

@haarchri, I was able to create, update, and delete ActiveMQ (not RabbitMQ) users, in the current provider version, using MQ Broker resource's embedded user field. RabbitMQ users cannot be managed neither using Terraform nor using AWS APIs.

I'm sharing the detailed steps below, to avoid any confusion. Does this address your needs?

Note that the reconciler enters an update loop upon applying any user updates, because updates won't take effect until next scheduled maintenance period or manual reboot of the broker.

  1. Apply the following manifest (requires EC2 provider as well):
apiVersion: mq.aws.upbound.io/v1beta1
kind: Broker
metadata:
  annotations:
    meta.upbound.io/example-id: mq/v1beta1/broker
  labels:
    testing.upbound.io/example-name: test-issue-1264-activemq-broker
  name: test-issue-1264-activemq-broker
spec:
  forProvider:
    # Due to an existing Terrajet limitation, we cannot use "metadata.name" for "brokerName"
    # Details can be found in https://github.com/crossplane/terrajet/issues/280
    brokerName: test-issue-1264-activemq-broker
    region: us-west-1
    securityGroupRefs:
    - name: test-issue-1264-mq-securitygroup
    engineType: ActiveMQ
    engineVersion: 5.17.6
    hostInstanceType: mq.t3.micro
    user:
    - passwordSecretRef:
        key: password
        name: test-issue-1264-mq-secret
        namespace: upbound-system
      username: admin

---
apiVersion: v1
kind: Secret
metadata:
  annotations:
    meta.upbound.io/example-id: mq/v1beta1/broker
    uptest.upbound.io/pre-delete-hook: testhooks/delete-broker.sh
  labels:
    testing.upbound.io/example-name: test-issue-1264-mq-secret
  name: test-issue-1264-mq-secret
  namespace: upbound-system
type: Opaque
stringData:
  password: "Upboundtest!"

---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: SecurityGroup
metadata:
  annotations:
    meta.upbound.io/example-id: ec2/v1beta1/securitygroup
  labels:
    testing.upbound.io/example-name: test-issue-1264-mq-securitygroup
  name: test-issue-1264-mq-securitygroup
spec:
  forProvider:
    region: us-west-1
    description: Allow TLS inbound traffic
    name: allow_tls
    tags:
      Name: allow_tls
  1. To test creation of a user, edit the broker resource and add the following block to spec.forProvider.user:
- consoleAccess: true
  passwordSecretRef:                                                                                                                                                                                                                        
    key: password                                                                                                                                                                                                                           
    name: test-issue-1264-mq-secret
    namespace: upbound-system                                                                                                                                                                                                               
  username: testuser
  1. Observe the user created in MQ Console.
  2. Reboot the broker from MQ Console, for new user creation to take effect.
  3. To test update of a user, edit the broker resource and set consoleAccess: false for the previously created user.
  4. Reboot the broker from MQ Console, for user update to take effect.
  5. Observe that “Console Access” has been disabled in MQ Console.
  6. To test deletion of the user, edit the broker resource and simply remove the whole block that we introduced above.
  7. Again, reboot the broker.

@haarchri
Copy link
Member Author

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

No branches or pull requests

3 participants