A list of CDK for Terraform sample implementions using Auth0 Terraform Provider.
- Instsall CDK for Terraform doc
- Clone the repository
- Run
npm installto install dependencies - Run
cdktf getto generate typescript definitions fromauth0 provider - Copy
.env.sampleto.env, and populate the values for your tenant configurationsDOMAIN- Your domainCLIENT_ID- Your deployment (machine to machine) client IDCLIENT_SECRET- Your deployment (machine to machine) client secret
- Deploy stacks
cdktf deploy stack-name1 stack-name2 ... - Destroy stacks
cdktf destroy stack-name1 stack-name2 ...
- Create a
your-stack.tsfile undersrc/stacksfolder - Define your stack
- Run
cdktf deploy(Any stack definitions undersrc/stacks/*are dynamically loaded)
The following are the sample stacks available from this repository.
cdktf deploy basic-m2mDeploys a stack containing the following resources
- A Machine-to-Machine client
- An API
- Client Grants
cdktf deploy basic-native- A Native client
- An API
- Client Grants
- A connection
- A user
cdktf deploy basic-rwa- A Regular Web App client
- An API
- Client Grants
- A connection
- A user
cdktf deploy basic-spa- A Single Page Application client
- An API
- Client Grants
- A connection
- A user
cdktf deploy actionsDeploys a stack containing the following resources
- Actions
src/scripts/actions/console-log.jsasConsole Log Action 1src/scripts/actions/console-log.jsasConsole Log Action 2
cdktf deploy rulesDeploys a stack containing the following resources
- Rules
src/scripts/rules/console-log.jsasConsole Log Rule 1src/scripts/rules/console-log.jsasConsole Log Rule 2
cdktf deploy auto-import-bcrypt-pwDeploys a stack containing the following resources
- A SAP client
- An API
- A connection
- Custom database scripts
src/scripts/database/auto-import-bcrypt.login.jssrc/scripts/database/auto-import-bcrypt.getUser.js
cdktf deploy basic-saml-idp basic-saml-spbasic-saml-idp deploys a stack containing the following resources
- A Regular Web App client with SAML support
- A datbase connection
- A user
basic-saml-sp deploys a stack containing the following resources
- A Regular Web App client
- A SAML connection
The SP must be dployed in a different tenant than the IDP's.
Required .env parameters:
SAML_SP_DOMAINSAML_SP_CLIENT_IDSAML_SP_CLIENT_SECRET
cdktf deploy basic-mobile-androidRequired .env parameters:
MOBILE_ANDROID_CALLBACK
cdktf deploy basic-mobile-iosRequired .env parameters:
MOBILE_IOS_CALLBACKMOBILE_IOS_LOGOUT
cdktf deploy guardian-android-appImportant: Currently Auth0 Terraform Provider does not support updating Guardian resources
Required .env parameters:
GUARDIAN_AWS_ACCESS_KEY_IDGUARDIAN_AWS_ACCESS_SECRET_KEYGUARDIAN_AWS_REGION
cdktf deploy custom-domainDeploys a stack containing the following resources
- Custom Domain with Auth0 Managed Certificate
- CName Record (at Cloudflare)
Required .env parameters:
CLOUDFLARE_API_TOKENAPI Token at CloudflareCLOUDFLARE_ZONE_IDZone ID at Cloudflare
cdktf deploy log-stream-awsDeploys a stack containing the following resources
- Auth0 Log Streaming (Event Bridge)
- AWS EventBridge Bus
- AWS EventBridge Rule
- AWS EventBridge Target
- AWS CloudWatch Log Group
Required .env parameters:
LOG_STREAM_AWS_ACCESS_KEYLOG_STREAM_AWS_SECRET_KEYLOG_STREAM_AWS_REGIONLOG_STREAM_AWS_ACCOUNT_ID