-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(ecs): bottlerocket support #10097
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Thank you so much for this quick PR after bottlerocket just published its ECS variant.
HI @iamhopaul123 , Should all addressed. Please take a look again. Thanks. |
If I extend the integ test to create the service like this import * as ec2 from '@aws-cdk/aws-ec2';
import * as cdk from '@aws-cdk/core';
import * as ecs from '../../lib';
import * as patterns from '@aws-cdk/aws-ecs-patterns';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-ecs-integ-bottlerocket');
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, natGateways: 1 });
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
cluster.addCapacity('bottlerocket-asg', {
minCapacity: 2,
instanceType: new ec2.InstanceType('c5.large'),
machineImageType: ecs.MachineImageType.BOTTLEROCKET,
});
const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef');
const web = taskDefinition.addContainer('web', {
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
memoryReservationMiB: 1024,
});
web.addPortMappings({
containerPort: 80,
})
new patterns.ApplicationLoadBalancedEc2Service(stack, 'ALBService', {
cluster,
taskDefinition,
})
app.synth(); I got the service deployed with the ALB URL returned And if I hit the URL, I got the sample PHP running as expected I am not going to extend this in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it Thank you for your contribution!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Hey @pahud there are a couple issues / caveats that I think we might want to have checks for:
|
Thank you @nathanpeck Let me fix this in another PR 😄 |
As introduced in #10097, Bottlerocket had to be explicitly (and only) selected via setting `machineImageType`, which would pick an appropriate `machineImage`. Setting `machineImage` to `new BottleRocketImage()` would not be sufficient, since the feature also requires configuring additional UserData commands which are only added if `machineImageType` was set. This method of configuration does not allow customization of the AMI, such as introduced in #16021. Instead, we reverse the logic: `machineImageType` may still be necessary to autoconfigure UserData if we can't know what the machineImage is (for example in case of a preconfigured AutoScalingGroup), but otherwise is derived from what `machineImage` is being used. We allow configuring both fields at the same time for the case when the autodetection fails. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
As introduced in aws#10097, Bottlerocket had to be explicitly (and only) selected via setting `machineImageType`, which would pick an appropriate `machineImage`. Setting `machineImage` to `new BottleRocketImage()` would not be sufficient, since the feature also requires configuring additional UserData commands which are only added if `machineImageType` was set. This method of configuration does not allow customization of the AMI, such as introduced in aws#16021. Instead, we reverse the logic: `machineImageType` may still be necessary to autoconfigure UserData if we can't know what the machineImage is (for example in case of a preconfigured AutoScalingGroup), but otherwise is derived from what `machineImage` is being used. We allow configuring both fields at the same time for the case when the autodetection fails. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
As introduced in aws#10097, Bottlerocket had to be explicitly (and only) selected via setting `machineImageType`, which would pick an appropriate `machineImage`. Setting `machineImage` to `new BottleRocketImage()` would not be sufficient, since the feature also requires configuring additional UserData commands which are only added if `machineImageType` was set. This method of configuration does not allow customization of the AMI, such as introduced in aws#16021. Instead, we reverse the logic: `machineImageType` may still be necessary to autoconfigure UserData if we can't know what the machineImage is (for example in case of a preconfigured AutoScalingGroup), but otherwise is derived from what `machineImage` is being used. We allow configuring both fields at the same time for the case when the autodetection fails. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
As introduced in aws#10097, Bottlerocket had to be explicitly (and only) selected via setting `machineImageType`, which would pick an appropriate `machineImage`. Setting `machineImage` to `new BottleRocketImage()` would not be sufficient, since the feature also requires configuring additional UserData commands which are only added if `machineImageType` was set. This method of configuration does not allow customization of the AMI, such as introduced in aws#16021. Instead, we reverse the logic: `machineImageType` may still be necessary to autoconfigure UserData if we can't know what the machineImage is (for example in case of a preconfigured AutoScalingGroup), but otherwise is derived from what `machineImage` is being used. We allow configuring both fields at the same time for the case when the autodetection fails. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(ecs): bottlerocket support
Closes: #10085
machineImageType
to select the bottlerocket machine image typeSSM session manager enabled by default
update README
integ test
unit test
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license