
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@ttoss/cloudformation
Advanced tools
Utilities and TypeScript types for working with AWS CloudFormation templates.
pnpm add @ttoss/cloudformation
The package exports TypeScript types for all commonly used CloudFormation intrinsic functions:
| Type | CloudFormation equivalent |
|---|---|
CloudFormationRef | { Ref: string } |
CloudFormationGetAtt | { 'Fn::GetAtt': [string, string] } |
CloudFormationJoin | { 'Fn::Join': [string, ...] } |
CloudFormationSub | { 'Fn::Sub': string } |
CloudFormationSelect | { 'Fn::Select': [number, string[]] } |
CloudFormationSplit | { 'Fn::Split': [string, string] } |
CloudFormationImportValue | { 'Fn::ImportValue': string | CloudFormationSub } |
CloudFormationIntrinsic | Union of all the above |
CloudFormationValue<T> | T | CloudFormationIntrinsic |
importValueFromParameterGenerates an Fn::ImportValue + Fn::Sub intrinsic that reads the export name
from a CloudFormation parameter. This is the standard pattern for consuming
cross-stack exports whose names are not known at author time.
import { importValueFromParameter } from '@ttoss/cloudformation';
importValueFromParameter('AppSyncLambdaRoleArn');
// => { 'Fn::ImportValue': { 'Fn::Sub': '${AppSyncLambdaRoleArn}' } }
Typical use in a CloudFormation template:
import { importValueFromParameter } from '@ttoss/cloudformation';
import { createApiTemplate } from '@ttoss/appsync-api';
const template = createApiTemplate({
schemaComposer,
dataSource: {
roleArn: importValueFromParameter('AppSyncLambdaDataSourceIAMRoleArn'),
},
lambdaFunction: {
roleArn: importValueFromParameter('AppSyncLambdaFunctionIAMRoleArn'),
environment: {
variables: {
TABLE_NAME: { Ref: 'DynamoTableName' },
EXTERNAL_ARN: importValueFromParameter('SomeOtherStackExportedName'),
},
},
},
});
When a producing stack exports a value and a consuming stack imports it with
Fn::ImportValue, CloudFormation protects that dependency by blocking deletion
of the producer export until imports are removed.
Producer stack output example:
const outputs = {
LambdaPostgresReadQueryFunctionArn: {
Value: { 'Fn::GetAtt': ['LambdaPostgresReadQueryFunction', 'Arn'] },
Export: {
Name: {
'Fn::Sub': '${AWS::StackName}-LambdaPostgresReadQueryFunctionArn',
},
},
},
};
Consumer stack usage with parameterized export name:
import { importValueFromParameter } from '@ttoss/cloudformation';
const resources = {
InvokePermission: {
Type: 'AWS::Lambda::Permission',
Properties: {
FunctionName: importValueFromParameter('ReadQueryFunctionArnExportName'),
Action: 'lambda:InvokeFunction',
Principal: 'apigateway.amazonaws.com',
},
},
};
findAndReadCloudFormationTemplateReads a CloudFormation template file from disk. Supports both TypeScript and YAML files.
import { findAndReadCloudFormationTemplate } from '@ttoss/cloudformation';
const template = await findAndReadCloudFormationTemplate({
templatePath: './cloudformation.ts',
options: { environment: 'Production' },
});
FAQs
CloudFormation utils.
The npm package @ttoss/cloudformation receives a total of 1,190 weekly downloads. As such, @ttoss/cloudformation popularity was classified as popular.
We found that @ttoss/cloudformation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.