question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to create CfnSpotFleet using Python

See original GitHub issue

When running CDK synth I am getting JSII error jsii.errors.JSIIError: Value did not match any type in union: Value did not match any type in union: Expected array type, got {"$jsii.struct":{"fqn":"@aws-cdk/aws-ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty",

Reproduction Steps

I created a spot fleet stack and when I am defining CfnSpotFleet I am seeing the JSIIError

 batch_workers_request_config_data = ec2.CfnSpotFleet.SpotFleetRequestConfigDataProperty(
            iam_fleet_role=spotfleet_role.role_arn,
            target_capacity=num_of_workers,
            instance_interruption_behavior='terminate',
            launch_specifications=batch_workers_launch_specification
        )
        ec2.CfnSpotFleetProps(spot_fleet_request_config_data=batch_workers_request_config_data)

        ec2.CfnSpotFleet(self, id=f'{id}-spot-fleet',
                         spot_fleet_request_config_data=batch_workers_request_config_data)

Error Log

Environment

  • **CLI Version :
  • **Framework Version (CDK): 1.30.0 (build 4f54ff7)
  • **OS : MacOS 10.14.6
  • **Language : English

Other

I am looking through the python library and see that CfnSpotFleet doesn’t have the JSII annotations that CfnSpotFleetProps has. I am not exactly that it cause this issue though.

@jsii.data_type(jsii_type="@aws-cdk/aws-ec2.CfnSpotFleetProps", jsii_struct_bases=[], name_mapping={'spot_fleet_request_config_data': 'spotFleetRequestConfigData'})
class CfnSpotFleetProps():
@jsii.implements(aws_cdk.core.IInspectable)
class CfnSpotFleet(aws_cdk.core.CfnResource, metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/aws-ec2.CfnSpotFleet"):

Is a side note. Where is the python library source code hosted or it is being generated?

Please let me know if any other information is required.

Thank you!


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jinamshahcommented, Oct 6, 2020

@yanz67 spot_fleet_request_config_data=[batch_workers_request_config_data]) This is wrong and this is not pluralised but this is launch_specifications=[batch_workers_launch_specification] I know you might have solved this issue by now, but this is for anyone else facing the issue.

0reactions
jinamshahcommented, Oct 7, 2020

@yanz67 do you have any idea about attaching tags to Spot Fleet request? They recently announced this feature but I haven’t been able to find a solution using cdk

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to create CfnSpotFleet using Python in AWS CDK
I am looking through the python library and see that CfnSpotFleet doesn't have the JSII annotations that CfnSpotFleetProps has. I am not exactly ......
Read more >
class CfnSpotFleet (construct) · AWS CDK
A Spot Fleet request contains the configuration information to launch a fleet, or group, of instances. The Spot Fleet request specifies the total...
Read more >
awslabs/aws-cdk - Gitter
Hi all, I'm trying to use the Python CDK for WAFv2. Currently creating an IPSet, a RuleProperty referencing the IPSet and finally the...
Read more >
Questions in Compute
Hello, I have followed all of the tutorials on how to build an AWS Lambda ... For example in my docker image that...
Read more >
aws-cdk-lib Lazy TypeScript Examples
CDK Lazy values generate a unique `${Token[TOKEN.63]}` string. These strings * can later be resolved to the real value (which we do in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found