def __init__(self): app = App() _env = Environment(region="ap-northeast-2", account=account) cluster = EksTestStack(app, 'EksClusterStack', env=_env) IamOICProvider(app, 'EksOICIdentityProvider', eks_cluster=cluster.eks_cluster, env=_env) app.synth()
def synth(): app = App( context={ "namespace": "static-site", "domain_name": "example.com", "domain_certificate_arn": "arn:aws:acm:us-east-1:123456789012:certificate/abc", "sub_domain_name": "blog", "origin_custom_header_parameter_name": "/prod/static-site/referer", "hosted_zone_id": "ZABCEF12345", "hosted_zone_name": "example.com.", } ) props = { "namespace": app.node.try_get_context("namespace"), "domain_name": app.node.try_get_context("domain_name"), "sub_domain_name": app.node.try_get_context("sub_domain_name"), "domain_certificate_arn": app.node.try_get_context( "domain_certificate_arn" ), "enable_s3_website_endpoint": app.node.try_get_context( "enable_s3_website_endpoint" ), "origin_custom_header_parameter_name": app.node.try_get_context( "origin_custom_header_parameter_name" ), "hosted_zone_id": app.node.try_get_context("hosted_zone_id"), "hosted_zone_name": app.node.try_get_context("hosted_zone_name"), } StaticSiteStack( scope=app, construct_id=props["namespace"], props=props, env={"account": "123456789012", "region": "us-east-1"}, ) return app.synth()
#!/usr/bin/env python3 from aws_cdk import App from native_objects.application_stack import ApplicationStack from native_objects.infrastructure_stack import InfrastructureStack app = App() env = {'region': 'us-west-2'} # Base infrastructure stack, Lambda Functions, DynamoDB Tables, etc.... infra = InfrastructureStack(app, "infrastructure", env=env) # Application stack that generally changes independently of the underlying infrastructure stack application = ApplicationStack(app, "application", referenced_function=infra.main_function, env=env) app.synth()