33
33
34
34
35
35
class AllowEverywhere (AWS .Statement ):
36
+ """Shortcut for creating IAM Statements that Allow to Resource "*"."""
36
37
def __init__ (self , * args , ** kwargs ):
37
38
my_kwargs = dict (Effect = AWS .Allow , Resource = ["*" ])
38
39
my_kwargs .update (kwargs )
39
40
super (AllowEverywhere , self ).__init__ (* args , ** my_kwargs )
40
41
41
42
42
43
def _service_assume_role (service : str ) -> AWS .Policy :
43
- """"""
44
+ """Build and return the IAM AssumeRolePolicy for use in service roles. """
44
45
return AWS .Policy (
45
46
Statement = [
46
47
AWS .Statement (
@@ -53,7 +54,7 @@ def _service_assume_role(service: str) -> AWS.Policy:
53
54
54
55
55
56
def _codebuild_role () -> iam .Role :
56
- """"""
57
+ """Build and return the IAM Role resource to be used by CodeBuild to run the build project. """
57
58
policy = iam .Policy (
58
59
"CodeBuildPolicy" ,
59
60
PolicyName = "CodeBuildPolicy" ,
@@ -68,7 +69,7 @@ def _codebuild_role() -> iam.Role:
68
69
69
70
70
71
def _codebuild_builder (role : iam .Role , application_bucket : s3 .Bucket ) -> codebuild .Project :
71
- """"""
72
+ """Build and return the CodeBuild Project resource to be used to build the decrypt oracle. """
72
73
artifacts = codebuild .Artifacts (Type = "CODEPIPELINE" )
73
74
environment = codebuild .Environment (
74
75
ComputeType = "BUILD_GENERAL1_SMALL" ,
@@ -88,7 +89,7 @@ def _codebuild_builder(role: iam.Role, application_bucket: s3.Bucket) -> codebui
88
89
89
90
90
91
def _pipeline_role (buckets : Iterable [s3 .Bucket ]) -> iam .Role :
91
- """"""
92
+ """Build and return the IAM Role resource to be used by CodePipeline to run the pipeline. """
92
93
bucket_statements = [
93
94
AWS .Statement (
94
95
Effect = AWS .Allow ,
@@ -133,7 +134,7 @@ def _pipeline_role(buckets: Iterable[s3.Bucket]) -> iam.Role:
133
134
134
135
135
136
def _cloudformation_role () -> iam .Role :
136
- """"""
137
+ """Build and return the IAM Role resource to be used by the pipeline to interact with CloudFormation. """
137
138
policy = iam .Policy (
138
139
"CloudFormationPolicy" ,
139
140
PolicyName = "CloudFormationPolicy" ,
@@ -153,7 +154,7 @@ def _pipeline(
153
154
github_branch : str ,
154
155
github_access_token : troposphere .AWSProperty ,
155
156
) -> codepipeline .Pipeline :
156
- """"""
157
+ """Build and return the CodePipeline pipeline resource. """
157
158
_source_output = "SourceOutput"
158
159
get_source = codepipeline .Stages (
159
160
Name = "Source" ,
@@ -230,7 +231,7 @@ def _pipeline(
230
231
231
232
232
233
def _build_template (github_owner : str , github_branch : str ) -> Template :
233
- """"""
234
+ """Build and return the pipeline template. """
234
235
template = Template (Description = "CI/CD pipeline for Decrypt Oracle powered by the AWS Encryption SDK for Python" )
235
236
github_access_token = template .add_parameter (
236
237
troposphere .Parameter (
0 commit comments