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

Elasticache ReplicationGroup connection secret is empty #1043

Closed
akunafin opened this issue Dec 26, 2023 · 7 comments
Closed

Elasticache ReplicationGroup connection secret is empty #1043

akunafin opened this issue Dec 26, 2023 · 7 comments
Labels
bug Something isn't working is:triaged Indicates that an issue has been reviewed.

Comments

@akunafin
Copy link

What happened?

I'm creating an AWS Elasticache replication group and expect connection endpoint to be published into a secret with the help of publishConnectionDetailsTo setting. I see that secret is successfully created, but the only data that it has:
data: attribute.auth_token: ""

How can we reproduce it?

Create an elasticache replicationgroup using xpkg.upbound.io/upbound/provider-aws-elasticache:v0.46.1.

What environment did it happen in?

  • Crossplane Version: v1.14.5
  • Provider Version: v0.46.1
  • Kubernetes Version: 1.23
  • Kubernetes Distribution: EKS
@akunafin akunafin added bug Something isn't working needs:triage labels Dec 26, 2023
@mbbush
Copy link
Collaborator

mbbush commented Jan 5, 2024

Thanks for the bug report @akunafin.

Could you please include a complete manifest that shows the problem? That will make it much easier to reproduce. Based on a very quick look at the elasitcache replication group terraform provider docs, it looks like "" is the expected value of auth_token unless you're setting it to something else using spec.forProvider.authTokenSecretRef

@akunafin
Copy link
Author

akunafin commented Jan 9, 2024

Thanks for your reply @mbbush!

The main problem is not that auth_token is an empty string. The main problem is that there is no connection endpoint in this secret. For now I had to hardcode this endpoint in the manifest of the application, but that's definitely not the way it should work. I want to reference this secret in the manifest of my application in order for it to connect to the this cluster.

This is a ReplicationGroup manifest that I'm using:

apiVersion: elasticache.aws.upbound.io/v1beta1
kind: ReplicationGroup
metadata:
  annotations:
    uptest.upbound.io/timeout: "3600"
  name: replicationgroup
spec:
  forProvider:
    automaticFailoverEnabled: true
    description: redis
    nodeType: {{ .Values.redis_node_type | default "cache.t2.micro" }}
    numberCacheClusters: 2
    parameterGroupName: default.redis7
    port: 6379
    region: {{ .Values.global.region }}
    securityGroupIdRefs:
      - name: elasticache-securitygroup
    subnetGroupNameRef:
      name: elasticache-subnetgroup
  publishConnectionDetailsTo:
    name: elasticache-endpoint

Manifest of the secret object created:

apiVersion: v1
data:
  attribute.auth_token: ""
kind: Secret
metadata:
    secret.crossplane.io/owner-uid: 149419d9-1e7f-4c14-9438-438433643de8
  name: elasticache-endpoint
  namespace: operators
  resourceVersion: "1346910711"
  uid: 2db2140d-f69d-4dd1-9bff-360e6acab7fb
type: connection.crossplane.io/v1alpha1

@mbbush
Copy link
Collaborator

mbbush commented Jan 10, 2024

By default the connection secrets only contain values designated as sensitive by terraform. If you also want a non-sensitive value in your secret, like the endpoint, take a look at https://docs.crossplane.io/knowledge-base/guides/connection-details/

I think I found another example somewhere of explicitly how to get values from the status into the composition's secret, but kubectl explain composition.spec.resources.connectionDetails may also help you.

@turkenf
Copy link
Collaborator

turkenf commented Jan 10, 2024

@akunafin, also you can find more information from here about how to add sensitive fields.

@turkenf turkenf added is:triaged Indicates that an issue has been reviewed. and removed needs:triage labels Jan 10, 2024
@akunafin
Copy link
Author

@mbbush thanks for a useful reference! I managed to achieve what I wanted with the composition.
However I still think that it makes sense for provider to put an endpoint into the connection secret even if it's not sensitive.

@dhumphries-sainsburys
Copy link

I agree with @akunafin it keeps all the things you need to connect to the instance together in a practical way and is the same way other providers use this field. The CRD spec even says that these kinds of things should be published to this secret as specified here

@turkenf
Copy link
Collaborator

turkenf commented Jun 7, 2024

This issue covered in this PR #1322

@turkenf turkenf closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working is:triaged Indicates that an issue has been reviewed.
Projects
None yet
Development

No branches or pull requests

5 participants