Coder Social home page Coder Social logo

Comments (3)

hasheddan avatar hasheddan commented on July 19, 2024

Ref TODO: https://github.com/crossplane/stack-aws/blob/12b4b63972249afa4e098311e48ff3c9440360bd/pkg/controller/database/rdsinstance.go#L228

from provider-aws.

muvaf avatar muvaf commented on July 19, 2024

I think my TODO was more related to having deletionProtection: true because in that case even if the user changes it to false, it won't matter since Update is never called when the deletion timestamp exists. See crossplane/crossplane-runtime#59

from provider-aws.

hasheddan avatar hasheddan commented on July 19, 2024

This was solved by updating the config as follows:

apiVersion: database.aws.crossplane.io/v1beta1
kind: RDSInstance
metadata:
  name: rdsmysql
  labels:
    example: "true"
spec:
  forProvider:
    dbInstanceClass: db.t2.small
    masterUsername: masteruser
    allocatedStorage: 20
    engine: mysql
    applyModificationsImmediately: true # this was added
    skipFinalSnapshotBeforeDeletion: true # this was added
  writeConnectionSecretsToNamespace: crossplane-system
  providerRef:
    name: aws-provider
  reclaimPolicy: Delete

This works because:

  1. applyModificationsImmediately: true makes it such that RDS will not wait for the next maintenance window to apply changes. This was the source of the error described above.
  2. When applying changes immediately, we must specify skipFinalSnapshotBeforeDeletion. If we do not, you will observe the following error from AWS:
- lastTransitionTime: "2020-02-25T17:44:02Z"     
    message: "delete failed: cannot delete RDS instance: InvalidParameterCombination:
      FinalDBSnapshotIdentifier is required unless SkipFinalSnapshot is specified.\n\tstatus
      code: 400, request id: 589d07eb-73e3-443b-9229-6700d363b5cc"
    reason: Encountered an error during resource reconciliation         
    status: "False"                   
    type: Synced   

from provider-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.