A list of CDK for Terraform sample implementions using Auth0 Terraform Provider.
- Instsall CDK for Terraform doc
- Clone the repository
- Run
npm install
to install dependencies - Run
cdktf get
to generate typescript definitions fromauth0 provider
- Copy
.env.sample
to.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.ts
file undersrc/stacks
folder - 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-m2m
Deploys 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 actions
Deploys a stack containing the following resources
- Actions
src/scripts/actions/console-log.js
asConsole Log Action 1
src/scripts/actions/console-log.js
asConsole Log Action 2
cdktf deploy rules
Deploys a stack containing the following resources
- Rules
src/scripts/rules/console-log.js
asConsole Log Rule 1
src/scripts/rules/console-log.js
asConsole Log Rule 2
cdktf deploy auto-import-bcrypt-pw
Deploys a stack containing the following resources
- A SAP client
- An API
- A connection
- Custom database scripts
src/scripts/database/auto-import-bcrypt.login.js
src/scripts/database/auto-import-bcrypt.getUser.js
cdktf deploy basic-saml-idp basic-saml-sp
basic-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_DOMAIN
SAML_SP_CLIENT_ID
SAML_SP_CLIENT_SECRET
cdktf deploy basic-mobile-android
Required .env
parameters:
MOBILE_ANDROID_CALLBACK
cdktf deploy basic-mobile-ios
Required .env
parameters:
MOBILE_IOS_CALLBACK
MOBILE_IOS_LOGOUT
cdktf deploy guardian-android-app
Important: Currently Auth0 Terraform Provider does not support updating Guardian resources
Required .env
parameters:
GUARDIAN_AWS_ACCESS_KEY_ID
GUARDIAN_AWS_ACCESS_SECRET_KEY
GUARDIAN_AWS_REGION
cdktf deploy custom-domain
Deploys a stack containing the following resources
- Custom Domain with Auth0 Managed Certificate
- CName Record (at Cloudflare)
Required .env
parameters:
CLOUDFLARE_API_TOKEN
API Token at CloudflareCLOUDFLARE_ZONE_ID
Zone ID at Cloudflare
cdktf deploy log-stream-aws
Deploys 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_KEY
LOG_STREAM_AWS_SECRET_KEY
LOG_STREAM_AWS_REGION
LOG_STREAM_AWS_ACCOUNT_ID