infrastructure-as-code
Terraform, CloudFormation, ARM templates, Kubernetes manifests, and state management best practices
What this skill does
# Infrastructure as Code ## Terraform Best Practices and Patterns ### Core Concepts - **Declarative Syntax**: Describe desired state, not execution steps - **State Management**: Terraform state tracks infrastructure resources - **Providers**: Plugins for interacting with cloud providers and services - **Modules**: Reusable components for infrastructure ### Best Practices - **State Management** - Use remote state (S3, Azure Storage, GCS) for collaboration - Enable state locking with DynamoDB, Azure Blob lease, or GCS lock - Separate state files by environment (dev, staging, prod) - Use state workspaces for environment isolation - Implement state versioning and backups - **Module Structure** - Use modules for reusable infrastructure components - Follow standard module structure: `main.tf`, `variables.tf`, `outputs.tf` - Document modules with README.md - Version control modules in separate repositories - Use module registries for sharing - **Resource Naming** - Use consistent naming conventions - Include environment and region in resource names - Use `name_prefix` or `name_suffix` for dynamic naming - Avoid hard-coded names where possible - **Variables and Outputs** - Use variables for configurable values - Provide sensible defaults for non-critical variables - Use variable validation for type checking - Output important resource attributes for other modules to consume - **Provider Configuration** - Use provider blocks for cloud provider authentication - Configure provider regions and endpoints - Use provider aliases for multi-region or multi-cloud deployments - Store provider credentials securely (environment variables, vault) ### Terraform Patterns - **Multi-Environment Pattern**: Use workspaces or separate state files - **Multi-Region Pattern**: Use provider aliases and module replication - **Multi-Cloud Pattern**: Use multiple providers and provider aliases - **GitOps Pattern**: Use Terraform with GitOps tools (Atlantis, TF-Controller) - **Zero-Downtime Pattern**: Use `create_before_destroy` and lifecycle rules ### Terraform Commands - `terraform init`: Initialize working directory and download providers - `terraform plan`: Preview changes before applying - `terraform apply`: Apply configuration changes - `terraform destroy`: Destroy infrastructure - `terraform import`: Import existing resources into state - `terraform state mv`: Move resources in state - `terraform refresh`: Update state file with real resources ## AWS CloudFormation Templates ### Core Concepts - **Templates**: JSON or YAML files describing AWS resources - **Stacks**: Collections of resources managed as a single unit - **Change Sets**: Preview changes before executing - **Parameters**: Input values for template customization - **Outputs**: Values returned after stack creation ### Best Practices - **Template Organization** - Use YAML for better readability - Use nested stacks for modularity - Use CloudFormation exports for cross-stack references - Use intrinsic functions for dynamic values - Use mappings for environment-specific values - **Resource Management** - Use DeletionPolicy for resource protection - Use UpdateReplacePolicy for resource replacement behavior - Use DependsOn for explicit resource dependencies - Use CreationPolicy and UpdatePolicy for resource lifecycle management - **Parameter and Output Design** - Use parameters for configurable values - Use parameter constraints for validation - Use default values for non-critical parameters - Output important resource attributes - **Change Set Management** - Always create change sets before updating stacks - Review change sets carefully before execution - Use change sets for zero-downtime deployments - Cancel change sets if changes are unexpected ### CloudFormation Intrinsic Functions - `!Ref`: Reference parameters or resources - `!GetAtt`: Get resource attributes - `!Sub`: String substitution - `!Join`: Join strings with a delimiter - `!Select`: Select from a list - `!Split`: Split a string into a list - `!If`: Conditional logic - `!Equals`: Compare values - `!And`, `!Or`, `!Not`: Boolean logic - `!FindInMap`: Look up values in a mapping - `!ImportValue`: Import exported values from other stacks ## Azure ARM Templates ### Core Concepts - **Templates**: JSON files describing Azure resources - **Resource Groups**: Logical containers for Azure resources - **Deployments**: Operations to create or update resources - **Parameters**: Input values for template customization - **Variables**: Internal values for template logic ### Best Practices - **Template Structure** - Use parameter files for environment-specific values - Use linked templates for modularity - Use deployment scripts for post-deployment actions - Use template specs for reusability - Use Azure Blueprints for governance - **Resource Management** - Use dependsOn for explicit dependencies - Use copy loops for multiple resource instances - Use deployment mode (incremental vs complete) - Use resource identity for managed identities - **Parameter and Variable Design** - Use parameters for external configuration - Use variables for internal calculations - Use parameter decorators for validation - Use secure strings for sensitive values ### ARM Template Functions - `parameters()`: Reference parameters - `variables()`: Reference variables - `reference()`: Get resource properties - `concat()`: Concatenate strings - `substring()`: Extract substring - `replace()`: Replace string - `toUpper()`, `toLower()`: Case conversion - `uniqueString()`: Generate unique strings - `resourceId()`: Get resource ID - `subscription()`, `resourceGroup()`: Get deployment scope ## Kubernetes Manifests and Helm Charts ### Kubernetes Manifests - **Core Concepts** - YAML files describing Kubernetes resources - Declarative configuration for pods, services, deployments, etc. - Use kubectl for applying manifests - **Best Practices** - Use labels and selectors for resource organization - Use namespaces for resource isolation - Use resource requests and limits for resource management - Use liveness and readiness probes for health checks - Use ConfigMaps and Secrets for configuration - Use persistent volumes for data persistence - Use services for service discovery - Use ingress for external access - **Common Resources** - Pod: Smallest deployable unit - Deployment: Manages replica sets and pods - Service: Exposes pods as network services - ConfigMap: Stores configuration data - Secret: Stores sensitive data - PersistentVolumeClaim: Claims storage - Ingress: Manages external access to services - Namespace: Logical partition for resources ### Helm Charts - **Core Concepts** - Helm is a package manager for Kubernetes - Charts are packages of Kubernetes manifests - Values files for chart customization - Templates for dynamic manifest generation - **Best Practices** - Use semantic versioning for chart versions - Use Chart.yaml for chart metadata - Use values.yaml for default values - Use values files for environment-specific configuration - Use templates for dynamic manifest generation - Use Helm hooks for lifecycle events - Use chart dependencies for modularity - Document charts with README.md - **Helm Commands** - `helm create`: Create a new chart - `helm install`: Install a chart - `helm upgrade`: Upgrade a release - `helm uninstall`: Uninstall a release - `helm template`: Render templates - `helm lint`: Validate charts - `helm repo add`: Add chart repository ## Ansible Playbooks ### Core Concepts - **Playbooks**: YAML files describing automation tasks - **Modules**: Reusable units of work - **Inventory**: List of managed hosts - **Roles**: Organized collections of playbooks, tasks, and files ### Best Practices - **Playbook Structure** - Use descriptive playbook names - Use roles for modularity
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.