https://pulumi.com logo
Title
d

dazzling-sundown-39670

07/03/2020, 10:34 PM
Any suggestions on how to create a mysql-provider for a rds-cluster inside a VPC? My current code looks like this but I guess I have to take my ip and add it to some rule maybe?
const m2cluster = new aws.rds.Cluster(
  'magento2-cluster',
  {
    backupRetentionPeriod: 5,
    masterUsername: mysqlUser,
    masterPassword: mysqlPassword,
    preferredBackupWindow: '07:00-09:00',
    deletionProtection: !isDev,
    vpcSecurityGroupIds: [sg.id],
    dbSubnetGroupName: subnetGroup.name,
    tags: pulumiTags,
    clusterIdentifierPrefix: 'magento2-cluster',
    databaseName: 'MAGENTO',
    skipFinalSnapshot: isDev,
    // finalSnapshotIdentifier: 'magento2-cluster-snapshot',
    storageEncrypted: true,
  },
  {
    dependsOn: subnetGroup,
  },
);

const mysqlProvider = new mysql.Provider(
  'mysql',
  {
    endpoint: m2cluster.endpoint,
    username: m2cluster.masterUsername,
    password: m2cluster.masterPassword.apply((p) => p!.toString()),
  },
  {
    dependsOn: m2cluster,
  },
);
m

millions-furniture-75402

07/06/2020, 2:12 PM
Ran into similar, and tried to solve it by creating a lambda that runs the provisioner… but then ran into a secret “feature” that strips out pulumi packages… So… I still think the correct route is to create an “operations microservice” in lambda that can run the pulumi provisioners, however, it will have to be deployed without pulumi, until pulumi removes that “feature”.
d

dazzling-sundown-39670

07/07/2020, 8:22 AM
@millions-furniture-75402 I see, thanks!