crossplane-contrib / provider-jet-aws

AWS Provider for Crossplane that is built with Terrajet.
https://crossplane.io
Apache License 2.0
37 stars 30 forks source link

Cannot create broker #181

Closed garreeoke closed 2 years ago

garreeoke commented 2 years ago

What happened?

Cannot create broker, status of the broker says cannot create the broker, duplicate name. Broker actually gets created in aws but broker object in kubernetes never goes to true due to duplicate broker name.

How can we reproduce it?

Try to create a broker.

What environment did it happen in?

Crossplane version:

jbw976 commented 2 years ago

Thanks for reporting this @garreeoke! is there any other debugging information you can provide? e.g. an example manifest that causes this behavior, the kubectl describe output of the broker object, etc.?

garreeoke commented 2 years ago

describe_broker.txt managed_resource.txt

@jbw976 attached is the describe of the broker object and the managed resource yaml I used to create it. The broker does get created in aws, but it does take about 5+ minutes.

garreeoke commented 2 years ago

I did turn on debugging for the provider, but no other valuable info in there.

garreeoke commented 2 years ago

Here is the created terraform file in the provider's container. main_terraform_file.txt

Screenshot of created resource in aws. image

garreeoke commented 2 years ago

@jbw976 got past this issue as can create a broker now. Only issue left is there is no data in the connection secret. Let me know if that should be a different issue.

jbw976 commented 2 years ago

Good progress @garreeoke! did you change something to get past the first issue with creating the broker resource? worth sharing here?

I'd keep tracking this all in this one issue - end to end success of broker creation and able to actually use it :)

garreeoke commented 2 years ago

@jbw976 No, I didn't change anything. Just used changes we did to bump the version to v1alpha2. There are no more errors for brokername.

ezgidemirel commented 2 years ago

Hey @garreeoke , what do you expect to see in the connection secret? We're passing the username via managed resource spec and storing the password in a k8s secret. The URLs will be available in the managed resource's status field once it's ready.

garreeoke commented 2 years ago

Hi @ezgidemirel I'm trying to get some values from the status and put them in the secret. For example ...

In the XRD I have ...

connectionSecretKeys:

In the composition I have ...

connectionDetails:

status: atProvider: arn: arn:aws:mq:us-west-2:609897127049:broker:spring-sensors-1:b-91e6378a-5916-4be9-8aa6-b260f6c68dbb id: b-91e6378a-5916-4be9-8aa6-b260f6c68dbb instances:

garreeoke commented 2 years ago

@ezgidemirel @jbw976 My connection secret get created right away before any of this information is available in the status. Should this be updated once the managed resource is ready?

ezgidemirel commented 2 years ago

@garreeoke that was my initial assumption. But, I couldn't make it work.

garreeoke commented 2 years ago

@ezgidemirel wrote an issue in crossplane for this. I can probably fix it.

https://github.com/crossplane/crossplane/issues/3086

ezgidemirel commented 2 years ago

Hey @garreeoke I could propagate the arn value to the connection secret successfully. The missing part in my composition file was the following:

        writeConnectionSecretToRef:
          namespace: crossplane-system

Is there anything else that needs to be done in this bug's scope?

garreeoke commented 2 years ago

Hi @ezgidemirel I had that information already, but didn't work. However, I deleted my CRD and composition, re-added them and it worked. Therefore, we can close this.