> For the complete documentation index, see [llms.txt](https://docs.release.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.release.com/reference-documentation/cloud-resources.md).

# Cloud resources

Tag AWS ECS tasks to use them with your Release environments

In this guide, we'll look at how you can create and use cloud-native resources like AWS ECS tasks or Lambdas with your Release environments.

While Release can create complex environments that run services as Docker containers or static files, cloud-native resources required by your Release environments are hosted by your cloud provider outside your Release clusters.

To add cloud resources to a Release environment, you'll add two tags to your resources using your cloud provider's console or API or by using Terraform.

Once tagged, these resources will show up on the environment page, below your instances. Release adds helpful buttons to interact with your cloud resources directly from your environment page.

## Supported cloud resources

Release currently supports AWS ECS tasks as the first available cloud resource. If you use other cloud resources that you'd like us to support, [let us know](mailto:support@release.com).

## How to add tags to AWS ECS tasks for Release environments

You can add AWS ECS tasks to your Release environments by adding two tags to your tasks in AWS.

| Tag Key                       | Tag Value                | Location in UI                                                                                    | Env variable                                                                                                                                                                                             |
| ----------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`releasehub.com/app-name`** | (the app name)           | Top of the environment page. In the screenshot below, the app name is `terraform-runner-example`. | `RELEASE_APP_NAME` (see [default Release environment variables](https://docs.release.com/reference-documentation/application-settings/default-environment-variables#releasehubs-environment-variables))  |
| **`releasehub.com/env-id`**   | (the environment handle) | In the screenshot below, the environment handle is `terraform-example-cloud-resources`.           | `RELEASE_ENV_ID` (see [default Release environment variables](https://docs.releasehub.com/reference-documentation/application-settings/default-environment-variables#releasehubs-environment-variables)) |

![Find the app name and environment ID on the environment page](https://585411240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1neGLLQ0sDXeK6ooSo%2Fuploads%2Fgit-blob-24c1496e9761f25055cfcc146eeab2385f9caa54%2Fapp-name-env-id.png?alt=media)

Follow the AWS documentation on [tagging ECS resources ](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)to add these tags using the AWS console.

You can add tags to task definitions directly so that task containers inherit tags from the task definition or you can set the tags on running containers as shown below:

![Editing AWS ECS tags using AWS console](https://585411240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1neGLLQ0sDXeK6ooSo%2Fuploads%2Fgit-blob-2ddcea4b617d26bcc176e4d6801521ec48520839%2Faws-tag-create.png?alt=media)

## Using Terraform to add tags to AWS ECS tasks

If you use [Terraform with Release's infrastructure runners](https://docs.release.com/guides-and-examples/advanced-guides/infrastructure/terraform), Terraform can create your AWS ECS tasks and set the required tags and their values when your environment is deployed.

When Release executes Terraform, your Terraform plans can access Release-specific environment variables. Use the `RELEASE_APP_NAME` and `RELEASE_ENV_ID` environment variables in our Terraform to create your tags.

```hcl
variable "RELEASE_APP_NAME" {
  type        = string
  description = "Name of the Release application"
}

variable "RELEASE_ENV_ID" {
  type        = string
  description = "Unique identifier for the Release environment"
}

resource "aws_ecs_task_definition" "service" {
  family = "service"
  container_definitions = jsonencode([ ... ])
  tags = {
    "releasehub.com/app-name" = var.RELEASE_APP_NAME
    "releasehub.com/env-id" = var.RELEASE_ENV_ID
    ...
  }
}
```

## How to configure ECS logs for Release

To view your ECS logs using the Release log viewer, configure your ECS tasks to use the `awslogs` log driver. This log driver sends logs to AWS CloudWatch, which Release then reads and adds to your environment page.

See the AWS guide on [using the `awslogs` log driver for ECS tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html). Your task execution IAM role needs the required permissions to create log groups and write to CloudWatch.

For logs to show up in Release, you need to set `logDriver` to `awslogs`, but you can set any values for `awslogs-group` or `awslogs-stream-prefix`.

The `containerDefinitions` section of your task definition should have a `logConfiguration` similar to the one below:

```json
{
  "containerDefinitions": [
    {
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "firelens-container",
          "awslogs-region": "us-west-2",
          "awslogs-create-group": "true",
          "awslogs-stream-prefix": "firelens"
        }
      }
    }
  ]
}
```

Click the **Logs** button next to your AWS ECS task on the environment page in Release to see the logs generated by the task.

![Logs button for an AWS ECS task in Release](https://585411240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1neGLLQ0sDXeK6ooSo%2Fuploads%2Fgit-blob-511e02366634baec77e53411d3cb4a25408e872a%2Fcloud-resources-logs-button.png?alt=media\&token=7ffca1ac-378d-43dd-ab53-78c202c99238)

When you click the **Logs** button, a new browser window will pop up showing the most recent logs.

![Logs generated by an AWS ECS task in Release](https://585411240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1neGLLQ0sDXeK6ooSo%2Fuploads%2Fgit-blob-d4df3710cc3619f33485cbaa40f603baea490468%2Fcloud-resources-logs.png?alt=media\&token=ff399433-9306-4a7a-9141-7e680b500dce)

## How to configure the terminal access in Release for AWS ECS tasks

To open a terminal to an AWS ECS task, the following requirements must be met:

1. ECS Exec must be enabled for the task. See the AWS guide about [turning on ECS Exec for your tasks and services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html#ecs-exec-enabling).
2. The task's IAM role must have ECS Exec IAM permissions. See the AWS guide about [IAM permissions required for ECS Exec](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html#ecs-exec-required-iam-permissions).

If your task is configured with ECS Exec and the required IAM permissions, you can click on the **Terminal** button to open a terminal to your task.

![Terminal button for an AWS ECS task in Release](https://585411240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1neGLLQ0sDXeK6ooSo%2Fuploads%2Fgit-blob-819fb007220449f74282730b35e5ac49f1dd0fb6%2Fcloud-resources-terminal-button.png?alt=media\&token=ac2aafa5-b1ad-4917-9018-f861c04944c7)

After clicking the **Terminal** button, a new browser window will open, showing terminal output and a command line.

![Terminal to an AWS ECS task in Release](https://585411240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1neGLLQ0sDXeK6ooSo%2Fuploads%2Fgit-blob-11a3b17750c90b1b13e64ca20fcd6fb51dd9f092%2Fcloud-resources-terminal.png?alt=media\&token=afa38d6d-b081-4e58-85ce-5b07bb9aec3a)

If terminal access is not available for a task or if the task does not have ECS Exec enabled, the **Terminal** button will be grayed out in Release.

We recommend reading the AWS documentation on [using Amazon ECS Exec for debugging](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) to make sure you follow AWS recommended best practices.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.release.com/reference-documentation/cloud-resources.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
