|
6 | 6 |
|
7 | 7 | This action allows you to run a script inside of your AWS Account, without having to spin up your own runner. By leveraging the power of ECS Tasks, you can use any docker image, and run any script inside of your Job, as if that script was being executed inside of the runner, however, the script is remotely executed inside of your AWS VPC, which grants your step special access to private resources, such as RDS Databases, Internal Loadbalancers, and much more.
|
8 | 8 |
|
| 9 | +<!-- start inputs --> |
| 10 | + |
| 11 | +| **Input** | **Description** | **Default** | **Required** | |
| 12 | +| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------ | |
| 13 | +| **`role_arn`** | Role ARN to be used to create/execute the required infrastructure on AWS | | **true** | |
| 14 | +| **`execution_role_arn`** | Role ARN to be used to as execution role for the ECS Task that will run the script. Defaults to ROLE_ARN | | **false** | |
| 15 | +| **`task_role_arn`** | Role ARN to be used as Task Role arn for the ECS Task that will run the script. Defaults to ROLE_ARN | | **false** | |
| 16 | +| **`memory`** | Amount of memory to be used by the remote ECS Task (Must be a FARGATE Compatible combination. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html) | `512` | **false** | |
| 17 | +| **`cpu`** | Amount of vCPU to be used by the remote ECS Task (Must be a FARGATE Compatible combination. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html) | `256` | **false** | |
| 18 | +| **`ecs_cluster_name`** | The name of the ECS Cluster where the Tasks will run. It will be automatically created if it doesn't exist | `github-actions-aws-run` | **false** | |
| 19 | +| **`image`** | Name of the docker container to be used for the step execution | | **true** | |
| 20 | +| **`region`** | AWS Region to execute the operations | `us-east-1` | **true** | |
| 21 | +| **`security_group_id`** | Security Group to be used by the ECS Task. If not informed, a temporary security group will be created with access to the internet | | **false** | |
| 22 | +| **`run`** | Script that will be executed in the remote environment | | **true** | |
| 23 | +| **`shell`** | Name of the shell to be used in the container to execute the run script | | **true** | |
| 24 | +| **`subnet_ids`** | Subnet ID of where the Task will be executed. If no subnet_ids is specified, the task will find one automatically within the VPC | | **false** | |
| 25 | +| **`vpc_id`** | VPC ID of where the Task will be executed | | **true** | |
| 26 | +| **`tags`** | The list of custom tags to be added to all resources created on AWS with. | | **false** | |
| 27 | +| **`polling_interval`** | The amount of time (in seconds) between polling cloudwatch logs. | `2` | **false** | |
| 28 | +| **`post_complete_log_cycles`** | Number of polling cycles to try getting logs after the ecs task completes. | `4` | **false** | |
| 29 | +| **`upload_includes`** | Array of string paths to include while uploading the runner workspace to the ECS Task. Excludes apply before includes. See https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters | | **false** | |
| 30 | +| **`upload_excludes`** | Array of string paths to exclude while uploading the runner workspace to the ECS Task. Excludes apply before includes. See https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters | | **false** | |
| 31 | +| **`download_includes`** | Array of string paths to include while downloading the runner workspace from the ECS Task. Excludes apply before includes. See https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters | | **false** | |
| 32 | +| **`download_excludes`** | Array of string paths to exclude while downloading the runner workspace from the ECS Task. Excludes apply before includes. See https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters | | **false** | |
| 33 | + |
| 34 | +<!-- end inputs --> |
| 35 | + |
9 | 36 | ## Benefits
|
10 | 37 |
|
11 | 38 | - Use IaC (such as Terraform) to manipulate resources that are in Private VPCs (such as RDS, Opensearch, etc)
|
@@ -246,8 +273,9 @@ In the execution phase, the action will:
|
246 | 273 | - [X] Map all GitHub Contexts/ENVS into the ECS Container
|
247 | 274 | - [X] Ability to upload artifacts back to GitHub (if your remote execution generates artifacts)
|
248 | 275 | - [ ] Find a way to map environment variables from the remote shell, back to the runner (after execution)
|
249 |
| -- [ ] Change the TearDown step to run as a **post** action on GHA, so take advantages of errors/cancellations |
| 276 | +- [X] Change the TearDown step to run as a **post** action on GHA, so take advantages of errors/cancellations |
250 | 277 | - [ ] Make it compatible with [Windows Containers](https://aws.amazon.com/blogs/containers/running-windows-containers-with-amazon-ecs-on-aws-fargate/)
|
| 278 | +
|
251 | 279 | ## Developing the action locally
|
252 | 280 |
|
253 | 281 |
|
|
0 commit comments