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 112 forks source link

No data in secret for EC2 connectionDetails #1335

Open dmarquez-splunk opened 1 month ago

dmarquez-splunk commented 1 month ago

Is there an existing issue for this?

Affected Resource(s)

ec2.aws.upbound.io Instance

Resource MRs required to reproduce the bug

Hey team

I am exploring creating ec2 instances using crossplane. I am creating a managed resource below but am encountering issues when trying to read connectionDetails about the provisioned resource. I can see the resources is synced and ready successfully and the secret is created. However there are no fields in the secret and it is completely empty. I don't see any relevant logs in the pods or events that can help explain which is leads me here. Am I doing something wrong, missing something, or is this expected?

The manifest I am using to create the instance:

apiVersion: ec2.aws.upbound.io/v1beta1
kind: Instance
metadata:
   name: test-2
spec:
  deletionPolicy: Delete
  forProvider:
    region: us-west-2
    ami: ami-01cd4de4363ab6ee8
    availabilityZone: us-west-2b
    instanceType: t2.micro
    subnetId: <some_subnet>
  providerConfigRef:
    name: aws-irsa
  publishConnectionDetailsTo:
    name: test-secret-2
  writeConnectionSecretToRef:
    namespace: crossplane
    name: test-secret-2
 kubectl get instances
NAME     SYNCED   READY   EXTERNAL-NAME         AGE
test-2   True     True    i-05da3c7201316daa4   11m
kubectl describe secret test-secret-2 -n crossplane
Name:         test-secret-2
Namespace:    crossplane
Labels:       <none>
Annotations:  <none>

Type:  connection.crossplane.io/v1alpha1

Data
====

Steps to Reproduce

Create resource using manifest above and inspect created secret

What happened?

I expected the created secret to have data about the created resource

Relevant Error Output Snippet

N/A

Crossplane Version

1.3.1

Provider Version

1.15.2

Kubernetes Version

1.28.8

Kubernetes Distribution

EKS

Additional Info

No response

turkenf commented 1 month ago

Hi @dmarquez-splunk,

Thank you for bringing up this. You can find more detailed information about additional sensitive fields and custom connection details here. We need to manually add configurations for these fields. If you would like to contribute we would appreciate it.

Here is an example: https://github.com/crossplane-contrib/provider-upjet-aws/blob/40abec2fd4618af0b9b1896e0908a53f7071cf85/config/rds/config.go#L39

dmarquez-splunk commented 1 month ago

@turkenf thanks for the response. The field I need is the private IP address of the provisioned instance. To support this I would have to:

  1. Create an MR with similar changes you mentioned above
  2. Once merged, wait for a new version to be published with my changes
  3. Update my provider
  4. Newly created instances should now populate the secret with the private IP

How long would a turn around for 1 & 2 typically take?

turkenf commented 1 month ago

How long would a turn around for 1 & 2 typically take?

We have a regular release schedule, aiming for the last Thursday of each month, except for exceptional cases. If you open your PR and it is merged during this time, the planned date is June 27, 2024