Coverage for .github / oidc_provider / app.py: 100.00%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-09-14 22:07 +0000

1#!/usr/bin/env python3 

2""" 

3CDK app entry point for the GitHub OIDC provider stack. 

4 

5This is a standalone CDK app — it does not import or depend on the main 

6GCO stacks. Deploy it independently: 

7 

8 cd .github/oidc_provider 

9 cdk deploy GCOGitHubOIDCStack 

10 

11Configuration is read from ``cdk.json`` context values: 

12 

13 github_repo — GitHub repository in owner/repo format 

14 (default: aws-solutions-library-samples/global-capacity-orchestrator-on-aws) 

15 github_subject_prefix — Optional exact OIDC repository subject prefix; 

16 immutable repositories include owner/repository IDs 

17 github_branch — Branch restriction; "main" = main only (default), 

18 "*" = explicit opt-in to any branch/tag 

19""" 

20 

21import aws_cdk as cdk 

22from stack import GCOGitHubOIDCStack 

23 

24app = cdk.App() 

25 

26# Read configuration from cdk.json context — users edit cdk.json, not this file. 

27github_repo = ( 

28 app.node.try_get_context("github_repo") 

29 or "aws-solutions-library-samples/global-capacity-orchestrator-on-aws" 

30) 

31github_subject_prefix = app.node.try_get_context("github_subject_prefix") 

32github_branch = app.node.try_get_context("github_branch") or "main" 

33 

34GCOGitHubOIDCStack( 

35 app, 

36 "GCOGitHubOIDCStack", 

37 github_repo=github_repo, 

38 github_subject_prefix=github_subject_prefix, 

39 github_branch=github_branch, 

40 description="GitHub Actions OIDC provider and CI role for GCO", 

41) 

42 

43app.synth()