-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.py
31 lines (26 loc) · 1.05 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
import os
import aws_cdk as cdk
import aws_cdk.aws_rds as rds
import aws_cdk.aws_ecs as ecs
from cdk_keycloak import KeyCloak, KeycloakVersion
from aws_cdk import CfnOutput
app = cdk.App()
env = cdk.Environment(region="{replacewithyourawsregion}", account="{replacewithyourawsaccount}")
stack = cdk.Stack(app, "keycloak-demo", env=env)
mysso = KeyCloak(stack, "KeyCloak",
certificate_arn="{replacewithyourcertificatearn}",
keycloak_version=KeycloakVersion.V21_0_1,
cluster_engine = rds.DatabaseClusterEngine.aurora_mysql(version=rds.AuroraMysqlEngineVersion.VER_2_11_2),
hostname = "{replacewithyourcustomdns}",
env = { "KEYCLOAK_FRONTEND_URL" : "{replacewithyourcustomdns}"},
container_image = ecs.ContainerImage.from_registry("{replacewithyourecrcontainerimage}"),
database_removal_policy=cdk.RemovalPolicy.DESTROY
)
CfnOutput(
stack,
id="KeyCloakSecret",
value=mysso.keycloak_secret.secret_full_arn,
description="Keycloak admin username and password"
)
app.synth()