Skip to content

(ec2): Windows Server 2022 not available in WindowsVersion #18199

@flo-mair

Description

@flo-mair

What is the problem?

The WindowsVersion enumerate does not include any valid attributes for Windows Server 2022.

https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ec2/WindowsVersion.html#aws_cdk.aws_ec2.WindowsVersion

Reproduction Steps

The following statement is not supported:

 server = ec2.Instance(
            self, 'server',
            instance_type=ec2.InstanceType('g4dn.2xlarge'),
            machine_image=ec2.MachineImage.latest_windows(
                version="WINDOWS_SERVER_2022_ENGLISH_FULL_BASE"
            ),
            vpc=vpc,
            role=server_role,
            user_data=ec2.UserData.custom(server_userdata)
        )

What did you expect to happen?

Sucessfully use Windows Server 2022 images as AMI

What actually happened?

Error Message:

AttributeError: WINDOWS_SERVER_2022_ENGLISH_FULL_BASE

CDK CLI Version

2.1.0

Framework Version

2.1.0

Node.js Version

16.13

OS

macOS

Language

Python

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-ec2Related to Amazon Elastic Compute Cloudfeature-requestA feature should be added or improved.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions