docs icon indicating copy to clipboard operation
docs copied to clipboard

[Web Bug] - AWS Quickstart Part 2 - Missing Configuration in Documentation for Crossplane Composition

Open wnqueiroz opened this issue 1 year ago • 0 comments

Description:

I found an issue in the documentation related to Crossplane compositions. The provided example lacks a necessary configuration, which can cause misconfigurations or deployment failures.

I was following the example that defines a composition with an S3 bucket and a DynamoDB table using a function-based patch-and-transform approach. However, the required configuration for provider reference is not included in the documentation.

Steps to Reproduce:

  1. Follow the documentation example to create a Composition similar to:

    apiVersion: apiextensions.crossplane.io/v1
    kind: Composition
    metadata:
      name: dynamo-with-bucket
    spec:
      mode: Pipeline
      pipeline:
        - step: patch-and-transform
          functionRef:
            name: function-patch-and-transform
          input:
            apiVersion: pt.fn.crossplane.io/v1beta1
            kind: Resources
            resources:
              - name: s3Bucket
                base:
                  apiVersion: s3.aws.upbound.io/v1beta1
                  kind: Bucket
                  metadata:
                    name: crossplane-quickstart-bucket
                  spec:
                    forProvider:
                      region: us-east-2
                    providerConfigRef:
                      name: default
                patches:
                  - type: FromCompositeFieldPath
                    fromFieldPath: "spec.location"
                    toFieldPath: "spec.forProvider.region"
                    transforms:
                      - type: map
                        map:
                          EU: "eu-north-1"
                          US: "us-east-2"
              - name: dynamoDB
                base:
                  apiVersion: dynamodb.aws.upbound.io/v1beta1
                  kind: Table
                  metadata:
                    name: crossplane-quickstart-database
                  spec:
                    forProvider:
                      region: "us-east-2"
                      writeCapacity: 1
                      readCapacity: 1
                      attribute:
                        - name: S3ID
                          type: S
                      hashKey: S3ID
                patches:
                  - type: FromCompositeFieldPath
                    fromFieldPath: "spec.location"
                    toFieldPath: "spec.forProvider.region"
                    transforms:
                      - type: map
                        map:
                          EU: "eu-north-1"
                          US: "us-east-2"
      compositeTypeRef:
        apiVersion: database.example.com/v1alpha1
        kind: NoSQL
    
  2. Deploy the composition and observe the error/missing behavior.

Expected Behavior:

The documentation should include the provider config reference in the DynamoDB spec to ensure the composition works correctly.

Actual Behavior:

The provided example is missing the provider config reference in the DynamoDB spec.

Suggested Fix:

Update the documentation to include the necessary configuration, ensuring that users following the guide do not run into the same issue:

providerConfigRef:
  name: default

Additional Context:

Image

URL: https://docs.crossplane.io/latest/getting-started/provider-aws-part-2/

wnqueiroz avatar Feb 27 '25 21:02 wnqueiroz