- Home
- Skills
- Giuseppe Trisciuoglio
- Developer Kit
- Aws Cloudformation Ec2
aws-cloudformation-ec2_skill
- Python
99
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill giuseppe-trisciuoglio/developer-kit --skill aws-cloudformation-ec2- SKILL.md49.7 KB
Overview
This skill provides production-ready AWS CloudFormation patterns for provisioning EC2 infrastructure. It bundles templates and patterns for EC2 (on-demand and Spot), Security Groups, IAM roles and instance profiles, Application Load Balancers, Target Groups, and modular template structure for Parameters, Mappings, Conditions, and cross-stack references. Use it to standardize reusable, secure EC2 deployments.
How this skill works
The skill supplies annotated CloudFormation patterns and ready-to-use YAML snippets that define EC2 instances, security groups, IAM roles, ALBs, and target groups. It shows how to structure templates with Parameters, Mappings, Conditions, Transforms, and Outputs, and demonstrates exporting values for cross-stack references and using SSM parameter types for dynamic AMIs. Examples include secure SSH/HTTP setups, IAM least-privilege roles, Spot instance configuration, and ALB integration.
When to use it
- Provision single or multiple EC2 instances with consistent configuration
- Launch Spot instances to reduce cost while retaining CloudFormation control
- Create Security Groups and network rules for EC2 workloads
- Attach IAM roles and instance profiles for secure AWS access from EC2
- Integrate Application Load Balancers and Target Groups for web services
- Design modular templates with Parameters, Conditions, Mappings, and cross-stack exports
Best practices
- Use AWS-specific parameter types (VPC, Subnet, AMI, KeyPair) for validation and console UX
- Keep IAM policies least privilege and attach via InstanceProfile to EC2
- Use Parameters and Mappings for environment-specific configuration instead of hardcoding
- Export minimal Outputs (IDs, ARNs) for cross-stack reuse and avoid leaking secrets
- Use Conditions to toggle optional resources (ALB, Spot) and reduce duplicate templates
- Bootstrap instances with UserData and use SSM/CloudWatch for monitoring and management
Example use cases
- Simple web server: secure EC2 instance with Security Group, KeyPair, and public IP for HTTP traffic
- Autoscaled app with ALB: use ALB + Target Group, and Parameters for subnet and security group selection
- Cost-optimized batch worker: Spot instances launched via template with fallback to on-demand
- S3-backed app: EC2 with an IAM role granting scoped S3 read/write permissions via InstanceProfile
- Cross-stack architecture: export VPC, Subnet and SecurityGroup IDs from a network stack for application stacks
FAQ
Yes. Use AWS::SSM::Parameter::ValueAWS::EC2::Image::Id to reference latest AMIs and keep templates up to date.
How do I switch between Spot and On-Demand instances?
Add a Parameter (e.g., UseSpotInstance) and a Condition to choose an InstanceMarketOptions property or alternate Auto Scaling group configuration.