Marketplace
BrowsePublish
Marketplace
devops-toolkit/dot-sql@v0.8.105
aws-postgresql

aws-postgresql

aws-postgresql
devops-toolkit/dot-sql@v0.8.105aws-postgresql
Type

Composition

Referenced XRD

SQL

Source Codegithub.com/vfarcic/devops-toolkit-crossplane/tree/master/packages/sql
Resources (11)

The following resources are composed to implement the referenced Composite Resource Definition (XRD).

Kind
Group
Version

VPC

ec2.aws.crossplane.io
v1beta1

Subnet

ec2.aws.crossplane.io
v1beta1

Subnet

ec2.aws.crossplane.io
v1beta1

Subnet

ec2.aws.crossplane.io
v1beta1

DBSubnetGroup

database.aws.crossplane.io
v1beta1

InternetGateway

ec2.aws.crossplane.io
v1beta1

RouteTable

ec2.aws.crossplane.io
v1beta1

SecurityGroup

ec2.aws.crossplane.io
v1beta1

RDSInstance

database.aws.crossplane.io
v1beta1

ProviderConfig

postgresql.sql.crossplane.io
v1alpha1

Database

postgresql.sql.crossplane.io
v1alpha1
YAML
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
  name: aws-postgresql
  creationTimestamp: null
  labels:
    db: postgresql
    provider: aws
spec:
  compositeTypeRef:
    apiVersion: devopstoolkitseries.com/v1alpha1
    kind: SQL
  patchSets:
    - name: metadata
      patches:
        - fromFieldPath: metadata.labels
  resources:
    - name: vpc
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: VPC
        spec:
          forProvider:
            cidrBlock: 10.0.0.0/16
            enableDnsHostNames: true
            enableDnsSupport: true
            region: us-east-1
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
    - name: subnet-a
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: Subnet
        metadata:
          labels:
            zone: us-east-1a
        spec:
          forProvider:
            availabilityZone: us-east-1a
            cidrBlock: 10.0.0.0/24
            region: us-east-1
            vpcIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-a"
    - name: subnet-b
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: Subnet
        metadata:
          labels:
            zone: us-east-1b
        spec:
          forProvider:
            availabilityZone: us-east-1b
            cidrBlock: 10.0.1.0/24
            region: us-east-1
            vpcIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-b"
    - name: subnet-c
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: Subnet
        metadata:
          labels:
            zone: us-east-1c
        spec:
          forProvider:
            availabilityZone: us-east-1c
            cidrBlock: 10.0.2.0/24
            region: us-east-1
            vpcIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-c"
    - name: dbsubnetgroup
      base:
        apiVersion: database.aws.crossplane.io/v1beta1
        kind: DBSubnetGroup
        spec:
          forProvider:
            description: I'm too lazy to write a good description
            region: us-east-1
            subnetIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
    - name: gateway
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: InternetGateway
        spec:
          forProvider:
            region: us-east-1
            vpcIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
    - name: routetable
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: RouteTable
        spec:
          forProvider:
            associations:
              - subnetIdSelector:
                  matchControllerRef: true
                  matchLabels:
                    zone: us-east-1a
              - subnetIdSelector:
                  matchControllerRef: true
                  matchLabels:
                    zone: us-east-1b
              - subnetIdSelector:
                  matchControllerRef: true
                  matchLabels:
                    zone: us-east-1c
            region: us-east-1
            routes:
              - destinationCidrBlock: 0.0.0.0/0
                gatewayIdSelector:
                  matchControllerRef: true
            vpcIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
    - name: sg-nodepool
      base:
        apiVersion: ec2.aws.crossplane.io/v1beta1
        kind: SecurityGroup
        spec:
          forProvider:
            description: I am too lazy to write descriptions
            ingress:
              - fromPort: 5432
                ipProtocol: tcp
                ipRanges:
                  - cidrIp: 0.0.0.0/0
                toPort: 5432
            region: us-east-1
            vpcIdSelector:
              matchControllerRef: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.id
          toFieldPath: spec.forProvider.groupName
    - name: rdsinstance
      base:
        apiVersion: database.aws.crossplane.io/v1beta1
        kind: RDSInstance
        spec:
          forProvider:
            allocatedStorage: 200
            dbInstanceClass: db.m5.large
            dbSubnetGroupNameSelector:
              matchControllerRef: true
            engine: postgres
            engineVersion: "14.1"
            masterUsername: masteruser
            publiclyAccessible: true
            region: us-east-1
            skipFinalSnapshotBeforeDeletion: true
            vpcSecurityGroupIDSelector:
              matchControllerRef: true
          writeConnectionSecretToRef:
            namespace: crossplane-system
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.id
          toFieldPath: spec.writeConnectionSecretToRef.name
        - fromFieldPath: spec.claimRef.namespace
          toFieldPath: spec.writeConnectionSecretToRef.namespace
        - fromFieldPath: spec.parameters.size
          toFieldPath: spec.forProvider.dbInstanceClass
          transforms:
            - type: map
              map:
                large: db.m5.8xlarge
                medium: db.m5.2xlarge
                small: db.m5.large
        - fromFieldPath: spec.parameters.version
          toFieldPath: spec.forProvider.engineVersion
      connectionDetails:
        - fromConnectionSecretKey: username
        - fromConnectionSecretKey: password
        - fromConnectionSecretKey: endpoint
        - fromConnectionSecretKey: port
    - name: sql-config
      base:
        apiVersion: postgresql.sql.crossplane.io/v1alpha1
        kind: ProviderConfig
        metadata:
          name: default
        spec:
          credentials:
            connectionSecretRef:
              namespace: crossplane-system
            source: PostgreSQLConnectionSecret
          sslMode: require
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.id
          toFieldPath: spec.credentials.connectionSecretRef.name
        - fromFieldPath: spec.claimRef.namespace
          toFieldPath: spec.credentials.connectionSecretRef.namespace
      readinessChecks:
        - type: None
    - name: sql-db
      base:
        apiVersion: postgresql.sql.crossplane.io/v1alpha1
        kind: Database
        spec:
          forProvider: {}
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.id
          toFieldPath: spec.providerConfigRef.name
      readinessChecks:
        - type: None
  writeConnectionSecretsToNamespace: crossplane-system
Marketplace

Discover the building blocks for your internal cloud platform.

© 2022 Upbound, Inc.

SolutionsProvidersConfigurations
LearnDocumentationTry for Free
MorePrivacy PolicyTerms & Conditions
Marketplace

© 2022 Upbound, Inc.

Marketplace

Discover the building blocksfor your internal cloud platform.