Skip to content

Commit 492c1d1

Browse files
authored
Reinstate AwsAutomationUser (#1236)
1 parent 1f10763 commit 492c1d1

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

pulumi/__main__.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import cloudfront
44
import pulumi
55
import tb_pulumi
6+
import tb_pulumi.ci
67
import tb_pulumi.cloudwatch
78
import tb_pulumi.ec2
89
import tb_pulumi.iam
@@ -103,19 +104,11 @@
103104
)
104105

105106

106-
def __sap_on_apply(resources):
107-
ci_user_name = f'{project.name_prefix}-ci'
108-
tb_pulumi.iam.UserWithAccessKey(
109-
ci_user_name,
110-
project=project,
111-
user_name=ci_user_name,
112-
groups=[resources['admin_group']],
113-
opts=pulumi.ResourceOptions(depends_on=[sap]),
114-
)
115-
107+
auto_users_opts = resources.get('tb:ci:AwsAutomationUser', {})
108+
for user, user_opts in auto_users_opts.items():
109+
tb_pulumi.ci.AwsAutomationUser(f'{project.name_prefix}-{user}', project=project, **user_opts)
116110

117111
sap = tb_pulumi.iam.StackAccessPolicies(
118112
f'{project.name_prefix}-sap',
119113
project=project,
120-
on_apply=__sap_on_apply,
121114
)

pulumi/config.prod.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,20 @@ resources:
236236
- thunderbird-services-monitoring@thunderbird.net
237237
config:
238238
alarms: {}
239+
240+
tb:ci:AwsAutomationUser:
241+
ci:
242+
additional_policies:
243+
- arn:aws:iam::768512802988:policy/appointment-prod-frontend-cache-invalidation
244+
enable_ecr_image_push: True
245+
ecr_repositories:
246+
- thunderbird/appointment
247+
enable_fargate_deployments: True
248+
fargate_clusters:
249+
- appointment-prod-fargate-backend
250+
fargate_task_role_arns:
251+
- arn:aws:iam::768512802988:role/appointment-prod-fargate-backend
252+
enable_full_s3_access: False
253+
enable_s3_bucket_upload: True
254+
s3_upload_buckets:
255+
- tb-appointment-prod-frontend

pulumi/config.stage.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,20 @@ resources:
246246
- thunderbird-services-monitoring@thunderbird.net
247247
config:
248248
alarms: {}
249+
250+
tb:ci:AwsAutomationUser:
251+
ci:
252+
additional_policies:
253+
- arn:aws:iam::768512802988:policy/appointment-stage-frontend-cache-invalidation
254+
enable_ecr_image_push: True
255+
ecr_repositories:
256+
- thunderbird/appointment
257+
enable_fargate_deployments: True
258+
fargate_clusters:
259+
- appointment-stage-fargate-backend
260+
fargate_task_role_arns:
261+
- arn:aws:iam::768512802988:role/appointment-stage-fargate-backend
262+
enable_full_s3_access: False
263+
enable_s3_bucket_upload: True
264+
s3_upload_buckets:
265+
- tb-appointment-stage-frontend

0 commit comments

Comments
 (0)