Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides AWS CloudFormation patterns for EC2 instances, Security Groups, IAM roles, and load balancers. Use when creating EC2 instances, SPOT instances, Security Groups, IAM roles for EC2, Application Load Balancers (ALB), Target Groups, and implementing template structure with Parameters, Outputs, Mappings, Conditions, and cross-stack references.
.claude/skills/giuseppe-trisciuoglio-aws-cloudformation-ec2/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 195% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 320% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 95% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 166% | 0% |
Create production-ready EC2 infrastructure using AWS CloudFormation templates. Covers EC2 instances (On-Demand and SPOT), Security Groups, IAM roles, Application Load Balancers (ALB), template structure, parameters, outputs, and cross-stack references.
Use AWS-specific parameter types for validation and console dropdowns.
yamlParameters: LatestAmiId: Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id> Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 InstanceType: Type: AWS::EC2::InstanceType Default: t3.micro AllowedValues: [t3.micro, t3.small, t3.medium] KeyName: Type: AWS::EC2::KeyPair::KeyName
See template-structure.md for advanced parameter patterns, mappings, conditions, and cross-stack references.
Define ingress/egress rules for network access.
yamlInstanceSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: Security group for EC2 instance VpcId: !Ref VpcId SecurityGroupIngress: - IpProtocol: tcp FromPort: 80 ToPort: 80 CidrIp: 0.0.0.0/0 - IpProtocol: tcp FromPort: 22 ToPort: 22 CidrIp: 10.0.0.0/16
See security-iam.md for advanced security group patterns, self-references, and IAM roles.
Define instance profile with least privilege permissions.
yamlEc2Role: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Principal: Service: ec2.amazonaws.com Action: sts:AssumeRole ManagedPolicyArns: - arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore Ec2InstanceProfile: Type: AWS::IAM::InstanceProfile Properties: Roles: [!Ref Ec2Role]
See security-iam.md for least privilege policies, SSM roles, and trust policies.
Configure instance with security group, IAM role, and user data.
yamlEc2Instance: Type: AWS::EC2::Instance Properties: ImageId: !Ref LatestAmiId InstanceType: !Ref InstanceType KeyName: !Ref KeyName SecurityGroupIds: [!Ref InstanceSecurityGroup] IamInstanceProfile: !Ref Ec2InstanceProfile SubnetId: !Ref SubnetId UserData: Fn::Base64: | #!/bin/bash yum update -y yum install -y httpd systemctl start httpd Tags: - Key: Name Value: !Sub ${AWS::StackName}-instance
See ec2-instances.md for multi-volume configurations, detailed monitoring, SPOT instances, and complete stack examples.
Validate template: aws cloudformation validate-template --template-body file://template.yaml
Create ALB with target group and listener for traffic distribution.
yamlApplicationLoadBalancer: Type: AWS::ElasticLoadBalancingV2::LoadBalancer Properties: Name: !Sub ${AWS::StackName}-alb Scheme: internet-facing SecurityGroups: [!Ref AlbSecurityGroup] Subnets: [!Ref PublicSubnet1, !Ref PublicSubnet2] ApplicationTargetGroup: Type: AWS::ElasticLoadBalancingV2::TargetGroup Properties: Port: 80 Protocol: HTTP VpcId: !Ref VpcId HealthCheckPath: /health ApplicationListener: Type: AWS::ElasticLoadBalancingV2::Listener Properties: DefaultActions: - Type: forward TargetGroupArn: !Ref ApplicationTargetGroup LoadBalancerArn: !Ref ApplicationLoadBalancer Port: 80 Protocol: HTTP
See load-balancers.md for HTTPS configuration, path-based routing, host-based routing, listener rules, and ALB attributes.
Export values for cross-stack references.
yamlOutputs: InstanceId: Description: EC2 Instance ID Value: !Ref Ec2Instance Export: Name: !Sub ${AWS::StackName}-InstanceId SecurityGroupId: Description: Security Group ID Value: !Ref InstanceSecurityGroup Export: Name: !Sub ${AWS::StackName}-SecurityGroupId LoadBalancerDnsName: Description: ALB DNS Name Value: !GetAtt ApplicationLoadBalancer.DNSName
See template-structure.md for cross-stack reference patterns and import/export strategies.
yamlAWSTemplateFormatVersion: "2010-09-09" Description: EC2 instance with ALB Parameters: LatestAmiId: Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id> Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 InstanceType: Type: AWS::EC2::InstanceType Default: t3.micro Resources: InstanceSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: Enable HTTP and SSH SecurityGroupIngress: - IpProtocol: tcp FromPort: 80 ToPort: 80 CidrIp: 0.0.0.0/0 Ec2Instance: Type: AWS::EC2::Instance Properties: ImageId: !Ref LatestAmiId InstanceType: !Ref InstanceType SecurityGroupIds: [!Ref InstanceSecurityGroup] LoadBalancer: Type: AWS::ElasticLoadBalancingV2::LoadBalancer Properties: Scheme: internet-facing SecurityGroups: [!Ref InstanceSecurityGroup] Subnets: [subnet-12345678, subnet-87654321] Outputs: InstanceId: Value: !Ref Ec2Instance LoadBalancerDns: Value: !GetAtt LoadBalancer.DNSName
bash# Create change set aws cloudformation create-change-set \ --stack-name my-ec2-stack \ --template-body file://template.yaml \ --change-set-type CREATE # Execute after review aws cloudformation execute-change-set \ --change-set-name <change-set-name>
See examples.md for complete production-ready templates.
AWS::EC2::VPC::Id, AWS::EC2::InstanceType)AWS::StackName prefixaws cloudformation validate-templateSee best-practices.md for detailed guidance on stack policies, termination protection, drift detection, change set automation, and validation scripts.
See constraints.md for complete constraints, troubleshooting guides, and monitoring setup.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 21,210 | 17,130 | -19% | 1 | 1 | 0% | 4,413 | 6,203 | +41% | 0 | 0 | — |
case-02 | fail→pass | 18,499 | 19,749 | +7% | 1 | 1 | 0% | 3,726 | 6,783 | +82% | 0 | 0 | — |
case-03 | pass→pass | 10,776 | 7,532 | -30% | 1 | 1 | 0% | 2,025 | 3,942 | +95% | 0 | 0 | — |
case-04 | pass→pass | 7,501 | 7,380 | -2% | 1 | 1 | 0% | 1,420 | 3,781 | +166% | 0 | 0 | — |
case-05 | pass→pass | 7,018 | 8,475 | +21% | 1 | 1 | 0% | 1,144 | 4,039 | +253% | 0 | 0 | — |
case-06 | pass→pass | 2,735 | 2,332 | -15% | 1 | 1 | 0% | 400 | 2,876 | +619% | 0 | 0 | — |
case-07 | fail→pass | 6,205 | 4,854 | -22% | 1 | 1 | 0% | 1,163 | 3,431 | +195% | 0 | 0 | — |
case-08 | pass→pass | 5,454 | 4,628 | -15% | 1 | 1 | 0% | 929 | 3,333 | +259% | 0 | 0 | — |
case-09 | pass→pass | 4,009 | 3,397 | -15% | 1 | 1 | 0% | 684 | 3,146 | +360% | 0 | 0 | — |
case-10 | pass→pass | 5,517 | 4,248 | -23% | 1 | 1 | 0% | 1,033 | 3,285 | +218% | 0 | 0 | — |
case-11 | pass→pass | 9,016 | 6,140 | -32% | 1 | 1 | 0% | 1,606 | 3,472 | +116% | 0 | 0 | — |
case-12 | pass→pass | 6,957 | 4,156 | -40% | 1 | 1 | 0% | 1,276 | 3,197 | +151% | 0 | 0 | — |
case-13 | pass→pass | 3,682 | 3,029 | -18% | 1 | 1 | 0% | 594 | 3,010 | +407% | 0 | 0 | — |
case-14 | pass→pass | 16,238 | 6,717 | -59% | 1 | 1 | 0% | 1,693 | 3,815 | +125% | 0 | 0 | — |
case-15 | pass→pass | 4,584 | 3,735 | -19% | 1 | 1 | 0% | 890 | 3,221 | +262% | 0 | 0 | — |
case-16 | pass→pass | 3,871 | 3,756 | -3% | 1 | 1 | 0% | 643 | 3,198 | +397% | 0 | 0 | — |
case-17 | fail→pass | 4,525 | 3,772 | -17% | 1 | 1 | 0% | 757 | 3,176 | +320% | 0 | 0 | — |
case-18 | pass→pass | 3,468 | 4,351 | +25% | 1 | 1 | 0% | 619 | 3,164 | +411% | 0 | 0 | — |
case-19 | pass→pass | 9,220 | 6,624 | -28% | 1 | 1 | 0% | 1,226 | 3,842 | +213% | 0 | 0 | — |
case-20 | pass→pass | 5,992 | 6,266 | +5% | 1 | 1 | 0% | 1,038 | 3,590 | +246% | 0 | 0 | — |
case-21 | pass→pass | 5,819 | 6,134 | +5% | 1 | 1 | 0% | 1,019 | 3,630 | +256% | 0 | 0 | — |
case-22 | pass→pass | 18,700 | 18,089 | -3% | 1 | 1 | 0% | 4,312 | 6,581 | +53% | 0 | 0 | — |
case-23 | pass→pass | 3,974 | 5,047 | +27% | 1 | 1 | 0% | 737 | 3,528 | +379% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.