shadcn.io is not affiliated with official shadcn/ui
AWS Setup Integration Block for React
An integration setup flow for a cloud cost tool connecting to AWS: a scope and 12-digit account ID, two aws iam commands built from that ID with a derived External ID, and a pasted role ARN that is parsed and checked against the account.
Installation
Overview
An integration setup section for React with Base UI, written for Meterfern, a fictional cloud cost reporting tool, and its AWS connection. A centred header ("Connect AWS in three steps") and the mark pair sit over one framed window, a raised panel inside a muted shell. Its top band is the catalog's Steps (numbers only on a phone). Step 1 picks the scope, one account or an organization, and takes the 12-digit account ID, checked as you type (dashes are dropped from a pasted ID). Step 2 builds the two aws iam commands from that ID, with an External ID derived from it, in a focusable scrolling code block with a Copy button; an organization adds organizations:ListAccounts. Step 3 takes the role ARN that create-role prints, splits it into partition, account and role name, and rejects one from a different account. Finish setup stays unavailable, with the reason beside it, until the ARN matches, then shows "Connected in this demo" and a ghost Disconnect that starts over. The commands are shown, never run, and nothing is sent to AWS. Each step's heading takes focus when you move, and every step sits in one grid cell with an unseen copy of them all, so the window keeps the tallest step's height. The page's rails and top rule come from the Guides spine. AWS is named in text only: no AWS logo, colour or wordmark ships with the block. The product's account ID, the commands' names and the sample ARN are example data.
FAQ
Does it connect to AWS or run the commands?
No. The commands are text for the customer to run themselves, the account ID and ARN are checked only for their shape, and "Connected in this demo" is local state. A line under the window says so from the first paint. To make it real, point Finish setup at your own endpoint, which should assume the role with the External ID and report whether it worked.
Where does the External ID come from?
It is derived from the account ID with a small hash (externalIdOf), so the same ID always gives the same value and the commands, the trust policy and the step 2 note agree. AWS's guidance is that the vendor, not the customer, generates and controls the External ID, so in production replace it with a value your backend creates and stores for each customer, and keep PRINCIPAL set to your own AWS account.
What do the two commands do?
The first checks the shell is in the right account, then aws iam create-role creates the role with a trust policy that lets your account assume it only when the External ID matches. The second, aws iam put-role-policy, attaches a read-only inline policy: Cost Explorer's ce:GetCostAndUsage and ce:GetTags, plus organizations:ListAccounts for an organization. Edit commandsOf, ROLE and POLICY to match your own policy.
How is the ARN checked?
parseArn accepts the shape arn:<partition>:iam::<12 digits>:role/<name> for the aws, aws-cn and aws-us-gov partitions, shows its three parts, and compares the account with the one entered in step 1. A mismatch, or text that isn't a role ARN, keeps Finish setup unavailable and says why. The note is also spoken by a polite live region once typing pauses, so it isn't read on every keystroke.
How does it fit on a phone, in right-to-left layouts and with reduced motion?
On a phone the step titles become numbers, the buttons go full width and the code block scrolls sideways in a region you can focus and read with the arrow keys. IDs, ARNs and commands keep their left-to-right order in a right-to-left layout while the rest of the window flips. The header and window fade up once on load; reduced motion turns that off.
Related
- Pro
AWS Detail Integration
Scopes and stepsAn integration detail section for a cloud cost tool connecting to AWS: a header with the mark pair and Connect AWS, a three-cell trust chain on one wire, and the five read-only IAM actions its role allows.
- Pro
AWS List Integration
Synced tablesAn integration list section for a cloud cost tool reading from AWS: six cost-allocation tags as rows with a coverage bar, a state word and an Activate switch, a segmented filter with counts, and a working Retry on the one row that timed out.
- Pro
AWS Grid Integration
Switch and tick gridsAn integration grid section for a cloud cost tool reading from AWS: eight service tiles you tick, and one stacked bar and coverage figure that follow every tick, counted from last month's typed spend.
- Pro
AWS Stats Integration
Bars and columnsAn integration stats section for a cloud cost tool reading from AWS: six region lanes on one 0 to 24 hour ruler showing how far each region's cost data runs behind, with a solid tick at the 6 hour agreement.
- Pro
Invite the App Setup Integration
Choose and verifyAn integration setup section for a spend approvals tool connecting to Slack: three steps (add the app under its five scopes, invite it with a copyable command, check that it joined) beside a drawn member list with a radar pulse that settles to Joined.
- Pro
Rollback Wizard Changelog
Deploys and rolloutsA three-step rollback wizard in one framed window: pick a previous release, review what reverts and what stays, then type the version to unlock a Shine Button that opens an alert dialog and ends on a stated demo result.