26
26
CODEBUILD_IMAGE = "aws/codebuild/standard:5.0"
27
27
BUILDSPEC = "decrypt_oracle/.chalice/buildspec.yaml"
28
28
GITHUB_REPO = "aws-encryption-sdk-python"
29
- WAITER_CONFIG = dict ( Delay = 10 )
29
+ WAITER_CONFIG = { " Delay" : 10 }
30
30
_LOGGER = logging .getLogger ("Decrypt Oracle Build Pipeline Deployer" )
31
31
32
32
@@ -35,7 +35,7 @@ class AllowEverywhere(AWS.Statement):
35
35
36
36
def __init__ (self , * args , ** kwargs ):
37
37
"""Set up override values."""
38
- my_kwargs = dict ( Effect = AWS .Allow , Resource = ["*" ])
38
+ my_kwargs = { " Effect" : AWS .Allow , " Resource" : ["*" ]}
39
39
my_kwargs .update (kwargs )
40
40
super ().__init__ (* args , ** my_kwargs )
41
41
@@ -167,13 +167,13 @@ def _pipeline(
167
167
ActionTypeId = codepipeline .ActionTypeId (
168
168
Category = "Source" , Owner = "ThirdParty" , Version = "1" , Provider = "GitHub"
169
169
),
170
- Configuration = dict (
171
- Owner = github_owner ,
172
- Repo = GITHUB_REPO ,
173
- OAuthToken = Ref (github_access_token ),
174
- Branch = github_branch ,
175
- PollForSourceChanges = True ,
176
- ) ,
170
+ Configuration = {
171
+ " Owner" : github_owner ,
172
+ " Repo" : GITHUB_REPO ,
173
+ " OAuthToken" : Ref (github_access_token ),
174
+ " Branch" : github_branch ,
175
+ " PollForSourceChanges" : True ,
176
+ } ,
177
177
)
178
178
],
179
179
)
@@ -191,7 +191,7 @@ def _pipeline(
191
191
ActionTypeId = codepipeline .ActionTypeId (
192
192
Category = "Build" , Owner = "AWS" , Version = "1" , Provider = "CodeBuild"
193
193
),
194
- Configuration = dict ( ProjectName = Ref (codebuild_builder )) ,
194
+ Configuration = { " ProjectName" : Ref (codebuild_builder )} ,
195
195
)
196
196
],
197
197
)
@@ -200,25 +200,25 @@ def _pipeline(
200
200
RunOrder = "1" ,
201
201
ActionTypeId = codepipeline .ActionTypeId (Category = "Deploy" , Owner = "AWS" , Version = "1" , Provider = "CloudFormation" ),
202
202
InputArtifacts = [codepipeline .InputArtifacts (Name = _compiled_cfn_template )],
203
- Configuration = dict (
204
- ActionMode = "CHANGE_SET_REPLACE" ,
205
- ChangeSetName = _changeset_name ,
206
- RoleArn = GetAtt (cfn_role , "Arn" ),
207
- Capabilities = "CAPABILITY_IAM" ,
208
- StackName = _stack_name ,
209
- TemplatePath = "{}::decrypt_oracle/transformed.yaml" .format (_compiled_cfn_template ),
210
- ) ,
203
+ Configuration = {
204
+ " ActionMode" : "CHANGE_SET_REPLACE" ,
205
+ " ChangeSetName" : _changeset_name ,
206
+ " RoleArn" : GetAtt (cfn_role , "Arn" ),
207
+ " Capabilities" : "CAPABILITY_IAM" ,
208
+ " StackName" : _stack_name ,
209
+ " TemplatePath" : "{}::decrypt_oracle/transformed.yaml" .format (_compiled_cfn_template ),
210
+ } ,
211
211
)
212
212
deploy_changeset = codepipeline .Actions (
213
213
Name = "Deploy" ,
214
214
RunOrder = "2" ,
215
215
ActionTypeId = codepipeline .ActionTypeId (Category = "Deploy" , Owner = "AWS" , Version = "1" , Provider = "CloudFormation" ),
216
- Configuration = dict (
217
- ActionMode = "CHANGE_SET_EXECUTE" ,
218
- ChangeSetName = _changeset_name ,
219
- StackName = _stack_name ,
220
- OutputFileName = "StackOutputs.json" ,
221
- ) ,
216
+ Configuration = {
217
+ " ActionMode" : "CHANGE_SET_EXECUTE" ,
218
+ " ChangeSetName" : _changeset_name ,
219
+ " StackName" : _stack_name ,
220
+ " OutputFileName" : "StackOutputs.json" ,
221
+ } ,
222
222
OutputArtifacts = [codepipeline .OutputArtifacts (Name = "AppDeploymentValues" )],
223
223
)
224
224
deploy = codepipeline .Stages (Name = "Deploy" , Actions = [stage_changeset , deploy_changeset ])
@@ -272,8 +272,7 @@ def _stack_exists(cloudformation) -> bool:
272
272
return False
273
273
raise
274
274
275
- else :
276
- return True
275
+ return True
277
276
278
277
279
278
def _update_existing_stack (cloudformation , template : Template , github_token : str ) -> None :
@@ -284,7 +283,7 @@ def _update_existing_stack(cloudformation, template: Template, github_token: str
284
283
cloudformation .update_stack (
285
284
StackName = PIPELINE_STACK_NAME ,
286
285
TemplateBody = template .to_json (),
287
- Parameters = [dict ( ParameterKey = " GithubPersonalToken" , ParameterValue = github_token ) ],
286
+ Parameters = [{ " ParameterKey" : " GithubPersonalToken" , " ParameterValue" : github_token } ],
288
287
Capabilities = ["CAPABILITY_IAM" ],
289
288
)
290
289
_LOGGER .info ("Waiting for stack update to complete..." )
@@ -301,7 +300,7 @@ def _deploy_new_stack(cloudformation, template: Template, github_token: str) ->
301
300
cloudformation .create_stack (
302
301
StackName = PIPELINE_STACK_NAME ,
303
302
TemplateBody = template .to_json (),
304
- Parameters = [dict ( ParameterKey = " GithubPersonalToken" , ParameterValue = github_token ) ],
303
+ Parameters = [{ " ParameterKey" : " GithubPersonalToken" , " ParameterValue" : github_token } ],
305
304
Capabilities = ["CAPABILITY_IAM" ],
306
305
)
307
306
_LOGGER .info ("Waiting for stack to deploy..." )
0 commit comments