Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Add support for AWS::CDK::Metadata Resource #334

Open
jnsf-cg opened this issue Nov 16, 2020 · 2 comments
Open

Add support for AWS::CDK::Metadata Resource #334

jnsf-cg opened this issue Nov 16, 2020 · 2 comments

Comments

@jnsf-cg
Copy link

jnsf-cg commented Nov 16, 2020

When attempting to Open a json or yaml file containing the contents outputted by the cdk synth command, an error is returned.

Package Version

v4.15.5

Example Code

	tpl, err := goformation.Open(filepath)
	if err != nil {
		return "", fmt.Errorf("Unable to Open CF Template [%w]", err)
	}

Example CF Template Content

Resources:
  AppLBListener908F43BE:
    Type: AWS::ElasticLoadBalancingV2::Listener
    Properties:
      DefaultActions:
        - FixedResponseConfig:
            ContentType: text/plain
            MessageBody: Hello, world.
            StatusCode: "200"
          Type: fixed-response
      Port: 443
      Protocol: HTTPS
      SslPolicy: ELBSecurityPolicy-FS-1-2-Res-2019-08
    Metadata:
      aws:cdk:path: Example1Stack/AppLB/Listener/Resource
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=1.73.0,@aws-cdk/assets=1.73.0,@aws-cdk/aws-cloudwatch=1.73.0,@aws-cdk/aws-ec2=1.73.0,@aws-cdk/aws-elasticloadbalancingv2=1.73.0,@aws-cdk/aws-events=1.73.0,@aws-cdk/aws-iam=1.73.0,@aws-cdk/aws-kms=1.73.0,@aws-cdk/aws-logs=1.73.0,@aws-cdk/aws-s3=1.73.0,@aws-cdk/aws-s3-assets=1.73.0,@aws-cdk/aws-ssm=1.73.0,@aws-cdk/cloud-assembly-schema=1.73.0,@aws-cdk/core=1.73.0,@aws-cdk/cx-api=1.73.0,@aws-cdk/region-info=1.73.0,jsii-runtime=node.js/v15.2.0
    Metadata:
      aws:cdk:path: Example1Stack/CDKMetadata/Default

Expected

No error to be returned

Got

Received the following error:

json: Unmarshal(nil)

Note: If I remove the CDKMetadata resource, the Open(...) succeeds.

@SleepyBrett
Copy link

SleepyBrett commented Jul 13, 2021

I've run into this as well. Being able to process the output of cdk synth would be nice.

Something that is working for me as a workaround is cdk synth --version-reporting false This causes synth to not output the CDKMetadata block.

Having a reasonable error message would also be super nice. I had to trace quite deep to figure out what was happening.

@ismferd
Copy link
Contributor

ismferd commented Dec 18, 2021

Hi,

I'm facing also with it.
which is the state of this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants