Created
July 31, 2022 05:42
-
-
Save leegilmorecode/946eb385c503adddda4b3fe672355754 to your computer and use it in GitHub Desktop.
Custom Resource Example with the AWS CDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this custom resource will create our postgres table on deploy if it doesn't exist | |
const provider: cr.Provider = new cr.Provider( | |
this, | |
"CreateOnlineOrdersTableCustomResource", | |
{ | |
onEventHandler: createTableHandler, // this lambda will be called on cfn deploy | |
logRetention: logs.RetentionDays.ONE_DAY, | |
providerFunctionName: "create-online-table-custom-resource", | |
} | |
); | |
new CustomResource(this, "CustomResource", { | |
serviceToken: provider.serviceToken, | |
properties: { | |
...environment, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment