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

[Bug]: DynamoDB Table does not support Capital letters in a table name whereas aws supports it. #1323

Open suvaanshkumar opened 1 month ago

suvaanshkumar commented 1 month ago

Is there an existing issue for this?

Affected Resource(s)

tables.dynamodb.aws.upbound.io/v1beta1

Resource MRs required to reproduce the bug

apiVersion: dynamodb.aws.upbound.io/v1beta1 kind: Table metadata: annotations: meta.upbound.io/example-id: dynamodb/v1beta1/table name: abc-Def spec: forProvider: attribute:

Steps to Reproduce

The Table "abc-Def" is invalid: 
* metadata.name: Invalid value: "abc-Def": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

What happened?

We were able to create an actual DynamoDB table with the name having capital letters on aws using terraform but we are unable to create using upbound provider.

Relevant Error Output Snippet

The Table "abc-Def" is invalid: 
* metadata.name: Invalid value: "abc-Def": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Crossplane Version

1.15.0

Provider Version

v1.3.1

Kubernetes Version

v1.28.3

Kubernetes Distribution

EKS

Additional Info

We are expecting to be able to create a DynamoDBtable with a name that contains the capital letters as we are able to create it on aws. Probably another field like spec.name would be useful.

chlunde commented 1 month ago

This works if you set the external-name annotation:

apiVersion: dynamodb.aws.upbound.io/v1beta1
kind: Table
metadata:
  name: example
  annotations:
    crossplane.io/external-name: specialTable.WithMoreChars99
blakeromano commented 4 weeks ago

I think this is really a K8s limitation rather then a Crossplane one https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names I would recommend going with the external-name approach.