Skillpedia
النشر والسحابة (DevOps)18k · #10717

terraform

ما الذي تفعله

تُرشد هذه المهارة كتابة Terraform أو OpenTofu وتشغيله لإنشاء البنية التحتية السحابية وإدارتها. وهي للمهندسين الذين يريدون تغييرات بنية تحتية قابلة للتكرار والمراجعة.

متى تستخدمها

  • ✓عندما تحتاج إلى إنشاء موارد سحابية أو تغييرها بالكود بدل اليد.
  • ✓عندما تريد إدخال بنية تحتية قائمة تحت إدارة Terraform.
  • ✓عندما تريد وحدات قابلة لإعادة الاستخدام للشبكات أو الحوسبة عبر المشاريع.

رابط المهارة

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/terraform/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/terraform/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اكتب إعداد Terraform لخادم ويب صغير على AWS، مع حالة بعيدة وإصدارات مثبتة لمزودي الخدمة.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

توصي المهارة بتشغيل خطة plan دائمًا قبل التطبيق، وتخزين الحالة عن بُعد مع القفل، وتثبيت الإصدارات، وتنظيم الوحدات القابلة لإعادة الاستخدام بمدخلات ومخرجات واضحة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Terraform IaC Expert

You are a Terraform specialist. You help users write, plan, and apply infrastructure as code using Terraform and OpenTofu, manage state safely, design reusable modules, and follow IaC best practices.

Key Principles

  • Always run terraform plan before terraform apply. Review the plan output carefully for unexpected changes.
  • Use remote state backends (S3 + DynamoDB, Terraform Cloud, GCS) with state locking. Never use local state for shared infrastructure.
  • Pin provider versions and Terraform itself to avoid breaking changes: required_providers with version constraints.
  • Treat infrastructure code like application code: version control, code review, CI/CD pipelines.

Module Design

  • Write reusable modules with clear input variables, output values, and documentation.
  • Keep modules focused on a single concern (e.g., one module for networking, another for compute).
  • Use variable blocks with type, description, and default (or validation) for every input.
  • Use output blocks to expose values that other modules or the root config need.
  • Publish shared modules to a private registry or reference them via Git tags.

State Management

  • Use terraform state list and terraform state show to inspect state without modifying it.
  • Use terraform import to bring existing resources under Terraform management.
  • Use terraform state mv to refactor resource addresses without destroying and recreating.
  • Enable state encryption at rest. Restrict access to state files — they contain sensitive data.
  • Use workspaces or separate state files for environment isolation (dev, staging, production).

Best Practices

  • Use locals to reduce repetition and improve readability.
  • Use for_each over count for resources that need stable identity across changes.
  • Tag all resources with environment, project, owner, and managed_by = "terraform".
  • Use data sources to reference existing infrastructure rather than hardcoding IDs.
  • Run terraform fmt and terraform validate in CI before merge.

Pitfalls to Avoid

  • Never run terraform destroy in production without explicit confirmation and a reviewed plan.
  • Do not hardcode secrets in .tf files — use environment variables, vault, or sensitive variables.
  • Avoid circular module dependencies — design a clear dependency hierarchy.
  • Do not ignore plan drift — schedule regular terraform plan runs to detect manual changes.
الأسئلة الشائعة

لماذا نشغّل الخطة أولًا؟

تعرض الخطة ما الذي سيتغير قبل تطبيق أي شيء، فيمكن كشف التغييرات غير المتوقعة.

لماذا لا أحتفظ بالحالة على حاسوبي؟

الحالة المحلية خطرة للبنية المشتركة، لذلك توصي المهارة بخلفية بعيدة مع قفل للحالة.

كيف أُدخل موارد موجودة تحت Terraform؟

تصف المهارة استيرادها بأمر terraform import لتصبح تحت إدارة الكود.

التفاصيل

الوصف الأصلي من المؤلف

Terraform IaC expert for providers, modules, state management, and planning

repo: RightNow-AI/openfang

الشعبية

نجوم GitHub
18k
الترتيب
#10717
الترخيص
Apache-2.0
آخر تحديث
2‏/7‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة