@finnairoyj/cdk-constructs-lib
    Preparing search index...

    Class DatabaseProxy

    Database proxy. Written as replacement for CDK's DatabaseProxy construct that is poorly written and generates multiple issues with cyclic dependencies. The CDK construct internally modifies resources passed as external referencies, sucha as SecurityGroups, IAM roles and KMS KeyPolicies, causing the cyclic dependencies.

    This construct is a drop-in replacement for the CDK DatabaseProxy construct, but won't create SecurityGroup or IAM role automatically, those need to be provided. IAM role must have required KMS permissions to decrypt the SecretsManager Secrets

    Currently supports only POSTGRES engine. MySQL-specific features are not implemented.

    Hierarchy

    • LibraryConstruct
      • DatabaseProxy

    Implements

    • IDatabaseProxy
    • IConnectable
    • ISecretAttachmentTarget
    Index

    Constructors

    Properties

    connections: Connections

    The network connections associated with this resource.

    dbProxyArn: string

    DB Proxy ARN

    dbProxyName: string

    DB Proxy Name

    endpoint: string

    Endpoint

    node: Node

    The tree node.

    Accessors

    • get env(): ResourceEnvironment

      The environment this resource belongs to.

      For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

      For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

      Returns ResourceEnvironment

    Methods

    • Apply the given removal policy to this resource

      The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

      The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

      Parameters

      • policy: RemovalPolicy

      Returns void

    • Renders the target specifications.

      Returns SecretAttachmentTargetProps

    • Grant the given identity connection access to the proxy.

      Parameters

      • _grantee: IGrantable
      • Optional_dbUser: string

      Returns Grant

      - if the Proxy had been provided a single Secret value,
      the user will be taken from that Secret
    • Returns a string representation of this construct.

      Returns string

    • Checks if x is a construct.

      Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

      Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

      Parameters

      • x: any

        Any object

      Returns x is Construct

      true if x is an object created from a class which extends Construct.