Feature: PreCondition / TemplateCondition
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
**Summary** We need a feature `PreCondition` or `TemplateCondition` that allows for specifying a condition on a resource being included in template building.
**Use Case**: We currently use `Condition: NotInChina` for resources that are not applicable to China.
This breaks for resources that are not at all available in China, e.g. KMS.
The template is validated before any conditions are applied, which fails if the resource does not exist in AWS-CN. We need a condition that removes these resources before sending it to CFN.
**Example**:
```
KmsAccess: {
Action: ‘Kms:Decrypt’,
Effect: ‘Allow’,
Resource: ‘kms:keys:*’,
PreCondition: ‘NotInChina’
}
```
The resource should be removed from the template object, *before* being submitted to Cloudformation.
This may require a change in /[cfn-config](https://github.com/mapbox/cfn-config) also, since cloudfriend itself is region/deploy-agnostic I think.
cc @mapbox/platform
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing cloudfriend's template-building and validation flow, then inspect the linked /cfn-config boundary to determine which project owns region-specific behavior. Done means resources using the proposed condition are removed from the template object before submission to CloudFormation, including the KMS example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100