Skip to content

Latest commit

 

History

History
639 lines (482 loc) · 20.1 KB

README.md

File metadata and controls

639 lines (482 loc) · 20.1 KB

Massdriver

gcp-cloud-sql-mysql

Release Contributors Forks Stargazers Issues MIT License

GCP Cloud SQL MySQL Database


Design

For detailed information, check out our Operator Guide for this bundle.

Usage

Our bundles aren't intended to be used locally, outside of testing. Instead, our bundles are designed to be configured, connected, deployed and monitored in the Massdriver platform.

What are Bundles?

Bundles are the basic building blocks of infrastructure, applications, and architectures in Massdriver. Read more here.

Bundle

Params

Form input parameters for configuring a bundle for deployment.

View

Properties

  • database_configuration (object): High availability, backups, other database settings can be configured here.
    • high_availability_enabled (boolean): If set to true, GCP will manage a hot standby primary node for you. It will automatically fail over to the hot stanby in the event of a zonal or node failure drastically minimizing downtime. Default: True.
    • query_insights_enabled (boolean): Enables query insights for your instance. Default: False.
    • retained_backup_count (integer): The number of backups to keep. If another backup is made, the oldest one is deleted. Minimum: 0. Maximum: 20. Default: 0.
  • deletion_protection (boolean): If the DB instance should have deletion protection enabled. Default: True.
  • engine_version (string): The major version of MySQL to use for your database. GCP manages minor version upgrades. Default: MYSQL_8_0.
    • One of
      • 8.x
      • 5.7
  • instance_configuration (object): Instance type, disk size, configure properties for your primary instance.
    • disk_size (integer): The size of the primary database instance in GB. Minimum: 20. Maximum: 3054.
    • disk_type (string): Solid State has better performance for mixtures of reads and writes. Use Hard Disks for continuous read workloads or for cheaper storage. Default: PD_SSD.
      • One of
        • Solid State
        • Hard Disk
    • tier (string): The type of compute used for the master instance.
      • One of
        • Shared-core: 1 vCPU 600MB Memory
        • Shared-core: 1 vCPU 1.7GB Memory
        • General: 1 vCPU 3.8GB Memory
        • General: 2 vCPUs 3.8GB Memory
        • General: 4 vCPUs 15GB Memory
        • General: 8 vCPUs 40GB Memory
        • General: 16 vCPUs 61GB Memory
        • General: 32 vCPUs 122GB Memory
        • General: 64 vCPUs 245GB Memory
        • General: 96 vCPUs 368GB Memory
        • High Memory: 2 vCPUs 13GB Memory
        • High Memory: 4 vCPUs 26GB Memory
        • High Memory: 8 vCPUs 53GB Memory
        • High Memory: 16 vCPUs 106GB Memory
        • High Memory: 32 vCPUs 212GB Memory
        • High Memory: 64 vCPUs 425GB Memory
        • High Memory: 96 vCPUs 638GB Memory
  • transaction_log_retention_days (integer): The number of days to keep the transaction logs before deleting them. Minimum: 1. Maximum: 7. Default: 5.
  • username (string): Primary DB username. Default: root.

Examples

{
    "__name": "Development",
    "database_configuration": {
        "high_availability": false
    },
    "deletion_protection": false,
    "instance_configuration": {
        "disk_size": 20,
        "disk_type": "PD_HDD",
        "tier": "db-g1-small"
    }
}

Connections

Connections from other bundles that this bundle depends on.

View

