{"id":"765028db-48bb-4c73-9dee-b66658e4353b","shortId":"sjeU3R","kind":"skill","title":"create-infrastructure","tagline":"Generate Harness Infrastructure Definition YAML for deployment targets and create via MCP. Use when user says \"create infrastructure\", \"infrastructure definition\", \"k8s cluster config\", \"deployment target\", or wants to configure where workloads run.","description":"# Create Infrastructure\n\nGenerate Harness Infrastructure Definition YAML and push via MCP.\n\n## Instructions\n\n1. **Identify infrastructure type** - KubernetesDirect, KubernetesGcp (GKE), KubernetesAzure (AKS), ECS, or ServerlessAwsLambda\n2. **Ensure prerequisites exist** - The environment and cloud/cluster connector must be created first\n3. **Generate YAML** using the templates below, referencing the correct connector and environment\n4. **Create via MCP** using `harness_create` with resource_type `infrastructure`\n\n## Infrastructure Types\n\n### KubernetesDirect\n```yaml\ninfrastructureDefinition:\n  name: K8s Production\n  identifier: k8s_prod\n  orgIdentifier: default\n  projectIdentifier: my_project\n  environmentRef: prod\n  deploymentType: Kubernetes\n  type: KubernetesDirect\n  spec:\n    connectorRef: k8s_connector\n    namespace: my-app-prod\n    releaseName: release-<+INFRA_KEY_SHORT_ID>\n  allowSimultaneousDeployments: false\n```\n\n### KubernetesGcp (GKE)\n```yaml\ninfrastructureDefinition:\n  name: GKE Cluster\n  identifier: gke_prod\n  environmentRef: prod\n  deploymentType: Kubernetes\n  type: KubernetesGcp\n  spec:\n    connectorRef: gcp_connector\n    cluster: my-gke-cluster\n    namespace: my-app\n    releaseName: release-<+INFRA_KEY_SHORT_ID>\n```\n\n### KubernetesAzure (AKS)\n```yaml\ninfrastructureDefinition:\n  name: AKS Cluster\n  identifier: aks_prod\n  environmentRef: prod\n  deploymentType: Kubernetes\n  type: KubernetesAzure\n  spec:\n    connectorRef: azure_connector\n    subscriptionId: <subscription_id>\n    resourceGroup: my-rg\n    cluster: my-aks-cluster\n    namespace: my-app\n    releaseName: release-<+INFRA_KEY_SHORT_ID>\n```\n\n### ECS\n```yaml\ninfrastructureDefinition:\n  name: ECS Fargate\n  identifier: ecs_prod\n  environmentRef: prod\n  deploymentType: ECS\n  type: ECS\n  spec:\n    connectorRef: aws_connector\n    region: us-east-1\n    cluster: my-ecs-cluster\n```\n\n### ServerlessAwsLambda\n```yaml\ninfrastructureDefinition:\n  name: Lambda\n  identifier: lambda_prod\n  environmentRef: prod\n  deploymentType: ServerlessAwsLambda\n  type: ServerlessAwsLambda\n  spec:\n    connectorRef: aws_connector\n    region: us-east-1\n    stage: prod\n```\n\n### AzureWebApp\n```yaml\ninfrastructureDefinition:\n  name: Azure Web App\n  identifier: azure_webapp_prod\n  environmentRef: prod\n  deploymentType: AzureWebApp\n  type: AzureWebApp\n  spec:\n    connectorRef: azure_connector\n    subscriptionId: <subscription_id>\n    resourceGroup: my-rg\n```\n\n### Asg (Auto Scaling Group)\n```yaml\ninfrastructureDefinition:\n  name: ASG Production\n  identifier: asg_prod\n  environmentRef: prod\n  deploymentType: Asg\n  type: Asg\n  spec:\n    connectorRef: aws_connector\n    region: us-east-1\n```\n\n### GoogleCloudFunctions\n```yaml\ninfrastructureDefinition:\n  name: Cloud Functions\n  identifier: gcf_prod\n  environmentRef: prod\n  deploymentType: GoogleCloudFunctions\n  type: GoogleCloudFunctions\n  spec:\n    connectorRef: gcp_connector\n    region: us-central1\n    project: my-gcp-project\n```\n\n### Pdc (Physical Data Center)\n```yaml\ninfrastructureDefinition:\n  name: On-Prem Servers\n  identifier: pdc_prod\n  environmentRef: prod\n  deploymentType: Ssh\n  type: Pdc\n  spec:\n    connectorRef: pdc_connector\n    hosts:\n      - host1.example.com\n      - host2.example.com\n```\n\n## Creating via MCP\n\n```\nCall MCP tool: harness_create\nParameters:\n  resource_type: \"infrastructure\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n  body: <infrastructure YAML>\n```\n\n## Examples\n\n- \"Create a K8s infrastructure for prod\" - KubernetesDirect with prod namespace\n- \"Set up GKE infrastructure\" - KubernetesGcp with GCP connector\n- \"Create ECS Fargate infrastructure\" - ECS type with AWS connector\n- \"Create Azure Web App infrastructure\" - AzureWebApp type with subscription and resource group\n- \"Set up on-prem infrastructure\" - Pdc type with host list for SSH deployments\n\n## Performance Notes\n\n- Verify the referenced connector and environment exist before creating the infrastructure definition.\n- Ensure namespace and cluster names are accurate — typos will cause deployment failures.\n- Use `<+INFRA_KEY_SHORT_ID>` in releaseName to guarantee uniqueness across deployments.\n\n## Troubleshooting\n\n- `CONNECTOR_NOT_FOUND` - Create the cloud/K8s connector first\n- `ENVIRONMENT_NOT_FOUND` - Create the environment first\n- `releaseName` must be unique per deployment; use `<+INFRA_KEY_SHORT_ID>`\n- `deploymentType` must match the service definition's type (e.g., Kubernetes service needs KubernetesDirect infra)\n- `allowSimultaneousDeployments: false` is the default; set to `true` only if concurrent deploys are safe","tags":["create","infrastructure","harness","skills","agent-skills","agents"],"capabilities":["skill","source-harness","skill-create-infrastructure","topic-agent-skills","topic-agents"],"categories":["harness-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/harness/harness-skills/create-infrastructure","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add harness/harness-skills","source_repo":"https://github.com/harness/harness-skills","install_from":"skills.sh"}},"qualityScore":"0.457","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 15 github stars · SKILL.md body (4,571 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:06:29.253Z","embedding":null,"createdAt":"2026-05-09T01:05:27.874Z","updatedAt":"2026-05-18T19:06:29.253Z","lastSeenAt":"2026-05-18T19:06:29.253Z","tsv":"'1':48,234,262,317 '2':60 '3':73 '4':86 'accur':464 'across':480 'ak':56,172,176,179,199 'allowsimultaneousdeploy':134,523 'app':126,164,204,271,421 'asg':291,298,301,306,308 'auto':292 'aw':228,256,311,416 'azur':189,269,273,284,419 'azurewebapp':265,279,281,423 'bodi':389 'call':376 'caus':467 'center':349 'central1':340 'cloud':322 'cloud/cluster':67 'cloud/k8s':488 'cluster':25,142,156,160,177,196,200,235,239,461 'concurr':533 'config':26 'configur':32 'connector':68,83,122,155,190,229,257,285,312,336,369,408,417,449,483,489 'connectorref':120,153,188,227,255,283,310,334,367 'correct':82 'creat':2,13,20,36,71,87,92,373,380,391,409,418,454,486,494 'create-infrastructur':1 'data':348 'default':109,527 'definit':7,23,41,457,514 'deploy':10,27,443,468,481,503,534 'deploymenttyp':115,148,183,222,250,278,305,329,362,509 'e.g':517 'east':233,261,316 'ec':57,211,215,218,223,225,238,410,413 'ensur':61,458 'environ':65,85,451,491,496 'environmentref':113,146,181,220,248,276,303,327,360 'exampl':390 'exist':63,452 'failur':469 'fals':135,524 'fargat':216,411 'first':72,490,497 'found':485,493 'function':323 'gcf':325 'gcp':154,335,344,407 'generat':4,38,74 'gke':54,137,141,144,159,403 'googlecloudfunct':318,330,332 'group':294,429 'guarante':478 'har':5,39,91,379 'host':370,439 'host1.example.com':371 'host2.example.com':372 'id':133,170,210,386,388,474,508 'identifi':49,105,143,178,217,245,272,300,324,357 'infra':130,167,207,471,505,522 'infrastructur':3,6,21,22,37,40,50,96,97,384,394,404,412,422,435,456 'infrastructuredefinit':101,139,174,213,242,267,296,320,351 'instruct':47 'k8s':24,103,106,121,393 'key':131,168,208,472,506 'kubernet':116,149,184,518 'kubernetesazur':55,171,186 'kubernetesdirect':52,99,118,397,521 'kubernetesgcp':53,136,151,405 'lambda':244,246 'list':440 'match':511 'mcp':15,46,89,375,377 'must':69,499,510 'my-aks-clust':197 'my-app':162,202 'my-app-prod':124 'my-ecs-clust':236 'my-gcp-project':342 'my-gke-clust':157 'my-rg':193,288 'name':102,140,175,214,243,268,297,321,352,462 'namespac':123,161,201,400,459 'need':520 'note':445 'on-prem':353,432 'org':385 'orgidentifi':108 'paramet':381 'pdc':346,358,365,368,436 'per':502 'perform':444 'physic':347 'prem':355,434 'prerequisit':62 'prod':107,114,127,145,147,180,182,219,221,247,249,264,275,277,302,304,326,328,359,361,396,399 'product':104,299 'project':112,341,345,387 'projectidentifi':110 'push':44 'referenc':80,448 'region':230,258,313,337 'releas':129,166,206 'releasenam':128,165,205,476,498 'resourc':94,382,428 'resourcegroup':192,287 'rg':195,290 'run':35 'safe':536 'say':19 'scale':293 'server':356 'serverlessawslambda':59,240,251,253 'servic':513,519 'set':401,430,528 'short':132,169,209,473,507 'skill' 'skill-create-infrastructure' 'source-harness' 'spec':119,152,187,226,254,282,309,333,366 'ssh':363,442 'stage':263 'subscript':426 'subscriptionid':191,286 'target':11,28 'templat':78 'tool':378 'topic-agent-skills' 'topic-agents' 'troubleshoot':482 'true':530 'type':51,95,98,117,150,185,224,252,280,307,331,364,383,414,424,437,516 'typo':465 'uniqu':479,501 'us':232,260,315,339 'us-central1':338 'us-east':231,259,314 'use':16,76,90,470,504 'user':18 'verifi':446 'via':14,45,88,374 'want':30 'web':270,420 'webapp':274 'workload':34 'yaml':8,42,75,100,138,173,212,241,266,295,319,350","prices":[{"id":"a070a618-d9cf-4611-bf11-cc0dacadd1ed","listingId":"765028db-48bb-4c73-9dee-b66658e4353b","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"harness","category":"harness-skills","install_from":"skills.sh"},"createdAt":"2026-05-09T01:05:27.874Z"}],"sources":[{"listingId":"765028db-48bb-4c73-9dee-b66658e4353b","source":"github","sourceId":"harness/harness-skills/create-infrastructure","sourceUrl":"https://github.com/harness/harness-skills/tree/main/skills/create-infrastructure","isPrimary":false,"firstSeenAt":"2026-05-09T01:05:27.874Z","lastSeenAt":"2026-05-18T19:06:29.253Z"}],"details":{"listingId":"765028db-48bb-4c73-9dee-b66658e4353b","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"harness","slug":"create-infrastructure","github":{"repo":"harness/harness-skills","stars":15,"topics":["agent-skills","agents"],"license":"apache-2.0","html_url":"https://github.com/harness/harness-skills","pushed_at":"2026-05-13T01:28:28Z","description":"A collection of structured AI agent skills that   enable Claude Code, Cursor, GitHub Copilot, and   other AI coding assistants to create, operate,   debug, and govern Harness CI/CD workflows through   natural language.","skill_md_sha":"1cbabd081025bae8c1ed2ca5fc80c5875b6fa7fa","skill_md_path":"skills/create-infrastructure/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/harness/harness-skills/tree/main/skills/create-infrastructure"},"layout":"multi","source":"github","category":"harness-skills","frontmatter":{"name":"create-infrastructure","license":"Apache-2.0","description":"Generate Harness Infrastructure Definition YAML for deployment targets and create via MCP. Use when user says \"create infrastructure\", \"infrastructure definition\", \"k8s cluster config\", \"deployment target\", or wants to configure where workloads run.","compatibility":"Requires Harness MCP v2 server (harness-mcp-v2)"},"skills_sh_url":"https://skills.sh/harness/harness-skills/create-infrastructure"},"updatedAt":"2026-05-18T19:06:29.253Z"}}