Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create CloudFormation stack without resources

I am using Terraform for most of my infrastructure, but at the same time I'm using the serverless framework to define some Lambda functions. Serverless uses CloudFormation under the hood where I need access to some ARNs for resources created by Terraform.

My idea was to create a CloudFormation stack in Terraform and export all of the value that I need, but it complains that it cannot create a stack without any resources. I don't want to define any resources in CloudFormation, only the outputs, so I though maybe there is a way to define some dummy resource, but I couldn't find any.

Is there a way to work around this issue? If not, I'm also open to other suggestions for getting parameters passed from Terraform to CloudFormation.

like image 504
TheEdgeOfRage Avatar asked Dec 13 '22 08:12

TheEdgeOfRage


1 Answers

You can use AWS::CloudFormation::WaitConditionHandle for this. Example:

Resources:
  NullResource:
    Type: AWS::CloudFormation::WaitConditionHandle
like image 144
lexicore Avatar answered Jan 08 '23 10:01

lexicore