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

AutoscalingGroup mixed_instances_policy override cannot take a dict as value (python) #1975

Open
hans-d opened this issue Jul 24, 2022 · 2 comments
Labels
bug/has-workaround A bug with a workaround (may not be elegant) bug Something isn't working cdktf language/python priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. provider/aws Issue shows up using AWS provider upstream/jsii Pending upstream work on JSII

Comments

@hans-d
Copy link

hans-d commented Jul 24, 2022

('override' must be specified using a Class, and cannot have a dict (python)

        asg = autoscaling.AutoscalingGroup(self, "auto",
                                           mixed_instances_policy={
                                               "launch_template": {
                                                   "launch_template_specification": {
                                                       "launch_template_id": tmpl.id
                                                   },
                                                   "override": [
                                                       {"instance_type": "t3.micro"},
                                                       autoscaling.AutoscalingGroupMixedInstancesPolicyLaunchTemplateOverride(
                                                           instance_type = "t3.micro"
                                                       )
                                                   ]
                                               }

                                           },
                                           availability_zones=["us-east-1a", "us-east-1b"],
                                           min_size=1,
                                           max_size=10,
                                           )

translates to:

    "aws_autoscaling_group": {
      "ec2_auto_16C147B8": {
        "//": {
          "metadata": {
            "path": "proj1/ec2/auto",
            "uniqueId": "ec2_auto_16C147B8"
          }
        },
        "availability_zones": [
          "us-east-1a",
          "us-east-1b"
        ],
        "max_size": 10,
        "min_size": 1,
        "mixed_instances_policy": {
          "launch_template": {
            "launch_template_specification": {
              "launch_template_id": "${aws_launch_template.ec2_tmpl_7F4E28E6.id}"
            },
            "override": [
              {
              },
              {
                "instance_type": "t3.micro"
              }
            ]
          }
        }
      }
    },
@DanielMSchmidt DanielMSchmidt transferred this issue from cdktf/cdktf-provider-aws Jul 28, 2022
@DanielMSchmidt DanielMSchmidt added new Un-triaged issue provider/aws Issue shows up using AWS provider labels Jul 28, 2022
@jsteinich
Copy link
Collaborator

Seems related to aws/jsii#1919 (Passing dict in lieu of jsii structs does not consistently work).

@DanielMSchmidt DanielMSchmidt added upstream/jsii Pending upstream work on JSII cdktf priority/important-soon High priority, to be worked on as part of our current release or the following one. language/python and removed new Un-triaged issue labels Aug 12, 2022
@xiehan xiehan added needs-reproduction bug Something isn't working labels Jun 1, 2023
@DanielMSchmidt
Copy link
Contributor

This is still an issue

@xiehan xiehan added bug/has-workaround A bug with a workaround (may not be elegant) priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. and removed needs-reproduction priority/important-soon High priority, to be worked on as part of our current release or the following one. labels Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/has-workaround A bug with a workaround (may not be elegant) bug Something isn't working cdktf language/python priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. provider/aws Issue shows up using AWS provider upstream/jsii Pending upstream work on JSII
Projects
None yet
Development

No branches or pull requests

4 participants