-
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(batch): add fargate Runtime Platform properties to ECS Fargate C… #28841
Changes from all commits
718ff5f
85d55b6
37f2d5b
3ce24f1
8d49211
c6ab7da
0a8fefa
0db9963
797ac32
55fc5da
137b554
4a27410
1f1b6a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -979,6 +979,20 @@ export interface IEcsFargateContainerDefinition extends IEcsContainerDefinition | |
* @default - 20 GiB | ||
*/ | ||
readonly ephemeralStorageSize?: Size; | ||
|
||
/** | ||
* The vCPU architecture of Fargate Runtime. | ||
* | ||
* @default - X86_64 | ||
*/ | ||
readonly fargateCpuArchitecture?: ecs.CpuArchitecture; | ||
|
||
/** | ||
* The operating system for the compute environment. | ||
* | ||
* @default - LINUX | ||
*/ | ||
readonly fargateOperatingSystemFamily?: ecs.OperatingSystemFamily; | ||
} | ||
|
||
/** | ||
|
@@ -1009,6 +1023,20 @@ export interface EcsFargateContainerDefinitionProps extends EcsContainerDefiniti | |
* @default - 20 GiB | ||
*/ | ||
readonly ephemeralStorageSize?: Size; | ||
|
||
/** | ||
* The vCPU architecture of Fargate Runtime. | ||
* | ||
* @default - X86_64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my own understanding, why set defaults for this and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is the default value should be same as the default value in CFN resource. |
||
*/ | ||
readonly fargateCpuArchitecture?: ecs.CpuArchitecture; | ||
|
||
/** | ||
* The operating system for the compute environment. | ||
* | ||
* @default - LINUX | ||
*/ | ||
readonly fargateOperatingSystemFamily?: ecs.OperatingSystemFamily; | ||
} | ||
|
||
/** | ||
|
@@ -1018,12 +1046,16 @@ export class EcsFargateContainerDefinition extends EcsContainerDefinitionBase im | |
public readonly fargatePlatformVersion?: ecs.FargatePlatformVersion; | ||
public readonly assignPublicIp?: boolean; | ||
public readonly ephemeralStorageSize?: Size; | ||
public readonly fargateCpuArchitecture?: ecs.CpuArchitecture; | ||
public readonly fargateOperatingSystemFamily?: ecs.OperatingSystemFamily; | ||
|
||
constructor(scope: Construct, id: string, props: EcsFargateContainerDefinitionProps) { | ||
super(scope, id, props); | ||
this.assignPublicIp = props.assignPublicIp; | ||
this.fargatePlatformVersion = props.fargatePlatformVersion; | ||
this.ephemeralStorageSize = props.ephemeralStorageSize; | ||
this.fargateCpuArchitecture = props.fargateCpuArchitecture; | ||
this.fargateOperatingSystemFamily = props.fargateOperatingSystemFamily; | ||
|
||
// validates ephemeralStorageSize is within limits | ||
if (props.ephemeralStorageSize) { | ||
|
@@ -1050,6 +1082,10 @@ export class EcsFargateContainerDefinition extends EcsContainerDefinitionBase im | |
networkConfiguration: { | ||
assignPublicIp: this.assignPublicIp ? 'ENABLED' : 'DISABLED', | ||
}, | ||
runtimePlatform: { | ||
cpuArchitecture: this.fargateCpuArchitecture?._cpuArchitecture, | ||
operatingSystemFamily: this.fargateOperatingSystemFamily?._operatingSystemFamily, | ||
}, | ||
}; | ||
}; | ||
} | ||
|
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.
Is it guaranteed that the
batch
EcsFaragetContainerDefintion
will always matchecs
? I am wondering if there is a case where ECS needs some update and then batch needs to follow. Meaning there would be a time where batch doesn't support all types ECS supports.I might be looking at this in the wrong way or have an miss understanding on how things connect together within CDK.
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.
I saw it was already using enum values from ECS definition so I didn't really think about it... Looking at the current values they're the same but I'm not sure if that's guaranteed or it's documented somewhere.
If we can generate all these values from the schema in the future, then we can be confident about the values here.