Skill 3.3.9

Use AWS AI tools to support CI/CD workflows (for example, automated deployment approvals, environment provisioning, post-deployment validation).

Key Concepts

Automated reviews and approvals. The Kiro CLI runs in headless mode with kiro-cli chat --no-interactive and a prompt, authenticated by a KIRO_API_KEY environment variable that is stored in AWS Secrets Manager or the CI system's secret store. Tool permissions are granted up front, ideally only read-only tools with --trust-tools, so the reviewer cannot change the repository. A build step can review a pull request for security issues or summarise the risk of a change. In CodePipeline, that summary can accompany a manual approval action, or a Lambda invoke action can call Amazon Bedrock to produce it, but the release decision stays with a person or with deterministic checks such as test results and alarms.

Environment provisioning. An AI agent can draft AWS CDK, CloudFormation or AWS SAM code from a spec, for example a new test environment with a queue, a table and a function. The template is committed, reviewed, checked with cfn-lint and a change set, and deployed by the pipeline's role, never by the agent with broad personal credentials. Steering files can hold the organisation's infrastructure rules, such as mandatory encryption and tags, so that the drafts follow them.

Post-deployment validation. AI tools can generate smoke tests and CloudWatch Synthetics canary scripts from the API definition, and the pipeline runs them after each deployment or in a CodeDeploy AfterAllowTraffic hook. If an alarm fires after a release, CodeDeploy rolls back automatically, and CloudWatch investigations can analyse the alarm, recent deployment events and changes to suggest a cause.

AI steps in a pipeline are themselves controlled: least-privilege roles, secrets in Secrets Manager, time limits on each job, logged prompts and outputs with sensitive data masked, and a manual approval before production for any change an agent proposed.