@continuous-excellence/ze-great-dashboard-aws 0.13.8 → 0.14.1

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 CHANGED
@@ -1,7 +1,17 @@
1
1
  # Ze Great Dashboard on AWS
2
2
 
3
- `@continuous-excellence/ze-great-dashboard-aws` packages a board as a private AWS Lambda. It
4
- includes the Lambda runtime, matching browser client, deployment CLI, and CloudFormation templates.
3
+ `@continuous-excellence/ze-great-dashboard-aws` packages a board for a private AWS Lambda or ECS
4
+ deployment. It includes the Lambda runtime, matching browser client, deployment CLI, and
5
+ CloudFormation templates.
6
+
7
+ Deployment mode is persisted in `dashboard-bootstrap.json` and generated application parameters
8
+ as `ComputeMode`. Existing files without that field mean `lambda`. Choose `--mode ecs` during
9
+ bootstrap initialization; routine packaging and diagnostics then select the matching template.
10
+ An explicit mode fails if it disagrees with persisted configuration, so changing mode requires
11
+ regenerating the reviewed bootstrap and parameter artifacts.
12
+
13
+ Consumer ECS deployments use the long-lived service template and provide their own subnets and
14
+ security groups.
5
15
 
6
16
  This deployment path is intended for teams that already operate AWS and have a protected gateway
7
17
  such as API Gateway or an ALB. It deliberately does not create a public endpoint, choose an
@@ -0,0 +1,86 @@
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: Ze Great Dashboard ECS bootstrap core v1. Administrator-managed; do not grant this authority to CI.
3
+
4
+ Parameters:
5
+ ComputeMode: { Type: String, Default: ecs, AllowedValues: [ecs] }
6
+ ArtifactBucketName: { Type: String, Description: Compatibility artifact bucket; ECS packages use the published image }
7
+ ApplicationStackName: { Type: String }
8
+ DashboardFunctionName: { Type: String, Description: Compatibility name retained by the bootstrap manifest }
9
+ RuntimeSecretArn: { Type: String, Default: '' }
10
+ ArtifactKmsKeyArn: { Type: String, Default: '' }
11
+
12
+ Conditions:
13
+ HasRuntimeSecret: !Not [!Equals [!Ref RuntimeSecretArn, '']]
14
+
15
+ Resources:
16
+ ArtifactBucket:
17
+ Type: AWS::S3::Bucket
18
+ DeletionPolicy: Retain
19
+ UpdateReplacePolicy: Retain
20
+ Properties:
21
+ BucketName: !Ref ArtifactBucketName
22
+ OwnershipControls: { Rules: [{ ObjectOwnership: BucketOwnerEnforced }] }
23
+ PublicAccessBlockConfiguration: { BlockPublicAcls: true, BlockPublicPolicy: true, IgnorePublicAcls: true, RestrictPublicBuckets: true }
24
+ CloudFormationExecutionRole:
25
+ Type: AWS::IAM::Role
26
+ DeletionPolicy: Retain
27
+ UpdateReplacePolicy: Retain
28
+ Properties:
29
+ RoleName: !Sub '${ApplicationStackName}-execution'
30
+ AssumeRolePolicyDocument:
31
+ Version: '2012-10-17'
32
+ Statement: [{ Effect: Allow, Principal: { Service: cloudformation.amazonaws.com }, Action: sts:AssumeRole }]
33
+ Policies:
34
+ - PolicyName: DashboardEcsApplicationResources
35
+ PolicyDocument:
36
+ Version: '2012-10-17'
37
+ Statement:
38
+ - Sid: DashboardEcs
39
+ Effect: Allow
40
+ Action: [ecs:CreateCluster, ecs:DescribeClusters, ecs:UpdateCluster, ecs:DeleteCluster, ecs:CreateService, ecs:DescribeServices, ecs:UpdateService, ecs:DeleteService, ecs:RegisterTaskDefinition, ecs:DeregisterTaskDefinition, ecs:DescribeTaskDefinition, ecs:TagResource, ecs:UntagResource]
41
+ Resource: '*'
42
+ - Sid: DashboardEcsLogs
43
+ Effect: Allow
44
+ Action: [logs:CreateLogGroup, logs:DeleteLogGroup, logs:DescribeLogGroups, logs:PutRetentionPolicy, logs:TagResource, logs:UntagResource]
45
+ Resource: !Sub 'arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/ecs/${ApplicationStackName}:*'
46
+ - Sid: ManageEcsRuntimeRoles
47
+ Effect: Allow
48
+ Action: [iam:CreateRole, iam:GetRole, iam:DeleteRole, iam:UpdateAssumeRolePolicy, iam:PutRolePolicy, iam:GetRolePolicy, iam:DeleteRolePolicy, iam:TagRole, iam:UntagRole]
49
+ Resource: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ApplicationStackName}-*'
50
+ - Sid: PassRuntimeRolesToEcsOnly
51
+ Effect: Allow
52
+ Action: iam:PassRole
53
+ Resource: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ApplicationStackName}-*'
54
+ Condition: { StringEquals: { 'iam:PassedToService': ecs-tasks.amazonaws.com } }
55
+ - !If
56
+ - HasRuntimeSecret
57
+ - Sid: ReadConfiguredRuntimeCredentials
58
+ Effect: Allow
59
+ Action: [secretsmanager:DescribeSecret, secretsmanager:GetSecretValue]
60
+ Resource: !Ref RuntimeSecretArn
61
+ - !Ref AWS::NoValue
62
+ - !If
63
+ - HasRuntimeSecret
64
+ - Sid: ReadConfiguredRuntimeParameter
65
+ Effect: Allow
66
+ Action: ssm:GetParameter
67
+ Resource: !Ref RuntimeSecretArn
68
+ - !Ref AWS::NoValue
69
+ - !If
70
+ - HasRuntimeSecret
71
+ - Sid: DecryptConfiguredRuntimeParameter
72
+ Effect: Allow
73
+ Action: kms:Decrypt
74
+ Resource: '*'
75
+ Condition:
76
+ StringEquals:
77
+ 'kms:ViaService': !Sub 'ssm.${AWS::Region}.amazonaws.com'
78
+ 'kms:EncryptionContext:PARAMETER_ARN': !Ref RuntimeSecretArn
79
+ - !Ref AWS::NoValue
80
+ Outputs:
81
+ BootstrapContractVersion: { Value: '1' }
82
+ BootstrapTemplateRevision: { Value: '1.0-ecs' }
83
+ ArtifactBucketName: { Value: !Ref ArtifactBucket }
84
+ ArtifactBucketArn: { Value: !GetAtt ArtifactBucket.Arn }
85
+ CloudFormationExecutionRoleArn: { Value: !GetAtt CloudFormationExecutionRole.Arn }
86
+ ApplicationStackName: { Value: !Ref ApplicationStackName }
@@ -2,6 +2,11 @@ AWSTemplateFormatVersion: '2010-09-09'
2
2
  Description: Ze Great Dashboard bootstrap core v1. Administrator-managed; do not grant this authority to CI.
