Unable to create CfnSpotFleet using Python
See original GitHub issueWhen 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:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yanz67
spot_fleet_request_config_data=[batch_workers_request_config_data])
This is wrong and this is not pluralised but this islaunch_specifications=[batch_workers_launch_specification]
I know you might have solved this issue by now, but this is for anyone else facing the issue.@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