crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
137 stars 113 forks source link

ActiveMQ User Resource is missing #1264

Closed haarchri closed 3 weeks ago

haarchri commented 2 months ago

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?

mergenci commented 2 months ago

Some pointers for reference:

ulucinar commented 2 months ago

We took an initial look at this:

haarchri commented 1 month ago

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

ulucinar commented 1 month ago

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

mergenci commented 1 month ago

@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 commented 3 weeks ago

Released with https://github.com/crossplane-contrib/provider-upjet-aws/releases/tag/v1.5.0