Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants