Skip to content

Commit 08e0a58

Browse files
committed
add comments to pipeline builder
1 parent ec15bda commit 08e0a58

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

decrypt_oracle/.chalice/pipeline.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333

3434

3535
class AllowEverywhere(AWS.Statement):
36+
"""Shortcut for creating IAM Statements that Allow to Resource "*"."""
3637
def __init__(self, *args, **kwargs):
3738
my_kwargs = dict(Effect=AWS.Allow, Resource=["*"])
3839
my_kwargs.update(kwargs)
3940
super(AllowEverywhere, self).__init__(*args, **my_kwargs)
4041

4142

4243
def _service_assume_role(service: str) -> AWS.Policy:
43-
""""""
44+
"""Build and return the IAM AssumeRolePolicy for use in service roles."""
4445
return AWS.Policy(
4546
Statement=[
4647
AWS.Statement(
@@ -53,7 +54,7 @@ def _service_assume_role(service: str) -> AWS.Policy:
5354

5455

5556
def _codebuild_role() -> iam.Role:
56-
""""""
57+
"""Build and return the IAM Role resource to be used by CodeBuild to run the build project."""
5758
policy = iam.Policy(
5859
"CodeBuildPolicy",
5960
PolicyName="CodeBuildPolicy",
@@ -68,7 +69,7 @@ def _codebuild_role() -> iam.Role:
6869

6970

7071
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."""
7273
artifacts = codebuild.Artifacts(Type="CODEPIPELINE")
7374
environment = codebuild.Environment(
7475
ComputeType="BUILD_GENERAL1_SMALL",
@@ -88,7 +89,7 @@ def _codebuild_builder(role: iam.Role, application_bucket: s3.Bucket) -> codebui
8889

8990

9091
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."""
9293
bucket_statements = [
9394
AWS.Statement(
9495
Effect=AWS.Allow,
@@ -133,7 +134,7 @@ def _pipeline_role(buckets: Iterable[s3.Bucket]) -> iam.Role:
133134

134135

135136
def _cloudformation_role() -> iam.Role:
136-
""""""
137+
"""Build and return the IAM Role resource to be used by the pipeline to interact with CloudFormation."""
137138
policy = iam.Policy(
138139
"CloudFormationPolicy",
139140
PolicyName="CloudFormationPolicy",
@@ -153,7 +154,7 @@ def _pipeline(
153154
github_branch: str,
154155
github_access_token: troposphere.AWSProperty,
155156
) -> codepipeline.Pipeline:
156-
""""""
157+
"""Build and return the CodePipeline pipeline resource."""
157158
_source_output = "SourceOutput"
158159
get_source = codepipeline.Stages(
159160
Name="Source",
@@ -230,7 +231,7 @@ def _pipeline(
230231

231232

232233
def _build_template(github_owner: str, github_branch: str) -> Template:
233-
""""""
234+
"""Build and return the pipeline template."""
234235
template = Template(Description="CI/CD pipeline for Decrypt Oracle powered by the AWS Encryption SDK for Python")
235236
github_access_token = template.add_parameter(
236237
troposphere.Parameter(

0 commit comments

Comments
 (0)