[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NZ40SQ984B74VJHDYB54K5":3,"skill-same:01M6NZ40SQ984B74VJHDYB54K5":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":18,"commitSha":51,"skillDirectory":52,"forksCount":13,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":55,"install":56,"resources":69},"01M6NZ40SQ984B74VJHDYB54K5","cloudformation",null,"Deploy AWS resources with CloudFormation templates. Create stacks, use nested stacks, and implement drift detection. Use when deploying AWS-native IaC.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fcloudformation\u002FSKILL.md",[],[5,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"main","drift detection","with","relevant","helper","resources","critical","platform","drift","implement","community","agent-skills","iac","only","use","access","devops-security","license","create","2026-11-10 10:12:30",false,"---\nname: cloudformation\ndescription: Deploy AWS resources with CloudFormation templates. Create stacks, use\n  nested stacks, and implement drift detection. Use when deploying AWS-native IaC.\ncategory: devops\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant OS\u002Fplatform tooling and privileged access where\n  noted. Docs-only; helper scripts and templates not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# CloudFormation\n\nDeploy AWS infrastructure with native CloudFormation templates, change sets, nested stacks, and drift detection.\n\n## When to Use This Skill\n\n- Deploying AWS resources using AWS-native Infrastructure as Code\n- Creating repeatable, parameterized infrastructure templates\n- Managing multi-environment deployments (dev, staging, prod) with the same template\n- Implementing safe deployments with change sets and rollback protection\n- Detecting and remediating configuration drift\n- Organizing large infrastructure into nested stacks\n- Exporting\u002Fimporting values between stacks\n\n## Prerequisites\n\n- AWS CLI v2 installed and configured\n- IAM permissions: `cloudformation:*`, plus permissions for all resources in the template\n- (Optional) `cfn-lint` installed for template validation (`pip install cfn-lint`)\n- S3 bucket for storing templates larger than 51,200 bytes\n\n## Template Structure\n\n```yaml\nAWSTemplateFormatVersion: '2010-09-09'\nDescription: Production web application infrastructure\n\nMetadata:\n  AWS::CloudFormation::Interface:\n    ParameterGroups:\n      - Label: { default: \"Environment\" }\n        Parameters: [Environment, InstanceType]\n      - Label: { default: \"Network\" }\n        Parameters: [VpcId, SubnetIds]\n\nParameters:\n  Environment:\n    Type: String\n    AllowedValues: [dev, staging, prod]\n    Default: dev\n\n  InstanceType:\n    Type: String\n    Default: t3.micro\n    AllowedValues: [t3.micro, t3.small, t3.medium, t3.large]\n\n  VpcId:\n    Type: AWS::EC2::VPC::Id\n    Description: VPC to deploy into\n\n  SubnetIds:\n    Type: List\u003CAWS::EC2::Subnet::Id>\n    Description: Subnets for the application\n\nConditions:\n  IsProd: !Equals [!Ref Environment, prod]\n  CreateReadReplica: !Equals [!Ref Environment, prod]\n\nMappings:\n  RegionAMI:\n    us-east-1:\n      AL2023: ami-0abcdef1234567890\n    us-west-2:\n      AL2023: ami-0fedcba9876543210\n\nResources:\n  SecurityGroup:\n    Type: AWS::EC2::SecurityGroup\n    Properties:\n      GroupDescription: !Sub '${Environment}-web-sg'\n      VpcId: !Ref VpcId\n      SecurityGroupIngress:\n        - IpProtocol: tcp\n          FromPort: 443\n          ToPort: 443\n          CidrIp: 0.0.0.0\u002F0\n      Tags:\n        - Key: Name\n          Value: !Sub '${Environment}-web-sg'\n\n  LaunchTemplate:\n    Type: AWS::EC2::LaunchTemplate\n    Properties:\n      LaunchTemplateName: !Sub '${Environment}-web'\n      LaunchTemplateData:\n        ImageId: !FindInMap [RegionAMI, !Ref 'AWS::Region', AL2023]\n        InstanceType: !If [IsProd, t3.large, !Ref InstanceType]\n        MetadataOptions:\n          HttpTokens: required\n        SecurityGroupIds:\n          - !Ref SecurityGroup\n\n  AutoScalingGroup:\n    Type: AWS::AutoScaling::AutoScalingGroup\n    Properties:\n      AutoScalingGroupName: !Sub '${Environment}-web-asg'\n      LaunchTemplate:\n        LaunchTemplateId: !Ref LaunchTemplate\n        Version: !GetAtt LaunchTemplate.LatestVersionNumber\n      MinSize: !If [IsProd, 2, 1]\n      MaxSize: !If [IsProd, 10, 3]\n      DesiredCapacity: !If [IsProd, 4, 1]\n      VPCZoneIdentifier: !Ref SubnetIds\n      TargetGroupARNs:\n        - !Ref TargetGroup\n      HealthCheckType: ELB\n      HealthCheckGracePeriod: 300\n      Tags:\n        - Key: Name\n          Value: !Sub '${Environment}-web'\n          PropagateAtLaunch: true\n    UpdatePolicy:\n      AutoScalingRollingUpdate:\n        MinInstancesInService: !If [IsProd, 2, 0]\n        MaxBatchSize: 1\n        PauseTime: PT5M\n        WaitOnResourceSignals: true\n        SuspendProcesses:\n          - HealthCheck\n          - ReplaceUnhealthy\n          - AZRebalance\n          - AlarmNotification\n          - ScheduledActions\n\n  TargetGroup:\n    Type: AWS::ElasticLoadBalancingV2::TargetGroup\n    Properties:\n      Name: !Sub '${Environment}-web-tg'\n      Port: 8080\n      Protocol: HTTP\n      VpcId: !Ref VpcId\n      TargetType: instance\n      HealthCheckPath: \u002Fhealth\n      HealthCheckIntervalSeconds: 30\n      HealthyThresholdCount: 2\n      UnhealthyThresholdCount: 3\n\nOutputs:\n  SecurityGroupId:\n    Description: Web security group ID\n    Value: !Ref SecurityGroup\n    Export:\n      Name: !Sub '${Environment}-WebSecurityGroup'\n\n  AutoScalingGroupName:\n    Description: ASG name\n    Value: !Ref AutoScalingGroup\n    Export:\n      Name: !Sub '${Environment}-WebASG'\n```\n\n## Stack Operations\n\n```bash\n# Validate a template\naws cloudformation validate-template --template-body file:\u002F\u002Ftemplate.yaml\n\n# Lint with cfn-lint (catches more issues)\ncfn-lint template.yaml\n\n# Create a stack\naws cloudformation create-stack \\\n  --stack-name production-web \\\n  --template-body file:\u002F\u002Ftemplate.yaml \\\n  --parameters \\\n    ParameterKey=Environment,ParameterValue=prod \\\n    ParameterKey=VpcId,ParameterValue=vpc-abc123 \\\n    ParameterKey=SubnetIds,ParameterValue=\"subnet-aaa\\\\,subnet-bbb\" \\\n  --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \\\n  --tags Key=Environment,Value=production Key=Team,Value=platform \\\n  --enable-termination-protection \\\n  --on-failure ROLLBACK\n\n# Wait for stack creation\naws cloudformation wait stack-create-complete --stack-name production-web\n\n# Describe stack status and outputs\naws cloudformation describe-stacks \\\n  --stack-name production-web \\\n  --query \"Stacks[0].{Status:StackStatus,Outputs:Outputs}\" \\\n  --output table\n\n# List stack resources\naws cloudformation list-stack-resources --stack-name production-web \\\n  --query \"StackResourceSummaries[].{Logical:LogicalResourceId,Physical:PhysicalResourceId,Type:ResourceType,Status:ResourceStatus}\" \\\n  --output table\n\n# Delete a stack\naws cloudformation delete-stack --stack-name dev-web\naws cloudformation wait stack-delete-complete --stack-name dev-web\n```\n\n## Change Sets (Safe Updates)\n\n```bash\n# Create a change set to preview changes before applying\naws cloudformation create-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type \\\n  --template-body file:\u002F\u002Ftemplate.yaml \\\n  --parameters \\\n    ParameterKey=Environment,ParameterValue=prod \\\n    ParameterKey=InstanceType,ParameterValue=t3.large \\\n    ParameterKey=VpcId,UsePreviousValue=true \\\n    ParameterKey=SubnetIds,UsePreviousValue=true \\\n  --capabilities CAPABILITY_IAM\n\n# Describe the change set to review planned changes\naws cloudformation describe-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type \\\n  --query \"Changes[].{Action:ResourceChange.Action,Resource:ResourceChange.LogicalResourceId,Type:ResourceChange.ResourceType,Replacement:ResourceChange.Replacement}\" \\\n  --output table\n\n# Execute the change set (apply changes)\naws cloudformation execute-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type\n\n# Wait for update\naws cloudformation wait stack-update-complete --stack-name production-web\n\n# Delete a change set without applying\naws cloudformation delete-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type\n```\n\n## Drift Detection\n\n```bash\n# Start drift detection\nDRIFT_ID=$(aws cloudformation detect-stack-drift \\\n  --stack-name production-web \\\n  --query 'StackDriftDetectionId' --output text)\n\n# Check drift detection status\naws cloudformation describe-stack-drift-detection-status \\\n  --stack-drift-detection-id $DRIFT_ID\n\n# View drifted resources\naws cloudformation describe-stack-resource-drifts \\\n  --stack-name production-web \\\n  --stack-resource-drift-status-filters MODIFIED DELETED \\\n  --query \"StackResourceDrifts[].{Resource:LogicalResourceId,Status:StackResourceDriftStatus,Differences:PropertyDifferences}\" \\\n  --output table\n\n# Detect drift on a specific resource\naws cloudformation detect-stack-resource-drift \\\n  --stack-name production-web \\\n  --logical-resource-id SecurityGroup\n```\n\n## Nested Stacks\n\nParent template:\n\n```yaml\nAWSTemplateFormatVersion: '2010-09-09'\nDescription: Parent stack - full application\n\nParameters:\n  Environment:\n    Type: String\n    AllowedValues: [dev, staging, prod]\n\nResources:\n  NetworkStack:\n    Type: AWS::CloudFormation::Stack\n    Properties:\n      TemplateURL: https:\u002F\u002Fs3.amazonaws.com\u002Fmy-cfn-templates\u002Fnetwork.yaml\n      Parameters:\n        Environment: !Ref Environment\n        VpcCidr: \"10.0.0.0\u002F16\"\n      Tags:\n        - Key: Environment\n          Value: !Ref Environment\n\n  DatabaseStack:\n    Type: AWS::CloudFormation::Stack\n    DependsOn: NetworkStack\n    Properties:\n      TemplateURL: https:\u002F\u002Fs3.amazonaws.com\u002Fmy-cfn-templates\u002Fdatabase.yaml\n      Parameters:\n        Environment: !Ref Environment\n        VpcId: !GetAtt NetworkStack.Outputs.VpcId\n        SubnetIds: !GetAtt NetworkStack.Outputs.PrivateSubnetIds\n\n  AppStack:\n    Type: AWS::CloudFormation::Stack\n    DependsOn: [NetworkStack, DatabaseStack]\n    Properties:\n      TemplateURL: https:\u002F\u002Fs3.amazonaws.com\u002Fmy-cfn-templates\u002Fapp.yaml\n      Parameters:\n        Environment: !Ref Environment\n        VpcId: !GetAtt NetworkStack.Outputs.VpcId\n        SubnetIds: !GetAtt NetworkStack.Outputs.PrivateSubnetIds\n        DbEndpoint: !GetAtt DatabaseStack.Outputs.Endpoint\n\nOutputs:\n  VpcId:\n    Value: !GetAtt NetworkStack.Outputs.VpcId\n  AppUrl:\n    Value: !GetAtt AppStack.Outputs.LoadBalancerDNS\n```\n\n```bash\n# Package nested templates (uploads local references to S3)\naws cloudformation package \\\n  --template-file parent.yaml \\\n  --s3-bucket my-cfn-templates \\\n  --output-template-file packaged.yaml\n\n# Deploy the packaged template\naws cloudformation deploy \\\n  --template-file packaged.yaml \\\n  --stack-name production-app \\\n  --parameter-overrides Environment=prod \\\n  --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND \\\n  --tags Environment=production\n```\n\n## Intrinsic Functions Reference\n\n```yaml\n# Ref - reference a parameter or resource\nSecurityGroupId: !Ref SecurityGroup\n\n# GetAtt - get an attribute of a resource\nSecurityGroupArn: !GetAtt SecurityGroup.GroupId\n\n# Sub - string substitution\nBucketName: !Sub '${Environment}-${AWS::AccountId}-data'\n\n# Join - concatenate strings\nPolicyArn: !Join ['', ['arn:aws:iam::', !Ref 'AWS::AccountId', ':policy\u002FMyPolicy']]\n\n# Select - pick from a list\nFirstSubnet: !Select [0, !Ref SubnetIds]\n\n# Split - split a string\nFirstPart: !Select [0, !Split ['-', !Ref 'AWS::StackName']]\n\n# If - conditional value\nInstanceSize: !If [IsProd, t3.large, t3.micro]\n\n# Equals - condition definition\nConditions:\n  IsProd: !Equals [!Ref Environment, prod]\n\n# ImportValue - cross-stack reference\nVpcId: !ImportValue production-VpcId\n\n# Cidr - generate CIDR blocks\nSubnets: !Cidr [!GetAtt VPC.CidrBlock, 6, 8]\n\n# GetAZs - list availability zones\nAZ: !Select [0, !GetAZs '']\n```\n\n## Stack Policy (Prevent Accidental Replacements)\n\n```bash\n# Apply a stack policy that prevents replacement of the database\naws cloudformation set-stack-policy \\\n  --stack-name production-web \\\n  --stack-policy-body '{\n    \"Statement\": [\n      {\n        \"Effect\": \"Allow\",\n        \"Action\": \"Update:*\",\n        \"Principal\": \"*\",\n        \"Resource\": \"*\"\n      },\n      {\n        \"Effect\": \"Deny\",\n        \"Action\": \"Update:Replace\",\n        \"Principal\": \"*\",\n        \"Resource\": \"LogicalResourceId\u002FDatabase\"\n      },\n      {\n        \"Effect\": \"Deny\",\n        \"Action\": \"Update:Delete\",\n        \"Principal\": \"*\",\n        \"Resource\": \"LogicalResourceId\u002FDatabase\"\n      }\n    ]\n  }'\n```\n\n## Stack Events and Debugging\n\n```bash\n# View stack events (most recent first)\naws cloudformation describe-stack-events \\\n  --stack-name production-web \\\n  --query \"StackEvents[?ResourceStatus=='CREATE_FAILED' || ResourceStatus=='UPDATE_FAILED'].{Time:Timestamp,Resource:LogicalResourceId,Status:ResourceStatus,Reason:ResourceStatusReason}\" \\\n  --output table\n\n# Continue a rollback that is stuck\naws cloudformation continue-update-rollback \\\n  --stack-name production-web \\\n  --resources-to-skip SecurityGroup\n\n# Cancel an in-progress update\naws cloudformation cancel-update-stack --stack-name production-web\n\n# Get template from an existing stack\naws cloudformation get-template \\\n  --stack-name production-web \\\n  --template-stage Processed \\\n  --query TemplateBody \\\n  --output text > current-template.yaml\n```\n\n## Troubleshooting\n\n| Problem | Cause | Fix |\n|---|---|---|\n| CREATE_FAILED on IAM resource | Missing CAPABILITY_IAM | Add `--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM` |\n| Stack stuck in UPDATE_ROLLBACK_FAILED | Resource cannot be rolled back | Use `continue-update-rollback` with `--resources-to-skip` |\n| Nested stack fails | Template URL wrong or S3 access denied | Use `aws cloudformation package` to upload; check bucket policy |\n| Circular dependency error | Two resources reference each other | Break the cycle with a third resource or use `DependsOn` |\n| Drift detected | Manual changes made outside CloudFormation | Re-apply the template or update template to match current state |\n| Change set shows no changes | Template and parameters identical | Verify the diff; check if the change is parameter-only |\n| Template validation error | YAML syntax or invalid resource property | Run `cfn-lint`; check property names against docs |\n| Export name already exists | Another stack uses the same export name | Use unique export names with `!Sub '${AWS::StackName}-Name'` |\n| Delete fails - resource in use | Dependent resource outside the stack | Remove the dependency first; check for SG references |\n\n## Related Skills\n\n- terraform-aws (`terraform-aws`) - Alternative IaC with Terraform\n- aws-iam (`aws-iam`) - IAM resources in templates\n- aws-vpc (`aws-vpc`) - Network infrastructure templates\n- aws-ec2 (`aws-ec2`) - Compute resources in templates\n- aws-s3 (`aws-s3`) - Storage resources in templates\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n","# CloudFormation\n\nDeploy AWS infrastructure with native CloudFormation templates, change sets, nested stacks, and drift detection.\n\n## When to Use This Skill\n\n- Deploying AWS resources using AWS-native Infrastructure as Code\n- Creating repeatable, parameterized infrastructure templates\n- Managing multi-environment deployments (dev, staging, prod) with the same template\n- Implementing safe deployments with change sets and rollback protection\n- Detecting and remediating configuration drift\n- Organizing large infrastructure into nested stacks\n- Exporting\u002Fimporting values between stacks\n\n## Prerequisites\n\n- AWS CLI v2 installed and configured\n- IAM permissions: `cloudformation:*`, plus permissions for all resources in the template\n- (Optional) `cfn-lint` installed for template validation (`pip install cfn-lint`)\n- S3 bucket for storing templates larger than 51,200 bytes\n\n## Template Structure\n\n```yaml\nAWSTemplateFormatVersion: '2010-09-09'\nDescription: Production web application infrastructure\n\nMetadata:\n  AWS::CloudFormation::Interface:\n    ParameterGroups:\n      - Label: { default: \"Environment\" }\n        Parameters: [Environment, InstanceType]\n      - Label: { default: \"Network\" }\n        Parameters: [VpcId, SubnetIds]\n\nParameters:\n  Environment:\n    Type: String\n    AllowedValues: [dev, staging, prod]\n    Default: dev\n\n  InstanceType:\n    Type: String\n    Default: t3.micro\n    AllowedValues: [t3.micro, t3.small, t3.medium, t3.large]\n\n  VpcId:\n    Type: AWS::EC2::VPC::Id\n    Description: VPC to deploy into\n\n  SubnetIds:\n    Type: List\u003CAWS::EC2::Subnet::Id>\n    Description: Subnets for the application\n\nConditions:\n  IsProd: !Equals [!Ref Environment, prod]\n  CreateReadReplica: !Equals [!Ref Environment, prod]\n\nMappings:\n  RegionAMI:\n    us-east-1:\n      AL2023: ami-0abcdef1234567890\n    us-west-2:\n      AL2023: ami-0fedcba9876543210\n\nResources:\n  SecurityGroup:\n    Type: AWS::EC2::SecurityGroup\n    Properties:\n      GroupDescription: !Sub '${Environment}-web-sg'\n      VpcId: !Ref VpcId\n      SecurityGroupIngress:\n        - IpProtocol: tcp\n          FromPort: 443\n          ToPort: 443\n          CidrIp: 0.0.0.0\u002F0\n      Tags:\n        - Key: Name\n          Value: !Sub '${Environment}-web-sg'\n\n  LaunchTemplate:\n    Type: AWS::EC2::LaunchTemplate\n    Properties:\n      LaunchTemplateName: !Sub '${Environment}-web'\n      LaunchTemplateData:\n        ImageId: !FindInMap [RegionAMI, !Ref 'AWS::Region', AL2023]\n        InstanceType: !If [IsProd, t3.large, !Ref InstanceType]\n        MetadataOptions:\n          HttpTokens: required\n        SecurityGroupIds:\n          - !Ref SecurityGroup\n\n  AutoScalingGroup:\n    Type: AWS::AutoScaling::AutoScalingGroup\n    Properties:\n      AutoScalingGroupName: !Sub '${Environment}-web-asg'\n      LaunchTemplate:\n        LaunchTemplateId: !Ref LaunchTemplate\n        Version: !GetAtt LaunchTemplate.LatestVersionNumber\n      MinSize: !If [IsProd, 2, 1]\n      MaxSize: !If [IsProd, 10, 3]\n      DesiredCapacity: !If [IsProd, 4, 1]\n      VPCZoneIdentifier: !Ref SubnetIds\n      TargetGroupARNs:\n        - !Ref TargetGroup\n      HealthCheckType: ELB\n      HealthCheckGracePeriod: 300\n      Tags:\n        - Key: Name\n          Value: !Sub '${Environment}-web'\n          PropagateAtLaunch: true\n    UpdatePolicy:\n      AutoScalingRollingUpdate:\n        MinInstancesInService: !If [IsProd, 2, 0]\n        MaxBatchSize: 1\n        PauseTime: PT5M\n        WaitOnResourceSignals: true\n        SuspendProcesses:\n          - HealthCheck\n          - ReplaceUnhealthy\n          - AZRebalance\n          - AlarmNotification\n          - ScheduledActions\n\n  TargetGroup:\n    Type: AWS::ElasticLoadBalancingV2::TargetGroup\n    Properties:\n      Name: !Sub '${Environment}-web-tg'\n      Port: 8080\n      Protocol: HTTP\n      VpcId: !Ref VpcId\n      TargetType: instance\n      HealthCheckPath: \u002Fhealth\n      HealthCheckIntervalSeconds: 30\n      HealthyThresholdCount: 2\n      UnhealthyThresholdCount: 3\n\nOutputs:\n  SecurityGroupId:\n    Description: Web security group ID\n    Value: !Ref SecurityGroup\n    Export:\n      Name: !Sub '${Environment}-WebSecurityGroup'\n\n  AutoScalingGroupName:\n    Description: ASG name\n    Value: !Ref AutoScalingGroup\n    Export:\n      Name: !Sub '${Environment}-WebASG'\n```\n\n## Stack Operations\n\n```bash\n# Validate a template\naws cloudformation validate-template --template-body file:\u002F\u002Ftemplate.yaml\n\n# Lint with cfn-lint (catches more issues)\ncfn-lint template.yaml\n\n# Create a stack\naws cloudformation create-stack \\\n  --stack-name production-web \\\n  --template-body file:\u002F\u002Ftemplate.yaml \\\n  --parameters \\\n    ParameterKey=Environment,ParameterValue=prod \\\n    ParameterKey=VpcId,ParameterValue=vpc-abc123 \\\n    ParameterKey=SubnetIds,ParameterValue=\"subnet-aaa\\\\,subnet-bbb\" \\\n  --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \\\n  --tags Key=Environment,Value=production Key=Team,Value=platform \\\n  --enable-termination-protection \\\n  --on-failure ROLLBACK\n\n# Wait for stack creation\naws cloudformation wait stack-create-complete --stack-name production-web\n\n# Describe stack status and outputs\naws cloudformation describe-stacks \\\n  --stack-name production-web \\\n  --query \"Stacks[0].{Status:StackStatus,Outputs:Outputs}\" \\\n  --output table\n\n# List stack resources\naws cloudformation list-stack-resources --stack-name production-web \\\n  --query \"StackResourceSummaries[].{Logical:LogicalResourceId,Physical:PhysicalResourceId,Type:ResourceType,Status:ResourceStatus}\" \\\n  --output table\n\n# Delete a stack\naws cloudformation delete-stack --stack-name dev-web\naws cloudformation wait stack-delete-complete --stack-name dev-web\n```\n\n## Change Sets (Safe Updates)\n\n```bash\n# Create a change set to preview changes before applying\naws cloudformation create-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type \\\n  --template-body file:\u002F\u002Ftemplate.yaml \\\n  --parameters \\\n    ParameterKey=Environment,ParameterValue=prod \\\n    ParameterKey=InstanceType,ParameterValue=t3.large \\\n    ParameterKey=VpcId,UsePreviousValue=true \\\n    ParameterKey=SubnetIds,UsePreviousValue=true \\\n  --capabilities CAPABILITY_IAM\n\n# Describe the change set to review planned changes\naws cloudformation describe-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type \\\n  --query \"Changes[].{Action:ResourceChange.Action,Resource:ResourceChange.LogicalResourceId,Type:ResourceChange.ResourceType,Replacement:ResourceChange.Replacement}\" \\\n  --output table\n\n# Execute the change set (apply changes)\naws cloudformation execute-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type\n\n# Wait for update\naws cloudformation wait stack-update-complete --stack-name production-web\n\n# Delete a change set without applying\naws cloudformation delete-change-set \\\n  --stack-name production-web \\\n  --change-set-name update-instance-type\n```\n\n## Drift Detection\n\n```bash\n# Start drift detection\nDRIFT_ID=$(aws cloudformation detect-stack-drift \\\n  --stack-name production-web \\\n  --query 'StackDriftDetectionId' --output text)\n\n# Check drift detection status\naws cloudformation describe-stack-drift-detection-status \\\n  --stack-drift-detection-id $DRIFT_ID\n\n# View drifted resources\naws cloudformation describe-stack-resource-drifts \\\n  --stack-name production-web \\\n  --stack-resource-drift-status-filters MODIFIED DELETED \\\n  --query \"StackResourceDrifts[].{Resource:LogicalResourceId,Status:StackResourceDriftStatus,Differences:PropertyDifferences}\" \\\n  --output table\n\n# Detect drift on a specific resource\naws cloudformation detect-stack-resource-drift \\\n  --stack-name production-web \\\n  --logical-resource-id SecurityGroup\n```\n\n## Nested Stacks\n\nParent template:\n\n```yaml\nAWSTemplateFormatVersion: '2010-09-09'\nDescription: Parent stack - full application\n\nParameters:\n  Environment:\n    Type: String\n    AllowedValues: [dev, staging, prod]\n\nResources:\n  NetworkStack:\n    Type: AWS::CloudFormation::Stack\n    Properties:\n      TemplateURL: https:\u002F\u002Fs3.amazonaws.com\u002Fmy-cfn-templates\u002Fnetwork.yaml\n      Parameters:\n        Environment: !Ref Environment\n        VpcCidr: \"10.0.0.0\u002F16\"\n      Tags:\n        - Key: Environment\n          Value: !Ref Environment\n\n  DatabaseStack:\n    Type: AWS::CloudFormation::Stack\n    DependsOn: NetworkStack\n    Properties:\n      TemplateURL: https:\u002F\u002Fs3.amazonaws.com\u002Fmy-cfn-templates\u002Fdatabase.yaml\n      Parameters:\n        Environment: !Ref Environment\n        VpcId: !GetAtt NetworkStack.Outputs.VpcId\n        SubnetIds: !GetAtt NetworkStack.Outputs.PrivateSubnetIds\n\n  AppStack:\n    Type: AWS::CloudFormation::Stack\n    DependsOn: [NetworkStack, DatabaseStack]\n    Properties:\n      TemplateURL: https:\u002F\u002Fs3.amazonaws.com\u002Fmy-cfn-templates\u002Fapp.yaml\n      Parameters:\n        Environment: !Ref Environment\n        VpcId: !GetAtt NetworkStack.Outputs.VpcId\n        SubnetIds: !GetAtt NetworkStack.Outputs.PrivateSubnetIds\n        DbEndpoint: !GetAtt DatabaseStack.Outputs.Endpoint\n\nOutputs:\n  VpcId:\n    Value: !GetAtt NetworkStack.Outputs.VpcId\n  AppUrl:\n    Value: !GetAtt AppStack.Outputs.LoadBalancerDNS\n```\n\n```bash\n# Package nested templates (uploads local references to S3)\naws cloudformation package \\\n  --template-file parent.yaml \\\n  --s3-bucket my-cfn-templates \\\n  --output-template-file packaged.yaml\n\n# Deploy the packaged template\naws cloudformation deploy \\\n  --template-file packaged.yaml \\\n  --stack-name production-app \\\n  --parameter-overrides Environment=prod \\\n  --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND \\\n  --tags Environment=production\n```\n\n## Intrinsic Functions Reference\n\n```yaml\n# Ref - reference a parameter or resource\nSecurityGroupId: !Ref SecurityGroup\n\n# GetAtt - get an attribute of a resource\nSecurityGroupArn: !GetAtt SecurityGroup.GroupId\n\n# Sub - string substitution\nBucketName: !Sub '${Environment}-${AWS::AccountId}-data'\n\n# Join - concatenate strings\nPolicyArn: !Join ['', ['arn:aws:iam::', !Ref 'AWS::AccountId', ':policy\u002FMyPolicy']]\n\n# Select - pick from a list\nFirstSubnet: !Select [0, !Ref SubnetIds]\n\n# Split - split a string\nFirstPart: !Select [0, !Split ['-', !Ref 'AWS::StackName']]\n\n# If - conditional value\nInstanceSize: !If [IsProd, t3.large, t3.micro]\n\n# Equals - condition definition\nConditions:\n  IsProd: !Equals [!Ref Environment, prod]\n\n# ImportValue - cross-stack reference\nVpcId: !ImportValue production-VpcId\n\n# Cidr - generate CIDR blocks\nSubnets: !Cidr [!GetAtt VPC.CidrBlock, 6, 8]\n\n# GetAZs - list availability zones\nAZ: !Select [0, !GetAZs '']\n```\n\n## Stack Policy (Prevent Accidental Replacements)\n\n```bash\n# Apply a stack policy that prevents replacement of the database\naws cloudformation set-stack-policy \\\n  --stack-name production-web \\\n  --stack-policy-body '{\n    \"Statement\": [\n      {\n        \"Effect\": \"Allow\",\n        \"Action\": \"Update:*\",\n        \"Principal\": \"*\",\n        \"Resource\": \"*\"\n      },\n      {\n        \"Effect\": \"Deny\",\n        \"Action\": \"Update:Replace\",\n        \"Principal\": \"*\",\n        \"Resource\": \"LogicalResourceId\u002FDatabase\"\n      },\n      {\n        \"Effect\": \"Deny\",\n        \"Action\": \"Update:Delete\",\n        \"Principal\": \"*\",\n        \"Resource\": \"LogicalResourceId\u002FDatabase\"\n      }\n    ]\n  }'\n```\n\n## Stack Events and Debugging\n\n```bash\n# View stack events (most recent first)\naws cloudformation describe-stack-events \\\n  --stack-name production-web \\\n  --query \"StackEvents[?ResourceStatus=='CREATE_FAILED' || ResourceStatus=='UPDATE_FAILED'].{Time:Timestamp,Resource:LogicalResourceId,Status:ResourceStatus,Reason:ResourceStatusReason}\" \\\n  --output table\n\n# Continue a rollback that is stuck\naws cloudformation continue-update-rollback \\\n  --stack-name production-web \\\n  --resources-to-skip SecurityGroup\n\n# Cancel an in-progress update\naws cloudformation cancel-update-stack --stack-name production-web\n\n# Get template from an existing stack\naws cloudformation get-template \\\n  --stack-name production-web \\\n  --template-stage Processed \\\n  --query TemplateBody \\\n  --output text > current-template.yaml\n```\n\n## Troubleshooting\n\n| Problem | Cause | Fix |\n|---|---|---|\n| CREATE_FAILED on IAM resource | Missing CAPABILITY_IAM | Add `--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM` |\n| Stack stuck in UPDATE_ROLLBACK_FAILED | Resource cannot be rolled back | Use `continue-update-rollback` with `--resources-to-skip` |\n| Nested stack fails | Template URL wrong or S3 access denied | Use `aws cloudformation package` to upload; check bucket policy |\n| Circular dependency error | Two resources reference each other | Break the cycle with a third resource or use `DependsOn` |\n| Drift detected | Manual changes made outside CloudFormation | Re-apply the template or update template to match current state |\n| Change set shows no changes | Template and parameters identical | Verify the diff; check if the change is parameter-only |\n| Template validation error | YAML syntax or invalid resource property | Run `cfn-lint`; check property names against docs |\n| Export name already exists | Another stack uses the same export name | Use unique export names with `!Sub '${AWS::StackName}-Name'` |\n| Delete fails - resource in use | Dependent resource outside the stack | Remove the dependency first; check for SG references |\n\n## Related Skills\n\n- terraform-aws (`terraform-aws`) - Alternative IaC with Terraform\n- aws-iam (`aws-iam`) - IAM resources in templates\n- aws-vpc (`aws-vpc`) - Network infrastructure templates\n- aws-ec2 (`aws-ec2`) - Compute resources in templates\n- aws-s3 (`aws-s3`) - Storage resources in templates\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n",{"name":5,"risk":24,"source":42,"license":14,"category":43,"metadata":44,"date_added":47,"description":7,"source_repo":48,"source_type":28,"compatibility":49,"license_source":50},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","devops",{"author":45,"version":46},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant OS\u002Fplatform tooling and privileged access where noted. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Fcloudformation","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill cloudformation",{"tool":62,"command":63},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill cloudformation",{"tool":65,"command":66},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill cloudformation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fcloudformation\u002FSKILL.md",true,[],[71,90,114,138,155,175],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":37},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[],[78,79,80,81,82,83,73,84,34,33,85,31,28,18,86,24,87,88,21,89],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","configure","active","scope","scripts","implementing",{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":37},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[97,98,99,100,101,102,103,104,105,106,107,108,109,31,110,28,111,112,24,113],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":37},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[121,122,123,124,125,126,127,35,128,129,130,131,132,28,18,133,134,135,136,137],"transcript","youtube transcript","youtube","safe","github","codex","research","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":37},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[],[121,122,123,145,124,146,125,126,35,147,148,149,150,130,151,28,18,152,153,154],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":37},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[],[123,162,163,101,124,164,165,166,167,35,149,168,169,170,171,18,172,133,173,174],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":37},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[],[182,123,183,184,124,146,147,185,186,148,149,150,130,187,151,28,18,152,188,136],"youtube full","full","google","server","dlp","credits","automatic"]