Properties

  • gcp_authentication (object): GCP Service Account. Cannot contain additional properties.

    • data (object)
      • auth_provider_x509_cert_url (string): Auth Provider x509 Certificate URL. Default: https://www.googleapis.com/oauth2/v1/certs.

        Examples:

        "https://example.com/some/path"
        "https://massdriver.cloud"
      • auth_uri (string): Auth URI. Default: https://accounts.google.com/o/oauth2/auth.

        Examples:

        "https://example.com/some/path"
        "https://massdriver.cloud"
      • client_email (string): Service Account Email.

        Examples:

      • client_id (string): .

      • client_x509_cert_url (string): Client x509 Certificate URL.

        Examples:

        "https://example.com/some/path"
        "https://massdriver.cloud"
      • private_key (string): .

      • private_key_id (string): .

      • project_id (string): .

      • token_uri (string): Token URI. Default: https://oauth2.googleapis.com/token.

        Examples:

        "https://example.com/some/path"
        "https://massdriver.cloud"
      • type (string): . Default: service_account.

    • specs (object)
      • gcp (object): .
        • project (string)

        • region (string): The GCP region to provision resources in.

          Examples:

          "us-east1"
          "us-east4"
          "us-west1"
          "us-west2"
          "us-west3"
          "us-west4"
          "us-central1"
  • gcp_subnetwork (object): A region-bound network for deploying GCP resources. Cannot contain additional properties.

    • data (object)

      • infrastructure (object)
        • cidr (string)

          Examples:

          "10.100.0.0/16"
          "192.24.12.0/22"
        • gcp_global_network_grn (string): GCP Resource Name (GRN).

          Examples:

          "projects/my-project/global/networks/my-global-network"
          "projects/my-project/regions/us-west2/subnetworks/my-subnetwork"
          "projects/my-project/topics/my-pubsub-topic"
          "projects/my-project/subscriptions/my-pubsub-subscription"
          "projects/my-project/locations/us-west2/instances/my-redis-instance"
          "projects/my-project/locations/us-west2/clusters/my-gke-cluster"
        • grn (string): GCP Resource Name (GRN).

          Examples:

          "projects/my-project/global/networks/my-global-network"
          "projects/my-project/regions/us-west2/subnetworks/my-subnetwork"
          "projects/my-project/topics/my-pubsub-topic"
          "projects/my-project/subscriptions/my-pubsub-subscription"
          "projects/my-project/locations/us-west2/instances/my-redis-instance"
          "projects/my-project/locations/us-west2/clusters/my-gke-cluster"
        • vpc_access_connector (string): GCP Resource Name (GRN).

          Examples:

          "projects/my-project/global/networks/my-global-network"
          "projects/my-project/regions/us-west2/subnetworks/my-subnetwork"
          "projects/my-project/topics/my-pubsub-topic"
          "projects/my-project/subscriptions/my-pubsub-subscription"
          "projects/my-project/locations/us-west2/instances/my-redis-instance"
          "projects/my-project/locations/us-west2/clusters/my-gke-cluster"
    • specs (object)

      • gcp (object): .
        • project (string)

        • region (string): The GCP region to provision resources in.

          Examples:

          "us-east1"
          "us-east4"
          "us-west1"
          "us-west2"
          "us-west3"
          "us-west4"
          "us-central1"

Artifacts

Resources created by this bundle that can be connected to other bundles.

View