3
3
 
4
4
  Parameters:
5
+ ComputeMode:
6
+ Type: String
7
+ Default: lambda
8
+ AllowedValues: [lambda]
9
+ Description: Persistent application compute mode for this bootstrap
5
10
  ArtifactBucketName:
6
11
  Type: String
7
12
  Description: Globally unique bucket for private Lambda artifacts
@@ -123,7 +128,7 @@ Resources:
123
128
 
124
129
  Outputs:
125
130
  BootstrapContractVersion: { Value: '1' }
126
- BootstrapTemplateRevision: { Value: '1.2' }
131
+ BootstrapTemplateRevision: { Value: '1.3' }
127
132
  ArtifactBucketName: { Value: !Ref ArtifactBucket }
128
133
  ArtifactBucketArn: { Value: !GetAtt ArtifactBucket.Arn }
129
134
  CloudFormationExecutionRoleArn: { Value: !GetAtt CloudFormationExecutionRole.Arn }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "mode": "lambda",
2
3
  "region": "us-east-1",
3
4
  "core": {
4
5
  "stackName": "team-dashboard-bootstrap",
@@ -0,0 +1,39 @@
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: Ze Great Dashboard GitHub OIDC adapter for ECS deployments.
3
+ Parameters:
4
+ ComputeMode: { Type: String, Default: ecs, AllowedValues: [ecs] }
5
+ GitHubOidcProviderArn: { Type: String }
6
+ GitHubRepository: { Type: String }
7
+ GitHubOwnerId: { Type: String }
8
+ GitHubRepositoryId: { Type: String }
9
+ GitHubEnvironment: { Type: String }
10
+ CoreBootstrapStackName: { Type: String }
11
+ ApplicationStackName: { Type: String }
12
+ ArtifactBucketName: { Type: String }
13
+ CloudFormationExecutionRoleArn: { Type: String }
14
+ Resources:
15
+ GitHubDeployRole:
16
+ Type: AWS::IAM::Role
17
+ Properties:
18
+ RoleName: !Sub '${ApplicationStackName}-github-deploy'
19
+ AssumeRolePolicyDocument:
20
+ Version: '2012-10-17'
21
+ Statement: [{ Effect: Allow, Principal: { Federated: !Ref GitHubOidcProviderArn }, Action: sts:AssumeRoleWithWebIdentity }]
22
+ Policies:
23
+ - PolicyName: DeployOneEcsApplication
24
+ PolicyDocument:
25
+ Version: '2012-10-17'
26
+ Statement:
27
+ - Sid: OperateOneApplicationStack
28
+ Effect: Allow
29
+ Action: [cloudformation:CreateChangeSet, cloudformation:DescribeChangeSet, cloudformation:ExecuteChangeSet, cloudformation:DeleteChangeSet, cloudformation:DescribeStacks, cloudformation:GetTemplate, cloudformation:GetTemplateSummary]
30
+ Resource: !Sub 'arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${ApplicationStackName}/*'
31
+ - Sid: PassCoreExecutionRole
32
+ Effect: Allow
33
+ Action: iam:PassRole
34
+ Resource: !Ref CloudFormationExecutionRoleArn
35
+ Condition: { StringEquals: { 'iam:PassedToService': cloudformation.amazonaws.com } }
36
+ Outputs:
37
+ BootstrapContractVersion: { Value: '1' }
38
+ BootstrapTemplateRevision: { Value: '1.0-ecs' }
39
+ GitHubDeployRoleArn: { Value: !GetAtt GitHubDeployRole.Arn }
@@ -2,6 +2,11 @@ AWSTemplateFormatVersion: '2010-09-09'
2
2
  Description: Ze Great Dashboard GitHub OIDC adapter v2. Administrator-managed; requires a central OIDC provider.
3
3
 
4
4
  Parameters:
5
+ ComputeMode:
6
+ Type: String
7
+ Default: lambda
8
+ AllowedValues: [lambda]
9
+ Description: Persistent application compute mode for this bootstrap
5
10
  GitHubOidcProviderArn: { Type: String }
6
11
  GitHubRepository: { Type: String, Description: owner/repository }
7
12
  GitHubOwnerId: { Type: String, Description: Immutable numeric GitHub owner id }
@@ -97,5 +102,5 @@ Resources:
97
102
 
98
103
  Outputs:
99
104
  BootstrapContractVersion: { Value: '2' }
100
- BootstrapTemplateRevision: { Value: '2.2' }
105
+ BootstrapTemplateRevision: { Value: '2.3' }
101
106
  GitHubDeployRoleArn: { Value: !GetAtt GitHubDeployRole.Arn }
@@ -1,3 +1,5 @@
1
+ import { type ComputeMode } from './compute-mode.js';
2
+ export { type ComputeMode, computeMode, resolveComputeMode } from './compute-mode.js';
1
3
  export type BootstrapKind = 'core' | 'github-oidc';
2
4
  export type CloudFormationParameterValue = {
3
5
  ParameterKey: string;
@@ -15,6 +17,8 @@ export type DeployedBootstrapStack = {
15
17
  }[];
16
18
  };
17
19
  export type BootstrapConfig = {
20
+ /** Omitted in older manifests; Lambda is the compatibility default. */
21
+ mode?: ComputeMode;
18
22
  region?: string;
19
23
  core?: {
20
24
  stackName?: string;
@@ -56,8 +60,9 @@ export type BootstrapConsistency = {
56
60
  ok: boolean;
57
61
  mismatches: string[];
58
62
  };
59
- export declare function bootstrapTemplatePath(kind: BootstrapKind): Promise<string>;
60
- export declare function bootstrapTemplate(kind: BootstrapKind): Promise<string>;
63
+ export declare function requireComputeMode(persisted: Pick<BootstrapConfig, 'mode'>, explicit?: string): ComputeMode;
64
+ export declare function bootstrapTemplatePath(kind: BootstrapKind, mode?: ComputeMode): Promise<string>;
65
+ export declare function bootstrapTemplate(kind: BootstrapKind, mode?: ComputeMode): Promise<string>;
61
66
  export declare function bootstrapContractVersion(template: string): string;
62
67
  export declare function bootstrapTemplateRevision(template: string): string;
63
68
  /** Returns installed templates and a reviewable, non-secret plan without external calls. */