Skip to content

Library for driving CloudFormation files in a composable, easy to maintain fashion

Notifications You must be signed in to change notification settings

futurematik/cloudformation-utils

Repository files navigation

CloudFormation Utils

Documentation is a work in progress!

A toolkit for generating CloudFormation templates programmatically.

It is designed to be as close as possible to the raw cloudformation while vastly improving the maintainability and composability of deployments.

Example

const [lambdaRoleBuilder, lambdaRole] = makeAwsResource(
  ResourceType.IAMRole,
  `ApiLambdaRole`,
  {
    AssumeRolePolicyDocument: makePolicyDocument({
      Principal: { Service: 'lambda.amazonaws.com' },
      Action: 'sts:AssumeRole',
      Effect: PolicyEffect.Allow,
    }),
    ManagedPolicyArns: [
      'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole',
    ],
  },
);

const [lambdaBuilder] = makeAwsResource(
  ResourceType.LambdaFunction,
  `ApiLambda`,
  {
    Code: apiAsset.ref,
    Role: lambdaRole.ref,
    Handler: 'index.handler',
  },
);

About

Library for driving CloudFormation files in a composable, easy to maintain fashion

Resources

Stars

Watchers

Forks

Packages

No packages published