@continuous-excellence/ze-great-dashboard-aws 0.31.41 → 0.31.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -10
- package/bootstrap/core-ecs-v1.yml +76 -24
- package/bootstrap/core-v1.yml +67 -28
- package/bootstrap/github-oidc-ecs-v1.yml +26 -10
- package/bootstrap/github-oidc-v1.yml +22 -12
- package/bootstrap/github-oidc-v2.yml +57 -27
- package/dist/bootstrap.d.ts +20 -0
- package/dist/cli.js +48 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -14
- package/dist/lambda.mjs +39 -16
- package/package.json +1 -1
- package/template-ecs.yml +77 -21
- package/template.yml +17 -14
package/template.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
AWSTemplateFormatVersion:
|
|
1
|
+
AWSTemplateFormatVersion: "2010-09-09"
|
|
2
2
|
Description: Ze Great Dashboard private Lambda application (integrate through a customer-managed gateway)
|
|
3
3
|
|
|
4
4
|
Metadata:
|
|
@@ -18,10 +18,10 @@ Parameters:
|
|
|
18
18
|
# ARN of a Secrets Manager JSON object or Parameter Store SecureString such as
|
|
19
19
|
# {"GITHUB_TOKEN":"github_pat_..."}. The value stays server-side; this ARN is the only
|
|
20
20
|
# credential-related Lambda setting.
|
|
21
|
-
SecretReference: { Type: String, Default:
|
|
21
|
+
SecretReference: { Type: String, Default: "" }
|
|
22
22
|
|
|
23
23
|
Conditions:
|
|
24
|
-
HasSecretReference: !Not [!Equals [!Ref SecretReference,
|
|
24
|
+
HasSecretReference: !Not [!Equals [!Ref SecretReference, ""]]
|
|
25
25
|
HasReservedConcurrency: !Not [!Equals [!Ref ReservedConcurrentExecutions, 0]]
|
|
26
26
|
|
|
27
27
|
Resources:
|
|
@@ -30,15 +30,16 @@ Resources:
|
|
|
30
30
|
Properties:
|
|
31
31
|
# A stable, Name-derived role name lets consumer bootstrap policies scope CloudFormation
|
|
32
32
|
# execution to this stack's runtime role rather than every role in the account.
|
|
33
|
-
RoleName: !Sub
|
|
33
|
+
RoleName: !Sub "${Name}-server"
|
|
34
34
|
AssumeRolePolicyDocument:
|
|
35
|
-
Version:
|
|
36
|
-
Statement:
|
|
35
|
+
Version: "2012-10-17"
|
|
36
|
+
Statement:
|
|
37
|
+
[{ Effect: Allow, Principal: { Service: lambda.amazonaws.com }, Action: sts:AssumeRole }]
|
|
37
38
|
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
|
|
38
39
|
Policies:
|
|
39
40
|
- PolicyName: read-consumer-credentials
|
|
40
41
|
PolicyDocument:
|
|
41
|
-
Version:
|
|
42
|
+
Version: "2012-10-17"
|
|
42
43
|
Statement:
|
|
43
44
|
- Effect: Allow
|
|
44
45
|
Action: [secretsmanager:DescribeSecret, secretsmanager:GetSecretValue]
|
|
@@ -47,7 +48,7 @@ Resources:
|
|
|
47
48
|
Resource: !If
|
|
48
49
|
- HasSecretReference
|
|
49
50
|
- !Ref SecretReference
|
|
50
|
-
- !Sub
|
|
51
|
+
- !Sub "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:ze-great-dashboard-no-secret-configured"
|
|
51
52
|
- Effect: Allow
|
|
52
53
|
Action: ssm:GetParameter
|
|
53
54
|
# The same reference may instead be an SSM parameter ARN. The opposite service's
|
|
@@ -55,19 +56,20 @@ Resources:
|
|
|
55
56
|
Resource: !If
|
|
56
57
|
- HasSecretReference
|
|
57
58
|
- !Ref SecretReference
|
|
58
|
-
- !Sub
|
|
59
|
+
- !Sub "arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/ze-great-dashboard-no-credential-configured"
|
|
59
60
|
- Effect: Allow
|
|
60
61
|
Action: kms:Decrypt
|
|
61
|
-
Resource:
|
|
62
|
+
Resource: "*"
|
|
62
63
|
# Parameter Store supplies this encryption context itself. This permits decryption
|
|
63
64
|
# only while SSM reads this exact configured parameter, including custom KMS keys.
|
|
64
65
|
Condition:
|
|
65
66
|
StringEquals:
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
"kms:ViaService": !Sub "ssm.${AWS::Region}.amazonaws.com"
|
|
68
|
+
"kms:EncryptionContext:PARAMETER_ARN": !Ref SecretReference
|
|
68
69
|
ServerLogGroup:
|
|
69
70
|
Type: AWS::Logs::LogGroup
|
|
70
|
-
Properties:
|
|
71
|
+
Properties:
|
|
72
|
+
{ RetentionInDays: !Ref LogRetentionInDays, LogGroupName: !Sub "/aws/lambda/${Name}" }
|
|
71
73
|
ServerFunction:
|
|
72
74
|
Type: AWS::Lambda::Function
|
|
73
75
|
DependsOn: ServerLogGroup
|
|
@@ -78,7 +80,8 @@ Resources:
|
|
|
78
80
|
Handler: index.handler
|
|
79
81
|
MemorySize: !Ref MemorySize
|
|
80
82
|
Timeout: !Ref Timeout
|
|
81
|
-
ReservedConcurrentExecutions:
|
|
83
|
+
ReservedConcurrentExecutions:
|
|
84
|
+
!If [HasReservedConcurrency, !Ref ReservedConcurrentExecutions, !Ref AWS::NoValue]
|
|
82
85
|
Role: !GetAtt ServerRole.Arn
|
|
83
86
|
Code: { S3Bucket: !Ref LambdaArtifactBucket, S3Key: !Ref LambdaArtifactKey }
|
|
84
87
|
Environment:
|