Properties

  • authentication (object): Authentication parameters for a MySQL database. Cannot contain additional properties.
    • data (object): Cannot contain additional properties.

      • authentication (object)

        • hostname (string)
        • password (string)
        • port (integer): Port number. Minimum: 0. Maximum: 65535.
        • username (string)
      • infrastructure (object): Cloud specific MySQL configuration data.

        • One of
          • AWS Infrastructure ARNobject: Minimal AWS Infrastructure Config. Cannot contain additional properties.

            • arn (string): Amazon Resource Name.

              Examples:

              "arn:aws:rds::ACCOUNT_NUMBER:db/prod"
              "arn:aws:ec2::ACCOUNT_NUMBER:vpc/vpc-foo"
          • Azure Infrastructure Resource IDobject: Minimal Azure Infrastructure Config. Cannot contain additional properties.

            • ari (string): Azure Resource ID.

              Examples:

              "/subscriptions/12345678-1234-1234-abcd-1234567890ab/resourceGroups/resource-group-name/providers/Microsoft.Network/virtualNetworks/network-name"
          • GCP Infrastructure Nameobject: GCP Infrastructure Config For Resources With A Name Not A GRN. Cannot contain additional properties.

            • name (string): Name Of GCP Resource.

              Examples:

              "my-cloud-function"
              "my-sql-instance"
      • security (object): TBD.

        • Any of
          • AWS Security informationobject: Informs downstream services of network and/or IAM policies. Cannot contain additional properties.
            • iam (object): IAM Policies. Cannot contain additional properties.

              • ^[a-z]+[a-z_]*[a-z]+$ (object)
                • policy_arn (string): AWS IAM policy ARN.

                  Examples:

                  "arn:aws:rds::ACCOUNT_NUMBER:db/prod"
                  "arn:aws:ec2::ACCOUNT_NUMBER:vpc/vpc-foo"
            • identity (object): For instances where IAM policies must be attached to a role attached to an AWS resource, for instance AWS Eventbridge to Firehose, this attribute should be used to allow the downstream to attach it's policies (Firehose) directly to the IAM role created by the upstream (Eventbridge). It is important to remember that connections in massdriver are one way, this scheme perserves the dependency relationship while allowing bundles to control the lifecycles of resources under it's management. Cannot contain additional properties.

              • role_arn (string): ARN for this resources IAM Role.

                Examples:

                "arn:aws:rds::ACCOUNT_NUMBER:db/prod"
                "arn:aws:ec2::ACCOUNT_NUMBER:vpc/vpc-foo"
            • network (object): AWS security group rules to inform downstream services of ports to open for communication. Cannot contain additional properties.

              • ^[a-z-]+$ (object)
                • arn (string): Amazon Resource Name.

                  Examples:

                  "arn:aws:rds::ACCOUNT_NUMBER:db/prod"
                  "arn:aws:ec2::ACCOUNT_NUMBER:vpc/vpc-foo"
                • port (integer): Port number. Minimum: 0. Maximum: 65535.

                • protocol (string): Must be one of: ['tcp', 'udp'].

          • Securityobject: Azure Security Configuration. Cannot contain additional properties.
            • iam (object): IAM Roles And Scopes. Cannot contain additional properties.
              • ^[a-z]+[a-z_]*[a-z]$ (object)
                • role: Azure Role.

                  Examples:

                  "Storage Blob Data Reader"
                • scope (string): Azure IAM Scope.

          • Securityobject: GCP Security Configuration. Cannot contain additional properties.
            • iam (object): IAM Roles And Conditions. Cannot contain additional properties.
              • ^[a-z]+[a-z_]*[a-z]$ (object)
                • condition (string): GCP IAM Condition.

                • role: GCP Role.

                  Examples:

                  "roles/owner"
                  "roles/redis.editor"
                  "roles/storage.objectCreator"
                  "roles/storage.legacyObjectReader"
    • specs (object): Cannot contain additional properties.

      • aws (object): .

        • region (string): AWS Region to provision in.

          Examples:

          "us-west-2"
      • azure (object): .

        • region (string): Select the Azure region you'd like to provision your resources in.
      • gcp (object): .

        • project (string)

        • region (string): The GCP region to provision resources in.

          Examples:

          "us-east1"
          "us-east4"
          "us-west1"
          "us-west2"
          "us-west3"
          "us-west4"
          "us-central1"
      • rdbms (object): Common metadata for relational databases.

        • engine (string): The type of database server.

          Examples:

          "postgresql"
          "mysql"
        • engine_version (string): The cloud provider's database version.

          Examples:

          "5.7.mysql_aurora.2.03.2"
        • version (string): The database version. Default: ``.

          Examples:

          "12.2"
          "5.7"

        Examples:

        {
            "engine": "postgresql",
            "engine_version": "10.14",
            "version": "10.14"
        }
        {
            "engine": "mysql",
            "engine_version": "5.7.mysql_aurora.2.03.2",
            "version": "5.7"
        }

Contributing

Bug Reports & Feature Requests

Did we miss something? Please submit an issue to report any bugs or request additional features.

Developing

Note: Massdriver bundles are intended to be tightly use-case scoped, intention-based, reusable pieces of IaC for use in the Massdriver platform. For this reason, major feature additions that broaden the scope of an existing bundle are likely to be rejected by the community.

Still want to get involved? First check out our contribution guidelines.

Fix or Fork

If your use-case isn't covered by this bundle, you can still get involved! Massdriver is designed to be an extensible platform. Fork this bundle, or create your own bundle from scratch!

Connect

Questions? Concerns? Adulations? We'd love to hear from you!

Please connect with us!

Email GitHub LinkedIn Twitter YouTube Reddit