@@ -1779,6 +1779,21 @@ export interface DockerImageOptions {
1779
1779
readonly secretsManagerCredentials ?: secretsmanager . ISecret ;
1780
1780
}
1781
1781
1782
+ /**
1783
+ * Environment type for Linux Docker images or AMI
1784
+ */
1785
+ export enum LinuxImageType {
1786
+ /**
1787
+ * The LINUX_CONTAINER environment type
1788
+ */
1789
+ LINUX_CONTAINER = EnvironmentType . LINUX_CONTAINER ,
1790
+
1791
+ /**
1792
+ * The LINUX_EC2 environment type
1793
+ */
1794
+ LINUX_EC2 = EnvironmentType . LINUX_EC2 ,
1795
+ }
1796
+
1782
1797
/**
1783
1798
* Construction properties of `LinuxBuildImage`.
1784
1799
* Module-private, as the constructor of `LinuxBuildImage` is private.
@@ -1788,6 +1803,7 @@ interface LinuxBuildImageProps {
1788
1803
readonly imagePullPrincipalType ?: ImagePullPrincipalType ;
1789
1804
readonly secretsManagerCredentials ?: secretsmanager . ISecret ;
1790
1805
readonly repository ?: ecr . IRepository ;
1806
+ readonly imageType ?: LinuxImageType ;
1791
1807
}
1792
1808
1793
1809
// Keep around to resolve a circular dependency until removing deprecated ARM image constants from LinuxBuildImage
@@ -1855,6 +1871,13 @@ export class LinuxBuildImage implements IBuildImage {
1855
1871
/** The Amazon Coretto 11 image x86_64, based on Amazon Linux 2023. */
1856
1872
public static readonly AMAZON_LINUX_2023_CORETTO_11 = LinuxBuildImage . codeBuildImage ( 'aws/codebuild/amazonlinux-x86_64-standard:corretto11' ) ;
1857
1873
1874
+ /** The Amazon Linux x86_64 1.0 AMI, based on Amazon Linux 2023. */
1875
+ public static readonly AMAZON_LINUX_2023_1_0_AMI : IBuildImage = new LinuxBuildImage ( {
1876
+ imageId : 'aws/codebuild/ami/amazonlinux-x86_64-base:2023-1.0' ,
1877
+ imagePullPrincipalType : ImagePullPrincipalType . CODEBUILD ,
1878
+ imageType : LinuxImageType . LINUX_EC2 ,
1879
+ } ) ;
1880
+
1858
1881
/**
1859
1882
* Image "aws/codebuild/amazonlinux2-aarch64-standard:1.0".
1860
1883
* @see {LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_1_0}
@@ -1997,14 +2020,15 @@ export class LinuxBuildImage implements IBuildImage {
1997
2020
} ) ;
1998
2021
}
1999
2022
2000
- public readonly type = EnvironmentType . LINUX_CONTAINER as string ;
2023
+ public readonly type : string ;
2001
2024
public readonly defaultComputeType = ComputeType . SMALL ;
2002
2025
public readonly imageId : string ;
2003
2026
public readonly imagePullPrincipalType ?: ImagePullPrincipalType ;
2004
2027
public readonly secretsManagerCredentials ?: secretsmanager . ISecret ;
2005
2028
public readonly repository ?: ecr . IRepository ;
2006
2029
2007
2030
private constructor ( props : LinuxBuildImageProps ) {
2031
+ this . type = ( props . imageType ?? LinuxImageType . LINUX_CONTAINER ) . toString ( ) ;
2008
2032
this . imageId = props . imageId ;
2009
2033
this . imagePullPrincipalType = props . imagePullPrincipalType ;
2010
2034
this . secretsManagerCredentials = props . secretsManagerCredentials ;
@@ -2027,7 +2051,7 @@ export class LinuxBuildImage implements IBuildImage {
2027
2051
}
2028
2052
2029
2053
/**
2030
- * Environment type for Windows Docker images
2054
+ * Environment type for Windows Docker images or AMI
2031
2055
*/
2032
2056
export enum WindowsImageType {
2033
2057
/**
@@ -2049,6 +2073,11 @@ export enum WindowsImageType {
2049
2073
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/fleets.html
2050
2074
*/
2051
2075
SERVER_2022 = EnvironmentType . WINDOWS_SERVER_2022_CONTAINER ,
2076
+
2077
+ /**
2078
+ * The WINDOWS_EC2 environment type
2079
+ */
2080
+ WINDOWS_EC2 = EnvironmentType . WINDOWS_EC2 ,
2052
2081
}
2053
2082
2054
2083
/**
@@ -2143,6 +2172,13 @@ export class WindowsBuildImage implements IBuildImage {
2143
2172
imageType : WindowsImageType . SERVER_2022 ,
2144
2173
} ) ;
2145
2174
2175
+ /** The CodeBuild Windows Server 2022 1.0 AMI */
2176
+ public static readonly WIN_SERVER_2022_1_0_AMI : IBuildImage = new WindowsBuildImage ( {
2177
+ imageId : 'aws/codebuild/ami/windows-base:2022-1.0' ,
2178
+ imagePullPrincipalType : ImagePullPrincipalType . CODEBUILD ,
2179
+ imageType : WindowsImageType . WINDOWS_EC2 ,
2180
+ } ) ;
2181
+
2146
2182
/**
2147
2183
* @returns a Windows build image from a Docker Hub image.
2148
2184
*/
0 commit comments