xarchitecture
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Automate AWS OIDC role creation for GitHub Actions with local policy discovery
How it fires
How this command gets triggered: by you, by Claude, or both.
/xoidcContext preview
What this command does when you run it.
Automate AWS OIDC role creation for GitHub Actions with local policy discovery
description: Automate AWS OIDC role creation for GitHub Actions with local policy discovery tags: [aws, oidc, github-actions, security, automation]
Automate the creation of AWS OIDC roles for GitHub Actions with intelligent policy discovery from local aws_policies folders.
# Basic usage with policy discovery /xoidc --github-org myorg --github-repo myrepo # With custom policies directory /xoidc --github-org myorg --github-repo myrepo --policies-dir custom_policies # Dry run validation /xoidc --github-org myorg --github-repo myrepo --dry-run # Full configuration /xoidc --github-org myorg --github-repo myrepo --region us-west-2 --github-token $GITHUB_TOKEN
First, check for required dependencies and validate environment: Check if AWS CLI is available. If not found, display error message. Check if GitHub CLI is available. If not found, display warning about limited features.
Parse arguments from $ARGUMENTS and set defaults:
Validate that required arguments are provided:
Scan for AWS policies in the specified directory: Display message indicating scanning for policies in the policies directory. Check if the policies directory exists. If not found, display error and exit.
List discovered policy files: Find all JSON files in the policies directory, excluding example files, and display them sorted.
Store policy files for processing: Get list of policy files and validate that at least one policy file was found. If no policy files found, display error and exit.
Validate each policy file structure: Display message indicating policy validation is starting. For each policy file found:
Create trust policy for GitHub OIDC: Display message indicating trust policy generation. Create a trust policy JSON file with:
Generate CloudFormation template: Display message indicating CloudFormation template creation. Create a CloudFormation template with:
For each policy file found:
Add outputs section with Role ARN for easy reference.
Set stack name if not provided: Generate stack name using pattern: gha-oidc-{github-org}-{github-repo}
If dry run mode is enabled:
Deploy the CloudFormation stack:
Get the role ARN from the stack output:
Set repository variable if GitHub token is provided: If GitHub token is available and GitHub CLI is installed:
If GitHub token is not provided:
Display completion message and setup summary:
Clean up temporary files: Remove temporary files created during the proc
Transform Claude Code into a complete development platform with 45 AI-powered commands that automate your entire software development workflow. Now with improved git identity management!
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Manage project configuration files, environment variables, and application settings
Continue an execution plan from where it left off across sessions
Interactive debugging support with error analysis and fix suggestions - integrates with Debug Specialist sub-agent for complexโฆ