{"id":30104077,"url":"https://github.com/nataliagranato/aws-resources","last_synced_at":"2025-08-09T22:14:13.723Z","repository":{"id":304423941,"uuid":"1018754881","full_name":"nataliagranato/aws-resources","owner":"nataliagranato","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-30T08:14:51.000Z","size":73,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T15:12:54.225Z","etag":null,"topics":["api-rest","aws","flask","python","rich"],"latest_commit_sha":null,"homepage":"https://www.nataliagranato.xyz/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nataliagranato.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"nataliagranato","ko_fi":"nataliagranato","buy_me_a_coffee":"nataliagranato","pix":"fada126d-7311-495f-bda2-55ec79b0a39b"}},"created_at":"2025-07-13T01:05:39.000Z","updated_at":"2025-07-17T17:09:29.000Z","dependencies_parsed_at":"2025-07-13T03:32:32.378Z","dependency_job_id":"0273807c-f448-49ba-b9b9-2155b764f33f","html_url":"https://github.com/nataliagranato/aws-resources","commit_stats":null,"previous_names":["nataliagranato/aws-resources"],"tags_count":0,"template":false,"template_full_name":"Tech-Preta/repository_sample","purl":"pkg:github/nataliagranato/aws-resources","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nataliagranato%2Faws-resources","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nataliagranato%2Faws-resources/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nataliagranato%2Faws-resources/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nataliagranato%2Faws-resources/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nataliagranato","download_url":"https://codeload.github.com/nataliagranato/aws-resources/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nataliagranato%2Faws-resources/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269646715,"owners_count":24453029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","aws","flask","python","rich"],"created_at":"2025-08-09T22:14:13.170Z","updated_at":"2025-08-09T22:14:13.713Z","avatar_url":"https://github.com/nataliagranato.png","language":"Python","funding_links":["https://github.com/sponsors/nataliagranato","https://ko-fi.com/nataliagranato","https://buymeacoffee.com/nataliagranato","fada126d-7311-495f-bda2-55ec79b0a39b"],"categories":[],"sub_categories":[],"readme":"# AWS Resources CLI Tool\n\nA comprehensive command-line interface for creating various AWS resources including S3 buckets, EC2 instances, DynamoDB tables, RDS instances, Lambda functions, and SNS topics.\n\n## Features\n\nThis CLI tool provides two complementary interfaces for AWS resource management:\n\n### Modern Package-based CLI (S3 \u0026 EC2 - Production Ready)\n- **S3 Bucket Management**: Create S3 buckets with region specification\n- **EC2 Instance Management**: Launch EC2 instances with customizable configuration\n- **Package Installation**: Install as `pip install -e .` and use `aws-resources` command\n- **Advanced Error Handling**: Comprehensive AWS error handling and user-friendly messages\n- **Hierarchical Commands**: Professional CLI experience with argparse subcommands\n\n### Extended Service Support (All AWS Services)\n- **DynamoDB Tables**: Create DynamoDB tables with partition keys and optional sort keys\n- **RDS Instances**: Create RDS database instances with various engines\n- **Lambda Functions**: Create Lambda functions with different runtimes\n- **SNS Topics**: Create SNS topics for messaging\n- **Direct Python Execution**: Use `python aws_cli.py` for broader service access\n\n## Prerequisites\n\n- Python 3.8 or higher\n- AWS credentials configured (via AWS CLI, environment variables, or IAM roles)\n- Required Python packages (see requirements.txt)\n\n## Installation\n\n1. Clone this repository:\n```bash\ngit clone https://github.com/nataliagranato/aws-resources.git\ncd aws-resources\n```\n\n2. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n3. Install the package for modern CLI experience:\n```bash\npip install -e .\n```\n\n4. Configure AWS credentials (choose one method):\n   - Using AWS CLI: `aws configure`\n   - Using environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`\n   - Using IAM roles (if running on EC2)\n\n## Usage\n\n### Modern Package-based CLI (Recommended for S3 \u0026 EC2)\n\n#### S3 Bucket Creation\n\nCreate a new S3 bucket:\n\n```bash\naws-resources s3 create-bucket --bucket-name my-unique-bucket --region us-west-2\n```\n\n**Parameters:**\n- `--bucket-name`: Name of the S3 bucket (must be globally unique)\n- `--region`: AWS region for the bucket (e.g., us-east-1, us-west-2)\n\n#### EC2 Instance Creation\n\nLaunch new EC2 instances:\n\n```bash\naws-resources ec2 create-instances \\\n  --image-id ami-12345678 \\\n  --instance-type t2.micro \\\n  --key-name my-ec2-key \\\n  --count 2 \\\n  --region us-east-1\n```\n\n**Parameters:**\n- `--image-id`: AMI ID to launch the instance from (required)\n- `--instance-type`: EC2 instance type like t2.micro, t3.small (required)\n- `--key-name`: Name of the EC2 Key Pair for SSH access (required)\n- `--count`: Number of instances to launch (default: 1)\n- `--region`: AWS region for the instances (required)\n\n#### Global Options\n\n- `-v, --verbose`: Enable verbose output for detailed information\n\n#### Help\n\nGet help for any command:\n\n```bash\naws-resources --help\naws-resources s3 --help\naws-resources ec2 create-instances --help\n```\n\n### Extended Service CLI (All AWS Services)\n\n#### General Syntax\n```bash\npython aws_cli.py \u003cservice\u003e \u003caction\u003e [options]\n```\n\n#### S3 Operations\n\nCreate an S3 bucket:\n```bash\npython aws_cli.py s3 create-bucket --name my-unique-bucket-name --region us-east-1\n```\n\n#### EC2 Operations\n\nCreate an EC2 instance:\n```bash\npython aws_cli.py ec2 create-instance --image-id ami-0abcdef1234567890 --instance-type t2.micro --region us-east-1\n```\n\nWith optional parameters:\n```bash\npython aws_cli.py ec2 create-instance --image-id ami-0abcdef1234567890 --instance-type t2.micro --region us-east-1 --key-name my-key-pair --security-groups default\n```\n\n#### DynamoDB Operations\n\nCreate a simple table with partition key only:\n```bash\npython aws_cli.py dynamodb create-table --name my-table --partition-key id --region us-east-1\n```\n\nCreate a table with both partition and sort keys:\n```bash\npython aws_cli.py dynamodb create-table --name my-table --partition-key userId --partition-key-type S --sort-key timestamp --sort-key-type N --region us-east-1\n```\n\n#### RDS Operations\n\nCreate an RDS MySQL instance:\n```bash\npython aws_cli.py rds create-instance --identifier my-database --engine mysql --username admin --password mypassword123 --region us-east-1\n```\n\nWith additional options:\n```bash\npython aws_cli.py rds create-instance --identifier my-database --engine postgres --instance-class db.t3.small --username admin --password mypassword123 --storage 50 --publicly-accessible --region us-east-1\n```\n\n#### Lambda Operations\n\nCreate a Lambda function (with default Hello World code):\n```bash\npython aws_cli.py lambda create-function --name my-function --runtime python3.9 --role arn:aws:iam::123456789012:role/lambda-execution-role --region us-east-1\n```\n\nWith custom code and settings:\n```bash\npython aws_cli.py lambda create-function --name my-function --runtime python3.9 --role arn:aws:iam::123456789012:role/lambda-execution-role --handler index.handler --code-file my-function.zip --timeout 60 --memory 256 --region us-east-1\n```\n\n#### SNS Operations\n\nCreate an SNS topic:\n```bash\npython aws_cli.py sns create-topic --name my-topic --region us-east-1\n```\n\nWith display name:\n```bash\npython aws_cli.py sns create-topic --name my-topic --display-name \"My Notification Topic\" --region us-east-1\n```\n\n## Examples\n\n### Modern CLI Examples\n\n#### Create an S3 bucket in us-east-1:\n```bash\naws-resources s3 create-bucket --bucket-name my-app-logs-2024 --region us-east-1\n```\n\n#### Launch a single t2.micro instance:\n```bash\naws-resources ec2 create-instances \\\n  --image-id ami-0abcdef1234567890 \\\n  --instance-type t2.micro \\\n  --key-name my-keypair \\\n  --region us-west-2\n```\n\n#### Launch multiple instances with verbose output:\n```bash\naws-resources -v ec2 create-instances \\\n  --image-id ami-0abcdef1234567890 \\\n  --instance-type t3.small \\\n  --key-name production-key \\\n  --count 3 \\\n  --region eu-west-1\n```\n\n## Architecture\n\nThe CLI is built with extensibility in mind:\n\n- **Base Service Class**: Common functionality for all AWS services\n- **Service-Specific Modules**: Dedicated modules for each AWS service\n- **Argument Parsing**: Hierarchical subcommands using argparse\n- **Error Handling**: Comprehensive error handling with user-friendly messages\n## Command Reference (Extended CLI)\n\n### Global Options\n- `--region`: AWS region (required for all commands)\n\n### S3 create-bucket\n- `--name`: Bucket name (must be globally unique)\n\n### EC2 create-instance\n- `--image-id`: AMI ID to launch (required)\n- `--instance-type`: Instance type (required, e.g., t2.micro)\n- `--key-name`: EC2 Key Pair name (optional)\n- `--security-groups`: Security group names (optional, space-separated)\n\n### DynamoDB create-table\n- `--name`: Table name (required)\n- `--partition-key`: Partition key attribute name (required)\n- `--partition-key-type`: Partition key type - S/N/B (default: S)\n- `--sort-key`: Sort key attribute name (optional)\n- `--sort-key-type`: Sort key type - S/N/B (default: S)\n\n### RDS create-instance\n- `--identifier`: DB instance identifier (required)\n- `--engine`: Database engine - mysql/postgres/mariadb/oracle-ee/sqlserver-ex (required)\n- `--username`: Master username (required)\n- `--password`: Master password (required)\n- `--instance-class`: DB instance class (default: db.t3.micro)\n- `--storage`: Allocated storage in GB (default: 20)\n- `--security-groups`: VPC security group IDs (optional, space-separated)\n- `--publicly-accessible`: Make instance publicly accessible (flag)\n\n### Lambda create-function\n- `--name`: Function name (required)\n- `--runtime`: Runtime environment (required) - python3.9/python3.10/python3.11/nodejs18.x/nodejs20.x/java11/dotnet6\n- `--role`: IAM role ARN (required)\n- `--handler`: Function handler (default: lambda_function.lambda_handler)\n- `--code-file`: Path to code zip file (optional, creates Hello World if not provided)\n- `--description`: Function description (optional)\n- `--timeout`: Function timeout in seconds (optional)\n- `--memory`: Memory size in MB (optional)\n\n### SNS create-topic\n- `--name`: Topic name (required)\n- `--display-name`: Topic display name (optional)\n\n## Requirements\n\n- Python 3.8+\n- boto3 \u003e= 1.26.0\n- Valid AWS credentials\n\n## Error Handling\n\nThe tool provides clear error messages for common scenarios:\n- Missing AWS credentials\n- Resource already exists\n- Invalid parameters\n- AWS service errors\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## Web Interface (New)\n\nThis project now includes a user-friendly web interface for creating AWS resources.\n\n### Running the Web App\n\n1.  **Install Flask**:\n    ```bash\n    pip install Flask\n    ```\n\n2.  **Run the application**:\n    ```bash\n    python -m aws_ui.app\n    ```\n    Or, if installed via `pip install -e .`:\n    ```bash\n    aws-resources-web\n    ```\n\n3.  Open your browser and navigate to `http://127.0.0.1:5000`.\n\n### Web App Features\n- Create S3 buckets\n- Launch EC2 instances\n- Real-time feedback on resource creation status\n\n---\n\nFeito com ❤️ por [Natália Granato](https://github.com/nataliagranato).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnataliagranato%2Faws-resources","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnataliagranato%2Faws-resources","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnataliagranato%2Faws-resources/lists"}