# Set up CI/CD and infrastructure as code

CI/CD pipelines and IaC templates with environments, checks, and rollback.

- Topic: Software Development
- Framework: RCTFVV
- Level: Advanced
- Tags: Coding, Sales, Plan, Code, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/set-up-ci-cd-and-infrastructure-as-code

## Prompt

```text
Role: Act as a DevOps / SRE engineer provisioning a service the standard way.

Context: Service and its requirements (compute, storage, networking, scaling, availability): [REQUIREMENTS]. Cloud / platform and IaC tool: [PLATFORM_TOOL]. Existing modules / standards to reuse: [STANDARDS]. Security and compliance requirements (network, secrets, IAM, logging): [SECURITY_REQS]. Environments: [ENVIRONMENTS]. Deployment strategy: [DEPLOY_STRATEGY].

Task: Produce: (1) the IaC for the service using existing modules/standards where possible, parameterised per environment, with secrets and IAM handled per policy; (2) a CI/CD pipeline outline - stages, quality/security gates, approvals, deployment strategy, health checks, and rollback; (3) the observability wiring (metrics, logs, alerts) that should ship with it.

Format: Sections: IaC (code, per resource) | Pipeline outline (stages + gates) | Observability. Code in fenced blocks.

Verification: Do not hardcode secrets or account IDs - use variables/parameters and note where values come from. Flag anything that deviates from the stated standards or security requirements.

Validation: Walk a deploy and a failed deploy through the pipeline: does the rollback actually restore service, and do the gates catch a bad build? Fix the weak point.
```

## What to fill in

- REQUIREMENTS
- PLATFORM_TOOL
- STANDARDS
- SECURITY_REQS
- ENVIRONMENTS
- DEPLOY_STRATEGY

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
