You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This action acts as the template compiler for our CloudFormation infrastructure. It takes a generic, region-agnostic meta-template and a JSON RegionMap, merges them using `jq`, and produces a valid, deployable CloudFormation JSON artifact.
7
+
8
+
### The Workflow
9
+
10
+
1.**Dependency Verification:** Ensures `jq` is installed on the runner.
11
+
2.**Region Map Injection:** Reads the provided `region_map` string and injects it into the `.Mappings.RegionMap` block of the source meta-template. This overrides any placeholder mappings.
12
+
3.**Lambda Code Injection:** For each entry in `lambda_injections`, reads the source file and injects its contents into `.Resources[<ResourceName>].Properties.Code.ZipFile`. Errors if the resource is missing from the template or the source file does not exist.
13
+
4.**Artifact Publishing:** Uploads the newly generated CloudFormation template as a GitHub Actions artifact for downstream jobs (like deployment or release aggregation) to consume.
14
+
15
+
### Inputs & Outputs
16
+
17
+
| Input | Required | Description |
18
+
| --- | --- | --- |
19
+
|`region_map`| Yes | The JSON string containing region-to-AMI mappings. |
20
+
|`output_filename`| Yes | The desired filename for the compiled template. |
21
+
|`artifact_name`| Yes | The name to assign the uploaded GitHub Actions artifact (passed straight to `upload-artifact`'s `name`). This is an artifact label, not a filesystem path. |
22
+
|`metatemplate_file_path`| Yes | Relative path to the source JSON meta-template. |
23
+
|`lambda_injections`| No | JSON object mapping Lambda resource logical IDs to source files to embed. Defaults to `'{}'`. |
This action deploys an ephemeral CloudFormation stack for integration and smoke testing. To avoid massive, brittle conditional blocks in our workflow YAMLs, this action utilizes a "Flavor Mapping" pattern. It dynamically constructs CloudFormation parameters based on the specific architecture being deployed (e.g., Linux vs. Windows, Single Node vs. Parallel Server).
7
+
8
+
### The Workflow
9
+
10
+
1.**Type Resolution:** Reads `refarch-type-mappings.json` to lookup the default parameter values and variable names (like identifying whether to use `SSHKeyName` or `RDPKeyName`) for the requested `refarch_type`.
11
+
2.**Dynamic Parameter Injection:** Fetches the GitHub Runner's current IP address and injects it, along with standard inputs (VPC, Subnet, SSH Key), into a generated `params.json` file.
12
+
3.**Execution:** Triggers `aws cloudformation create-stack` and blocks until the `stack-create-complete` signal is received.
13
+
4.**Data Retrieval:** Parses the final CloudFormation stack outputs into a flattened JSON key-value string.
14
+
15
+
### Inputs & Outputs
16
+
17
+
| Input | Required | Description |
18
+
| --- | --- | --- |
19
+
|`compiled_template_file_path`| Yes | Path to the already-compiled CloudFormation template. |
20
+
|`refarch_type`| Yes | Target deployment architecture type matching a key in `refarch-type-mappings.json`. |
21
+
|`region`| Yes | AWS region to deploy the stack into. |
22
+
|`stack_name`| Yes | Unique identifier for the temporary stack. |
23
+
|`vpc_id` / `subnet_id`| Yes | Network configuration for the deployment. |
24
+
|`key_pair_name`| Yes | Name of the pre-provisioned AWS EC2 key pair for access. |
25
+
26
+
**Outputs:**
27
+
28
+
*`stack_outputs`: A flat JSON string of the CloudFormation stack outputs (e.g., `{"HeadnodePublicDNS": "ec2-...", "RDPConnection": "..."}`).
0 commit comments