aws-cloudformation / aws-cloudformation-macros

This repository hosts examples of AWS CloudFormation macros.
Apache License 2.0
82 stars 49 forks source link

The S3Objects macro returns "Unrecognized resource types: [AWS::S3::Object]" #11

Closed edenhare closed 3 years ago

edenhare commented 3 years ago

There are several issues to get here.

Running this template

---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
  ResourceFunction:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: python3.6
      CodeUri: lambda
      Handler: resource.handler
      Policies: AmazonS3FullAccess

  MacroFunction:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: python3.6
      CodeUri: lambda
      Handler: macro.handler
      Policies: AmazonS3FullAccess
      Environment:
        Variables:
          LAMBDA_ARN: !GetAtt ResourceFunction.Arn

  Macro:
    Type: AWS::CloudFormation::Macro
    Properties:
      Name: S3Objects
      FunctionName: !GetAtt MacroFunction.Arn

results in the error aws cloudformation create-stack --stack-name bucket -objects --template-body file://s3bucketa.yaml --capabilities CAPABILITY_AUTO_EXPAND An error occurred (ValidationError) when calling the CreateStack operation: Template f ormat error: Unrecognized resource types: [AWS::S3::Object]

I have made the changes in my cloned repo, but I haven't figured that unrecognized resource type yet. If I can figure it out, I will contribute the changes back. Would appreciate any assistance.

edenhare commented 3 years ago

not sure what the problem was. i deleted the s3Objects macro-template/packaged template and started over. this error got resolved.