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

[aws-ec2] Instance creation and PlacementGroup options #11331

Closed
nbenaglia opened this issue Nov 6, 2020 · 8 comments
Closed

[aws-ec2] Instance creation and PlacementGroup options #11331

nbenaglia opened this issue Nov 6, 2020 · 8 comments
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@nbenaglia
Copy link

nbenaglia commented Nov 6, 2020

When creating an EC2 instance (new ec2.Instance), it should be possible to specify a placement group where instance belongs.

@nbenaglia nbenaglia added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 6, 2020
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Nov 6, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 9, 2020

Placement groups are a Launch Template feature, are they not?

@rix0rrr rix0rrr added effort/medium Medium work item – several days of effort p2 labels Nov 9, 2020
@nbenaglia
Copy link
Author

nbenaglia commented Nov 9, 2020

In AWS::EC2::Instance there's a PlacementGroup property:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-placementgroupname

And from AWS Console you can launch an EC2, specify the placementGroup without passing through a launchTemplate.

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Nov 9, 2020
@AGSaidi
Copy link
Member

AGSaidi commented Jan 29, 2021

You can do this like the following, but it would be nice to be able to specify it in the constructor.

pg = CfnPlacementGroup(self, 'my-placement-group', strategy='cluster')
i = ec2.Instance(self, 'instance-of-mine',
            instance_type=...
i.instance.add_property_override('PlacementGroupName', pg.ref)

@rix0rrr rix0rrr removed their assignment Jun 3, 2021
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 3, 2022
@github-actions github-actions bot closed this as completed Jun 8, 2022
@comcalvi
Copy link
Contributor

fixed by #24775

@rogerkenny
Copy link

I'm still not seeing a way to specify a placement group when launching an ec2 instance. Am I missing it?

@pahud
Copy link
Contributor

pahud commented May 21, 2024

@rogerkenny we'll add that support for ec2.Instance from here #30292

@smeikalr
Copy link

You can do this like the following, but it would be nice to be able to specify it in the constructor.

pg = CfnPlacementGroup(self, 'my-placement-group', strategy='cluster')
i = ec2.Instance(self, 'instance-of-mine',
            instance_type=...
i.instance.add_property_override('PlacementGroupName', pg.ref)

For Python and Launch Template:

launch_template = ec2.LaunchTemplate(...)
placement_group = ec2.CfnPlacementGroup(self, "my-placement-group", strategy="cluster")
launch_template.node.default_child.add_property_override("LaunchTemplateData.Placement.GroupName", placement_group.ref)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

8 participants