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

CDK No Longer Supported #66

Open
zscgeek opened this issue Jul 13, 2024 · 0 comments
Open

CDK No Longer Supported #66

zscgeek opened this issue Jul 13, 2024 · 0 comments

Comments

@zscgeek
Copy link

zscgeek commented Jul 13, 2024

One of the recent commits broke CDK support.

Before I could do this:

        download_file("https://axiom-cloudformation.s3.amazonaws.com/stacks/cloudwatch-ingester-axiom-cloudformation-stack.yaml", "cloudwatch-ingester-axiom-cloudformation-stack.yaml" )
        ingester = cfn_inc.CfnInclude(self, "ingester",  
                template_file="cloudwatch-ingester-axiom-cloudformation-stack.yaml",
                    parameters={
                        "AxiomToken": os.environ.get("AXIOM_KEY"),
                        "AxiomDataset": "aws-" + self.account,
                        "CloudWatchLogGroupNames": "",
                        "DataTags": "",
                    },
                    preserve_logical_ids=False
                )
        output = ingester.get_output("LogsLambdaARN")

cfn_inc.CfnInclude would let me bring in the stack to my CDK apps. But you changed to use Transform: "AWS::LanguageExtensions" and Fn::ForEach and this no longer works.

Now we get this:

cdk synth MyStack
jsii.errors.JavaScriptError:
  Error: The `type` property is required
      at new CfnResource (/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/jsii-kernel-FXSn23/node_modules/aws-cdk-lib/core/lib/cfn-resource.js:1:1696)
      at CfnInclude.getOrCreateResource (/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/jsii-kernel-FXSn23/node_modules/aws-cdk-lib/cloudformation-include/lib/cfn-include.js:1:13428)
      at new CfnInclude (/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/jsii-kernel-FXSn23/node_modules/aws-cdk-lib/cloudformation-include/lib/cfn-include.js:1:2314)
      at Kernel._Kernel_create (/private/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/tmp4myy5big/lib/program.js:10119:25)
      at Kernel.create (/private/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/tmp4myy5big/lib/program.js:9790:93)
      at KernelHost.processRequest (/private/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/tmp4myy5big/lib/program.js:11707:36)
      at KernelHost.run (/private/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/tmp4myy5big/lib/program.js:11667:22)
      at Immediate._onImmediate (/private/var/folders/_z/y3ct0zn126j4__fv8xdp5fyr0000gn/T/tmp4myy5big/lib/program.js:11668:46)
      at process.processImmediate (node:internal/timers:478:21)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/rj/dev.consig/consig-infra-axiom/cdk/app.py", line 12, in <module>
    AxiomStack(app,"xxx", env=cdk.Environment(account='xxx', region='us-east-1'))
  File "/Users/rj/.pyenv/versions/3.12.2/lib/python3.12/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rj/dev.consig/consig-infra-axiom/cdk/cdk/Axiom.py", line 29, in __init__
    ingester = cfn_inc.CfnInclude(self, "ingester",
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rj/.pyenv/versions/3.12.2/lib/python3.12/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rj/.pyenv/versions/3.12.2/lib/python3.12/site-packages/aws_cdk/cloudformation_include/__init__.py", line 552, in __init__
    jsii.create(self.__class__, self, [scope, id, props])
  File "/Users/rj/.pyenv/versions/3.12.2/lib/python3.12/site-packages/jsii/_kernel/__init__.py", line 334, in create
    response = self.provider.create(
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rj/.pyenv/versions/3.12.2/lib/python3.12/site-packages/jsii/_kernel/providers/process.py", line 365, in create
    return self._process.send(request, CreateResponse)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rj/.pyenv/versions/3.12.2/lib/python3.12/site-packages/jsii/_kernel/providers/process.py", line 342, in send
    raise RuntimeError(resp.error) from JavaScriptError(resp.stack)
RuntimeError: The `type` property is required

Subprocess exited with error 1
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

1 participant