# Environments

Environment is an instance of an Environment template, analogy being, instance of a class.

| **Setting** | **Description** |
| --- | --- |
| **apiVersion** | Rafay’s API version `eaas.envmgmt.io/v1`. |
| **Kind** | `Environment`. |
| **Metadata** | \- **description**: Description or purpose of the environment template resource. Optional but recommended as it is displayed on the environment card. <br> \- **name**: Name of the environment template. <br> \- **project**: Project name where the environment template resides. |
| **spec -> agents** | Set to the name of the agent used for running the code of the resource template. |
| **spec -> variables** | List of input variables, should include: <br> \- **name**: Name of the variable, either pre-existing or new (if allowed). <br> \- **value**: Single value. <br> \- **sensitive**: `true` means the value is encrypted for storage. |
| **spec -> files** | List of files, should include: <br> \- **name**: Name of the file or file path. <br> \- **data**: Content of the file in base64 encoded format. |
| **spec -> envs** | List of environment variables, should include: <br> \- **key**: Name of the variable. <br> \- **value**: Plain text or a reference to encrypted data (e.g., `sealed://AWS_SECRET_ACCESS_KEY`). <br>**Note**: For sensitive data, use [SecretSealer](https://docs.rafay.co/integrations/secretseal/gitrepo/). |
| **spec -> template** | Template name and version with which the environment is published. |
| **spec -> schedule\_optouts** | Request to opt out of schedules. The request may be honored or denied based on template configurations and approvals: <br> \- **Required**: <br> \- **name**: Name of the schedule to opt out from. <br> \- **Optional**: <br> \- **duration**: Requested opt-out duration. |

* * *

```yaml
apiVersion: eaas.envmgmt.io/v1
kind: Environment
metadata:
  name: rauto-environment-eks-ec-rds-name-65837
  project: defaultproject
spec:
  schedule_optouts:
  - duration: 71m
    name: destroy1-ec2-instance
  agents:
  - name: k8sagent1
  secret:
    name: file://artifacts/rauto-environment-eks-ec-rds-name-65837/sealed-secret.yaml
  template:
    name: rauto-environment-eks-ec-rds-template-name-65837
    version: custom-noagent
  variables:
  - name: db_password
    options:
      description: db_password
      override:
        type: allowed
      required: true
      sensitive: true
    value: sealed://variables.0
    valueType: text
  - name: aws_cloud_provider_access_key
    options:
      description: aws_access_key
      override:
        type: allowed
      required: true
      sensitive: true
    value: sealed://variables.1
    valueType: text
  - name: aws_cloud_provider_secret_key
    options:
      sensitive: true
    value: sealed://variables.2
    valueType: text
  - name: eks_cluster_region
    value: us-west-2
    valueType: text
  - name: eks_cluster_az
    value: '[
