File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import aws_cdk as cdk
22from aws_cdk import (
3- Duration ,
43 Stack ,
54 aws_ecs as ecs ,
65 aws_ecs_patterns as ecs_patterns ,
109 aws_elasticloadbalancingv2 as elbv2 ,
1110 aws_certificatemanager as acm ,
1211 aws_iam as iam ,
13- aws_kms as kms ,
1412)
1513from constructs import Construct
1614
1715
1816class CodeArtifactProxy (Stack ):
17+ """A CDK stack that creates the resources required for a Code Artifact Proxy (deployed as a load balanced fargate service)"""
18+
1919 __ecs_service : ecs_patterns .ApplicationLoadBalancedFargateService = None
2020 vpc : ec2 .Vpc = None
21- __role_attached : bool = False
2221
2322 domain_name : str = None
2423 repository_name : str = None
@@ -78,7 +77,6 @@ def attach_iam_role(self):
7877 },
7978 )
8079 )
81- self .__role_attached = True
8280
8381 def create_code_artifact (self ):
8482 """Creates a CodeArtifact repository"""
@@ -125,7 +123,9 @@ def create_loadbalanced_fargate(
125123 raise Exception (
126124 "Both certificate_arn and certificate_ssm_parameter cannot be set"
127125 )
128- elif certificate_arn :
126+
127+ # Resolve the CDK certificate object via the certificate ARN or SSM parameter value
128+ if certificate_arn :
129129 certificate = acm .Certificate .from_certificate_arn (
130130 self , id = "acm_certificate" , certificate_arn = certificate_arn
131131 )
You can’t perform that action at this time.
0 commit comments