Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 37 additions & 18 deletions architectures/aws-pcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,20 @@ want direct SSH, set `SSHAccessCidr` to a trusted CIDR at deploy time to open SS
on the login node to that CIDR.

**Console:** [EC2 Console](https://console.aws.amazon.com/ec2/home#Instances:) → filter
by `aws:pcs:compute-node-group-name = login` → **Connect** → **Session Manager**.
by `Name` = `<your-stack-name>-login` → **Connect** → **Session Manager**.

**CLI** (AWS CloudShell has the required permissions):
**CLI** (AWS CloudShell has the required permissions). Set `STACK_NAME` /
`AWS_REGION` once, then a single command resolves the login node's
instance ID — it works no matter what your CNG is named because the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

§6 rationale is slightly self-contradictory — the resilience is against the Name tag, not the CNG name

Small wording thing: the §6 intro says the lookup "works no matter what your CNG is named because the lookup goes through the PCS API." But the lookup hardcodes computeNodeGroups[?name==\login`], so it *does* depend on the login CNG being named login(which deploy-all guarantees). What the PCS-API path actually buys you is independence from the mutable EC2Name` tag — that's the real win worth stating.

Suggested change
instance ID — it works no matter what your CNG is named because the
instance ID — it works no matter how instances are Name-tagged because the

lookup goes through the PCS API, not the human-facing tag:

```bash
INSTANCE_ID=$(aws ec2 describe-instances \
--filters "Name=tag:aws:pcs:compute-node-group-name,Values=login" \
"Name=instance-state-name,Values=running" \
--query 'Reservations[0].Instances[0].InstanceId' --output text)
aws ssm start-session --target $INSTANCE_ID
STACK_NAME=pcs-ml-cluster # your CloudFormation stack name
AWS_REGION=us-east-1 # your region

LOGIN_INSTANCE_ID=$(aws ec2 describe-instances --region "$AWS_REGION" --filters "Name=tag:aws:pcs:compute-node-group-id,Values=$(aws pcs list-compute-node-groups --cluster-identifier $(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" --query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text) --region "$AWS_REGION" --query 'computeNodeGroups[?name==`login`].id' --output text)" "Name=instance-state-name,Values=running" --query 'Reservations[0].Instances[0].InstanceId' --output text)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested LOGIN_INSTANCE_ID=$(…) one-liner fails silently to None, and --cluster-identifier is unquoted — 🟢 [confirmed]

Observation: The triple-nested substitution (this line in §6, and the §8.2 copy) is functionally correct — the JMESPath backticks are protected by single quotes, and nested $(…) parses fine. But there's no error path: a wrong STACK_NAME/AWS_REGION or a missing ClusterId output makes the inner describe-stacks return empty → list-compute-node-groups runs with an empty identifier → the Values= filter matches nothing → --output text prints literal None → aws ssm start-session --target None fails opaquely. Separately, --cluster-identifier $(…) is unquoted, so on an empty ClusterId the token vanishes and the following --region is consumed as the identifier value — a different, more confusing error than a clean "empty identifier."
Impact: A first-time copy-paste into the wrong stack/region gets None with no hint why. (Test 15's "no None/empty" gate is exactly the right guard — but the snippet itself gives the user no diagnostic.)
Suggestion: Split into named steps with a guard, and quote the identifier — IAM.md already splits out CLUSTER_ID for the Grafana step, so the pattern exists:

CLUSTER_ID=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" \
  --query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text)
[ -n "$CLUSTER_ID" ] && [ "$CLUSTER_ID" != "None" ] || { echo "No ClusterId — check STACK_NAME/AWS_REGION"; return 1; }
CNG_ID=$(aws pcs list-compute-node-groups --cluster-identifier "$CLUSTER_ID" --region "$AWS_REGION" \
  --query 'computeNodeGroups[?name==`login`].id' --output text)
LOGIN_INSTANCE_ID=$(aws ec2 describe-instances --region "$AWS_REGION" \
  --filters "Name=tag:aws:pcs:compute-node-group-id,Values=$CNG_ID" "Name=instance-state-name,Values=running" \
  --query 'Reservations[0].Instances[0].InstanceId' --output text)


aws ssm start-session --target "$LOGIN_INSTANCE_ID" --region "$AWS_REGION"
```

Then `sudo su - ubuntu` and use `sinfo` / `squeue` / `scontrol show nodes`.
Expand Down Expand Up @@ -435,28 +439,38 @@ DCGM exporter image (`DcgmExporterImage`) are pinned and rarely need changing
#### Accessing the Grafana dashboards

Log in to Grafana as **`admin`**; the password is generated per cluster and stored in
SSM Parameter Store. Retrieve it (with `CLUSTER_ID` from the stack's `ClusterId` output):
SSM Parameter Store. Retrieve it — the same `STACK_NAME` / `AWS_REGION` used in §6
resolve the cluster's `ClusterId` from the stack Outputs:

```bash
aws ssm get-parameter --name "/pcs/${CLUSTER_ID}/grafana/admin-password" \
--with-decryption --query 'Parameter.Value' --output text
STACK_NAME=pcs-ml-cluster # your CloudFormation stack name
AWS_REGION=us-east-1 # your region

aws ssm get-parameter --region "$AWS_REGION" --with-decryption --query 'Parameter.Value' --output text \
--name "/pcs/$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" --query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text)/grafana/admin-password"
```

There are two ways to reach the UI.

##### Option A — SSM port forwarding (default, private)

No public access required; works even when the login node has no inbound rules.
The monitoring stack runs on the instance tagged `monitoring-role=login`;
scope by the cluster's `aws:pcs:cluster-id` so multi-cluster VPCs don't
cross the streams.

```bash
# Login node instance ID
INSTANCE_ID=$(aws ec2 describe-instances \
--filters "Name=tag:aws:pcs:compute-node-group-name,Values=login" \
STACK_NAME=pcs-ml-cluster # your CloudFormation stack name
AWS_REGION=us-east-1 # your region

LOGIN_INSTANCE_ID=$(aws ec2 describe-instances --region "$AWS_REGION" \
--filters "Name=tag:aws:pcs:cluster-id,Values=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" --query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text)" \
"Name=tag:monitoring-role,Values=login" \
"Name=instance-state-name,Values=running" \
--query 'Reservations[0].Instances[0].InstanceId' --output text)

# Port-forward remote 443 -> local 8443 (needs the Session Manager plugin)
aws ssm start-session --target $INSTANCE_ID \
aws ssm start-session --target "$LOGIN_INSTANCE_ID" --region "$AWS_REGION" \
--document-name AWS-StartPortForwardingSession \
--parameters '{"portNumber":["443"],"localPortNumber":["8443"]}'
```
Expand All @@ -474,11 +488,16 @@ attaches it to the login node, so you can open:
https://<login-node-public-ip>/grafana/
```

Get the login node's public IP from the EC2 console, or:
Get the login node's public IP from the EC2 console, or (again scoping by
`monitoring-role=login` + `aws:pcs:cluster-id` for the monitoring instance):

```bash
aws ec2 describe-instances \
--filters "Name=tag:aws:pcs:compute-node-group-name,Values=login" \
STACK_NAME=pcs-ml-cluster # your CloudFormation stack name
AWS_REGION=us-east-1 # your region

aws ec2 describe-instances --region "$AWS_REGION" \
--filters "Name=tag:aws:pcs:cluster-id,Values=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" --query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text)" \
"Name=tag:monitoring-role,Values=login" \
"Name=instance-state-name,Values=running" \
--query 'Reservations[0].Instances[0].PublicIpAddress' --output text
```
Expand Down Expand Up @@ -528,7 +547,7 @@ NCCL, FSDP), see the [Test & Validation Guide](tests/README.md).

> **Note — node-type tagging.** The monitoring stack identifies login vs compute nodes by
> the `monitoring-role` tag (`login`/`compute`), **not** the EC2 `Name` tag — so the `Name`
> tag (default `PCS-<cngname>`) is free for you to retag without breaking dashboards.
> tag (default `<ClusterName>-<cngname>`) is free for you to retag without breaking dashboards.

> **Note — monitoring across login-node replacement.** Prometheus + Grafana run on the
> (single) login node. Metric collection, the Grafana password, and the built-in
Expand Down
14 changes: 7 additions & 7 deletions architectures/aws-pcs/assets/add-cng-p5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,15 @@ Resources:
Tags:
- Key: HPCRecipes
Value: "true"
# Name is free for arbitrary operator use. The monitoring stack
# identifies login vs compute nodes via the monitoring-role tag
# (below), not Name, so dashboards work regardless of this value.
# Default to PCS-<cngname> (mirrors CngName) for a recognizable
# console name; retag freely afterward.
# Name defaults to <ClusterName>-<CngName> so the EC2 console
# can tell instances of different clusters apart at a glance;
# retag freely, nothing operational reads it (monitoring keys
# off monitoring-role below, docs look up instances via the
# PCS API + aws:pcs:* tags).
- Key: Name
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: CngName
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: ClusterName
Value: !Ref ClusterName
- Key: pcs-cluster-id
Expand Down
14 changes: 7 additions & 7 deletions architectures/aws-pcs/assets/add-cng-p6-b200.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ Resources:
Tags:
- Key: HPCRecipes
Value: "true"
# Name is free for arbitrary operator use. The monitoring stack
# identifies login vs compute nodes via the monitoring-role tag
# (below), not Name, so dashboards work regardless of this value.
# Default to PCS-<cngname> (mirrors CngName) for a recognizable
# console name; retag freely afterward.
# Name defaults to <ClusterName>-<CngName> so the EC2 console
# can tell instances of different clusters apart at a glance;
# retag freely, nothing operational reads it (monitoring keys
# off monitoring-role below, docs look up instances via the
# PCS API + aws:pcs:* tags).
- Key: Name
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: CngName
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: ClusterName
Value: !Ref ClusterName
- Key: pcs-cluster-id
Expand Down
14 changes: 7 additions & 7 deletions architectures/aws-pcs/assets/add-cng-p6-b300.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,15 @@ Resources:
Tags:
- Key: HPCRecipes
Value: "true"
# Name is free for arbitrary operator use. The monitoring stack
# identifies login vs compute nodes via the monitoring-role tag
# (below), not Name, so dashboards work regardless of this value.
# Default to PCS-<cngname> (mirrors CngName) for a recognizable
# console name; retag freely afterward.
# Name defaults to <ClusterName>-<CngName> so the EC2 console
# can tell instances of different clusters apart at a glance;
# retag freely, nothing operational reads it (monitoring keys
# off monitoring-role below, docs look up instances via the
# PCS API + aws:pcs:* tags).
- Key: Name
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: CngName
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: ClusterName
Value: !Ref ClusterName
- Key: pcs-cluster-id
Expand Down
14 changes: 7 additions & 7 deletions architectures/aws-pcs/assets/add-cng.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ Resources:
Tags:
- Key: HPCRecipes
Value: "true"
# Name is free for arbitrary operator use. The monitoring stack
# identifies login vs compute nodes via the monitoring-role tag
# (below), not Name, so dashboards work regardless of this value.
# Default to PCS-<cngname> (mirrors CngName) for a recognizable
# console name; retag freely afterward.
# Name defaults to <ClusterName>-<CngName> so the EC2 console
# can tell instances of different clusters apart at a glance;
# retag freely, nothing operational reads it (monitoring keys
# off monitoring-role below, docs look up instances via the
# PCS API + aws:pcs:* tags).
- Key: Name
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'
- Key: CngName
Value: !Sub 'PCS-${CngName}'
Value: !Sub '${ClusterName}-${CngName}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CngName tag no longer holds the CNG name — 🟢 [confirmed]

Observation: The custom tag Key: CngName now gets Value: !Sub '${ClusterName}-${CngName}' — identical to Name. A tag keyed CngName whose value is <cluster>-<cng> is misleading; the bare CNG name is !Ref CngName. (It was already mildly off as PCS-${CngName}, but this PR edits the line and could set it right.)
Impact: Redundant with Name; anything grouping/filtering by tag:CngName (dashboards, cost allocation) now sees a cluster-prefixed value, not the CNG name.
Suggestion:

Suggested change
Value: !Sub '${ClusterName}-${CngName}'
Value: !Ref CngName

(or drop the duplicate tag, since Name already carries the console-readable value). Applies to the same line in all four add-cng*.yaml.

- Key: ClusterName
Value: !Ref ClusterName
- Key: pcs-cluster-id
Expand Down
4 changes: 2 additions & 2 deletions architectures/aws-pcs/assets/cluster-user-iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Description: |
- Retrieve the Grafana admin password from Parameter Store
- Terminate their own SSM sessions
They cannot create, modify, or delete cluster resources, and cannot open
shells on compute nodes (the ssm:resourceTag Name=PCS-login* scope blocks that. Note: the Name tag is operator-mutable; if you rename login nodes, update the policy accordingly).
shells on compute nodes (the ssm:resourceTag Name=*-login scope blocks that — templates default Name to <ClusterName>-<CngName>, so any login CNG matches; compute/GPU CNGs do not. Note: the Name tag is operator-mutable; if you rename login nodes, update the policy accordingly).
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
Expand Down Expand Up @@ -86,7 +86,7 @@ Resources:
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"StringLike": {
"ssm:resourceTag/Name": "PCS-login*"
"ssm:resourceTag/Name": "*-login"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ssm:resourceTag/Name: *-login is a leading-wildcard grant — it doesn't scope to the cluster, and it can match compute nodes — 🔴 (security) [confirmed]

Observation: The cluster-user SSM condition goes from PCS-login* (anchored prefix) to *-login (leading wildcard), while Resource stays arn:aws:ec2:*:*:instance/*. A leading * in StringLike matches any instance Name ending in -login, and cluster-user-iam.yaml has no ClusterName/ClusterId parameter to narrow it. So a cluster-user can ssm:StartSession (shell / port-forward / SSH-over-SSM) on:

  1. Every other cluster's login node — this PR names them <ClusterName>-login, so all of them match *-login. The change makes the Name cluster-unique but the policy discards that uniqueness.
  2. Any unrelated account instance ending in -login (bastion-login, vpn-login, …) — strictly broader than the old PCS-login*, which at least required the PCS- prefix.
  3. A compute CNG whose name ends in login (e.g. CNG data-login → Name=<cluster>-data-login) — this breaks the template's own stated guarantee ("cannot open shells on compute nodes"); the old PCS-login* prefix would not have matched it.

The IAM.md prose ("so any login CNG matches; compute/GPU CNGs do not", "the most stable signal available") reassures where it should warn — it omits the account-wide breadth.
Impact: In the very multi-cluster/one-VPC scenario this PR targets, the IAM layer provides no per-cluster isolation and can reach unrelated instances. I confirmed this with iam simulate-custom-policy on the exact statement — under *-login, ssm:StartSession is allowed on myclusterB-login (another cluster), bastion-login / vpn-login (unrelated), and myclusterA-data-login (a compute CNG ending in login), and correctly denied only on myclusterA-cpu1 / -gpu-p5. Every one of those four unintended allows was implicitDeny under the old PCS-login* — so this is a demonstrated widening, not a theoretical one. (Today's real blast radius is small — 1 *-login instance live in the test region — but the glob is unbounded by design.)
Suggestion: Scope by the AWS-managed, operator-immutable aws:pcs:cluster-id tag — the same lever the §8.2 monitoring path in this PR already uses. Add a ClusterId parameter to this template and AND both keys in one StringLike (keys AND together), so it's PCS-instances-of-this-cluster-whose-role-is-login:

"StringLike": {
  "ssm:resourceTag/aws:pcs:cluster-id": "<ClusterId param>",
  "ssm:resourceTag/Name": "*login*"
}

(cluster-id alone would expose compute nodes; Name alone is account-wide — you need both.) If *-login stays for now, please make the IAM.md / description prose state plainly that it's an account-wide leading-wildcard match, so an operator tightening for production isn't misled. — verified live 2026-07-11: cluster-user-iam.yaml params are only GroupName/AttachUsers; instances carry an immutable aws:pcs:cluster-id tag.

}
}
},
Expand Down
35 changes: 21 additions & 14 deletions architectures/aws-pcs/docs/IAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,24 @@ admin will also deploy the standalone DLAMI builder
### What the cluster user can do once attached

```bash
# Find the login node and open a session
INSTANCE_ID=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=PCS-login" "Name=instance-state-name,Values=running" \
--query 'Reservations[0].Instances[0].InstanceId' --output text)
aws ssm start-session --target $INSTANCE_ID
STACK_NAME=pcs-ml-cluster # your CloudFormation stack name
AWS_REGION=us-east-1 # your region

# Find the login node's instance ID via the PCS API — no dependency on tag naming
LOGIN_INSTANCE_ID=$(aws ec2 describe-instances --region "$AWS_REGION" --filters "Name=tag:aws:pcs:compute-node-group-id,Values=$(aws pcs list-compute-node-groups --cluster-identifier $(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" --query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text) --region "$AWS_REGION" --query 'computeNodeGroups[?name==`login`].id' --output text)" "Name=instance-state-name,Values=running" --query 'Reservations[0].Instances[0].InstanceId' --output text)

# Open a session
aws ssm start-session --target "$LOGIN_INSTANCE_ID" --region "$AWS_REGION"

# Port-forward Grafana (443 -> 8443), then open https://localhost:8443/grafana/
aws ssm start-session --target $INSTANCE_ID \
aws ssm start-session --target "$LOGIN_INSTANCE_ID" --region "$AWS_REGION" \
--document-name AWS-StartPortForwardingSession \
--parameters '{"portNumber":["443"],"localPortNumber":["8443"]}'

# Read the Grafana admin password
aws ssm get-parameter --name "/pcs/<cluster-id>/grafana/admin-password" \
# Read the Grafana admin password (CLUSTER_ID is resolved by CFN Outputs above; look it up if needed)
CLUSTER_ID=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region "$AWS_REGION" \
--query 'Stacks[0].Outputs[?OutputKey==`ClusterId`].OutputValue' --output text)
aws ssm get-parameter --name "/pcs/${CLUSTER_ID}/grafana/admin-password" --region "$AWS_REGION" \
--with-decryption --query 'Parameter.Value' --output text
```

Expand All @@ -84,13 +89,15 @@ VPC + FSx + IAM roles itself (the AWS reference policy assumes those already
exist). Review and tighten before production use.

**Login-node access is scoped by the `Name` tag.** The user policy conditions
`ssm:StartSession` on `ssm:resourceTag/Name` matching `PCS-login*`. PCS does not
`ssm:StartSession` on `ssm:resourceTag/Name` matching `*-login`. PCS does not
emit a dedicated "is this a login node" tag, so the templates set
`Name=PCS-login` on the login node and `Name=PCS-<cng-name>` on compute nodes
(`PCS-cpu1`, `PCS-hpc8a`, …) — the most stable signal available. **The `Name`
tag is operator-mutable**: if you re-tag a login node, update the policy
condition to match (or fork the templates to add a dedicated `IsLoginNode=true`
tag and key off that).
`Name=<ClusterName>-<cng-name>` on every instance — the login CNG's default
`CngName=login` yields `Name=<ClusterName>-login` (which the `*-login` glob
matches), and compute CNGs get `<ClusterName>-cpu1`, `<ClusterName>-gpu-p5`,
etc. This is the most stable signal available. **The `Name` tag is
operator-mutable**: if you re-tag a login node, update the policy condition
to match (or fork the templates to add a dedicated `IsLoginNode=true` tag
and key off that).

**Combined CRUD is intentional, not a mistake.** The admin policy covers
create + update + delete in one policy because (1) CFN rollback on a failed
Expand Down
1 change: 1 addition & 0 deletions architectures/aws-pcs/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ LDAP users).
| 11-12 | **Multi-user** | OpenLDAP directory + Slurm managed accounting | [`multi-user-test.md`](./multi-user-test.md) | Directory / accounting changes |
| 13 | **GPU health** | GPU Cluster Health Check suite (DCGM, EFA, NVLink, NCCL thresholds) | [`gpu-healthcheck-test.md`](./gpu-healthcheck-test.md) | GPU CNG deploys |
| 14 | **IAM** | cluster-admin deploys+deletes (no `iam:CreatePolicy`); cluster-user is SSM-login-only and can't read the LDAP password | [`iam-test.md`](./iam-test.md) | IAM policy changes |
| 15 | **README walkthrough** | Deploy from README §3 Quick Start, then run the SSM connect (§6) and Grafana port-forward (§8.2) commands **as written**. Every copy-pasted command must return a real value (no `None`, no `Not found`), Grafana must load `admin` + SSM-retrieved password. Catches tag/CLI/permission drifts before customers hit them. | [`readme-walkthrough-test.md`](./readme-walkthrough-test.md) | Every PR touching README §3/§6/§8.2 or the tags/policies they depend on |

---

Expand Down
2 changes: 2 additions & 0 deletions architectures/aws-pcs/tests/lint-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ BANNED=(
$'DeployMonitoring=true\tMonitoringStack|internally|nested\tDeployMonitoring (bool) was replaced by MonitoringStack at the deploy-all layer'
$'S3 (public )?hosting is not allowed\tNEVERMATCH\tPostInstallScriptUrl now accepts s3:// URLs'
$'architectures/aws-pcs/iam/\tNEVERMATCH\tthe iam/ directory was removed; use docs/IAM.md + assets/cluster-*-iam.yaml'
$'aws:pcs:compute-node-group-name\tNEVERMATCH\ttag key does not exist — use `aws pcs list-compute-node-groups` + `tag:aws:pcs:compute-node-group-id`'
$'Name=tag:Name,Values=PCS-\tNEVERMATCH\tthe Name tag is <ClusterName>-<CngName>; resolve the login node via the PCS API instead'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new lint gives a false all-clear — two Jupyter docs still carry the patterns it's meant to eradicate

This PR replaces the mutable-Name-tag login discovery and the PCS-login* scope across README / IAM.md / iam-test.md, and adds these two BANNED patterns to stop them creeping back. The gap: two sibling docs describing the same login-node flow still carry the pre-PR forms, and both sit inside the lint's own DOC_GLOBS (docs/*.md tests/*.md):

  • docs/JUPYTER.md:120 and tests/jupyter-notebook-test.md:119 — login discovery via --filters "Name=tag:Name,Values=*login" + Reservations[0].Instances[0] (un-cluster-scoped, arbitrary first match — the exact shared-VPC "wrong cluster" hazard §6/§8/IAM.md now avoid).
  • docs/JUPYTER.md:144 — describes the SSM condition as ssm:resourceTag/Name = PCS-login* (the old StringLike). The claim it supports is still true, but the named mechanism is stale and misleads anyone auditing a restricted role from that doc.

I checked live that these two new patterns (aws:pcs:compute-node-group-name, Name=tag:Name,Values=PCS-) match none of those forms, so the lint passes green while the drift survives in-tree — it reads as "no stale lookups" when three remain. I see you deliberately reverted the JUPYTER.md scope change (43a54fc, "out of scope, untested") — deferring the Jupyter rewrite is a reasonable call for a PR already carrying a security fix. The narrower ask is to keep the lint honest about it: either widen the two patterns so they actually catch Values=*login / PCS-login* (which forces the small Jupyter fix now), or add an explicit "Jupyter docs deferred to #NNNN" note so a green lint isn't read as full coverage. I'd lean toward widening the patterns — making this class fail CI is the whole point of adding them.

)
for entry in "${BANNED[@]}"; do
IFS=$'\t' read -r pat allow msg <<<"$entry"
Expand Down
Loading