> For the complete documentation index, see [llms.txt](https://docs.gomboc.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gomboc.ai/orl/agent-skills/examples/inline-value-with-comment-rule.md).

# Inline Value with Comment

Set the attribute to a default value and add an inline comment listing all valid options. Useful when engineers should see alternatives without leaving the file.

## Prompt

The following can be used with the [gomboc-enterprise-skills](/orl/agent-skills/gomboc-enterprise-skills.md).

```markdown
/gomboc:fix

I want to create an ORL rule that checks that the AMI used for EC2 instances or launch configurations is one of the following:

- ami-0a1b2c3d4e5f67890
- ami-0987654321fedcba0
- ami-0ff11223344556677
- ami-0abcdef1234567890
- ami-0123456789abcdef0

If the value is not one of those, then use the first one listed as the value.  Then add an inline comment after the value with all the values pipe-separated (`|`).
```

{% hint style="info" %}
Use `/gomboc-community:fix` if you have the [gomboc-community-skills](/orl/agent-skills/gomboc-community-skills.md) installed.
{% endhint %}

Specify both the default value and the comment format (pipe-separated list).

## Rule Output Example

```yaml
---
type: Ruleset
version: v1
metadata:
  name: enforce-approved-ami
  description: |
    Ensures that aws_instance and aws_launch_configuration resources use only approved AMI IDs.
spec:
  template:
    language: terraform
    audit_language: ast
  rules:
    - name: enforce-approved-ami-aws-instance
      audit: |
        {{ aResource("aws_instance", anAttributeValue("ami", "(#not-match? @value \"ami-0a1b2c3d4e5f67890|ami-0987654321fedcba0|ami-0ff11223344556677|ami-0abcdef1234567890|ami-0123456789abcdef0\")")) }}
      remediation:
        - command: replace
          path: value
          value: '"ami-0a1b2c3d4e5f67890" # ami-0a1b2c3d4e5f67890 | ami-0987654321fedcba0 | ami-0ff11223344556677 | ami-0abcdef1234567890 | ami-0123456789abcdef0'

    - name: enforce-approved-ami-aws-launch-configuration
      audit: |
        {{ aResource("aws_launch_configuration", anAttributeValue("image_id", "(#not-match? @value \"ami-0a1b2c3d4e5f67890|ami-0987654321fedcba0|ami-0ff11223344556677|ami-0abcdef1234567890|ami-0123456789abcdef0\")")) }}
      remediation:
        - command: replace
          path: value
          value: '"ami-0a1b2c3d4e5f67890" # ami-0a1b2c3d4e5f67890 | ami-0987654321fedcba0 | ami-0ff11223344556677 | ami-0abcdef1234567890 | ami-0123456789abcdef0'
```

Each rule audits one resource type. Invalid AMIs are replaced with the first allowlisted value and an inline comment showing every option.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gomboc.ai/orl/agent-skills/examples/inline-value-with-comment-rule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
