Socket
Socket
Sign inDemoInstall

@aws-cdk/aws-cloudformation

Package Overview
Dependencies
Maintainers
4
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-cloudformation

The CDK Construct Library for AWS::CloudFormation


Version published
Weekly downloads
83K
increased by13.39%
Maintainers
4
Weekly downloads
 
Created

What is @aws-cdk/aws-cloudformation?

@aws-cdk/aws-cloudformation is an AWS Cloud Development Kit (CDK) module that allows you to define AWS CloudFormation templates using TypeScript or JavaScript. It provides a high-level, object-oriented abstraction to define AWS resources and manage their lifecycle.

What are @aws-cdk/aws-cloudformation's main functionalities?

Creating a CloudFormation Stack

This code sample demonstrates how to create a CloudFormation stack using the @aws-cdk/aws-cloudformation package. It defines a nested stack with a template URL and parameters.

const cdk = require('@aws-cdk/core');
const cfn = require('@aws-cdk/aws-cloudformation');

class MyStack extends cdk.Stack {
  constructor(scope, id, props) {
    super(scope, id, props);

    new cfn.CfnStack(this, 'MyNestedStack', {
      templateUrl: 'https://s3.amazonaws.com/my-bucket/my-template.json',
      parameters: {
        MyParameter: 'ParameterValue'
      }
    });
  }
}

const app = new cdk.App();
new MyStack(app, 'MyStack');
app.synth();

Custom Resources

This code sample demonstrates how to create a custom resource using the @aws-cdk/aws-cloudformation package. It defines a custom resource with a service token and properties.

const cdk = require('@aws-cdk/core');
const cfn = require('@aws-cdk/aws-cloudformation');

class MyStack extends cdk.Stack {
  constructor(scope, id, props) {
    super(scope, id, props);

    new cfn.CfnCustomResource(this, 'MyCustomResource', {
      serviceToken: 'arn:aws:lambda:region:account-id:function:function-name',
      properties: {
        MyProperty: 'PropertyValue'
      }
    });
  }
}

const app = new cdk.App();
new MyStack(app, 'MyStack');
app.synth();

Wait Conditions

This code sample demonstrates how to create a wait condition using the @aws-cdk/aws-cloudformation package. It defines a wait condition handle and a wait condition with a timeout and count.

const cdk = require('@aws-cdk/core');
const cfn = require('@aws-cdk/aws-cloudformation');

class MyStack extends cdk.Stack {
  constructor(scope, id, props) {
    super(scope, id, props);

    const waitHandle = new cfn.CfnWaitConditionHandle(this, 'MyWaitHandle');

    new cfn.CfnWaitCondition(this, 'MyWaitCondition', {
      handle: waitHandle.ref,
      timeout: '300',
      count: 1
    });
  }
}

const app = new cdk.App();
new MyStack(app, 'MyStack');
app.synth();

Other packages similar to @aws-cdk/aws-cloudformation

Keywords

FAQs

Package last updated on 31 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc