Feature request: adding to resources created with pcluster CloudFormation stack with additional_cfn_template
- Dominant language
- Python
- Stars
- 888
- Forks
- 314
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 43
Description
**Environment:**
- aws-parallelcluster-2.4.1
- OS: centos7
- Scheduler: slurm
- Master instance type: t2.micro
- Compute instance type: t2.micro
Is it possible to access resources created with the base pcluster CloudFormation template within `additional_cfn_template`?
I wanted to add a lifecycle hook to the ComputeFleet autoscaling group, but the following fails because `ComputeFleet` is not defined in that nested stack. Since we can't pass parameters from the parent stack to the nested stack (or at least I haven't found how), I believe the parent stack should export some of its variables to expose the resources it creates. (I'm a CloudFormation newbie, so I might be wrong.)
```json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Additional CloudFormation Stack for ParallelCluster config.",
"Resources": {
"ComputeFleetTerminationLifeCycleHook": {
"Type": "AWS::AutoScaling::LifecycleHook",
"Properties": {
"AutoScalingGroupName": {
"Ref": "ComputeFleet"
},
"DefaultResult": "ABANDON",
"HeartbeatTimeout": 3600,
"LifeCycleHookName": "ComputeFleetTermination",
"LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING"
}
}
}
}
```
Contributor guide
Research direction
Start by tracing how additional_cfn_template is incorporated into the base ParallelCluster CloudFormation deployment and how nested-stack resources are exposed. Verify whether parent-stack parameters or exports can reference ComputeFleet, then define and test a supported way for the additional template to access that resource. Done means the lifecycle-hook example can resolve the compute Auto Scaling group without relying on undefined nested-stack resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100