@wraps.dev/cli 2.21.12 → 2.21.14

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.
Binary file
package/dist/cli.js CHANGED
@@ -32159,6 +32159,7 @@ var WRAPS_PLATFORM_ACCOUNT_ID = "905130073023";
32159
32159
  async function updatePlatformRole(metadata, progress, externalId) {
32160
32160
  const roleName = "wraps-console-access-role";
32161
32161
  const iam11 = new IAMClient3({ region: "us-east-1" });
32162
+ const trustedAccountId = metadata.services?.selfhost ? metadata.accountId : WRAPS_PLATFORM_ACCOUNT_ID;
32162
32163
  let roleExists2 = false;
32163
32164
  try {
32164
32165
  await iam11.send(new GetRoleCommand({ RoleName: roleName }));
@@ -32189,7 +32190,7 @@ async function updatePlatformRole(metadata, progress, externalId) {
32189
32190
  {
32190
32191
  Effect: "Allow",
32191
32192
  Principal: {
32192
- AWS: `arn:aws:iam::${WRAPS_PLATFORM_ACCOUNT_ID}:root`
32193
+ AWS: `arn:aws:iam::${trustedAccountId}:root`
32193
32194
  },
32194
32195
  Action: "sts:AssumeRole",
32195
32196
  Condition: {
@@ -32218,7 +32219,7 @@ async function updatePlatformRole(metadata, progress, externalId) {
32218
32219
  {
32219
32220
  Effect: "Allow",
32220
32221
  Principal: {
32221
- AWS: `arn:aws:iam::${WRAPS_PLATFORM_ACCOUNT_ID}:root`
32222
+ AWS: `arn:aws:iam::${trustedAccountId}:root`
32222
32223
  },
32223
32224
  Action: "sts:AssumeRole",
32224
32225
  Condition: {
@@ -33875,14 +33876,23 @@ Run ${pc47.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
33875
33876
  console.log(`${key}=${value}`);
33876
33877
  }
33877
33878
  console.log("");
33878
- console.log(
33879
- "# AWS credentials for role assumption \u2014 create an IAM user in your account"
33880
- );
33881
- console.log(
33882
- `# with sts:AssumeRole permission on arn:aws:iam::${identity.accountId}:role/wraps-console-access-role`
33883
- );
33884
- console.log("# AWS_ACCESS_KEY_ID=<fill-in>");
33885
- console.log("# AWS_SECRET_ACCESS_KEY=<fill-in>");
33879
+ console.log("# =============================================================================");
33880
+ console.log("# AWS Backend Credentials \u2014 Vercel OIDC (recommended)");
33881
+ console.log("# =============================================================================");
33882
+ console.log("#");
33883
+ console.log("# 1. In Vercel: Project Settings \u2192 Cloud \u2192 Configure AWS");
33884
+ console.log("# Copy the OIDC Provider URL (looks like https://oidc.vercel.com/<team-id>)");
33885
+ console.log("#");
33886
+ console.log("# 2. In AWS IAM \u2192 Identity providers \u2192 Add provider:");
33887
+ console.log("# Provider type: OpenID Connect");
33888
+ console.log("# Provider URL: <your Vercel OIDC URL from step 1>");
33889
+ console.log("# Audience: sts.amazonaws.com");
33890
+ console.log("#");
33891
+ console.log("# 3. Create an IAM role that trusts that OIDC provider, with this permission:");
33892
+ console.log(`# sts:AssumeRole on arn:aws:iam::${identity.accountId}:role/wraps-console-access-role`);
33893
+ console.log("#");
33894
+ console.log("# 4. Set AWS_ROLE_ARN to that role's ARN in Vercel:");
33895
+ console.log(`# AWS_ROLE_ARN=arn:aws:iam::${identity.accountId}:role/<your-vercel-backend-role>`);
33886
33896
  clack44.outro(
33887
33897
  pc47.dim(
33888
33898
  "Paste into Vercel \u2192 Settings \u2192 Environment Variables \u2192 Add from .env"