jamlen
02/11/2022, 9:30 AMapp.defaultRemovalPolicy
so I can remove the tables on ephemeral environments, but if it is in prod how does it pass a reference to the existing table?Frank
Frank
const table = app.stage === "prod"
? new Table(this, "Table", {
dynamodbTable: dynamodb.Table.fromTableArn(this, "ITable", tableArn),
})
: new Table(this, "Table", {
fields: {
userId: TableFieldType.STRING,
},
primaryIndex: { partitionKey: "userId" },
});
jamlen
02/11/2022, 10:56 AMyarn sst remove
and when I start it back up I don't want to have to go find the arn and poke it in... would this be something that a 'policy' could be defined? Something like:
const table = new Table(this, "Table", {
fields: { userId: TableFieldType.STRING},
primaryIndex: { partitionKey: "userId" },
creationPolicy: "ReuseIfExisting"
})
and if that is set it would go and find the ARN based upon the active aws account, project name and table name?thdxr
02/11/2022, 3:17 PMthdxr
02/11/2022, 3:17 PMremove
and let it get recreatedPablo Fernandez
02/11/2022, 6:42 PMPablo Fernandez
02/11/2022, 6:43 PMPablo Fernandez
02/11/2022, 6:43 PMDrew
02/11/2022, 9:51 PM